@antscorp/antsomi-ui 2.0.114 → 2.0.115

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 (287) hide show
  1. package/CHANGELOG.md +92 -0
  2. package/README.md +78 -78
  3. package/es/__mocks__/1000_city.json +802 -802
  4. package/es/__mocks__/sql-query.json +56 -56
  5. package/es/assets/css/main.scss +8 -8
  6. package/es/assets/images/feedback.svg +3 -3
  7. package/es/assets/svg/mobile-frame.svg +3 -3
  8. package/es/assets/svg/warning-icon.svg +5 -5
  9. package/es/components/atoms/Alert/Alert.js +28 -28
  10. package/es/components/atoms/ContentEditable/styled.js +16 -16
  11. package/es/components/atoms/DividerPure/styled.js +35 -35
  12. package/es/components/atoms/Eyedropper/styled.js +39 -39
  13. package/es/components/atoms/Icon/index.js +19 -19
  14. package/es/components/atoms/Iframe/Iframe.js +18 -18
  15. package/es/components/atoms/Input/styled.js +104 -104
  16. package/es/components/atoms/InputDynamic/styled.js +284 -284
  17. package/es/components/atoms/MobileBrandingBar/styled.js +21 -21
  18. package/es/components/atoms/MobileFrame/styled.js +30 -30
  19. package/es/components/atoms/MobileFrameV2/styled.js +42 -42
  20. package/es/components/atoms/MobileFrameV3/styled.js +31 -31
  21. package/es/components/atoms/NotificationStatus/styled.js +10 -10
  22. package/es/components/atoms/PreviewTabs/styled.js +69 -69
  23. package/es/components/atoms/Radio/index.js +16 -16
  24. package/es/components/atoms/ReactIframe/ReactIframe.js +5 -5
  25. package/es/components/atoms/ReactIframe/styled.js +9 -9
  26. package/es/components/atoms/RequiredLabel/styled.js +3 -3
  27. package/es/components/atoms/ScrollBox/index.js +5 -5
  28. package/es/components/atoms/Scrollbars/styled.js +21 -21
  29. package/es/components/atoms/SelectAssociatedTag/SelectAssociatedTag.d.ts +5 -0
  30. package/es/components/atoms/SelectAssociatedTag/SelectAssociatedTag.js +15 -0
  31. package/es/components/atoms/SelectAssociatedTag/SelectTag.d.ts +4 -0
  32. package/es/components/atoms/SelectAssociatedTag/SelectTag.js +26 -0
  33. package/es/components/atoms/SelectAssociatedTag/constants.d.ts +11 -0
  34. package/es/components/atoms/SelectAssociatedTag/constants.js +42 -0
  35. package/es/components/atoms/SelectAssociatedTag/index.d.ts +3 -0
  36. package/es/components/atoms/SelectAssociatedTag/index.js +2 -0
  37. package/es/components/atoms/SelectAssociatedTag/styled.d.ts +7 -0
  38. package/es/components/atoms/SelectAssociatedTag/styled.js +60 -0
  39. package/es/components/atoms/SelectAssociatedTag/types.d.ts +76 -0
  40. package/es/components/atoms/SelectAssociatedTag/types.js +1 -0
  41. package/es/components/atoms/SlideBar/styled.js +194 -194
  42. package/es/components/atoms/Slider/styled.js +31 -31
  43. package/es/components/atoms/Space/Space.js +4 -4
  44. package/es/components/atoms/Spin/styled.js +11 -11
  45. package/es/components/atoms/Steps/styled.js +244 -244
  46. package/es/components/atoms/Switch/styled.js +56 -56
  47. package/es/components/atoms/Tag/Tag.js +10 -10
  48. package/es/components/atoms/Text/styled.js +34 -34
  49. package/es/components/atoms/index.d.ts +1 -0
  50. package/es/components/atoms/index.js +1 -0
  51. package/es/components/icons/CircleInfoIcon.js +2 -2
  52. package/es/components/icons/DomainManagementIcon.js +1 -1
  53. package/es/components/icons/LazyIcon/LazyIcon.d.ts +2 -0
  54. package/es/components/icons/LazyIcon/LazyIcon.js +2 -0
  55. package/es/components/icons/LoadingIcon.js +33 -33
  56. package/es/components/icons/document/styled.js +43 -43
  57. package/es/components/index.scss +2 -2
  58. package/es/components/molecules/AccessDenied/styled.js +28 -28
  59. package/es/components/molecules/AccountSelection/styled.js +110 -110
  60. package/es/components/molecules/AddDynamicContent/styled.js +23 -23
  61. package/es/components/molecules/AlignSetting/styled.js +4 -4
  62. package/es/components/molecules/ApplyPopupContent/styled.js +32 -32
  63. package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/styled.js +8 -8
  64. package/es/components/molecules/CalendarSelection/components/CustomPicker/styled.js +79 -79
  65. package/es/components/molecules/CalendarSelection/components/Footer/styled.js +4 -4
  66. package/es/components/molecules/CalendarSelection/components/RangePicker/styled.js +21 -21
  67. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/Option.js +26 -26
  68. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/styled.js +30 -30
  69. package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/styled.js +26 -26
  70. package/es/components/molecules/CalendarSelection/styled.js +8 -8
  71. package/es/components/molecules/CaptureScreen/components/CommentBox/styled.js +119 -119
  72. package/es/components/molecules/CaptureScreen/components/Cursor/styled.js +67 -67
  73. package/es/components/molecules/CaptureScreen/styled.js +240 -240
  74. package/es/components/molecules/ChartTab/components/styled.js +24 -24
  75. package/es/components/molecules/ChartTab/styled.js +20 -20
  76. package/es/components/molecules/ChatBox/AntsomiAI.js +8 -8
  77. package/es/components/molecules/ChatBox/ChatBoxInsight/QuestionItem.js +9 -9
  78. package/es/components/molecules/ChatBox/ChatBoxInsight/styled.js +365 -365
  79. package/es/components/molecules/ChatBox/styled.js +324 -324
  80. package/es/components/molecules/CodeStructure/styled.js +5 -5
  81. package/es/components/molecules/ColorPicker/ChromePicker/styled.js +10 -10
  82. package/es/components/molecules/ColorPicker/CustomPicker/styled.js +89 -89
  83. package/es/components/molecules/ColorPicker/SketchPicker/styled.js +5 -5
  84. package/es/components/molecules/ColorPicker/styled.js +7 -7
  85. package/es/components/molecules/ColorSetting/styled.js +39 -39
  86. package/es/components/molecules/DatePicker/components/AdvancedPicker/styled.js +110 -110
  87. package/es/components/molecules/DatePickerV2/styled.js +6 -6
  88. package/es/components/molecules/DisplayFormat/styled.js +12 -12
  89. package/es/components/molecules/DrawerDetail/components/ToggleDrawerSizeButton.js +24 -24
  90. package/es/components/molecules/DrawerDetail/styled.js +109 -109
  91. package/es/components/molecules/Dropdown/style.scss +11 -11
  92. package/es/components/molecules/Dropdown/styled.js +28 -28
  93. package/es/components/molecules/EdgeSetting/styled.js +10 -10
  94. package/es/components/molecules/EditableName/styled.js +70 -70
  95. package/es/components/molecules/EditingList/styled.js +29 -29
  96. package/es/components/molecules/EditingListV2/components/List/List.js +9 -9
  97. package/es/components/molecules/EditorTab/styled.js +156 -156
  98. package/es/components/molecules/EmojiCollections/styled.js +22 -22
  99. package/es/components/molecules/EmojiPopover/styled.js +4 -4
  100. package/es/components/molecules/EmptyData/styled.js +53 -53
  101. package/es/components/molecules/EyedropperButton/styled.js +19 -19
  102. package/es/components/molecules/FontSizeInput/index.scss +15 -15
  103. package/es/components/molecules/FontSizeInput/styled.js +31 -31
  104. package/es/components/molecules/GradientSetting/styled.js +57 -57
  105. package/es/components/molecules/HeaderV2/styled.js +70 -70
  106. package/es/components/molecules/IconSelection/styled.js +69 -69
  107. package/es/components/molecules/ImageEditor/components/ModalShortcut.js +21 -21
  108. package/es/components/molecules/ImageEditor/styled.js +5 -5
  109. package/es/components/molecules/ImagePreview/styled.js +3 -3
  110. package/es/components/molecules/InputNumberWithUnit/styled.js +14 -14
  111. package/es/components/molecules/InputSearch/styled.js +41 -41
  112. package/es/components/molecules/InputSelectAttribute/index.d.ts +25 -0
  113. package/es/components/molecules/InputSelectAttribute/index.js +124 -0
  114. package/es/components/molecules/InputSelectAttribute/styled.d.ts +14 -0
  115. package/es/components/molecules/InputSelectAttribute/styled.js +33 -0
  116. package/es/components/molecules/ItemNotFound/styled.js +26 -26
  117. package/es/components/molecules/MatchAnySelect/components/ExtendValuePopup.js +8 -8
  118. package/es/components/molecules/MatchAnySelect/styled.js +247 -247
  119. package/es/components/molecules/Modal/styled.js +63 -63
  120. package/es/components/molecules/ModalSelect/styled.js +152 -152
  121. package/es/components/molecules/ModalV2/styled.js +27 -27
  122. package/es/components/molecules/PopupDraggable/styled.js +57 -57
  123. package/es/components/molecules/PreviewModal/styled.js +26 -26
  124. package/es/components/molecules/ProcessLoading/styled.js +2 -2
  125. package/es/components/molecules/QuillEditor/CustomToolbar.js +3165 -3165
  126. package/es/components/molecules/QuillEditor/EditorToolbar.js +7 -7
  127. package/es/components/molecules/QuillEditor/styled.js +25 -25
  128. package/es/components/molecules/RadioGroup/styled.js +9 -9
  129. package/es/components/molecules/RequestAccess/styled.js +38 -38
  130. package/es/components/molecules/ResizeGrid/components/Cell/styled.js +77 -77
  131. package/es/components/molecules/ResizeGrid/styled.js +50 -50
  132. package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/styled.js +118 -118
  133. package/es/components/molecules/RichMenu/RichMenuBlock/styled.js +13 -13
  134. package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/styled.js +40 -40
  135. package/es/components/molecules/RichMenu/RichMenuChatBar/styled.js +27 -27
  136. package/es/components/molecules/RichMenu/RichMenuMobileView/RichMenuMobileView.js +2 -2
  137. package/es/components/molecules/RichMenu/RichMenuMobileView/styled.js +38 -38
  138. package/es/components/molecules/SearchPopover/components/PopoverSelect/styled.js +36 -36
  139. package/es/components/molecules/SearchPopover/components/PopoverSelect/styles.scss +7 -7
  140. package/es/components/molecules/SearchPopover/styled.js +32 -32
  141. package/es/components/molecules/Select/styled.js +32 -32
  142. package/es/components/molecules/SelectAccount/styled.js +147 -147
  143. package/es/components/molecules/SelectEventAttribute/styled.js +8 -8
  144. package/es/components/molecules/SelectMulti/styled.js +62 -62
  145. package/es/components/molecules/SelectV2/styled.d.ts +3 -1
  146. package/es/components/molecules/SelectV2/styled.js +124 -124
  147. package/es/components/molecules/SettingWrapper/styled.js +12 -12
  148. package/es/components/molecules/ShareAccess/components/GeneralAccess/styled.js +56 -56
  149. package/es/components/molecules/ShareAccess/components/LayoutContent/styled.js +5 -5
  150. package/es/components/molecules/ShareAccess/components/ModalTransferOwnerShip/styled.js +15 -15
  151. package/es/components/molecules/ShareAccess/components/PeopleAccess/styled.js +63 -63
  152. package/es/components/molecules/ShareAccess/components/SearchUser/styled.js +31 -31
  153. package/es/components/molecules/SliderWithInputNumber/styled.js +2 -2
  154. package/es/components/molecules/Tabs/Tabs.js +11 -11
  155. package/es/components/molecules/TagifyInput/TagifyInput.js +209 -121
  156. package/es/components/molecules/TagifyInput/constants.d.ts +24 -2
  157. package/es/components/molecules/TagifyInput/constants.js +25 -2
  158. package/es/components/molecules/TagifyInput/patternHandlers.d.ts +12 -6
  159. package/es/components/molecules/TagifyInput/patternHandlers.js +88 -43
  160. package/es/components/molecules/TagifyInput/styled.js +37 -37
  161. package/es/components/molecules/TagifyInput/types.d.ts +24 -3
  162. package/es/components/molecules/TagifyInput/utils.d.ts +10 -1
  163. package/es/components/molecules/TagifyInput/utils.js +94 -16
  164. package/es/components/molecules/TagifyInput/utils.style.js +246 -261
  165. package/es/components/molecules/TemplateSaveAs/components/Category/Category.js +5 -5
  166. package/es/components/molecules/TemplateSaveAs/components/ImageSlider/styled.js +276 -276
  167. package/es/components/molecules/TemplateSaveAs/styled.js +134 -134
  168. package/es/components/molecules/ThumbnailCard/styled.js +92 -92
  169. package/es/components/molecules/Tree/styled.js +38 -38
  170. package/es/components/molecules/UnsubscribePreferences/styled.js +7 -7
  171. package/es/components/molecules/UnsubscribePreview/components/styled.js +53 -53
  172. package/es/components/molecules/UnsubscribePreview/styled.js +48 -48
  173. package/es/components/molecules/UploadImage/styled.js +114 -114
  174. package/es/components/molecules/VirtualizedMenu/styled.js +103 -103
  175. package/es/components/molecules/index.d.ts +1 -0
  176. package/es/components/molecules/index.js +1 -0
  177. package/es/components/molecules/index.scss +1 -1
  178. package/es/components/organism/AccountProfile/components/AccountSetting/components/EditableInput/styles.js +98 -98
  179. package/es/components/organism/AccountProfile/components/AccountSetting/components/LanguageSelector/styles.js +18 -18
  180. package/es/components/organism/AccountProfile/components/AccountSetting/styled.js +543 -543
  181. package/es/components/organism/AccountProfile/components/AccountSetting/styles.scss +39 -39
  182. package/es/components/organism/AccountSharing/AccountSharing.js +18 -10
  183. package/es/components/organism/AccountSharing/styled.js +336 -336
  184. package/es/components/organism/ActivityTimeline/__mocks__/event_tracking.json +1290 -1290
  185. package/es/components/organism/ActivityTimeline/__mocks__/timeline.json +1896 -1896
  186. package/es/components/organism/ActivityTimeline/components/ActionHistory/styled.js +28 -28
  187. package/es/components/organism/ActivityTimeline/components/CardMember/styled.js +60 -60
  188. package/es/components/organism/ActivityTimeline/components/ItemGroupEvent/styled.js +4 -4
  189. package/es/components/organism/ActivityTimeline/components/List/styled.js +77 -77
  190. package/es/components/organism/ActivityTimeline/components/ListItem/styled.js +37 -37
  191. package/es/components/organism/ActivityTimeline/components/ProductCard/styled.js +92 -92
  192. package/es/components/organism/ActivityTimeline/components/Redeem/styled.js +7 -7
  193. package/es/components/organism/ActivityTimeline/components/Slide/styled.js +20 -20
  194. package/es/components/organism/ActivityTimeline/components/TimeLineTitle/styled.js +7 -7
  195. package/es/components/organism/ActivityTimeline/components/TimelineSection/styled.js +69 -69
  196. package/es/components/organism/ActivityTimeline/styled.js +43 -43
  197. package/es/components/organism/ActivityTimeline/utils.js +168 -2
  198. package/es/components/organism/AlgorithmsSetting/styled.js +35 -35
  199. package/es/components/organism/BasicLogin/components/ChooseMethod/styled.js +19 -19
  200. package/es/components/organism/BasicLogin/components/LoginWithEmail/styled.js +3 -3
  201. package/es/components/organism/BasicLogin/components/LoginWithGG/styled.js +3 -3
  202. package/es/components/organism/BasicLogin/components/SignIn/styled.js +8 -8
  203. package/es/components/organism/BasicLogin/components/WidgetLayout/styled.js +18 -18
  204. package/es/components/organism/BasicLogin/styled.js +107 -107
  205. package/es/components/organism/ContentSources/styled.js +50 -50
  206. package/es/components/organism/DataTable/components/AddButton/index.js +8 -8
  207. package/es/components/organism/DataTable/components/ModifyColumn/styled.js +18 -18
  208. package/es/components/organism/DataTable/components/Pagination/styled.js +26 -26
  209. package/es/components/organism/DataTable/components/Table/styled.js +135 -135
  210. package/es/components/organism/DataTable/components/Toolbar/SearchPopover.js +17 -17
  211. package/es/components/organism/DataTable/components/Toolbar/styled.js +70 -70
  212. package/es/components/organism/DataTable/styled/index.js +84 -84
  213. package/es/components/organism/Filter/components/FilterCondition/styled.js +34 -34
  214. package/es/components/organism/Filter/styled.js +109 -109
  215. package/es/components/organism/FilterSetting/components/common/InputArray/styled.js +5 -5
  216. package/es/components/organism/FilterSetting/components/common/InputOrSelect/index.js +63 -63
  217. package/es/components/organism/FilterSetting/components/common/InputSelectMulti/ColumnSuggestion/index.js +31 -31
  218. package/es/components/organism/FilterSetting/components/common/InputSelectMulti/Tree/index.js +22 -22
  219. package/es/components/organism/FilterSetting/components/common/InputSelectMulti/index.js +55 -55
  220. package/es/components/organism/FilterSetting/styled.js +19 -19
  221. package/es/components/organism/Help/styled.js +267 -267
  222. package/es/components/organism/LeftMenu/components/HomeMenu/styled.js +39 -39
  223. package/es/components/organism/LeftMenu/components/common/ChildMenu/components/MenuItemImage/styled.js +16 -16
  224. package/es/components/organism/LeftMenu/components/common/ChildMenu/styled.js +156 -156
  225. package/es/components/organism/LeftMenu/hooks/usePermission.js +1 -1
  226. package/es/components/organism/LeftMenu/styled.js +214 -214
  227. package/es/components/organism/LeftMenu/utils/index.js +1 -1
  228. package/es/components/organism/Login/components/ChooseMethod/styled.js +19 -19
  229. package/es/components/organism/Login/components/ForgotPassword/styled.js +8 -8
  230. package/es/components/organism/Login/components/LoginSelectPortal/Item/styled.js +31 -31
  231. package/es/components/organism/Login/components/LoginSelectPortal/styled.js +3 -3
  232. package/es/components/organism/Login/components/LoginWithEmail/styled.js +3 -3
  233. package/es/components/organism/Login/components/LoginWithGG/styled.js +3 -3
  234. package/es/components/organism/Login/components/SetupGGAuthenticator/styled.js +7 -7
  235. package/es/components/organism/Login/components/SignIn/styled.js +8 -8
  236. package/es/components/organism/Login/components/VerifyAccount/styled.js +13 -13
  237. package/es/components/organism/Login/components/WidgetLayout/styled.js +18 -18
  238. package/es/components/organism/Login/styled.js +115 -115
  239. package/es/components/organism/Menu/styled.js +6 -6
  240. package/es/components/organism/ModifyColumnModal/styled.js +132 -132
  241. package/es/components/organism/Notification/styled.js +155 -155
  242. package/es/components/organism/PreviewCollections/Messages/SkeletonMessage/styled.js +14 -14
  243. package/es/components/organism/PreviewCollections/WhatsappMessage/CarouselMessage/styled.js +63 -63
  244. package/es/components/organism/PreviewCollections/constants.js +50 -50
  245. package/es/components/organism/PreviewCollections/styled.js +16 -16
  246. package/es/components/organism/PreviewTemplateModal/components/Banner/styled.js +78 -78
  247. package/es/components/organism/PreviewTemplateModal/components/Information/styled.js +52 -52
  248. package/es/components/organism/PreviewTemplateModal/components/SimilarTemplate/styled.js +18 -18
  249. package/es/components/organism/PreviewTemplateModal/components/ThumbnailSlider/styled.js +77 -77
  250. package/es/components/organism/PreviewTemplateModal/styled.js +21 -21
  251. package/es/components/organism/SQLGeneration/components/styled.js +354 -354
  252. package/es/components/organism/SQLGeneration/index.scss +1 -1
  253. package/es/components/organism/SQLGeneration/integrations/AceEditor/index.scss +4 -4
  254. package/es/components/organism/Table/CrossTabTable/components/CustomCell/styled.js +11 -11
  255. package/es/components/organism/Table/CrossTabTable/styled.js +11 -11
  256. package/es/components/organism/Table/ExplorePivotTable/components/CustomCell/styled.js +17 -17
  257. package/es/components/organism/Table/ExplorePivotTable/styled.js +11 -11
  258. package/es/components/organism/TextEditor/__mocks__/text-contennt.js +44 -44
  259. package/es/components/organism/TextEditor/index.scss +65 -65
  260. package/es/components/organism/TextEditor/stories/WithOldDynAndLink/froala-legacy-format.settings.json +95 -95
  261. package/es/components/organism/TextEditor/styled.js +54 -54
  262. package/es/components/organism/TextEditor/ui/Button/Button.js +22 -22
  263. package/es/components/organism/TextEditor/ui/DropdownButton/DropdownButton.js +13 -13
  264. package/es/components/organism/TextEditor/ui/FontPopover/styled.js +32 -32
  265. package/es/components/organism/TextEditor/ui/SplitButtonDropdown/styled.js +54 -54
  266. package/es/components/organism/TextEditor/ui/TextAlignSelect/TextAlignSelect.js +9 -9
  267. package/es/components/organism/TextEditor/ui/Toolbar/actions/FontSizeAction.js +11 -11
  268. package/es/components/organism/TicketEditor/styled.js +850 -850
  269. package/es/components/organism/TicketEditorV2/styled.js +839 -839
  270. package/es/components/organism/index.scss +2 -2
  271. package/es/components/template/Layout/Layout.js +10 -10
  272. package/es/components/template/Layout/components/RecommendationWorkspace/components/MenuMapping/components/OldLeftMenu/styled.js +73 -73
  273. package/es/components/template/Layout/components/RecommendationWorkspace/components/MenuMapping/styled.js +39 -39
  274. package/es/components/template/Layout/components/RecommendationWorkspace/components/RecommendationImage/styled.js +61 -61
  275. package/es/components/template/Layout/components/RecommendationWorkspace/styled.js +16 -16
  276. package/es/components/template/Layout/styled.js +84 -84
  277. package/es/components/template/TemplateListing/components/BlankTemplate/styled.js +21 -21
  278. package/es/components/template/TemplateListing/components/CategoryListing/styled.js +123 -123
  279. package/es/components/template/TemplateListing/components/Empty/styled.js +20 -20
  280. package/es/components/template/TemplateListing/stories/demo/styled.js +4 -4
  281. package/es/components/template/TemplateListing/styled/index.js +40 -40
  282. package/es/providers/ConfigProvider/GlobalStyle.js +1249 -1249
  283. package/es/styled/common.js +51 -51
  284. package/es/tests/styled.js +4 -4
  285. package/es/utils/cookie.js +9 -0
  286. package/es/utils/variables.js +7 -7
  287. package/package.json +276 -276
@@ -17,13 +17,15 @@ import '@yaireo/tagify/dist/tagify.css';
17
17
  // Styled
18
18
  import { TagTextArea, TagifyWrapper, WrapperPlaceHolder } from './styled';
19
19
  // Utils
20
- import { parseTagStringToTagify, convertInputStringToOriginal, emojiManufacturer, getEmojiTag, isPersonalizeTagType, generateTagContent, unescapeString, hasLineBreak, selectRange, isTagClickable, findURLInTextNodes, getAttributesString, isAnchorNodeChildOfElement, isShortLinkTagType, isCaretAtEndOfTextNodeWithNextTag, getCurrentSelectionAndCloneRange, handleEnterWithNextTag, handleTextNodeBackspace, } from './utils';
21
- import { acceptablePatternChecking, detectURLRegex, getCachedRegex, getPersonalizeTagInfo, getShortLinkTagInfo, patternHandlers, } from './patternHandlers';
20
+ import { parseTagStringToTagify, convertInputStringToOriginal, emojiManufacturer, getEmojiTag, isPersonalizeTagType, generateTagContent, unescapeString, hasLineBreak, selectRange, isTagClickable, findURLInTextNodes, getAttributesString, isAnchorNodeChildOfElement, isShortLinkTagType, isCustomTagType, sanitizeTagAttributes, getTagAttributes, applyTagAttributes, getTagContentAttributes, isCaretAtEndOfTextNodeWithNextTag, getCurrentSelectionAndCloneRange, handleEnterWithNextTag, handleTextNodeBackspace, preventUndoRedo, } from './utils';
21
+ import { acceptablePatternChecking, detectURLRegex, getCachedRegex, getCustomTagId, getPersonalizeTagInfo, getShortLinkTagInfo, patternHandlers, } from './patternHandlers';
22
22
  // Constants
23
- import { DETECT_LINK, EMOJI, FORCE_SHOW_TOOLTIP, INVALID_TAG, MESSAGE_TAG, NO_VIEW_TAG, PERSONALIZE_PTN, PROMOTION_CODE, READONLY_TAG, REMOVED_TAG, SHORT_LINK, SHORT_LINK_PTN, SHORT_LINK_V2, UNSUBSCRIBE_WHATSAPP, defaultCssVariables, tagifyDefaultProps, } from './constants';
23
+ import { DETECT_LINK, EMOJI, PERSONALIZE_PTN, SHORT_LINK, SHORT_LINK_PTN, SHORT_LINK_V2, TAG_TYPE, UNSUBSCRIBE_WHATSAPP, defaultCssVariables, tagifyDefaultProps, TAG_CUSTOM_ATTRIBUTES, } from './constants';
24
+ const { CUSTOM_TAG } = TAG_TYPE;
25
+ const { PREPARING_ST, INVALID_TAG, MESSAGE_TAG, FORCE_SHOW_TOOLTIP, ERROR_TAG, WARNING_TAG } = TAG_CUSTOM_ATTRIBUTES;
24
26
  const TagifyInput = forwardRef((props, ref) => {
25
27
  // Props
26
- const { initialValue, escapeHTML, status, readonly, readonlyTag, readonlyText, realtime, disabled, maxLength, maxHeight, minWidth, placeholder, minWidthPlaceholder, isSingleLineText, acceptableTagPattern, mapAttributes, mapErrorAttributes, maxPersonalizeTags, name, children, cssTagifyVariables, onTagClick, onChange, } = props;
28
+ const { initialValue, escapeHTML, status, readonly, readonlyTag, readonlyText, realtime, disabled, maxLength, maxHeight, minWidth, placeholder, minWidthPlaceholder, isSingleLineText, acceptableTagPattern, tagProperties, mapAttributes = {}, mapErrorAttributes = {}, maxPersonalizeTags, name, children, cssTagifyVariables, onTagClick, onTagRemove, onChange, } = props;
27
29
  // States
28
30
  const [isLineBreak, setIsLineBreak] = useState(hasLineBreak(initialValue));
29
31
  const [tooltipRefresher, setTooltipRefresher] = useState(1);
@@ -33,6 +35,7 @@ const TagifyInput = forwardRef((props, ref) => {
33
35
  const tagifyWrapperRef = useRef(null);
34
36
  const placeholderRef = useRef(null);
35
37
  const lastRange = useRef(null);
38
+ const tagLength = tagifyRef?.current?.getTagElms().length;
36
39
  // Memoizations
37
40
  const cssVariablesMemoized = useMemo(() => _.assign({}, defaultCssVariables, cssTagifyVariables || {}), [cssTagifyVariables]);
38
41
  // Only run in the first render
@@ -454,6 +457,11 @@ const TagifyInput = forwardRef((props, ref) => {
454
457
  onTagClick(event.detail);
455
458
  }
456
459
  }, [onTagClick]);
460
+ const onTagifyRemoveTag = useCallback((event) => {
461
+ if (event.detail && onTagRemove) {
462
+ onTagRemove(event.detail);
463
+ }
464
+ }, [onTagRemove]);
457
465
  // Used to trigger replace URL detection and line break
458
466
  const onTagifyTyping = useCallback((event) => {
459
467
  if (event.detail) {
@@ -523,7 +531,11 @@ const TagifyInput = forwardRef((props, ref) => {
523
531
  case EMOJI: {
524
532
  closeIcon = '';
525
533
  const emojiPath = emojiManufacturer(value, collection);
526
- visibleTagContent = getEmojiTag({ src: emojiPath, emoji: label, code: value });
534
+ visibleTagContent = getEmojiTag({
535
+ src: emojiPath,
536
+ emoji: label,
537
+ code: value,
538
+ });
527
539
  break;
528
540
  }
529
541
  case DETECT_LINK: {
@@ -538,21 +550,21 @@ const TagifyInput = forwardRef((props, ref) => {
538
550
  }
539
551
  }
540
552
  const additionalTagAttrs = getAttributesString(additionalAttributes);
541
- return `
542
- <tag
543
- contenteditable='false'
544
- spellcheck='false'
545
- tabIndex="${settings.a11y.focusableTags ? 0 : -1}"
546
- class="${settings.classNames.tag} ${tagData.class ? tagData.class : ''}"
547
- ${tagify.getAttributes(tagData)}
548
- ${additionalTagAttrs}
549
- >
550
- ${closeIcon}
551
-
553
+ return `
554
+ <tag
555
+ contenteditable='false'
556
+ spellcheck='false'
557
+ tabIndex="${settings.a11y.focusableTags ? 0 : -1}"
558
+ class="${settings.classNames.tag} ${tagData.class ? tagData.class : ''}"
559
+ ${tagify.getAttributes(tagData)}
560
+ ${additionalTagAttrs}
561
+ >
562
+ ${closeIcon}
563
+
552
564
  ${generateTagContent({
553
565
  tagData,
554
566
  content: visibleTagContent,
555
- })}
567
+ })}
556
568
  </tag>`;
557
569
  }, []);
558
570
  /*
@@ -582,52 +594,29 @@ const TagifyInput = forwardRef((props, ref) => {
582
594
  while ((match = regex.exec(value)) !== null) {
583
595
  const [, personalizeContent] = match;
584
596
  const [tagCode] = personalizeContent.split('||');
585
- const { label: tagLabel, isValid, message, type, isRemoved, hasViewPermission, } = getPersonalizeTagInfo(tagCode, attributes, errorAttributes);
586
- const isPromotionCode = type === PROMOTION_CODE;
597
+ const { label: tagLabel, type, status, statusMsg, } = getPersonalizeTagInfo(tagCode, attributes, errorAttributes);
587
598
  const tagTextNode = tagifyRef.current?.getTagTextNode(tagElement);
588
599
  /*
589
600
  * Just only update to the correct text of the tag
590
601
  * NOTE: Do not actually affect raw data
591
602
  */
592
603
  if (tagTextNode) {
593
- tagTextNode.textContent = tagLabel;
594
- // Clear all previous attributes
595
- tagElement.removeAttribute(REMOVED_TAG);
596
- tagElement.removeAttribute(NO_VIEW_TAG);
597
- tagElement.removeAttribute(INVALID_TAG);
598
- tagElement.removeAttribute(READONLY_TAG);
599
- tagElement.removeAttribute(MESSAGE_TAG);
600
- // In case promotion pool has something wrong
601
- if (isPromotionCode && message) {
602
- if (isRemoved) {
603
- tagElement.setAttribute(REMOVED_TAG, 'true');
604
- tagElement.setAttribute(MESSAGE_TAG, message);
605
- tagifyRef.current?.getSetTagData(tagElement, {
606
- ...tagData,
607
- status: 'error',
608
- statusMsg: message,
609
- });
610
- }
611
- else if (!hasViewPermission) {
612
- tagElement.setAttribute(NO_VIEW_TAG, 'true');
613
- tagElement.setAttribute(MESSAGE_TAG, message);
614
- tagifyRef.current?.getSetTagData(tagElement, {
615
- ...tagData,
616
- status: 'warning',
617
- statusMsg: message,
618
- });
619
- }
620
- else if (!isValid) {
621
- tagElement.setAttribute(READONLY_TAG, 'true');
622
- tagElement.setAttribute(INVALID_TAG, 'true');
623
- tagElement.setAttribute(MESSAGE_TAG, message);
624
- tagifyRef.current?.getSetTagData(tagElement, {
625
- ...tagData,
626
- status: 'warning',
627
- statusMsg: message,
628
- });
629
- }
604
+ const isCustomTag = isCustomTagType(type);
605
+ // NOTE: Custom tag type [CUSTOM_TAG] does not need to get label from map attribute
606
+ // It's just get from [tagProperties] instead
607
+ if (!isCustomTag) {
608
+ tagTextNode.textContent = tagLabel;
630
609
  }
610
+ // Remove all existing attributes
611
+ sanitizeTagAttributes(tagElement);
612
+ // Update new tag attributes
613
+ const tagAttributes = getTagAttributes({
614
+ type: type,
615
+ status,
616
+ statusMsg,
617
+ displayName: tagLabel,
618
+ });
619
+ applyTagAttributes(tagElement, tagAttributes);
631
620
  }
632
621
  }
633
622
  }
@@ -637,7 +626,7 @@ const TagifyInput = forwardRef((props, ref) => {
637
626
  if (!isAccepted)
638
627
  return;
639
628
  const { url, shortener, label } = tagData;
640
- const { label: tagLabel, isValid, message, type: tagType, } = getShortLinkTagInfo({
629
+ const { label: tagLabel, type: tagType, status, statusMsg, } = getShortLinkTagInfo({
641
630
  type,
642
631
  label,
643
632
  shortener,
@@ -652,22 +641,16 @@ const TagifyInput = forwardRef((props, ref) => {
652
641
  */
653
642
  if (tagTextNode) {
654
643
  tagTextNode.textContent = tagLabel;
655
- // Clear all previous attributes
656
- tagElement.removeAttribute(REMOVED_TAG);
657
- tagElement.removeAttribute(NO_VIEW_TAG);
658
- tagElement.removeAttribute(INVALID_TAG);
659
- tagElement.removeAttribute(READONLY_TAG);
660
- tagElement.removeAttribute(MESSAGE_TAG);
661
- // In case promotion pool has something wrong
662
- if (!isValid && message) {
663
- tagElement.setAttribute(REMOVED_TAG, 'true');
664
- tagElement.setAttribute(MESSAGE_TAG, message);
665
- tagifyRef.current?.getSetTagData(tagElement, {
666
- ...tagData,
667
- status: 'error',
668
- statusMsg: message,
669
- });
670
- }
644
+ // Remove all existing attributes
645
+ sanitizeTagAttributes(tagElement);
646
+ // Update new tag attributes
647
+ const tagAttributes = getTagAttributes({
648
+ type: type,
649
+ status,
650
+ statusMsg,
651
+ displayName: tagLabel,
652
+ });
653
+ applyTagAttributes(tagElement, tagAttributes);
671
654
  }
672
655
  }
673
656
  }
@@ -675,6 +658,52 @@ const TagifyInput = forwardRef((props, ref) => {
675
658
  setTooltipRefresher(prev => prev + 1);
676
659
  }
677
660
  }, [acceptableTagPattern]);
661
+ /*
662
+ * Execute tag properties for each tag
663
+ */
664
+ const executeTagProperties = useCallback((properties) => {
665
+ if (tagifyRef.current) {
666
+ let isChangeOccurred = false;
667
+ const tagElements = tagifyRef.current.getTagElms();
668
+ const { pattern, name: cachePatternName } = patternHandlers[PERSONALIZE_PTN];
669
+ tagElements.forEach(tagElement => {
670
+ const { __tagifyTagData: tagData } = tagElement;
671
+ if (!tagData || tagData?.type !== CUSTOM_TAG || !tagData?.value)
672
+ return;
673
+ const { type, value } = tagData;
674
+ // Use the cached regex instead of creating a new one each time
675
+ const regex = getCachedRegex(pattern, 'g', cachePatternName);
676
+ let match;
677
+ // Iterate over matches of the current pattern
678
+ // eslint-disable-next-line no-cond-assign
679
+ while ((match = regex.exec(value)) !== null) {
680
+ const [, contentCode] = match;
681
+ const customTagId = getCustomTagId(type, contentCode);
682
+ const property = _.get(properties, customTagId);
683
+ if (!customTagId || !property)
684
+ continue;
685
+ const { displayName } = property;
686
+ // Update tag text (but not raw data)
687
+ tagifyRef.current?.setTagTextNode(tagElement, displayName);
688
+ isChangeOccurred = true;
689
+ // Remove all existing attributes
690
+ sanitizeTagAttributes(tagElement);
691
+ // Update new tag attributes
692
+ const tagAttributes = getTagAttributes(property);
693
+ applyTagAttributes(tagElement, tagAttributes);
694
+ // Update tag content element attributes
695
+ const tagContentEl = tagElement.querySelector('.tagify__tag-content');
696
+ if (tagContentEl) {
697
+ const tagContentAttributes = getTagContentAttributes(property.type);
698
+ applyTagAttributes(tagContentEl, tagContentAttributes);
699
+ }
700
+ }
701
+ });
702
+ if (isChangeOccurred) {
703
+ setTooltipRefresher(prev => prev + 1);
704
+ }
705
+ }
706
+ }, []);
678
707
  const initializeTagify = useCallback(() => {
679
708
  if (inputRef.current && !tagifyRef.current) {
680
709
  tagifyRef.current = new Tagify(inputRef.current, {
@@ -789,6 +818,50 @@ const TagifyInput = forwardRef((props, ref) => {
789
818
  }
790
819
  };
791
820
  }, [initializeTagify]);
821
+ useEffect(() => {
822
+ if (tagifyRef.current && tagLength && _.isFunction(onTagRemove)) {
823
+ // Because the remove tag event is not triggered when the tag is removed with Backspace or drag selection tags
824
+ // we need to listen to the input element to detect when a tag is removed
825
+ let mutationQueue = [];
826
+ let processing = false;
827
+ const processMutations = () => {
828
+ processing = true;
829
+ const relevantNodes = mutationQueue.flatMap(mutation => [...mutation.removedNodes].filter(node => {
830
+ const isUpdatedTag = mutation.addedNodes.length > 0;
831
+ return !isUpdatedTag && node.nodeType === Node.ELEMENT_NODE && node.nodeName === 'TAG';
832
+ }));
833
+ relevantNodes.forEach(node => {
834
+ try {
835
+ const tagData = tagifyRef.current?.getSetTagData(node);
836
+ if (tagData && tagData.type === CUSTOM_TAG && !tagData?.__removed) {
837
+ onTagRemove({ data: tagData });
838
+ }
839
+ }
840
+ catch (error) {
841
+ // biome-ignore lint/suspicious/noConsole: <explanation>
842
+ console.error('Error while removing tag with Backspace', error);
843
+ }
844
+ });
845
+ mutationQueue = [];
846
+ processing = false;
847
+ };
848
+ const observer = new MutationObserver(mutations => {
849
+ mutationQueue.push(...mutations);
850
+ if (!processing) {
851
+ requestAnimationFrame(processMutations); // Ensures all mutations are processed efficiently
852
+ }
853
+ });
854
+ observer.observe(tagifyRef.current.DOM.input, {
855
+ childList: true, // Only observe direct child additions/removals
856
+ subtree: false, // Prevent deep observation
857
+ attributes: false, // Ignore attribute changes
858
+ characterData: false, // Ignore text content changes
859
+ });
860
+ return () => {
861
+ observer.disconnect();
862
+ };
863
+ }
864
+ }, [tagLength, onTagRemove]);
792
865
  // Settings some tagify attributes
793
866
  // Set [readonly, disabled, placeholder]
794
867
  useEffect(() => {
@@ -806,27 +879,28 @@ const TagifyInput = forwardRef((props, ref) => {
806
879
  }, [disabled, placeholder, readonly]);
807
880
  // Set readonly for each tag
808
881
  useEffect(() => {
809
- if (tagifyRef.current && typeof readonlyTag !== 'undefined') {
882
+ if (tagifyRef.current && tagLength && typeof readonlyTag !== 'undefined') {
810
883
  const tagElementList = tagifyRef.current.getTagElms();
811
884
  tagElementList.forEach((tagElement) => {
812
885
  const tagType = _.get(tagElement, '__tagifyTagData.type', '');
813
886
  const isPersonalizeTag = isPersonalizeTagType(tagType);
887
+ const isCustomTag = isCustomTagType(tagType);
814
888
  // Only support readonly for personalize tag
815
- if (!isPersonalizeTag)
889
+ if (!isPersonalizeTag && !isCustomTag)
816
890
  return;
817
891
  // Caution: Don't use readonly attribute -> readonly attribute Tagify library managed
818
892
  if (readonlyTag) {
819
- tagElement.setAttribute(READONLY_TAG, readonlyTag.toString());
893
+ tagElement.setAttribute(PREPARING_ST, readonlyTag.toString());
820
894
  }
821
895
  else {
822
896
  // Only remove readonly-tag attribute if the invalid attribute is not existing
823
897
  if (!tagElement.hasAttribute(INVALID_TAG)) {
824
- tagElement.removeAttribute(READONLY_TAG);
898
+ tagElement.removeAttribute(PREPARING_ST);
825
899
  }
826
900
  }
827
901
  });
828
902
  }
829
- }, [readonlyTag]);
903
+ }, [readonlyTag, tagLength]);
830
904
  // Set max personalize tags
831
905
  useLayoutEffect(() => {
832
906
  if (tagifyRef.current && typeof maxPersonalizeTags !== 'undefined') {
@@ -837,10 +911,13 @@ const TagifyInput = forwardRef((props, ref) => {
837
911
  * Need to sync label of the tags if any map attribute is changed to make correct label
838
912
  * */
839
913
  useDeepCompareEffect(() => {
840
- if (!_.isEmpty(mapAttributes)) {
841
- makeValidLabelTags(mapAttributes, mapErrorAttributes);
842
- }
914
+ makeValidLabelTags(mapAttributes, mapErrorAttributes);
843
915
  }, [mapAttributes, mapErrorAttributes, makeValidLabelTags]);
916
+ useLayoutEffect(() => {
917
+ if (tagProperties && tagLength) {
918
+ executeTagProperties(tagProperties);
919
+ }
920
+ }, [tagProperties, tagLength, executeTagProperties]);
844
921
  // Listen to Tagify events
845
922
  useEffect(() => {
846
923
  const { current: tagifyInstance } = tagifyRef || {};
@@ -848,7 +925,11 @@ const TagifyInput = forwardRef((props, ref) => {
848
925
  tagifyInstance.on('click', onTagItemClick);
849
926
  tagifyInstance.on('input', onInputTagifyDebounce);
850
927
  tagifyInstance.on('change', onTagifyChangedDebounce);
928
+ tagifyInstance.on('remove', onTagifyRemoveTag);
851
929
  tagifyInstance.on('keydown', onKeyDown);
930
+ if (tagifyInstance.DOM.input) {
931
+ tagifyInstance.DOM.input.addEventListener('keydown', preventUndoRedo);
932
+ }
852
933
  }
853
934
  // Off listen to Tagify events
854
935
  return () => {
@@ -857,6 +938,9 @@ const TagifyInput = forwardRef((props, ref) => {
857
938
  tagifyInstance.off('input', onInputTagifyDebounce);
858
939
  tagifyInstance.off('change', onTagifyChangedDebounce);
859
940
  tagifyInstance.off('keydown', onKeyDown);
941
+ if (tagifyInstance.DOM.input) {
942
+ tagifyInstance.DOM.input.removeEventListener('keydown', preventUndoRedo);
943
+ }
860
944
  }
861
945
  };
862
946
  }, [onTagItemClick, onInputTagifyDebounce, onTagifyChangedDebounce, onKeyDown]);
@@ -880,20 +964,24 @@ const TagifyInput = forwardRef((props, ref) => {
880
964
  }
881
965
  // Convert the string to tagify pattern
882
966
  const content = parseTagStringToTagify(textValue, acceptableTagPattern);
967
+ setIsLineBreak(hasLineBreak(textValue));
883
968
  tagifyRef.current.loadOriginalValues(content);
884
969
  // Need to sync label of the tags if any map attribute is changed to make correct label
885
- if (!_.isEmpty(mapAttributes)) {
886
- makeValidLabelTags(mapAttributes, mapErrorAttributes);
970
+ makeValidLabelTags(mapAttributes, mapErrorAttributes);
971
+ if (tagProperties) {
972
+ executeTagProperties(tagProperties);
887
973
  }
888
974
  }
889
975
  }
890
976
  }, [
891
977
  initialValue,
892
978
  mapAttributes,
979
+ tagProperties,
893
980
  mapErrorAttributes,
894
981
  escapeHTML,
895
982
  acceptableTagPattern,
896
983
  makeValidLabelTags,
984
+ executeTagProperties,
897
985
  ]);
898
986
  useEffect(() => {
899
987
  if (tagifyRef.current && initialValue === '') {
@@ -911,44 +999,44 @@ const TagifyInput = forwardRef((props, ref) => {
911
999
  if (!tagifyTooltip) {
912
1000
  const style = document.createElement('style');
913
1001
  style.type = 'text/css';
914
- style.appendChild(document.createTextNode(`
915
- .tagify__tooltip {
916
- display: none;
917
- position: fixed;
918
- background-color: #595959;
919
- border-radius: 10px;
920
- color: #ffffff;
921
- padding: 6px;
922
- z-index: 10000;
923
- max-width: 280px;
924
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
925
- }
926
-
927
- .tagify__tooltip_content {
928
- width: 100%;
929
- max-width: 250px;
930
- height: auto;
931
- position: relative;
932
- transition: 0s;
933
- font-size: 12px;
934
- line-height: 16px;
935
- text-align: center;
936
- word-wrap: break-word;
937
- white-space: normal;
938
- }
939
-
940
- .tagify__tooltip_content:before {
941
- content: '';
942
- position: absolute;
943
- top: 100%;
944
- right: 50%;
945
- left: auto;
946
- background-color: #595959;
947
- width: 10px;
948
- height: 10px;
949
- transform: rotate(45deg) translate(50%,-50%);
950
- border-radius: 1px;
951
- }
1002
+ style.appendChild(document.createTextNode(`
1003
+ .tagify__tooltip {
1004
+ display: none;
1005
+ position: fixed;
1006
+ background-color: #595959;
1007
+ border-radius: 10px;
1008
+ color: #ffffff;
1009
+ padding: 6px;
1010
+ z-index: 10000;
1011
+ max-width: 280px;
1012
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
1013
+ }
1014
+
1015
+ .tagify__tooltip_content {
1016
+ width: 100%;
1017
+ max-width: 250px;
1018
+ height: auto;
1019
+ position: relative;
1020
+ transition: 0s;
1021
+ font-size: 12px;
1022
+ line-height: 16px;
1023
+ text-align: center;
1024
+ word-wrap: break-word;
1025
+ white-space: normal;
1026
+ }
1027
+
1028
+ .tagify__tooltip_content:before {
1029
+ content: '';
1030
+ position: absolute;
1031
+ top: 100%;
1032
+ right: 50%;
1033
+ left: auto;
1034
+ background-color: #595959;
1035
+ width: 10px;
1036
+ height: 10px;
1037
+ transform: rotate(45deg) translate(50%,-50%);
1038
+ border-radius: 1px;
1039
+ }
952
1040
  `));
953
1041
  document.head.appendChild(style);
954
1042
  const tooltipWrapper = document.createElement('div');
@@ -4,15 +4,32 @@ export declare const DIMENSIONS: {
4
4
  readonly TAG_H: 24;
5
5
  };
6
6
  export declare const MIN_H_WRAPPER: 34, TAG_H: 24;
7
+ export declare const TAG_STATUS: {
8
+ readonly REMOVED: "removed";
9
+ readonly ARCHIVED: "archived";
10
+ readonly ACTIVE: "active";
11
+ readonly INACTIVE: "inactive";
12
+ readonly EXPIRED: "expired";
13
+ readonly WARNING: "warning";
14
+ readonly ERROR: "error";
15
+ readonly INVALID: "invalid";
16
+ readonly DO_NOT_VIEW: "do-not-view";
17
+ };
7
18
  export declare const TAG_CUSTOM_ATTRIBUTES: {
19
+ readonly PREPARING_ST: "preparing-setting";
8
20
  readonly READONLY_TAG: "readonly-tag";
9
21
  readonly INVALID_TAG: "invalid-tag";
10
22
  readonly REMOVED_TAG: "removed-tag";
11
23
  readonly NO_VIEW_TAG: "no-view-tag";
12
24
  readonly MESSAGE_TAG: "message-tag";
13
25
  readonly FORCE_SHOW_TOOLTIP: "force-show-tooltip";
26
+ readonly ERROR_TAG: "error-tag";
27
+ readonly WARNING_TAG: "warning-tag";
28
+ readonly PRIORITY_COLOR_TYPE: "priority-color-type";
29
+ readonly BG_COLOR_PERSONALIZE_TYPE: "bg-color-personalize-type";
30
+ readonly BG_COLOR_PERSONALIZE_TYPE_V2: "bgColorPersonalizeType";
14
31
  };
15
- export declare const READONLY_TAG: "readonly-tag", INVALID_TAG: "invalid-tag", REMOVED_TAG: "removed-tag", NO_VIEW_TAG: "no-view-tag", MESSAGE_TAG: "message-tag", FORCE_SHOW_TOOLTIP: "force-show-tooltip";
32
+ export declare const PREPARING_ST: "preparing-setting", READONLY_TAG: "readonly-tag", INVALID_TAG: "invalid-tag", REMOVED_TAG: "removed-tag", NO_VIEW_TAG: "no-view-tag", MESSAGE_TAG: "message-tag", FORCE_SHOW_TOOLTIP: "force-show-tooltip", ERROR_TAG: "error-tag", WARNING_TAG: "warning-tag", PRIORITY_COLOR_TYPE: "priority-color-type", BG_COLOR_PERSONALIZE_TYPE: "bg-color-personalize-type", BG_COLOR_PERSONALIZE_TYPE_V2: "bgColorPersonalizeType";
16
33
  export declare const defaultCssVariables: {
17
34
  '--input-color': string | undefined;
18
35
  '--input-font-size': string;
@@ -59,9 +76,12 @@ export declare const TAG_TYPE: {
59
76
  readonly SHORT_LINK_V2: "shortlink_v2";
60
77
  readonly DETECT_LINK: "detect_link";
61
78
  readonly CONTENT_SOURCE_GROUP: "groups";
79
+ readonly ALLOCATED_CODE: "allocated_code";
80
+ readonly CUSTOM_TAG: "custom_tag";
62
81
  readonly UNSUBSCRIBE_WHATSAPP: "unsubscribe_whatsapp";
63
82
  };
64
- export declare const CUSTOMER: "customer", VISITOR: "visitor", EVENT: "event", JOURNEY: "story", CAMPAIGN: "campaign", VARIANT: "variant", PROMOTION_CODE: "promotion_code", CUSTOM_FN: "custom", EMOJI: "emoji", DETECT_LINK: "detect_link", SHORT_LINK: "shortlink", SHORT_LINK_V2: "shortlink_v2", OBJECT_WIDGET: "objectWidget", CONTENT_SOURCE_GROUP: "groups", UNSUBSCRIBE_WHATSAPP: "unsubscribe_whatsapp";
83
+ export declare const CUSTOMER: "customer", VISITOR: "visitor", EVENT: "event", JOURNEY: "story", CAMPAIGN: "campaign", VARIANT: "variant", PROMOTION_CODE: "promotion_code", CUSTOM_FN: "custom", EMOJI: "emoji", DETECT_LINK: "detect_link", SHORT_LINK: "shortlink", SHORT_LINK_V2: "shortlink_v2", OBJECT_WIDGET: "objectWidget", CONTENT_SOURCE_GROUP: "groups", ALLOCATED_CODE: "allocated_code", CUSTOM_TAG: "custom_tag", UNSUBSCRIBE_WHATSAPP: "unsubscribe_whatsapp";
84
+ export declare const TAG_TYPE_LIST: readonly ("campaign" | "event" | "custom" | "emoji" | "variant" | "customer" | "visitor" | "groups" | "shortlink" | "objectWidget" | "promotion_code" | "story" | "shortlink_v2" | "detect_link" | "allocated_code" | "custom_tag" | "unsubscribe_whatsapp")[];
65
85
  export declare const SHORT_LINK_TYPE: {
66
86
  readonly INDIVIDUAL: "shortlink";
67
87
  readonly GENERAL: "shortlink_static";
@@ -91,6 +111,8 @@ export declare const TAG_COLOR: {
91
111
  readonly custom: "#bbefbe";
92
112
  readonly groups: "#ffdd9f";
93
113
  readonly emoji: "transparent";
114
+ readonly allocated_code: "#DAA7F8";
115
+ readonly custom_tag: "transparent";
94
116
  readonly unsubscribe_whatsapp: "#cafedd";
95
117
  };
96
118
  export declare const EMOJI_COLLECTIONS: {
@@ -5,15 +5,32 @@ export const DIMENSIONS = {
5
5
  TAG_H: 24,
6
6
  };
7
7
  export const { MIN_H_WRAPPER, TAG_H } = DIMENSIONS;
8
+ export const TAG_STATUS = {
9
+ REMOVED: 'removed',
10
+ ARCHIVED: 'archived',
11
+ ACTIVE: 'active',
12
+ INACTIVE: 'inactive',
13
+ EXPIRED: 'expired',
14
+ WARNING: 'warning',
15
+ ERROR: 'error',
16
+ INVALID: 'invalid',
17
+ DO_NOT_VIEW: 'do-not-view',
18
+ };
8
19
  export const TAG_CUSTOM_ATTRIBUTES = {
20
+ PREPARING_ST: 'preparing-setting',
9
21
  READONLY_TAG: 'readonly-tag',
10
22
  INVALID_TAG: 'invalid-tag',
11
23
  REMOVED_TAG: 'removed-tag',
12
24
  NO_VIEW_TAG: 'no-view-tag',
13
25
  MESSAGE_TAG: 'message-tag',
14
26
  FORCE_SHOW_TOOLTIP: 'force-show-tooltip',
27
+ ERROR_TAG: 'error-tag',
28
+ WARNING_TAG: 'warning-tag',
29
+ PRIORITY_COLOR_TYPE: 'priority-color-type',
30
+ BG_COLOR_PERSONALIZE_TYPE: 'bg-color-personalize-type',
31
+ BG_COLOR_PERSONALIZE_TYPE_V2: 'bgColorPersonalizeType',
15
32
  };
16
- export const { READONLY_TAG, INVALID_TAG, REMOVED_TAG, NO_VIEW_TAG, MESSAGE_TAG, FORCE_SHOW_TOOLTIP, } = TAG_CUSTOM_ATTRIBUTES;
33
+ export const { PREPARING_ST, READONLY_TAG, INVALID_TAG, REMOVED_TAG, NO_VIEW_TAG, MESSAGE_TAG, FORCE_SHOW_TOOLTIP, ERROR_TAG, WARNING_TAG, PRIORITY_COLOR_TYPE, BG_COLOR_PERSONALIZE_TYPE, BG_COLOR_PERSONALIZE_TYPE_V2, } = TAG_CUSTOM_ATTRIBUTES;
17
34
  export const defaultCssVariables = {
18
35
  '--input-color': globalToken?.colorText,
19
36
  '--input-font-size': `${globalToken?.fontSize}px`,
@@ -58,6 +75,7 @@ export const tagifyDefaultProps = {
58
75
  placeholder: undefined,
59
76
  minWidthPlaceholder: 130,
60
77
  acceptableTagPattern: DEFAULT_ACCEPT_TAGS,
78
+ mapErrorAttributes: {},
61
79
  onChange: () => { },
62
80
  };
63
81
  export const TAG_TYPE = {
@@ -75,9 +93,12 @@ export const TAG_TYPE = {
75
93
  SHORT_LINK_V2: 'shortlink_v2',
76
94
  DETECT_LINK: 'detect_link',
77
95
  CONTENT_SOURCE_GROUP: 'groups',
96
+ ALLOCATED_CODE: 'allocated_code',
97
+ CUSTOM_TAG: 'custom_tag', // Refer to all tag type
78
98
  UNSUBSCRIBE_WHATSAPP: 'unsubscribe_whatsapp',
79
99
  };
80
- export const { CUSTOMER, VISITOR, EVENT, JOURNEY, CAMPAIGN, VARIANT, PROMOTION_CODE, CUSTOM_FN, EMOJI, DETECT_LINK, SHORT_LINK, SHORT_LINK_V2, OBJECT_WIDGET, CONTENT_SOURCE_GROUP, UNSUBSCRIBE_WHATSAPP, } = TAG_TYPE;
100
+ export const { CUSTOMER, VISITOR, EVENT, JOURNEY, CAMPAIGN, VARIANT, PROMOTION_CODE, CUSTOM_FN, EMOJI, DETECT_LINK, SHORT_LINK, SHORT_LINK_V2, OBJECT_WIDGET, CONTENT_SOURCE_GROUP, ALLOCATED_CODE, CUSTOM_TAG, UNSUBSCRIBE_WHATSAPP, } = TAG_TYPE;
101
+ export const TAG_TYPE_LIST = Object.freeze(Object.values(TAG_TYPE));
81
102
  export const SHORT_LINK_TYPE = {
82
103
  INDIVIDUAL: 'shortlink', // Individual link
83
104
  GENERAL: 'shortlink_static', // General link
@@ -107,6 +128,8 @@ export const TAG_COLOR = {
107
128
  [CUSTOM_FN]: '#bbefbe',
108
129
  [CONTENT_SOURCE_GROUP]: '#ffdd9f',
109
130
  [EMOJI]: 'transparent',
131
+ [ALLOCATED_CODE]: '#DAA7F8',
132
+ [CUSTOM_TAG]: 'transparent',
110
133
  [UNSUBSCRIBE_WHATSAPP]: '#cafedd',
111
134
  };
112
135
  export const EMOJI_COLLECTIONS = {
@@ -1,11 +1,9 @@
1
- import type { AcceptablePattern, MapAttributesProps, PatterTagName, PatternHandlerWrapper } from './types';
1
+ import type { AcceptablePattern, MapAttributesProps, PatterTagName, PatternHandlerWrapper, TagTypeProperty } from './types';
2
2
  interface TagInfo {
3
3
  label: string;
4
4
  type: string;
5
- isValid: boolean;
6
- message?: string;
7
- isRemoved?: boolean;
8
- hasViewPermission?: boolean;
5
+ status: string;
6
+ statusMsg: string;
9
7
  }
10
8
  /**
11
9
  * Retrieves a cached regular expression or compiles and caches it if not found.
@@ -18,7 +16,15 @@ export declare function getCachedRegex(pattern: string, flags?: string, cacheKey
18
16
  export declare const detectURLRegex: RegExp;
19
17
  export declare const tagRegexStringPattern = "\\[\\[({.*?})\\]\\]";
20
18
  export declare function acceptablePatternChecking(pattern: AcceptablePattern, acceptablePattern: Array<AcceptablePattern>): boolean;
21
- export declare const getPersonalizeTagInfo: (originalTag: string, mapAttributes?: MapAttributesProps, mapErrorAttributes?: MapAttributesProps) => TagInfo;
19
+ /**
20
+ * Extracts the custom tag ID from a merge code if the tag type is a custom tag.
21
+ *
22
+ * @param {TagTypeProperty} tagType - The type of the tag to check.
23
+ * @param {string} mergeCode - The merge code containing the tag information, typically in the format "type.customTagId||additionalInfo".
24
+ * @returns {string} The extracted custom tag ID if the tag type is a custom tag; otherwise, empty string.
25
+ */
26
+ export declare const getCustomTagId: (tagType: TagTypeProperty, mergeCode: string) => string;
27
+ export declare const getPersonalizeTagInfo: (originalTag: string, mapAttributes: MapAttributesProps, mapErrorAttributes: MapAttributesProps) => TagInfo;
22
28
  export declare const getShortLinkTagInfo: (params: {
23
29
  type: string;
24
30
  label: string;