@antscorp/antsomi-ui 2.0.110 → 2.0.112

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.
Files changed (344) hide show
  1. package/es/assets/css/main.scss +2 -0
  2. package/es/components/atoms/Eyedropper/Eyedropper.d.ts +2 -0
  3. package/es/components/atoms/Eyedropper/Eyedropper.js +53 -0
  4. package/es/components/atoms/Eyedropper/index.d.ts +0 -0
  5. package/es/components/atoms/Eyedropper/index.js +1 -0
  6. package/es/components/atoms/Eyedropper/styled.d.ts +9 -0
  7. package/es/components/atoms/Eyedropper/styled.js +45 -0
  8. package/es/components/atoms/Eyedropper/types.d.ts +5 -0
  9. package/es/components/atoms/Eyedropper/types.js +1 -0
  10. package/es/components/icons/ALignRightIcon.d.ts +3 -0
  11. package/es/components/icons/ALignRightIcon.js +7 -0
  12. package/es/components/icons/AlignCenterIcon.d.ts +3 -0
  13. package/es/components/icons/AlignCenterIcon.js +7 -0
  14. package/es/components/icons/AlignJustifyIcon.d.ts +3 -0
  15. package/es/components/icons/AlignJustifyIcon.js +7 -0
  16. package/es/components/icons/AlignLeftIcon.d.ts +3 -0
  17. package/es/components/icons/AlignLeftIcon.js +7 -0
  18. package/es/components/icons/ArrowDropDownIcon.d.ts +3 -0
  19. package/es/components/icons/ArrowDropDownIcon.js +7 -0
  20. package/es/components/icons/ChevronRightIcon.d.ts +3 -0
  21. package/es/components/icons/ChevronRightIcon.js +7 -0
  22. package/es/components/icons/ColorizeIcon.d.ts +3 -0
  23. package/es/components/icons/ColorizeIcon.js +7 -0
  24. package/es/components/icons/LazyIcon/LazyIcon.d.ts +9 -0
  25. package/es/components/icons/LazyIcon/LazyIcon.js +9 -0
  26. package/es/components/icons/LinkOffIcon.d.ts +3 -0
  27. package/es/components/icons/LinkOffIcon.js +7 -0
  28. package/es/components/icons/MinusIcon.d.ts +3 -0
  29. package/es/components/icons/MinusIcon.js +7 -0
  30. package/es/components/icons/index.d.ts +9 -0
  31. package/es/components/icons/index.js +9 -0
  32. package/es/components/index.scss +1 -0
  33. package/es/components/molecules/EmojiCollections/CommonCollection/index.js +2 -2
  34. package/es/components/molecules/EmojiCollections/types.d.ts +1 -0
  35. package/es/components/molecules/EmojiPopover/EmojiPopover.d.ts +2 -0
  36. package/es/components/molecules/EmojiPopover/EmojiPopover.js +10 -6
  37. package/es/components/molecules/EmojiPopover/styled.js +1 -1
  38. package/es/components/molecules/EyedropperButton/EyedropperButton.d.ts +11 -0
  39. package/es/components/molecules/EyedropperButton/EyedropperButton.js +34 -0
  40. package/es/components/molecules/EyedropperButton/index.d.ts +0 -0
  41. package/es/components/molecules/EyedropperButton/index.js +1 -0
  42. package/es/components/molecules/EyedropperButton/styled.d.ts +7 -0
  43. package/es/components/molecules/EyedropperButton/styled.js +23 -0
  44. package/es/components/molecules/FontSizeInput/FontSizeInput.d.ts +3 -0
  45. package/es/components/molecules/FontSizeInput/FontSizeInput.js +134 -0
  46. package/es/components/molecules/FontSizeInput/components/FontSizeControl.d.ts +8 -0
  47. package/es/components/molecules/FontSizeInput/components/FontSizeControl.js +14 -0
  48. package/es/components/molecules/FontSizeInput/components/FontSizeDropdown.d.ts +21 -0
  49. package/es/components/molecules/FontSizeInput/components/FontSizeDropdown.js +19 -0
  50. package/es/components/molecules/FontSizeInput/constants.d.ts +2 -0
  51. package/es/components/molecules/FontSizeInput/constants.js +5 -0
  52. package/es/components/molecules/FontSizeInput/index.d.ts +2 -0
  53. package/es/components/molecules/FontSizeInput/index.js +1 -0
  54. package/es/components/molecules/FontSizeInput/styled.d.ts +7 -0
  55. package/es/components/molecules/FontSizeInput/styled.js +39 -0
  56. package/es/components/molecules/FontSizeInput/types.d.ts +23 -0
  57. package/es/components/molecules/FontSizeInput/types.js +1 -0
  58. package/es/components/molecules/FontSizeInput/utils.d.ts +7 -0
  59. package/es/components/molecules/FontSizeInput/utils.js +9 -0
  60. package/es/components/molecules/SearchPopover/SearchPopover.d.ts +2 -1
  61. package/es/components/molecules/SearchPopover/SearchPopover.js +3 -3
  62. package/es/components/molecules/SearchPopover/styled.d.ts +12 -1
  63. package/es/components/molecules/SearchPopover/styled.js +1 -2
  64. package/es/components/molecules/SearchPopover/types.d.ts +4 -3
  65. package/es/components/molecules/VirtualizedMenu/VirtualizedMenu.d.ts +1 -0
  66. package/es/components/molecules/VirtualizedMenu/components/Item/Item.js +6 -8
  67. package/es/components/molecules/VirtualizedMenu/components/MenuInline/MenuInline.d.ts +10 -10
  68. package/es/components/molecules/VirtualizedMenu/components/MenuInline/MenuInline.js +49 -289
  69. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/index.d.ts +9 -0
  70. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/index.js +5 -0
  71. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useFocusManagement.d.ts +23 -0
  72. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useFocusManagement.js +81 -0
  73. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useItemInteraction.d.ts +24 -0
  74. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useItemInteraction.js +32 -0
  75. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useKeyboardNavigation.d.ts +26 -0
  76. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useKeyboardNavigation.js +93 -0
  77. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useTreeState.d.ts +24 -0
  78. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useTreeState.js +94 -0
  79. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useVisibleItems.d.ts +7 -0
  80. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useVisibleItems.js +132 -0
  81. package/es/components/molecules/VirtualizedMenu/styled.js +24 -3
  82. package/es/components/molecules/VirtualizedMenu/types.d.ts +2 -0
  83. package/es/components/molecules/VirtualizedMenu/utils.d.ts +2 -0
  84. package/es/components/molecules/VirtualizedMenu/utils.js +2 -0
  85. package/es/components/molecules/index.d.ts +1 -0
  86. package/es/components/molecules/index.js +1 -0
  87. package/es/components/molecules/index.scss +1 -0
  88. package/es/components/organism/TextEditor/TextEditor.d.ts +10 -0
  89. package/es/components/organism/TextEditor/TextEditor.js +403 -0
  90. package/es/components/organism/TextEditor/__mocks__/text-block.settings.json +320 -0
  91. package/es/components/organism/TextEditor/__mocks__/text-contennt.d.ts +1 -0
  92. package/es/components/organism/TextEditor/__mocks__/text-contennt.js +47 -0
  93. package/es/components/organism/TextEditor/constants.d.ts +196 -0
  94. package/es/components/organism/TextEditor/constants.js +398 -0
  95. package/es/components/organism/TextEditor/extensions/BackgroundColor.d.ts +25 -0
  96. package/es/components/organism/TextEditor/extensions/BackgroundColor.js +43 -0
  97. package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu-plugin.d.ts +18 -0
  98. package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu-plugin.js +81 -0
  99. package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu.d.ts +15 -0
  100. package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu.js +35 -0
  101. package/es/components/organism/TextEditor/extensions/BubbleMenu/index.d.ts +2 -0
  102. package/es/components/organism/TextEditor/extensions/BubbleMenu/index.js +2 -0
  103. package/es/components/organism/TextEditor/extensions/ClearFormatting.d.ts +16 -0
  104. package/es/components/organism/TextEditor/extensions/ClearFormatting.js +30 -0
  105. package/es/components/organism/TextEditor/extensions/Color.d.ts +6 -0
  106. package/es/components/organism/TextEditor/extensions/Color.js +34 -0
  107. package/es/components/organism/TextEditor/extensions/Emoji.d.ts +57 -0
  108. package/es/components/organism/TextEditor/extensions/Emoji.js +184 -0
  109. package/es/components/organism/TextEditor/extensions/FontFamily.d.ts +6 -0
  110. package/es/components/organism/TextEditor/extensions/FontFamily.js +36 -0
  111. package/es/components/organism/TextEditor/extensions/FontSize.d.ts +31 -0
  112. package/es/components/organism/TextEditor/extensions/FontSize.js +46 -0
  113. package/es/components/organism/TextEditor/extensions/FontWeight.d.ts +23 -0
  114. package/es/components/organism/TextEditor/extensions/FontWeight.js +41 -0
  115. package/es/components/organism/TextEditor/extensions/Indent.d.ts +21 -0
  116. package/es/components/organism/TextEditor/extensions/Indent.js +63 -0
  117. package/es/components/organism/TextEditor/extensions/LetterSpacing.d.ts +32 -0
  118. package/es/components/organism/TextEditor/extensions/LetterSpacing.js +48 -0
  119. package/es/components/organism/TextEditor/extensions/LineHeight.d.ts +20 -0
  120. package/es/components/organism/TextEditor/extensions/LineHeight.js +101 -0
  121. package/es/components/organism/TextEditor/extensions/Link.d.ts +22 -0
  122. package/es/components/organism/TextEditor/extensions/Link.js +197 -0
  123. package/es/components/organism/TextEditor/extensions/ListItem.d.ts +10 -0
  124. package/es/components/organism/TextEditor/extensions/ListItem.js +93 -0
  125. package/es/components/organism/TextEditor/extensions/ListItemMarker.d.ts +13 -0
  126. package/es/components/organism/TextEditor/extensions/ListItemMarker.js +174 -0
  127. package/es/components/organism/TextEditor/extensions/OrderedList.d.ts +56 -0
  128. package/es/components/organism/TextEditor/extensions/OrderedList.js +187 -0
  129. package/es/components/organism/TextEditor/extensions/SmartTag.d.ts +33 -0
  130. package/es/components/organism/TextEditor/extensions/SmartTag.js +194 -0
  131. package/es/components/organism/TextEditor/extensions/StyleMemory.d.ts +36 -0
  132. package/es/components/organism/TextEditor/extensions/StyleMemory.js +163 -0
  133. package/es/components/organism/TextEditor/extensions/TextTransform.d.ts +30 -0
  134. package/es/components/organism/TextEditor/extensions/TextTransform.js +36 -0
  135. package/es/components/organism/TextEditor/extensions/UnorderedList.d.ts +55 -0
  136. package/es/components/organism/TextEditor/extensions/UnorderedList.js +176 -0
  137. package/es/components/organism/TextEditor/hooks/index.d.ts +6 -0
  138. package/es/components/organism/TextEditor/hooks/index.js +6 -0
  139. package/es/components/organism/TextEditor/hooks/useColorSet.d.ts +4 -0
  140. package/es/components/organism/TextEditor/hooks/useColorSet.js +29 -0
  141. package/es/components/organism/TextEditor/hooks/useDocumentState.d.ts +18 -0
  142. package/es/components/organism/TextEditor/hooks/useDocumentState.js +42 -0
  143. package/es/components/organism/TextEditor/hooks/useMarkTracking.d.ts +26 -0
  144. package/es/components/organism/TextEditor/hooks/useMarkTracking.js +69 -0
  145. package/es/components/organism/TextEditor/hooks/usePersistence.d.ts +31 -0
  146. package/es/components/organism/TextEditor/hooks/usePersistence.js +169 -0
  147. package/es/components/organism/TextEditor/hooks/useStyleMemory.d.ts +6 -0
  148. package/es/components/organism/TextEditor/hooks/useStyleMemory.js +42 -0
  149. package/es/components/organism/TextEditor/hooks/useStylePresets.d.ts +34 -0
  150. package/es/components/organism/TextEditor/hooks/useStylePresets.js +83 -0
  151. package/es/components/organism/TextEditor/index.d.ts +18 -0
  152. package/es/components/organism/TextEditor/index.js +8 -0
  153. package/es/components/organism/TextEditor/index.scss +65 -0
  154. package/es/components/organism/TextEditor/provider.d.ts +15 -0
  155. package/es/components/organism/TextEditor/provider.js +36 -0
  156. package/es/components/organism/TextEditor/store.d.ts +20 -0
  157. package/es/components/organism/TextEditor/store.js +40 -0
  158. package/es/components/organism/TextEditor/stories/WithOldDynAndLink/froala-legacy-format.settings.json +95 -0
  159. package/es/components/organism/TextEditor/stories/WithOldDynAndLink/shared.d.ts +111 -0
  160. package/es/components/organism/TextEditor/stories/WithOldDynAndLink/shared.js +82 -0
  161. package/es/components/organism/TextEditor/stories/shared.d.ts +64 -0
  162. package/es/components/organism/TextEditor/stories/shared.js +57 -0
  163. package/es/components/organism/TextEditor/styled.d.ts +9 -0
  164. package/es/components/organism/TextEditor/styled.js +61 -0
  165. package/es/components/organism/TextEditor/types.d.ts +324 -0
  166. package/es/components/organism/TextEditor/types.js +6 -0
  167. package/es/components/organism/TextEditor/ui/BubbleMenu/BubbleMenu.d.ts +3 -0
  168. package/es/components/organism/TextEditor/ui/BubbleMenu/BubbleMenu.js +114 -0
  169. package/es/components/organism/TextEditor/ui/BubbleMenu/index.d.ts +1 -0
  170. package/es/components/organism/TextEditor/ui/BubbleMenu/index.js +1 -0
  171. package/es/components/organism/TextEditor/ui/Button/Button.d.ts +9 -0
  172. package/es/components/organism/TextEditor/ui/Button/Button.js +35 -0
  173. package/es/components/organism/TextEditor/ui/Button/index.d.ts +2 -0
  174. package/es/components/organism/TextEditor/ui/Button/index.js +1 -0
  175. package/es/components/organism/TextEditor/ui/Button/types.d.ts +10 -0
  176. package/es/components/organism/TextEditor/ui/Button/types.js +1 -0
  177. package/es/components/organism/TextEditor/ui/ColorPicker/ColorPicker.d.ts +39 -0
  178. package/es/components/organism/TextEditor/ui/ColorPicker/ColorPicker.js +131 -0
  179. package/es/components/organism/TextEditor/ui/ColorPicker/index.d.ts +1 -0
  180. package/es/components/organism/TextEditor/ui/ColorPicker/index.js +1 -0
  181. package/es/components/organism/TextEditor/ui/DropdownButton/DropdownButton.d.ts +17 -0
  182. package/es/components/organism/TextEditor/ui/DropdownButton/DropdownButton.js +51 -0
  183. package/es/components/organism/TextEditor/ui/DropdownButton/index.d.ts +1 -0
  184. package/es/components/organism/TextEditor/ui/DropdownButton/index.js +1 -0
  185. package/es/components/organism/TextEditor/ui/Emoji/EmojiList.d.ts +11 -0
  186. package/es/components/organism/TextEditor/ui/Emoji/EmojiList.js +66 -0
  187. package/es/components/organism/TextEditor/ui/Emoji/index.d.ts +2 -0
  188. package/es/components/organism/TextEditor/ui/Emoji/index.js +2 -0
  189. package/es/components/organism/TextEditor/ui/Emoji/suggestion.d.ts +4 -0
  190. package/es/components/organism/TextEditor/ui/Emoji/suggestion.js +71 -0
  191. package/es/components/organism/TextEditor/ui/FontPopover/FontItem.d.ts +2 -0
  192. package/es/components/organism/TextEditor/ui/FontPopover/FontItem.js +27 -0
  193. package/es/components/organism/TextEditor/ui/FontPopover/FontPopover.d.ts +16 -0
  194. package/es/components/organism/TextEditor/ui/FontPopover/FontPopover.js +102 -0
  195. package/es/components/organism/TextEditor/ui/FontPopover/styled.d.ts +2 -0
  196. package/es/components/organism/TextEditor/ui/FontPopover/styled.js +36 -0
  197. package/es/components/organism/TextEditor/ui/FontPopover/types.d.ts +35 -0
  198. package/es/components/organism/TextEditor/ui/FontPopover/types.js +1 -0
  199. package/es/components/organism/TextEditor/ui/LinkInsertForm/LinkInsertForm.d.ts +16 -0
  200. package/es/components/organism/TextEditor/ui/LinkInsertForm/LinkInsertForm.js +61 -0
  201. package/es/components/organism/TextEditor/ui/LinkInsertForm/index.d.ts +2 -0
  202. package/es/components/organism/TextEditor/ui/LinkInsertForm/index.js +1 -0
  203. package/es/components/organism/TextEditor/ui/LinkPopover/LinkPopover.d.ts +9 -0
  204. package/es/components/organism/TextEditor/ui/LinkPopover/LinkPopover.js +126 -0
  205. package/es/components/organism/TextEditor/ui/LinkPopover/index.d.ts +2 -0
  206. package/es/components/organism/TextEditor/ui/LinkPopover/index.js +1 -0
  207. package/es/components/organism/TextEditor/ui/Popover/Popover.d.ts +6 -0
  208. package/es/components/organism/TextEditor/ui/Popover/Popover.js +9 -0
  209. package/es/components/organism/TextEditor/ui/Popover/index.d.ts +1 -0
  210. package/es/components/organism/TextEditor/ui/Popover/index.js +1 -0
  211. package/es/components/organism/TextEditor/ui/Select/Select.d.ts +4 -0
  212. package/es/components/organism/TextEditor/ui/Select/Select.js +7 -0
  213. package/es/components/organism/TextEditor/ui/Select/index.d.ts +1 -0
  214. package/es/components/organism/TextEditor/ui/Select/index.js +1 -0
  215. package/es/components/organism/TextEditor/ui/SplitButtonDropdown/SplitButtonDropdown.d.ts +2 -0
  216. package/es/components/organism/TextEditor/ui/SplitButtonDropdown/SplitButtonDropdown.js +44 -0
  217. package/es/components/organism/TextEditor/ui/SplitButtonDropdown/index.d.ts +1 -0
  218. package/es/components/organism/TextEditor/ui/SplitButtonDropdown/index.js +1 -0
  219. package/es/components/organism/TextEditor/ui/SplitButtonDropdown/styled.d.ts +2 -0
  220. package/es/components/organism/TextEditor/ui/SplitButtonDropdown/styled.js +58 -0
  221. package/es/components/organism/TextEditor/ui/SplitButtonDropdown/types.d.ts +19 -0
  222. package/es/components/organism/TextEditor/ui/SplitButtonDropdown/types.js +1 -0
  223. package/es/components/organism/TextEditor/ui/TextAlignSelect/TextAlignSelect.d.ts +30 -0
  224. package/es/components/organism/TextEditor/ui/TextAlignSelect/TextAlignSelect.js +75 -0
  225. package/es/components/organism/TextEditor/ui/TextAlignSelect/index.d.ts +1 -0
  226. package/es/components/organism/TextEditor/ui/TextAlignSelect/index.js +1 -0
  227. package/es/components/organism/TextEditor/ui/Toolbar/FormattingToolbar.d.ts +19 -0
  228. package/es/components/organism/TextEditor/ui/Toolbar/FormattingToolbar.js +85 -0
  229. package/es/components/organism/TextEditor/ui/Toolbar/LinkPreviewToolbar.d.ts +10 -0
  230. package/es/components/organism/TextEditor/ui/Toolbar/LinkPreviewToolbar.js +39 -0
  231. package/es/components/organism/TextEditor/ui/Toolbar/actions/BoldAction.d.ts +6 -0
  232. package/es/components/organism/TextEditor/ui/Toolbar/actions/BoldAction.js +19 -0
  233. package/es/components/organism/TextEditor/ui/Toolbar/actions/BulletListAction.d.ts +6 -0
  234. package/es/components/organism/TextEditor/ui/Toolbar/actions/BulletListAction.js +93 -0
  235. package/es/components/organism/TextEditor/ui/Toolbar/actions/ClearFormattingAction.d.ts +5 -0
  236. package/es/components/organism/TextEditor/ui/Toolbar/actions/ClearFormattingAction.js +20 -0
  237. package/es/components/organism/TextEditor/ui/Toolbar/actions/EmojiAction.d.ts +4 -0
  238. package/es/components/organism/TextEditor/ui/Toolbar/actions/EmojiAction.js +32 -0
  239. package/es/components/organism/TextEditor/ui/Toolbar/actions/FontFamilyAction.d.ts +19 -0
  240. package/es/components/organism/TextEditor/ui/Toolbar/actions/FontFamilyAction.js +41 -0
  241. package/es/components/organism/TextEditor/ui/Toolbar/actions/FontSizeAction.d.ts +8 -0
  242. package/es/components/organism/TextEditor/ui/Toolbar/actions/FontSizeAction.js +51 -0
  243. package/es/components/organism/TextEditor/ui/Toolbar/actions/HistoryAction.d.ts +5 -0
  244. package/es/components/organism/TextEditor/ui/Toolbar/actions/HistoryAction.js +21 -0
  245. package/es/components/organism/TextEditor/ui/Toolbar/actions/IndentAction.d.ts +5 -0
  246. package/es/components/organism/TextEditor/ui/Toolbar/actions/IndentAction.js +17 -0
  247. package/es/components/organism/TextEditor/ui/Toolbar/actions/ItalicAction.d.ts +5 -0
  248. package/es/components/organism/TextEditor/ui/Toolbar/actions/ItalicAction.js +18 -0
  249. package/es/components/organism/TextEditor/ui/Toolbar/actions/LetterSpacing.d.ts +5 -0
  250. package/es/components/organism/TextEditor/ui/Toolbar/actions/LetterSpacing.js +28 -0
  251. package/es/components/organism/TextEditor/ui/Toolbar/actions/LineSpacingAction.d.ts +10 -0
  252. package/es/components/organism/TextEditor/ui/Toolbar/actions/LineSpacingAction.js +45 -0
  253. package/es/components/organism/TextEditor/ui/Toolbar/actions/LinkAction.d.ts +6 -0
  254. package/es/components/organism/TextEditor/ui/Toolbar/actions/LinkAction.js +17 -0
  255. package/es/components/organism/TextEditor/ui/Toolbar/actions/OrderedListAction.d.ts +5 -0
  256. package/es/components/organism/TextEditor/ui/Toolbar/actions/OrderedListAction.js +67 -0
  257. package/es/components/organism/TextEditor/ui/Toolbar/actions/OutdentAction.d.ts +5 -0
  258. package/es/components/organism/TextEditor/ui/Toolbar/actions/OutdentAction.js +17 -0
  259. package/es/components/organism/TextEditor/ui/Toolbar/actions/SmartTagAction.d.ts +7 -0
  260. package/es/components/organism/TextEditor/ui/Toolbar/actions/SmartTagAction.js +18 -0
  261. package/es/components/organism/TextEditor/ui/Toolbar/actions/StrikeAction.d.ts +5 -0
  262. package/es/components/organism/TextEditor/ui/Toolbar/actions/StrikeAction.js +18 -0
  263. package/es/components/organism/TextEditor/ui/Toolbar/actions/SubscriptAction.d.ts +5 -0
  264. package/es/components/organism/TextEditor/ui/Toolbar/actions/SubscriptAction.js +26 -0
  265. package/es/components/organism/TextEditor/ui/Toolbar/actions/SuperscriptAction.d.ts +5 -0
  266. package/es/components/organism/TextEditor/ui/Toolbar/actions/SuperscriptAction.js +26 -0
  267. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextAlignAction.d.ts +5 -0
  268. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextAlignAction.js +3 -0
  269. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextBackgroundColorAction.d.ts +5 -0
  270. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextBackgroundColorAction.js +29 -0
  271. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextColorAction.d.ts +14 -0
  272. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextColorAction.js +22 -0
  273. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextTransformAction.d.ts +5 -0
  274. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextTransformAction.js +36 -0
  275. package/es/components/organism/TextEditor/ui/Toolbar/actions/UnderlineAction.d.ts +5 -0
  276. package/es/components/organism/TextEditor/ui/Toolbar/actions/UnderlineAction.js +18 -0
  277. package/es/components/organism/TextEditor/ui/Toolbar/actions/UnsetLink.d.ts +7 -0
  278. package/es/components/organism/TextEditor/ui/Toolbar/actions/UnsetLink.js +18 -0
  279. package/es/components/organism/TextEditor/ui/Toolbar/actions/index.d.ts +24 -0
  280. package/es/components/organism/TextEditor/ui/Toolbar/actions/index.js +24 -0
  281. package/es/components/organism/TextEditor/ui/Toolbar/index.d.ts +2 -0
  282. package/es/components/organism/TextEditor/ui/Toolbar/index.js +2 -0
  283. package/es/components/organism/TextEditor/utils/documentState.d.ts +73 -0
  284. package/es/components/organism/TextEditor/utils/documentState.js +149 -0
  285. package/es/components/organism/TextEditor/utils/font.d.ts +74 -0
  286. package/es/components/organism/TextEditor/utils/font.js +147 -0
  287. package/es/components/organism/TextEditor/utils/htmlProcessing.d.ts +87 -0
  288. package/es/components/organism/TextEditor/utils/htmlProcessing.js +460 -0
  289. package/es/components/organism/TextEditor/utils/indent.d.ts +11 -0
  290. package/es/components/organism/TextEditor/utils/indent.js +56 -0
  291. package/es/components/organism/TextEditor/utils/index.d.ts +8 -0
  292. package/es/components/organism/TextEditor/utils/index.js +16 -0
  293. package/es/components/organism/TextEditor/utils/link.d.ts +116 -0
  294. package/es/components/organism/TextEditor/utils/link.js +304 -0
  295. package/es/components/organism/TextEditor/utils/menu.d.ts +134 -0
  296. package/es/components/organism/TextEditor/utils/menu.js +321 -0
  297. package/es/components/organism/TextEditor/utils/selection.d.ts +25 -0
  298. package/es/components/organism/TextEditor/utils/selection.js +58 -0
  299. package/es/components/organism/TextEditor/utils/shared.d.ts +13 -0
  300. package/es/components/organism/TextEditor/utils/shared.js +52 -0
  301. package/es/components/organism/TextEditor/utils/smartTag.d.ts +49 -0
  302. package/es/components/organism/TextEditor/utils/smartTag.js +90 -0
  303. package/es/components/organism/TextEditor/utils/style.d.ts +78 -0
  304. package/es/components/organism/TextEditor/utils/style.js +193 -0
  305. package/es/components/organism/index.d.ts +1 -0
  306. package/es/components/organism/index.js +1 -0
  307. package/es/components/organism/index.scss +1 -0
  308. package/es/constants/index.d.ts +1 -0
  309. package/es/constants/index.js +1 -0
  310. package/es/constants/web.d.ts +8 -0
  311. package/es/constants/web.js +57 -0
  312. package/es/hooks/index.d.ts +4 -0
  313. package/es/hooks/index.js +4 -0
  314. package/es/hooks/useBroadcastedLocalStorage.d.ts +5 -0
  315. package/es/hooks/useBroadcastedLocalStorage.js +71 -0
  316. package/es/hooks/useElementSize.d.ts +7 -0
  317. package/es/hooks/useElementSize.js +56 -0
  318. package/es/hooks/useEyedropper/attach.d.ts +4 -0
  319. package/es/hooks/useEyedropper/attach.js +9 -0
  320. package/es/hooks/useEyedropper/eyedropper.d.ts +69 -0
  321. package/es/hooks/useEyedropper/eyedropper.js +205 -0
  322. package/es/hooks/useEyedropper/index.d.ts +2 -0
  323. package/es/hooks/useEyedropper/index.js +7 -0
  324. package/es/hooks/useEyedropper/support.d.ts +1 -0
  325. package/es/hooks/useEyedropper/support.js +3 -0
  326. package/es/hooks/useEyedropper/types.d.ts +9 -0
  327. package/es/hooks/useEyedropper/types.js +1 -0
  328. package/es/hooks/useEyedropper/useEyedropper.d.ts +8 -0
  329. package/es/hooks/useEyedropper/useEyedropper.js +50 -0
  330. package/es/hooks/useEyedropper/utils.d.ts +11 -0
  331. package/es/hooks/useEyedropper/utils.js +17 -0
  332. package/es/hooks/useIsMounted.d.ts +1 -0
  333. package/es/hooks/useIsMounted.js +11 -0
  334. package/es/index.d.ts +1 -1
  335. package/es/index.js +1 -1
  336. package/es/locales/i18n.d.ts +1 -1
  337. package/es/types/index.d.ts +9 -0
  338. package/es/utils/common.d.ts +15 -9
  339. package/es/utils/common.js +62 -24
  340. package/es/utils/index.d.ts +1 -0
  341. package/es/utils/index.js +1 -0
  342. package/es/utils/web.d.ts +80 -0
  343. package/es/utils/web.js +226 -0
  344. package/package.json +26 -17
@@ -0,0 +1,42 @@
1
+ import { useCallback, useEffect } from 'react';
2
+ export function useStyleMemory(editor) {
3
+ // Store current marks manually
4
+ const storeCurrentMarks = useCallback(() => {
5
+ editor?.commands.storeCurrentMarks();
6
+ }, [editor]);
7
+ // Clear stored marks
8
+ const clearStoredMarks = useCallback(() => {
9
+ editor?.commands.clearStoredMarks();
10
+ }, [editor]);
11
+ // Apply stored marks
12
+ const applyStoredMarks = useCallback(() => {
13
+ editor?.commands.applyStoredMarks();
14
+ }, [editor]);
15
+ // Auto-store marks when selection changes
16
+ useEffect(() => {
17
+ if (!editor)
18
+ return;
19
+ const handleSelectionUpdate = () => {
20
+ const { selection, doc } = editor.state;
21
+ // Only store if editor has content and selection has marks
22
+ if (doc.content.size > 4 && !selection.empty) {
23
+ const { $from } = selection;
24
+ const marks = editor.state.storedMarks || $from.marks();
25
+ if (marks.length > 0) {
26
+ storeCurrentMarks();
27
+ }
28
+ }
29
+ };
30
+ editor.on('selectionUpdate', handleSelectionUpdate);
31
+ editor.on('update', handleSelectionUpdate);
32
+ return () => {
33
+ editor.off('selectionUpdate', handleSelectionUpdate);
34
+ editor.off('update', handleSelectionUpdate);
35
+ };
36
+ }, [editor, storeCurrentMarks]);
37
+ return {
38
+ storeCurrentMarks,
39
+ clearStoredMarks,
40
+ applyStoredMarks,
41
+ };
42
+ }
@@ -0,0 +1,34 @@
1
+ import { Editor } from '@tiptap/react';
2
+ export interface StylePreset {
3
+ id: string;
4
+ name: string;
5
+ description?: string;
6
+ marks: Array<{
7
+ type: string;
8
+ attrs: Record<string, any>;
9
+ }>;
10
+ textStyle: {
11
+ fontSize?: string;
12
+ fontFamily?: string;
13
+ color?: string;
14
+ backgroundColor?: string;
15
+ fontWeight?: string | number;
16
+ };
17
+ createdAt: number;
18
+ usageCount: number;
19
+ }
20
+ export interface UseStylePresetsOptions {
21
+ /** Storage key for presets */
22
+ storageKey?: string;
23
+ /** Maximum number of presets */
24
+ maxPresets?: number;
25
+ /** Default presets */
26
+ defaultPresets?: Omit<StylePreset, 'id' | 'createdAt' | 'usageCount'>[];
27
+ }
28
+ export declare function useStylePresets(editor: Editor | null, options?: UseStylePresetsOptions): {
29
+ presets: StylePreset[];
30
+ createPreset: (name: string, description?: string) => StylePreset | undefined;
31
+ applyPreset: (presetId: string) => void;
32
+ deletePreset: (presetId: string) => void;
33
+ getPopularPresets: (limit?: number) => StylePreset[];
34
+ };
@@ -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>&nbsp;Special <a data-link-id=\"rrd48wh5\" href=\"https://ant.design\" target=\"_blank\" id=\"isPasted\">Bonus</a>&nbsp;fasdfas&nbsp; 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
+ ];