@antscorp/antsomi-ui 2.0.110 → 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/es/assets/css/main.scss +2 -0
- 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/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/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/MinusIcon.d.ts +3 -0
- package/es/components/icons/MinusIcon.js +7 -0
- package/es/components/icons/index.d.ts +9 -0
- package/es/components/icons/index.js +9 -0
- package/es/components/index.scss +1 -0
- package/es/components/molecules/EmojiCollections/CommonCollection/index.js +2 -2
- package/es/components/molecules/EmojiCollections/types.d.ts +1 -0
- package/es/components/molecules/EmojiPopover/EmojiPopover.d.ts +2 -0
- package/es/components/molecules/EmojiPopover/EmojiPopover.js +10 -6
- package/es/components/molecules/EmojiPopover/styled.js +1 -1
- 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/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/SearchPopover/SearchPopover.d.ts +2 -1
- package/es/components/molecules/SearchPopover/SearchPopover.js +3 -3
- package/es/components/molecules/SearchPopover/styled.d.ts +12 -1
- package/es/components/molecules/SearchPopover/styled.js +1 -2
- package/es/components/molecules/SearchPopover/types.d.ts +4 -3
- 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 +24 -3
- 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/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/index.d.ts +1 -0
- package/es/components/organism/index.js +1 -0
- package/es/components/organism/index.scss +1 -0
- 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/i18n.d.ts +1 -1
- 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/web.d.ts +80 -0
- package/es/utils/web.js +226 -0
- package/package.json +26 -17
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// Use case**: Template systems, corporate branding, user productivity
|
|
2
|
+
import { useCallback } from 'react';
|
|
3
|
+
import { useBroadcastedLocalStorage } from '@antscorp/antsomi-ui/es/hooks/useBroadcastedLocalStorage';
|
|
4
|
+
export function useStylePresets(editor, options = {}) {
|
|
5
|
+
const { storageKey = 'text-editor-style-presets', maxPresets = 20, defaultPresets = [], } = options;
|
|
6
|
+
const { value: presets, setValue: setPresets } = useBroadcastedLocalStorage(storageKey, defaultPresets.map((preset, index) => ({
|
|
7
|
+
...preset,
|
|
8
|
+
id: `default-${index}`,
|
|
9
|
+
createdAt: Date.now(),
|
|
10
|
+
usageCount: 0,
|
|
11
|
+
})));
|
|
12
|
+
// Create preset from current style
|
|
13
|
+
const createPreset = useCallback((name, description) => {
|
|
14
|
+
if (!editor)
|
|
15
|
+
return;
|
|
16
|
+
const { selection, storedMarks } = editor.state;
|
|
17
|
+
const { $from } = selection;
|
|
18
|
+
const marks = (storedMarks || $from.marks()).map(mark => ({
|
|
19
|
+
type: mark.type.name,
|
|
20
|
+
attrs: mark.attrs,
|
|
21
|
+
}));
|
|
22
|
+
const textStyle = editor.getAttributes('textStyle');
|
|
23
|
+
const preset = {
|
|
24
|
+
id: `preset-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
|
|
25
|
+
name,
|
|
26
|
+
description,
|
|
27
|
+
marks,
|
|
28
|
+
textStyle,
|
|
29
|
+
createdAt: Date.now(),
|
|
30
|
+
usageCount: 0,
|
|
31
|
+
};
|
|
32
|
+
setPresets(prev => {
|
|
33
|
+
const updated = [preset, ...prev];
|
|
34
|
+
return updated.slice(0, maxPresets);
|
|
35
|
+
});
|
|
36
|
+
return preset;
|
|
37
|
+
}, [editor, maxPresets, setPresets]);
|
|
38
|
+
// Apply preset
|
|
39
|
+
const applyPreset = useCallback((presetId) => {
|
|
40
|
+
if (!editor)
|
|
41
|
+
return;
|
|
42
|
+
const preset = presets.find(p => p.id === presetId);
|
|
43
|
+
if (!preset)
|
|
44
|
+
return;
|
|
45
|
+
// Clear current formatting
|
|
46
|
+
editor.chain().focus().unsetAllMarks().run();
|
|
47
|
+
// Apply text style attributes
|
|
48
|
+
if (preset.textStyle.fontSize) {
|
|
49
|
+
editor.chain().setFontSize(preset.textStyle.fontSize).run();
|
|
50
|
+
}
|
|
51
|
+
if (preset.textStyle.fontFamily) {
|
|
52
|
+
editor.chain().setFontFamily(preset.textStyle.fontFamily).run();
|
|
53
|
+
}
|
|
54
|
+
if (preset.textStyle.color) {
|
|
55
|
+
editor.chain().setColor(preset.textStyle.color).run();
|
|
56
|
+
}
|
|
57
|
+
if (preset.textStyle.backgroundColor) {
|
|
58
|
+
editor.chain().setBackgroundColor(preset.textStyle.backgroundColor).run();
|
|
59
|
+
}
|
|
60
|
+
if (preset.textStyle.fontWeight) {
|
|
61
|
+
editor.chain().setFontWeight(preset.textStyle.fontWeight).run();
|
|
62
|
+
}
|
|
63
|
+
// Apply marks
|
|
64
|
+
preset.marks.forEach(({ type, attrs }) => {
|
|
65
|
+
editor.chain().setMark(type, attrs).run();
|
|
66
|
+
});
|
|
67
|
+
// Update usage count
|
|
68
|
+
setPresets(prev => prev.map(p => (p.id === presetId ? { ...p, usageCount: p.usageCount + 1 } : p)));
|
|
69
|
+
}, [editor, presets, setPresets]);
|
|
70
|
+
// Delete preset
|
|
71
|
+
const deletePreset = useCallback((presetId) => {
|
|
72
|
+
setPresets(prev => prev.filter(p => p.id !== presetId));
|
|
73
|
+
}, [setPresets]);
|
|
74
|
+
// Get popular presets
|
|
75
|
+
const getPopularPresets = useCallback((limit = 5) => [...presets].sort((a, b) => b.usageCount - a.usageCount).slice(0, limit), [presets]);
|
|
76
|
+
return {
|
|
77
|
+
presets,
|
|
78
|
+
createPreset,
|
|
79
|
+
applyPreset,
|
|
80
|
+
deletePreset,
|
|
81
|
+
getPopularPresets,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { JSONContent } from '@tiptap/core';
|
|
3
|
+
export type { TextEditorProps, TextEditorAllProps, TextEditorRef, TextEditorWithProviderRef, TextEditorComponentsRender, LinkAttrs, FontConfig, } from './types';
|
|
4
|
+
export { isLinkMark, isLinkMarkRange } from './types';
|
|
5
|
+
export { CUSTOM_LINK_EXTENSION_NAME } from './constants';
|
|
6
|
+
export type { JSONContent as TextEditorJSONContent };
|
|
7
|
+
export { TextEditorProvider, type TextEditorProviderProps, type TextEditorProviderRefHandler, } from './provider';
|
|
8
|
+
export declare const TextEditor: import("react").ForwardRefExoticComponent<import("./types").TextEditorProps & {
|
|
9
|
+
colors?: string[] | undefined;
|
|
10
|
+
onChangeColors?: ((colors: string[]) => void) | undefined;
|
|
11
|
+
} & import("react").RefAttributes<import("./types").TextEditorWithProviderRef>> & {
|
|
12
|
+
Provider: import("react").ForwardRefExoticComponent<import("./provider").TextEditorProviderProps & import("react").RefAttributes<import("./provider").TextEditorProviderRefHandler>>;
|
|
13
|
+
Internal: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<import("./types").TextEditorProps & import("react").RefAttributes<import("./types").TextEditorRef>>>;
|
|
14
|
+
} & {
|
|
15
|
+
Utils: {
|
|
16
|
+
htmlMinifyForEmail: (htmlEditorContent: string) => string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TextEditor as TextEditorComponent } from './TextEditor';
|
|
2
|
+
import { htmlMinifyForEmail } from './utils';
|
|
3
|
+
export { isLinkMark, isLinkMarkRange } from './types';
|
|
4
|
+
export { CUSTOM_LINK_EXTENSION_NAME } from './constants';
|
|
5
|
+
export { TextEditorProvider, } from './provider';
|
|
6
|
+
export const TextEditor = Object.assign(TextEditorComponent, {
|
|
7
|
+
Utils: { htmlMinifyForEmail },
|
|
8
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
.antsomi-text-editor-bubble-menu {
|
|
2
|
+
visibility: hidden;
|
|
3
|
+
position: absolute;
|
|
4
|
+
pointer-events: auto;
|
|
5
|
+
z-index: 999;
|
|
6
|
+
background-color: white;
|
|
7
|
+
border-radius: 4px;
|
|
8
|
+
padding: 15px;
|
|
9
|
+
box-shadow: var(--antsomi-box-shadow-secondary);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.antsomi-text-editor-emoji-popover {
|
|
13
|
+
position: absolute;
|
|
14
|
+
width: 180px;
|
|
15
|
+
z-index: 1000;
|
|
16
|
+
|
|
17
|
+
.antsomi-text-editor-emoji-list {
|
|
18
|
+
.antsomi-virtualize-menu-menu-inline {
|
|
19
|
+
background-color: white;
|
|
20
|
+
box-shadow: var(--antsomi-box-shadow-secondary);
|
|
21
|
+
border-radius: 10px;
|
|
22
|
+
|
|
23
|
+
.antsomi-virtualize-menu-item-label {
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
gap: 10px;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.font-popover-overlay {
|
|
33
|
+
padding: 0;
|
|
34
|
+
|
|
35
|
+
.font-popover-item {
|
|
36
|
+
width: 100%;
|
|
37
|
+
height: 100%;
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
padding-left: 10px;
|
|
40
|
+
padding-right: 8px;
|
|
41
|
+
|
|
42
|
+
&:hover,
|
|
43
|
+
&.active {
|
|
44
|
+
background-color: #f2f9ff;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.font-weight-popover {
|
|
50
|
+
&.antsomi-popover {
|
|
51
|
+
.antsomi-popover-inner {
|
|
52
|
+
padding: 10px 0px;
|
|
53
|
+
|
|
54
|
+
.font-weight-item {
|
|
55
|
+
padding: 4px 10px;
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
|
|
58
|
+
&:hover,
|
|
59
|
+
&.active {
|
|
60
|
+
background-color: #f2f9ff;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { StoreApi } from 'zustand';
|
|
3
|
+
import type { TextEditorStore } from './store';
|
|
4
|
+
export type TextEditorStoreApi = StoreApi<TextEditorStore>;
|
|
5
|
+
export declare const TextEditorStoreContext: import("react").Context<TextEditorStoreApi | null>;
|
|
6
|
+
export interface TextEditorProviderRefHandler {
|
|
7
|
+
updateColors?: (colors: string[]) => void;
|
|
8
|
+
}
|
|
9
|
+
export interface TextEditorProviderProps {
|
|
10
|
+
children: React.ReactNode | ((props: TextEditorStoreApi) => React.ReactNode);
|
|
11
|
+
colors?: string[];
|
|
12
|
+
onChangeColors?: (colors: string[]) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const TextEditorProvider: import("react").ForwardRefExoticComponent<TextEditorProviderProps & import("react").RefAttributes<TextEditorProviderRefHandler>>;
|
|
15
|
+
export declare const useTextEditorStore: <T>(selector: (state: TextEditorStore) => T) => T;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Libraries
|
|
3
|
+
import { createContext, forwardRef, useContext, useEffect, useImperativeHandle, useRef, } from 'react';
|
|
4
|
+
import { useStore } from 'zustand';
|
|
5
|
+
// Store
|
|
6
|
+
import { createTextEditorStore } from './store';
|
|
7
|
+
export const TextEditorStoreContext = createContext(null);
|
|
8
|
+
export const TextEditorProvider = forwardRef(({ children, colors, onChangeColors }, ref) => {
|
|
9
|
+
const storeRef = useRef();
|
|
10
|
+
if (!storeRef.current) {
|
|
11
|
+
storeRef.current = createTextEditorStore({
|
|
12
|
+
colors,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
storeRef.current?.setState({
|
|
17
|
+
setColors: colors => {
|
|
18
|
+
storeRef.current?.getInitialState().setColors(colors);
|
|
19
|
+
onChangeColors?.(colors);
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
}, [onChangeColors]);
|
|
23
|
+
useImperativeHandle(ref, () => ({
|
|
24
|
+
updateColors: colors => {
|
|
25
|
+
// Use getInitialState to bypass the wrapped setColors and avoid triggering onChangeColors
|
|
26
|
+
storeRef.current?.getInitialState().setColors(colors);
|
|
27
|
+
},
|
|
28
|
+
}));
|
|
29
|
+
return (_jsx(TextEditorStoreContext.Provider, { value: storeRef.current, children: typeof children === 'function' ? children(storeRef.current) : children }));
|
|
30
|
+
});
|
|
31
|
+
export const useTextEditorStore = (selector) => {
|
|
32
|
+
const store = useContext(TextEditorStoreContext);
|
|
33
|
+
if (!store)
|
|
34
|
+
throw new Error('Missing TextEditorStoreContext.Provider in the tree');
|
|
35
|
+
return useStore(store, selector);
|
|
36
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { LinkFormData, LinkFormState } from './types';
|
|
2
|
+
export type TextEditorState = {
|
|
3
|
+
bubbleMenuContainer: HTMLElement | null;
|
|
4
|
+
colors?: string[];
|
|
5
|
+
/** Link form state for default link insert/edit UI */
|
|
6
|
+
linkFormState: LinkFormState;
|
|
7
|
+
};
|
|
8
|
+
export type TextEditorActions = {
|
|
9
|
+
setBubbleMenuContainer: (container: HTMLElement | null) => void;
|
|
10
|
+
setColors: (newColorSet: string[]) => void;
|
|
11
|
+
/** Show link form with initial data */
|
|
12
|
+
showLinkForm: (mode: 'insert' | 'edit', initialData: LinkFormData) => void;
|
|
13
|
+
/** Hide link form */
|
|
14
|
+
hideLinkForm: () => void;
|
|
15
|
+
/** Update link form data (partial update) */
|
|
16
|
+
updateLinkFormData: (data: Partial<LinkFormData>) => void;
|
|
17
|
+
};
|
|
18
|
+
export type TextEditorStore = TextEditorState & TextEditorActions;
|
|
19
|
+
export declare const defaultTextEditorState: TextEditorState;
|
|
20
|
+
export declare const createTextEditorStore: (initState?: Partial<TextEditorState>) => import("zustand").StoreApi<TextEditorStore>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Libraries
|
|
2
|
+
import isEqual from 'react-fast-compare';
|
|
3
|
+
import { createStore } from 'zustand';
|
|
4
|
+
export const defaultTextEditorState = {
|
|
5
|
+
bubbleMenuContainer: null,
|
|
6
|
+
linkFormState: null,
|
|
7
|
+
};
|
|
8
|
+
export const createTextEditorStore = (initState = {}) => createStore()((set, get) => ({
|
|
9
|
+
...defaultTextEditorState,
|
|
10
|
+
...initState,
|
|
11
|
+
setBubbleMenuContainer: container => set(() => ({ bubbleMenuContainer: container })),
|
|
12
|
+
setColors: newColors => {
|
|
13
|
+
const currentColors = get().colors;
|
|
14
|
+
if (isEqual(currentColors, newColors)) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
set(() => ({ colors: newColors }));
|
|
18
|
+
},
|
|
19
|
+
showLinkForm: (mode, initialData) => set(() => ({
|
|
20
|
+
linkFormState: {
|
|
21
|
+
isVisible: true,
|
|
22
|
+
mode,
|
|
23
|
+
data: initialData,
|
|
24
|
+
},
|
|
25
|
+
})),
|
|
26
|
+
hideLinkForm: () => set(() => ({ linkFormState: null })),
|
|
27
|
+
updateLinkFormData: data => set(state => {
|
|
28
|
+
if (!state.linkFormState)
|
|
29
|
+
return state;
|
|
30
|
+
return {
|
|
31
|
+
linkFormState: {
|
|
32
|
+
...state.linkFormState,
|
|
33
|
+
data: {
|
|
34
|
+
...state.linkFormState.data,
|
|
35
|
+
...data,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
}),
|
|
40
|
+
}));
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
{
|
|
2
|
+
"rawHTML": "<div class=\"fr-element fr-view\" dir=\"auto\" contenteditable=\"true\" aria-disabled=\"false\" spellcheck=\"true\"><p><span style=\"font-family: Montserrat; font-size: 22px; letter-spacing: 0px; color: #000000;\"><a data-link-id=\"j24jwuk2\" target=\"_blank\" href=\"https://ant.design/components/modal\"><span data-dynamic=\"true\" data-dynamic-id=\"i6fapgk6\" style=\"direction: unset; unicode-bidi: bidi-override; background-color: rgba(0, 199, 97, 0.2);\">Last modified by</span></a> Special <a data-link-id=\"rrd48wh5\" target=\"_blank\" href=\"https://ant.design\">Bonus <span data-dynamic=\"true\" data-dynamic-id=\"4ip5g3w4\" style=\"direction: unset; unicode-bidi: bidi-override; background-color: rgba(0, 199, 97, 0.2);\">Created date</span> Has</a> Been <span data-dynamic=\"true\" data-dynamic-id=\"vd3tmfc3\" style=\"direction: unset; unicode-bidi: bidi-override; background-color: rgba(0, 199, 97, 0.2);\"><a data-link-id=\"ir1h7e67\" target=\"_blank\" href=\"https://fireup.pro/news/goodbye-useeffect-exploring-use-in-react-19?ref=dailydev\">Name</a></span> Special <a data-link-id=\"rrd48wh5\" href=\"https://ant.design\" target=\"_blank\" id=\"isPasted\">Bonus</a> fasdfas sdfadf</span></p></div>",
|
|
3
|
+
"dynamic": {
|
|
4
|
+
"data": {
|
|
5
|
+
"4ip5g3w4": {
|
|
6
|
+
"type": "visitor-attribute",
|
|
7
|
+
"attribute": {
|
|
8
|
+
"label": "Created date",
|
|
9
|
+
"value": "date_created",
|
|
10
|
+
"status": 1,
|
|
11
|
+
"dataType": "datetime",
|
|
12
|
+
"disabled": false,
|
|
13
|
+
"datetimeFormatSettings": {
|
|
14
|
+
"type": "datetime",
|
|
15
|
+
"language": "en",
|
|
16
|
+
"hasDateFormat": true,
|
|
17
|
+
"hasTimeFormat": true,
|
|
18
|
+
"dateParseFormat": "MM/DD/YYYY",
|
|
19
|
+
"dateParseOption": "medium",
|
|
20
|
+
"timeParseFormat": "12hour",
|
|
21
|
+
"timeParseOption": "medium",
|
|
22
|
+
"dateFormatString": "MMM DD, YYYY h:mm:ss A"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"mappingKey": "lg5pk39o2qmxyc7oano5-4ip5g3w4",
|
|
26
|
+
"mappingFields": "visitor.date_created"
|
|
27
|
+
},
|
|
28
|
+
"i6fapgk6": {
|
|
29
|
+
"type": "event-attribute",
|
|
30
|
+
"event": "226539:17",
|
|
31
|
+
"source": [556657814],
|
|
32
|
+
"attribute": {
|
|
33
|
+
"type": 1,
|
|
34
|
+
"label": "Last modified by",
|
|
35
|
+
"value": "ad_zone.u_user_id",
|
|
36
|
+
"status": 1,
|
|
37
|
+
"children": [],
|
|
38
|
+
"dataType": "number",
|
|
39
|
+
"itemTypeId": -1013,
|
|
40
|
+
"itemTypeName": "ad_zone",
|
|
41
|
+
"propertyName": "u_user_id",
|
|
42
|
+
"eventPropertySyntax": "dims.ad_zone_id",
|
|
43
|
+
"numberFormatSettings": {
|
|
44
|
+
"type": "number",
|
|
45
|
+
"decimal": ".",
|
|
46
|
+
"grouping": ",",
|
|
47
|
+
"isCompact": false,
|
|
48
|
+
"prefixType": "code",
|
|
49
|
+
"currencyCode": "USD",
|
|
50
|
+
"decimalPlaces": 2
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"mappingKey": "lg5pk39o2qmxyc7oano5-i6fapgk6",
|
|
54
|
+
"mappingFields": "event.ad_zone.u_user_id"
|
|
55
|
+
},
|
|
56
|
+
"vd3tmfc3": {
|
|
57
|
+
"type": "customer-attribute",
|
|
58
|
+
"attribute": {
|
|
59
|
+
"label": "Name",
|
|
60
|
+
"value": "name",
|
|
61
|
+
"status": 1,
|
|
62
|
+
"dataType": "string",
|
|
63
|
+
"disabled": false
|
|
64
|
+
},
|
|
65
|
+
"mappingKey": "lg5pk39o2qmxyc7oano5-vd3tmfc3",
|
|
66
|
+
"mappingFields": "customer.name"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"highlight": true,
|
|
70
|
+
"selectedId": ""
|
|
71
|
+
},
|
|
72
|
+
"link": {
|
|
73
|
+
"data": {
|
|
74
|
+
"ir1h7e67": {
|
|
75
|
+
"url": "https://fireup.pro/news/goodbye-useeffect-exploring-use-in-react-19?ref=dailydev",
|
|
76
|
+
"text": "Name",
|
|
77
|
+
"linkType": "static",
|
|
78
|
+
"openNewTab": true
|
|
79
|
+
},
|
|
80
|
+
"j24jwuk2": {
|
|
81
|
+
"url": "https://ant.design/components/modal",
|
|
82
|
+
"text": "Your",
|
|
83
|
+
"linkType": "static",
|
|
84
|
+
"openNewTab": true
|
|
85
|
+
},
|
|
86
|
+
"rrd48wh5": {
|
|
87
|
+
"url": "https://ant.design",
|
|
88
|
+
"text": "Bonus Offer Has",
|
|
89
|
+
"linkType": "static",
|
|
90
|
+
"openNewTab": true
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"selectedId": ""
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ⚠️ LEGACY FORMAT TYPES
|
|
3
|
+
* These types represent the OLD format from Froala editor
|
|
4
|
+
* DO NOT modify unless you understand the legacy compatibility requirements
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Dynamic tag data structure from Froala editor
|
|
8
|
+
* Used for backwards compatibility with old HTML format
|
|
9
|
+
*/
|
|
10
|
+
export type DynamicData = {
|
|
11
|
+
type: string;
|
|
12
|
+
attribute?: {
|
|
13
|
+
label: string;
|
|
14
|
+
value: string;
|
|
15
|
+
dataType?: string;
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
};
|
|
18
|
+
event?: string;
|
|
19
|
+
source?: number[];
|
|
20
|
+
mappingKey: string;
|
|
21
|
+
mappingFields: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Link data structure from Froala editor
|
|
25
|
+
* Used for backwards compatibility with old HTML format
|
|
26
|
+
*/
|
|
27
|
+
export type LinkData = {
|
|
28
|
+
url: string;
|
|
29
|
+
text: string;
|
|
30
|
+
linkType: string;
|
|
31
|
+
openNewTab: boolean;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* State management for old format demo
|
|
35
|
+
*/
|
|
36
|
+
export type State = {
|
|
37
|
+
link: {
|
|
38
|
+
data: Record<string, LinkData>;
|
|
39
|
+
selectedId: string;
|
|
40
|
+
};
|
|
41
|
+
dynamic: {
|
|
42
|
+
data: Record<string, DynamicData>;
|
|
43
|
+
selectedId: string;
|
|
44
|
+
highlight: boolean;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Actions for state reducer
|
|
49
|
+
*/
|
|
50
|
+
export type Action = {
|
|
51
|
+
type: 'add_smart_tag';
|
|
52
|
+
payload: {
|
|
53
|
+
selectionText: string;
|
|
54
|
+
};
|
|
55
|
+
} | {
|
|
56
|
+
type: 'edit_smart_tag';
|
|
57
|
+
payload: {
|
|
58
|
+
id: string;
|
|
59
|
+
};
|
|
60
|
+
} | {
|
|
61
|
+
type: 'delete_smart_tag';
|
|
62
|
+
payload: {
|
|
63
|
+
id: string;
|
|
64
|
+
};
|
|
65
|
+
} | {
|
|
66
|
+
type: 'save_smart_tag';
|
|
67
|
+
payload: {
|
|
68
|
+
id: string;
|
|
69
|
+
data: DynamicData;
|
|
70
|
+
};
|
|
71
|
+
} | {
|
|
72
|
+
type: 'add_link';
|
|
73
|
+
payload: {
|
|
74
|
+
selectionText: string;
|
|
75
|
+
};
|
|
76
|
+
} | {
|
|
77
|
+
type: 'edit_link';
|
|
78
|
+
payload: {
|
|
79
|
+
id: string;
|
|
80
|
+
data?: Partial<LinkData>;
|
|
81
|
+
};
|
|
82
|
+
} | {
|
|
83
|
+
type: 'delete_link';
|
|
84
|
+
payload: {
|
|
85
|
+
id: string;
|
|
86
|
+
};
|
|
87
|
+
} | {
|
|
88
|
+
type: 'close_smart_tag_modal';
|
|
89
|
+
} | {
|
|
90
|
+
type: 'close_link_modal';
|
|
91
|
+
} | {
|
|
92
|
+
type: 'toggle_highlight';
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Reducer for managing old format demo state
|
|
96
|
+
*/
|
|
97
|
+
export declare const reducer: (state: State, action: Action) => State;
|
|
98
|
+
/**
|
|
99
|
+
* Constants for dynamic tag types
|
|
100
|
+
*/
|
|
101
|
+
export declare const DYNAMIC_TAG_TYPES: {
|
|
102
|
+
label: string;
|
|
103
|
+
value: string;
|
|
104
|
+
}[];
|
|
105
|
+
/**
|
|
106
|
+
* Constants for data types
|
|
107
|
+
*/
|
|
108
|
+
export declare const DATA_TYPES: {
|
|
109
|
+
label: string;
|
|
110
|
+
value: string;
|
|
111
|
+
}[];
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { produce } from 'immer';
|
|
2
|
+
import uniqid from 'uniqid';
|
|
3
|
+
/**
|
|
4
|
+
* Reducer for managing old format demo state
|
|
5
|
+
*/
|
|
6
|
+
export const reducer = (state, action) => produce(state, draft => {
|
|
7
|
+
switch (action.type) {
|
|
8
|
+
case 'add_smart_tag': {
|
|
9
|
+
draft.dynamic.selectedId = uniqid();
|
|
10
|
+
break;
|
|
11
|
+
}
|
|
12
|
+
case 'edit_smart_tag': {
|
|
13
|
+
draft.dynamic.selectedId = action.payload.id;
|
|
14
|
+
break;
|
|
15
|
+
}
|
|
16
|
+
case 'delete_smart_tag': {
|
|
17
|
+
delete draft.dynamic.data[action.payload.id];
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
case 'save_smart_tag': {
|
|
21
|
+
draft.dynamic.data[action.payload.id] = action.payload.data;
|
|
22
|
+
draft.dynamic.selectedId = '';
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
case 'close_smart_tag_modal': {
|
|
26
|
+
draft.dynamic.selectedId = '';
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
case 'add_link': {
|
|
30
|
+
const newLinkId = uniqid();
|
|
31
|
+
draft.link.selectedId = newLinkId;
|
|
32
|
+
draft.link.data[newLinkId] = {
|
|
33
|
+
url: '',
|
|
34
|
+
text: action.payload.selectionText,
|
|
35
|
+
linkType: 'static',
|
|
36
|
+
openNewTab: true,
|
|
37
|
+
};
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
case 'edit_link': {
|
|
41
|
+
draft.link.selectedId = action.payload.id;
|
|
42
|
+
if (action.payload.data) {
|
|
43
|
+
draft.link.data[action.payload.id] = {
|
|
44
|
+
...state.link.data[action.payload.id],
|
|
45
|
+
...action.payload.data,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
case 'delete_link': {
|
|
51
|
+
delete draft.link.data[action.payload.id];
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
case 'close_link_modal': {
|
|
55
|
+
draft.link.selectedId = '';
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
case 'toggle_highlight': {
|
|
59
|
+
draft.dynamic.highlight = !draft.dynamic.highlight;
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
default:
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
/**
|
|
67
|
+
* Constants for dynamic tag types
|
|
68
|
+
*/
|
|
69
|
+
export const DYNAMIC_TAG_TYPES = [
|
|
70
|
+
{ label: 'Customer Attribute', value: 'customer-attribute' },
|
|
71
|
+
{ label: 'Visitor Attribute', value: 'visitor-attribute' },
|
|
72
|
+
{ label: 'Event Attribute', value: 'event-attribute' },
|
|
73
|
+
];
|
|
74
|
+
/**
|
|
75
|
+
* Constants for data types
|
|
76
|
+
*/
|
|
77
|
+
export const DATA_TYPES = [
|
|
78
|
+
{ label: 'String', value: 'string' },
|
|
79
|
+
{ label: 'Number', value: 'number' },
|
|
80
|
+
{ label: 'Datetime', value: 'datetime' },
|
|
81
|
+
{ label: 'Boolean', value: 'boolean' },
|
|
82
|
+
];
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parse HTML content from mock data
|
|
3
|
+
*/
|
|
4
|
+
export declare const htmlContent: string;
|
|
5
|
+
/**
|
|
6
|
+
* State type for TextBlock component
|
|
7
|
+
*/
|
|
8
|
+
export type State = {
|
|
9
|
+
link: {
|
|
10
|
+
data: Record<string, {
|
|
11
|
+
url: string;
|
|
12
|
+
text: string;
|
|
13
|
+
title: string;
|
|
14
|
+
}>;
|
|
15
|
+
selectedId: string;
|
|
16
|
+
};
|
|
17
|
+
dynamic: {
|
|
18
|
+
data: Record<string, unknown>;
|
|
19
|
+
selectedId: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Action types for TextBlock reducer
|
|
24
|
+
*/
|
|
25
|
+
export type Action = {
|
|
26
|
+
type: 'add_smart_tag';
|
|
27
|
+
payload: {
|
|
28
|
+
selectionText: string;
|
|
29
|
+
};
|
|
30
|
+
} | {
|
|
31
|
+
type: 'edit_smart_tag';
|
|
32
|
+
payload: {
|
|
33
|
+
id: string;
|
|
34
|
+
};
|
|
35
|
+
} | {
|
|
36
|
+
type: 'add_link';
|
|
37
|
+
payload: {
|
|
38
|
+
selectionText: string;
|
|
39
|
+
};
|
|
40
|
+
} | {
|
|
41
|
+
type: 'edit_link';
|
|
42
|
+
payload: {
|
|
43
|
+
id: string;
|
|
44
|
+
data?: Partial<{
|
|
45
|
+
url: string;
|
|
46
|
+
text: string;
|
|
47
|
+
title: string;
|
|
48
|
+
}>;
|
|
49
|
+
};
|
|
50
|
+
} | {
|
|
51
|
+
type: 'close_smart_tag_modal';
|
|
52
|
+
} | {
|
|
53
|
+
type: 'close_link_modal';
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Reducer for TextBlock component state management
|
|
57
|
+
*/
|
|
58
|
+
export declare const reducer: (state: State, action: Action) => State;
|
|
59
|
+
/**
|
|
60
|
+
* Props for TextBlock component
|
|
61
|
+
*/
|
|
62
|
+
export type TextBlockProps = {
|
|
63
|
+
defaultValue?: string;
|
|
64
|
+
};
|