@antscorp/antsomi-ui 2.0.107 → 2.0.109

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 (299) hide show
  1. package/CHANGELOG.md +63 -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 +6 -6
  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/Icon/index.js +19 -19
  13. package/es/components/atoms/Iframe/Iframe.js +18 -18
  14. package/es/components/atoms/Input/styled.js +104 -104
  15. package/es/components/atoms/InputDynamic/styled.js +284 -284
  16. package/es/components/atoms/MobileBrandingBar/styled.js +21 -21
  17. package/es/components/atoms/MobileFrame/styled.js +30 -30
  18. package/es/components/atoms/MobileFrameV2/styled.js +42 -42
  19. package/es/components/atoms/MobileFrameV3/styled.js +31 -31
  20. package/es/components/atoms/NotificationStatus/styled.js +10 -10
  21. package/es/components/atoms/PreviewTabs/styled.js +69 -69
  22. package/es/components/atoms/Radio/index.js +16 -16
  23. package/es/components/atoms/ReactIframe/ReactIframe.js +5 -5
  24. package/es/components/atoms/ReactIframe/styled.js +9 -9
  25. package/es/components/atoms/RequiredLabel/styled.js +3 -3
  26. package/es/components/atoms/ScrollBox/index.js +5 -5
  27. package/es/components/atoms/Scrollbars/styled.js +21 -21
  28. package/es/components/atoms/SlideBar/styled.js +194 -194
  29. package/es/components/atoms/Slider/styled.js +31 -31
  30. package/es/components/atoms/Space/Space.js +4 -4
  31. package/es/components/atoms/Spin/styled.js +11 -11
  32. package/es/components/atoms/Steps/styled.js +244 -244
  33. package/es/components/atoms/Switch/styled.js +56 -56
  34. package/es/components/atoms/Tag/Tag.js +10 -10
  35. package/es/components/atoms/Text/styled.js +34 -34
  36. package/es/components/icons/DomainManagementIcon.js +1 -1
  37. package/es/components/icons/LoadingIcon.js +33 -33
  38. package/es/components/icons/document/styled.js +43 -43
  39. package/es/components/index.scss +1 -1
  40. package/es/components/molecules/AccessDenied/styled.js +28 -28
  41. package/es/components/molecules/AccountSelection/styled.js +110 -110
  42. package/es/components/molecules/AddDynamicContent/styled.js +23 -23
  43. package/es/components/molecules/AlignSetting/styled.js +4 -4
  44. package/es/components/molecules/ApplyPopupContent/styled.js +32 -32
  45. package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/styled.js +8 -8
  46. package/es/components/molecules/CalendarSelection/components/CustomPicker/styled.js +79 -79
  47. package/es/components/molecules/CalendarSelection/components/Footer/styled.js +4 -4
  48. package/es/components/molecules/CalendarSelection/components/RangePicker/styled.js +21 -21
  49. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/Option.js +26 -26
  50. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/styled.js +30 -30
  51. package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/styled.js +26 -26
  52. package/es/components/molecules/CalendarSelection/styled.js +8 -8
  53. package/es/components/molecules/CaptureScreen/components/CommentBox/styled.js +119 -119
  54. package/es/components/molecules/CaptureScreen/components/Cursor/styled.js +67 -67
  55. package/es/components/molecules/CaptureScreen/styled.js +240 -240
  56. package/es/components/molecules/ChartTab/components/styled.js +24 -24
  57. package/es/components/molecules/ChartTab/styled.js +20 -20
  58. package/es/components/molecules/ChatBox/AntsomiAI.js +8 -8
  59. package/es/components/molecules/ChatBox/ChatBoxInsight/QuestionItem.js +9 -9
  60. package/es/components/molecules/ChatBox/ChatBoxInsight/styled.js +365 -365
  61. package/es/components/molecules/ChatBox/styled.js +324 -324
  62. package/es/components/molecules/CodeStructure/styled.js +5 -5
  63. package/es/components/molecules/ColorPicker/ChromePicker/styled.js +10 -10
  64. package/es/components/molecules/ColorPicker/CustomPicker/styled.js +89 -89
  65. package/es/components/molecules/ColorPicker/SketchPicker/styled.js +5 -5
  66. package/es/components/molecules/ColorPicker/styled.js +7 -7
  67. package/es/components/molecules/ColorSetting/styled.js +39 -39
  68. package/es/components/molecules/DatePicker/components/AdvancedPicker/styled.js +110 -110
  69. package/es/components/molecules/DatePickerV2/styled.js +6 -6
  70. package/es/components/molecules/DisplayFormat/styled.js +12 -12
  71. package/es/components/molecules/DrawerDetail/components/ToggleDrawerSizeButton.js +24 -24
  72. package/es/components/molecules/DrawerDetail/styled.js +109 -109
  73. package/es/components/molecules/Dropdown/style.scss +11 -11
  74. package/es/components/molecules/Dropdown/styled.js +28 -28
  75. package/es/components/molecules/EdgeSetting/styled.js +10 -10
  76. package/es/components/molecules/EditableName/styled.js +70 -70
  77. package/es/components/molecules/EditingList/styled.js +29 -29
  78. package/es/components/molecules/EditingListV2/components/List/List.d.ts +1 -1
  79. package/es/components/molecules/EditingListV2/components/List/List.js +16 -7
  80. package/es/components/molecules/EditorTab/styled.js +156 -156
  81. package/es/components/molecules/EmojiCollections/styled.js +22 -22
  82. package/es/components/molecules/EmojiPopover/styled.js +4 -4
  83. package/es/components/molecules/EmptyData/styled.js +53 -53
  84. package/es/components/molecules/FontSizeInput/index.scss +15 -15
  85. package/es/components/molecules/GradientSetting/styled.js +57 -57
  86. package/es/components/molecules/HeaderV2/styled.js +70 -70
  87. package/es/components/molecules/IconSelection/styled.js +69 -69
  88. package/es/components/molecules/ImageEditor/components/ModalShortcut.js +21 -21
  89. package/es/components/molecules/ImageEditor/styled.js +5 -5
  90. package/es/components/molecules/ImagePreview/styled.js +3 -3
  91. package/es/components/molecules/InputNumberWithUnit/styled.js +14 -14
  92. package/es/components/molecules/InputSearch/styled.js +41 -41
  93. package/es/components/molecules/ItemNotFound/styled.js +26 -26
  94. package/es/components/molecules/MatchAnySelect/components/ExtendValuePopup.js +8 -8
  95. package/es/components/molecules/MatchAnySelect/styled.js +247 -247
  96. package/es/components/molecules/Modal/styled.js +63 -63
  97. package/es/components/molecules/ModalSelect/styled.js +152 -152
  98. package/es/components/molecules/ModalV2/styled.js +27 -27
  99. package/es/components/molecules/PopupDraggable/styled.js +57 -57
  100. package/es/components/molecules/PreviewModal/styled.js +26 -26
  101. package/es/components/molecules/ProcessLoading/styled.js +2 -2
  102. package/es/components/molecules/QuillEditor/CustomToolbar.js +3165 -3165
  103. package/es/components/molecules/QuillEditor/EditorToolbar.js +7 -7
  104. package/es/components/molecules/QuillEditor/styled.js +25 -25
  105. package/es/components/molecules/RadioGroup/styled.js +9 -9
  106. package/es/components/molecules/RequestAccess/styled.js +38 -38
  107. package/es/components/molecules/ResizeGrid/components/Cell/styled.js +77 -77
  108. package/es/components/molecules/ResizeGrid/styled.js +50 -50
  109. package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/styled.js +118 -118
  110. package/es/components/molecules/RichMenu/RichMenuBlock/styled.js +13 -13
  111. package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/styled.js +40 -40
  112. package/es/components/molecules/RichMenu/RichMenuChatBar/styled.js +27 -27
  113. package/es/components/molecules/RichMenu/RichMenuMobileView/RichMenuMobileView.js +2 -2
  114. package/es/components/molecules/RichMenu/RichMenuMobileView/styled.js +38 -38
  115. package/es/components/molecules/SearchPopover/components/PopoverSelect/styled.js +36 -36
  116. package/es/components/molecules/SearchPopover/components/PopoverSelect/styles.scss +7 -7
  117. package/es/components/molecules/SearchPopover/styled.js +32 -32
  118. package/es/components/molecules/Select/styled.js +32 -32
  119. package/es/components/molecules/SelectAccount/styled.js +147 -147
  120. package/es/components/molecules/SelectEventAttribute/styled.js +8 -8
  121. package/es/components/molecules/SelectMulti/styled.js +62 -62
  122. package/es/components/molecules/SelectV2/styled.js +124 -124
  123. package/es/components/molecules/SettingWrapper/styled.js +12 -12
  124. package/es/components/molecules/ShareAccess/components/GeneralAccess/styled.js +56 -56
  125. package/es/components/molecules/ShareAccess/components/LayoutContent/styled.js +5 -5
  126. package/es/components/molecules/ShareAccess/components/ModalTransferOwnerShip/styled.js +15 -15
  127. package/es/components/molecules/ShareAccess/components/PeopleAccess/styled.js +63 -63
  128. package/es/components/molecules/ShareAccess/components/SearchUser/styled.js +31 -31
  129. package/es/components/molecules/SliderWithInputNumber/styled.js +2 -2
  130. package/es/components/molecules/Tabs/Tabs.js +11 -11
  131. package/es/components/molecules/TagifyInput/TagifyInput.js +65 -54
  132. package/es/components/molecules/TagifyInput/constants.d.ts +7 -3
  133. package/es/components/molecules/TagifyInput/constants.js +7 -2
  134. package/es/components/molecules/TagifyInput/patternHandlers.js +34 -1
  135. package/es/components/molecules/TagifyInput/styled.js +37 -37
  136. package/es/components/molecules/TagifyInput/types.d.ts +13 -3
  137. package/es/components/molecules/TagifyInput/utils.d.ts +1 -0
  138. package/es/components/molecules/TagifyInput/utils.js +15 -14
  139. package/es/components/molecules/TagifyInput/utils.style.js +218 -218
  140. package/es/components/molecules/TemplateSaveAs/components/Category/Category.js +5 -5
  141. package/es/components/molecules/TemplateSaveAs/components/ImageSlider/styled.js +276 -276
  142. package/es/components/molecules/TemplateSaveAs/styled.js +134 -134
  143. package/es/components/molecules/ThumbnailCard/styled.js +92 -92
  144. package/es/components/molecules/Tree/styled.js +38 -38
  145. package/es/components/molecules/UnsubscribePreferences/constants.d.ts +27 -0
  146. package/es/components/molecules/UnsubscribePreferences/constants.js +28 -0
  147. package/es/components/molecules/UnsubscribePreferences/index.d.ts +17 -0
  148. package/es/components/molecules/UnsubscribePreferences/index.js +203 -0
  149. package/es/components/molecules/UnsubscribePreferences/styled.d.ts +2 -0
  150. package/es/components/molecules/UnsubscribePreferences/styled.js +11 -0
  151. package/es/components/molecules/UnsubscribePreferences/utils.d.ts +15 -0
  152. package/es/components/molecules/UnsubscribePreferences/utils.js +56 -0
  153. package/es/components/molecules/UnsubscribePreview/components/PreferencesPage/index.d.ts +12 -0
  154. package/es/components/molecules/UnsubscribePreview/components/PreferencesPage/index.js +159 -0
  155. package/es/components/molecules/UnsubscribePreview/components/ResultPage/index.d.ts +13 -0
  156. package/es/components/molecules/UnsubscribePreview/components/ResultPage/index.js +28 -0
  157. package/es/components/molecules/UnsubscribePreview/components/TestAlert/index.d.ts +9 -0
  158. package/es/components/molecules/UnsubscribePreview/components/TestAlert/index.js +18 -0
  159. package/es/components/molecules/UnsubscribePreview/components/UnsubscribedPage/index.d.ts +13 -0
  160. package/es/components/molecules/UnsubscribePreview/components/UnsubscribedPage/index.js +85 -0
  161. package/es/components/molecules/UnsubscribePreview/components/index.d.ts +3 -0
  162. package/es/components/molecules/UnsubscribePreview/components/index.js +3 -0
  163. package/es/components/molecules/UnsubscribePreview/components/styled.d.ts +13 -0
  164. package/es/components/molecules/UnsubscribePreview/components/styled.js +65 -0
  165. package/es/components/molecules/UnsubscribePreview/index.d.ts +10 -0
  166. package/es/components/molecules/UnsubscribePreview/index.js +66 -0
  167. package/es/components/molecules/UnsubscribePreview/styled.d.ts +9 -0
  168. package/es/components/molecules/UnsubscribePreview/styled.js +51 -0
  169. package/es/components/molecules/UnsubscribePreview/type.d.ts +5 -0
  170. package/es/components/molecules/UnsubscribePreview/type.js +1 -0
  171. package/es/components/molecules/UnsubscribePreview/utils.d.ts +9 -0
  172. package/es/components/molecules/UnsubscribePreview/utils.js +27 -0
  173. package/es/components/molecules/UploadImage/index.d.ts +4 -0
  174. package/es/components/molecules/UploadImage/index.js +2 -2
  175. package/es/components/molecules/UploadImage/styled.js +114 -114
  176. package/es/components/molecules/VirtualizedMenu/styled.js +82 -82
  177. package/es/components/molecules/index.d.ts +4 -0
  178. package/es/components/molecules/index.js +2 -0
  179. package/es/components/organism/AccountProfile/components/AccountSetting/components/EditableInput/styles.js +98 -98
  180. package/es/components/organism/AccountProfile/components/AccountSetting/components/LanguageSelector/styles.js +18 -18
  181. package/es/components/organism/AccountProfile/components/AccountSetting/styled.js +543 -543
  182. package/es/components/organism/AccountProfile/components/AccountSetting/styles.scss +39 -39
  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 +3059 -3059
  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 +39 -39
  197. package/es/components/organism/AlgorithmsSetting/styled.js +35 -35
  198. package/es/components/organism/BasicLogin/components/ChooseMethod/styled.js +19 -19
  199. package/es/components/organism/BasicLogin/components/LoginWithEmail/styled.js +3 -3
  200. package/es/components/organism/BasicLogin/components/LoginWithGG/styled.js +3 -3
  201. package/es/components/organism/BasicLogin/components/SignIn/styled.js +8 -8
  202. package/es/components/organism/BasicLogin/components/WidgetLayout/styled.js +18 -18
  203. package/es/components/organism/BasicLogin/styled.js +107 -107
  204. package/es/components/organism/ContentSources/styled.js +50 -50
  205. package/es/components/organism/DataTable/components/AddButton/index.js +8 -8
  206. package/es/components/organism/DataTable/components/ModifyColumn/styled.js +18 -18
  207. package/es/components/organism/DataTable/components/Pagination/styled.js +26 -26
  208. package/es/components/organism/DataTable/components/Table/styled.js +135 -135
  209. package/es/components/organism/DataTable/components/Toolbar/SearchPopover.js +17 -17
  210. package/es/components/organism/DataTable/components/Toolbar/styled.js +70 -70
  211. package/es/components/organism/DataTable/styled/index.js +84 -84
  212. package/es/components/organism/Filter/components/FilterCondition/styled.js +34 -34
  213. package/es/components/organism/Filter/styled.js +109 -109
  214. package/es/components/organism/FilterSetting/components/common/InputArray/styled.js +5 -5
  215. package/es/components/organism/FilterSetting/components/common/InputOrSelect/index.js +63 -63
  216. package/es/components/organism/FilterSetting/components/common/InputSelectMulti/ColumnSuggestion/index.js +31 -31
  217. package/es/components/organism/FilterSetting/components/common/InputSelectMulti/Tree/index.js +22 -22
  218. package/es/components/organism/FilterSetting/components/common/InputSelectMulti/index.js +55 -55
  219. package/es/components/organism/FilterSetting/styled.js +19 -19
  220. package/es/components/organism/Help/styled.js +267 -267
  221. package/es/components/organism/LeftMenu/components/HomeMenu/styled.js +39 -39
  222. package/es/components/organism/LeftMenu/components/common/ChildMenu/components/MenuItemImage/styled.js +16 -16
  223. package/es/components/organism/LeftMenu/components/common/ChildMenu/styled.js +156 -156
  224. package/es/components/organism/LeftMenu/styled.js +214 -214
  225. package/es/components/organism/Login/components/ChooseMethod/styled.js +19 -19
  226. package/es/components/organism/Login/components/ForgotPassword/styled.js +8 -8
  227. package/es/components/organism/Login/components/LoginSelectPortal/Item/styled.js +31 -31
  228. package/es/components/organism/Login/components/LoginSelectPortal/styled.js +3 -3
  229. package/es/components/organism/Login/components/LoginWithEmail/styled.js +3 -3
  230. package/es/components/organism/Login/components/LoginWithGG/styled.js +3 -3
  231. package/es/components/organism/Login/components/SetupGGAuthenticator/styled.js +7 -7
  232. package/es/components/organism/Login/components/SignIn/styled.js +8 -8
  233. package/es/components/organism/Login/components/VerifyAccount/styled.js +13 -13
  234. package/es/components/organism/Login/components/WidgetLayout/styled.js +18 -18
  235. package/es/components/organism/Login/styled.js +115 -115
  236. package/es/components/organism/Menu/styled.js +6 -6
  237. package/es/components/organism/ModifyColumnModal/styled.js +132 -132
  238. package/es/components/organism/Notification/styled.js +155 -155
  239. package/es/components/organism/PreviewCollections/Messages/SkeletonMessage/styled.js +14 -14
  240. package/es/components/organism/PreviewCollections/WhatsappMessage/CarouselMessage/styled.js +63 -63
  241. package/es/components/organism/PreviewCollections/WhatsappMessage/FooterMessage/index.js +3 -1
  242. package/es/components/organism/PreviewCollections/constants.js +50 -50
  243. package/es/components/organism/PreviewCollections/styled.js +16 -16
  244. package/es/components/organism/PreviewTemplateModal/components/Banner/styled.js +78 -78
  245. package/es/components/organism/PreviewTemplateModal/components/Information/styled.js +52 -52
  246. package/es/components/organism/PreviewTemplateModal/components/SimilarTemplate/styled.js +18 -18
  247. package/es/components/organism/PreviewTemplateModal/components/ThumbnailSlider/styled.js +77 -77
  248. package/es/components/organism/PreviewTemplateModal/styled.js +21 -21
  249. package/es/components/organism/SQLGeneration/components/styled.js +354 -354
  250. package/es/components/organism/SQLGeneration/index.scss +1 -1
  251. package/es/components/organism/SQLGeneration/integrations/AceEditor/index.scss +4 -4
  252. package/es/components/organism/Table/CrossTabTable/components/CustomCell/styled.js +11 -11
  253. package/es/components/organism/Table/CrossTabTable/styled.js +11 -11
  254. package/es/components/organism/Table/ExplorePivotTable/components/CustomCell/styled.js +17 -17
  255. package/es/components/organism/Table/ExplorePivotTable/styled.js +11 -11
  256. package/es/components/organism/TicketEditor/styled.js +850 -850
  257. package/es/components/organism/TicketEditorV2/styled.js +839 -839
  258. package/es/components/organism/index.scss +1 -1
  259. package/es/components/template/Layout/Layout.js +10 -10
  260. package/es/components/template/Layout/components/RecommendationWorkspace/components/MenuMapping/components/OldLeftMenu/styled.js +73 -73
  261. package/es/components/template/Layout/components/RecommendationWorkspace/components/MenuMapping/styled.js +39 -39
  262. package/es/components/template/Layout/components/RecommendationWorkspace/components/RecommendationImage/styled.js +61 -61
  263. package/es/components/template/Layout/components/RecommendationWorkspace/styled.js +16 -16
  264. package/es/components/template/Layout/styled.js +84 -84
  265. package/es/components/template/TemplateListing/components/BlankTemplate/styled.js +21 -21
  266. package/es/components/template/TemplateListing/components/CategoryListing/styled.js +123 -123
  267. package/es/components/template/TemplateListing/components/Empty/styled.js +20 -20
  268. package/es/components/template/TemplateListing/stories/demo/styled.js +4 -4
  269. package/es/components/template/TemplateListing/styled/index.js +40 -40
  270. package/es/constants/index.d.ts +1 -0
  271. package/es/constants/index.js +1 -0
  272. package/es/constants/queries.d.ts +5 -0
  273. package/es/constants/queries.js +6 -0
  274. package/es/constants/unsubscribe.d.ts +56 -0
  275. package/es/constants/unsubscribe.js +77 -0
  276. package/es/providers/ConfigProvider/GlobalStyle.js +1249 -1249
  277. package/es/queries/Unsubscribe/index.d.ts +5 -0
  278. package/es/queries/Unsubscribe/index.js +5 -0
  279. package/es/queries/Unsubscribe/useGetUnsubscribeList.d.ts +8 -0
  280. package/es/queries/Unsubscribe/useGetUnsubscribeList.js +18 -0
  281. package/es/queries/Unsubscribe/useGetUnsubscribeListByIdentifier.d.ts +8 -0
  282. package/es/queries/Unsubscribe/useGetUnsubscribeListByIdentifier.js +11 -0
  283. package/es/queries/Unsubscribe/useGetUnsubscribeListPermission.d.ts +8 -0
  284. package/es/queries/Unsubscribe/useGetUnsubscribeListPermission.js +17 -0
  285. package/es/queries/Unsubscribe/useGetUnsubscribePreferences.d.ts +23 -0
  286. package/es/queries/Unsubscribe/useGetUnsubscribePreferences.js +26 -0
  287. package/es/services/MediaTemplateDesign/UploadFile/index.js +4 -4
  288. package/es/services/Unsubscribe/index.d.ts +41 -0
  289. package/es/services/Unsubscribe/index.js +78 -0
  290. package/es/styled/common.js +51 -51
  291. package/es/tests/styled.js +4 -4
  292. package/es/types/index.d.ts +1 -0
  293. package/es/types/index.js +1 -0
  294. package/es/types/unsubscribe.d.ts +25 -0
  295. package/es/types/unsubscribe.js +1 -0
  296. package/es/utils/common.d.ts +1 -0
  297. package/es/utils/common.js +3 -0
  298. package/es/utils/variables.js +7 -7
  299. package/package.json +266 -266
@@ -20,10 +20,10 @@ import { TagTextArea, TagifyWrapper, WrapperPlaceHolder } from './styled';
20
20
  import { parseTagStringToTagify, convertInputStringToOriginal, emojiManufacturer, getEmojiTag, isPersonalizeTagType, generateTagContent, unescapeString, hasLineBreak, selectRange, isTagClickable, findURLInTextNodes, getAttributesString, isAnchorNodeChildOfElement, isShortLinkTagType, isCaretAtEndOfTextNodeWithNextTag, getCurrentSelectionAndCloneRange, handleEnterWithNextTag, handleTextNodeBackspace, } from './utils';
21
21
  import { acceptablePatternChecking, detectURLRegex, getCachedRegex, 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, defaultCssVariables, tagifyDefaultProps, } from './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';
24
24
  const TagifyInput = forwardRef((props, ref) => {
25
25
  // Props
26
- const { initialValue, escapeHTML, status, readonly, readonlyTag, realtime, disabled, maxLength, maxHeight, minWidth, placeholder, minWidthPlaceholder, isSingleLineText, acceptableTagPattern, mapAttributes, mapErrorAttributes, maxPersonalizeTags, name, children, cssTagifyVariables, onTagClick, onChange, } = 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;
27
27
  // States
28
28
  const [isLineBreak, setIsLineBreak] = useState(hasLineBreak(initialValue));
29
29
  const [tooltipRefresher, setTooltipRefresher] = useState(1);
@@ -371,7 +371,7 @@ const TagifyInput = forwardRef((props, ref) => {
371
371
  if (newTag && tagifyRef.current) {
372
372
  const { settings, value: currentTags } = tagifyRef.current;
373
373
  const { readonly, maxTags } = settings;
374
- const currentPersonalizeTags = currentTags.filter(tag => ![EMOJI, SHORT_LINK, SHORT_LINK_V2].includes(tag.type));
374
+ const currentPersonalizeTags = currentTags.filter(tag => ![EMOJI, SHORT_LINK, SHORT_LINK_V2, UNSUBSCRIBE_WHATSAPP].includes(tag.type));
375
375
  const currentPersonalizeTagsLength = currentPersonalizeTags.length;
376
376
  // Check readonly
377
377
  if (readonly)
@@ -387,7 +387,7 @@ const TagifyInput = forwardRef((props, ref) => {
387
387
  * Validate the max limit before add new tag
388
388
  * For emoji and short link, it will be passed
389
389
  */
390
- if (![EMOJI, SHORT_LINK, SHORT_LINK_V2].includes(type) &&
390
+ if (![EMOJI, SHORT_LINK, SHORT_LINK_V2, UNSUBSCRIBE_WHATSAPP].includes(type) &&
391
391
  currentPersonalizeTagsLength >= maxTags)
392
392
  return;
393
393
  // Create new tag
@@ -538,21 +538,21 @@ const TagifyInput = forwardRef((props, ref) => {
538
538
  }
539
539
  }
540
540
  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
-
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
+
552
552
  ${generateTagContent({
553
553
  tagData,
554
554
  content: visibleTagContent,
555
- })}
555
+ })}
556
556
  </tag>`;
557
557
  }, []);
558
558
  /*
@@ -722,6 +722,17 @@ const TagifyInput = forwardRef((props, ref) => {
722
722
  });
723
723
  }
724
724
  }, [maxLength, customizeTag]);
725
+ useEffect(() => {
726
+ if (!tagifyRef.current)
727
+ return;
728
+ const inputEl = tagifyRef.current.DOM.input;
729
+ if (readonlyText) {
730
+ inputEl.setAttribute('contenteditable', 'false');
731
+ }
732
+ else {
733
+ inputEl.setAttribute('contenteditable', 'true');
734
+ }
735
+ }, [readonlyText]);
725
736
  const onTagifyWrapperClick = useCallback(event => {
726
737
  event.preventDefault();
727
738
  event.stopPropagation();
@@ -900,44 +911,44 @@ const TagifyInput = forwardRef((props, ref) => {
900
911
  if (!tagifyTooltip) {
901
912
  const style = document.createElement('style');
902
913
  style.type = 'text/css';
903
- style.appendChild(document.createTextNode(`
904
- .tagify__tooltip {
905
- display: none;
906
- position: fixed;
907
- background-color: #595959;
908
- border-radius: 10px;
909
- color: #ffffff;
910
- padding: 6px;
911
- z-index: 10000;
912
- max-width: 280px;
913
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
914
- }
915
-
916
- .tagify__tooltip_content {
917
- width: 100%;
918
- max-width: 250px;
919
- height: auto;
920
- position: relative;
921
- transition: 0s;
922
- font-size: 12px;
923
- line-height: 16px;
924
- text-align: center;
925
- word-wrap: break-word;
926
- white-space: normal;
927
- }
928
-
929
- .tagify__tooltip_content:before {
930
- content: '';
931
- position: absolute;
932
- top: 100%;
933
- right: 50%;
934
- left: auto;
935
- background-color: #595959;
936
- width: 10px;
937
- height: 10px;
938
- transform: rotate(45deg) translate(50%,-50%);
939
- border-radius: 1px;
940
- }
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
+ }
941
952
  `));
942
953
  document.head.appendChild(style);
943
954
  const tooltipWrapper = document.createElement('div');
@@ -38,9 +38,11 @@ export declare const PATTERN_CACHE_TYPE: {
38
38
  readonly LINE_EMOJI_PTN: "line_emoji_pattern";
39
39
  readonly PERSONALIZE_PTN: "personalize_pattern";
40
40
  readonly VIBER_EMOJI_PTN: "viber_emoji_pattern";
41
+ readonly UNSUBSCRIBE_WHATSAPP_PTN: "unsubscribe_whatsapp_pattern";
42
+ readonly UNSUBSCRIBE_PTN: "unsubscribe_pattern";
41
43
  };
42
- export declare const SHORT_LINK_PTN: "shortlink_pattern", SHORT_LINK_INDIVIDUAL_PTN: "shortlink_individual_pattern", SHORT_LINK_GENERAL_PTN: "shortlink_general_pattern", SHORT_LINK_V2_INDIVIDUAL_PTN: "shortlink_v2_individual_pattern", SHORT_LINK_V2_GENERAL_PTN: "shortlink_v2_general_pattern", LINE_EMOJI_PTN: "line_emoji_pattern", PERSONALIZE_PTN: "personalize_pattern", VIBER_EMOJI_PTN: "viber_emoji_pattern";
43
- export declare const DEFAULT_ACCEPT_TAGS: ("shortlink_pattern" | "line_emoji_pattern" | "personalize_pattern" | "viber_emoji_pattern")[];
44
+ export declare const SHORT_LINK_PTN: "shortlink_pattern", SHORT_LINK_INDIVIDUAL_PTN: "shortlink_individual_pattern", SHORT_LINK_GENERAL_PTN: "shortlink_general_pattern", SHORT_LINK_V2_INDIVIDUAL_PTN: "shortlink_v2_individual_pattern", SHORT_LINK_V2_GENERAL_PTN: "shortlink_v2_general_pattern", LINE_EMOJI_PTN: "line_emoji_pattern", PERSONALIZE_PTN: "personalize_pattern", VIBER_EMOJI_PTN: "viber_emoji_pattern", UNSUBSCRIBE_WHATSAPP_PTN: "unsubscribe_whatsapp_pattern", UNSUBSCRIBE_PTN: "unsubscribe_pattern";
45
+ export declare const DEFAULT_ACCEPT_TAGS: ("shortlink_pattern" | "line_emoji_pattern" | "personalize_pattern" | "viber_emoji_pattern" | "unsubscribe_pattern")[];
44
46
  export declare const tagifyDefaultProps: TagifyInputProps;
45
47
  export declare const TAG_TYPE: {
46
48
  readonly CUSTOMER: "customer";
@@ -57,8 +59,9 @@ export declare const TAG_TYPE: {
57
59
  readonly SHORT_LINK_V2: "shortlink_v2";
58
60
  readonly DETECT_LINK: "detect_link";
59
61
  readonly CONTENT_SOURCE_GROUP: "groups";
62
+ readonly UNSUBSCRIBE_WHATSAPP: "unsubscribe_whatsapp";
60
63
  };
61
- 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";
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";
62
65
  export declare const SHORT_LINK_TYPE: {
63
66
  readonly INDIVIDUAL: "shortlink";
64
67
  readonly GENERAL: "shortlink_static";
@@ -88,6 +91,7 @@ export declare const TAG_COLOR: {
88
91
  readonly custom: "#bbefbe";
89
92
  readonly groups: "#ffdd9f";
90
93
  readonly emoji: "transparent";
94
+ readonly unsubscribe_whatsapp: "#cafedd";
91
95
  };
92
96
  export declare const EMOJI_COLLECTIONS: {
93
97
  readonly COMMON: "common";
@@ -39,13 +39,16 @@ export const PATTERN_CACHE_TYPE = {
39
39
  LINE_EMOJI_PTN: 'line_emoji_pattern',
40
40
  PERSONALIZE_PTN: 'personalize_pattern',
41
41
  VIBER_EMOJI_PTN: 'viber_emoji_pattern',
42
+ UNSUBSCRIBE_WHATSAPP_PTN: 'unsubscribe_whatsapp_pattern',
43
+ UNSUBSCRIBE_PTN: 'unsubscribe_pattern',
42
44
  };
43
- export const { SHORT_LINK_PTN, SHORT_LINK_INDIVIDUAL_PTN, SHORT_LINK_GENERAL_PTN, SHORT_LINK_V2_INDIVIDUAL_PTN, SHORT_LINK_V2_GENERAL_PTN, LINE_EMOJI_PTN, PERSONALIZE_PTN, VIBER_EMOJI_PTN, } = PATTERN_CACHE_TYPE;
45
+ export const { SHORT_LINK_PTN, SHORT_LINK_INDIVIDUAL_PTN, SHORT_LINK_GENERAL_PTN, SHORT_LINK_V2_INDIVIDUAL_PTN, SHORT_LINK_V2_GENERAL_PTN, LINE_EMOJI_PTN, PERSONALIZE_PTN, VIBER_EMOJI_PTN, UNSUBSCRIBE_WHATSAPP_PTN, UNSUBSCRIBE_PTN, } = PATTERN_CACHE_TYPE;
44
46
  export const DEFAULT_ACCEPT_TAGS = [
45
47
  SHORT_LINK_PTN,
46
48
  PERSONALIZE_PTN,
47
49
  VIBER_EMOJI_PTN,
48
50
  LINE_EMOJI_PTN,
51
+ UNSUBSCRIBE_PTN,
49
52
  ];
50
53
  export const tagifyDefaultProps = {
51
54
  initialValue: '',
@@ -72,8 +75,9 @@ export const TAG_TYPE = {
72
75
  SHORT_LINK_V2: 'shortlink_v2',
73
76
  DETECT_LINK: 'detect_link',
74
77
  CONTENT_SOURCE_GROUP: 'groups',
78
+ UNSUBSCRIBE_WHATSAPP: 'unsubscribe_whatsapp',
75
79
  };
76
- 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, } = TAG_TYPE;
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;
77
81
  export const SHORT_LINK_TYPE = {
78
82
  INDIVIDUAL: 'shortlink', // Individual link
79
83
  GENERAL: 'shortlink_static', // General link
@@ -103,6 +107,7 @@ export const TAG_COLOR = {
103
107
  [CUSTOM_FN]: '#bbefbe',
104
108
  [CONTENT_SOURCE_GROUP]: '#ffdd9f',
105
109
  [EMOJI]: 'transparent',
110
+ [UNSUBSCRIBE_WHATSAPP]: '#cafedd',
106
111
  };
107
112
  export const EMOJI_COLLECTIONS = {
108
113
  COMMON: 'common',
@@ -9,7 +9,7 @@ import { isViberEmoji } from './iconsViber';
9
9
  import { random } from '@antscorp/antsomi-ui/es/utils';
10
10
  import { containsTagType } from './utils';
11
11
  // Constants
12
- import { CONTENT_SOURCE_GROUP, EMOJI, EMOJI_COLLECTIONS, LINE_EMOJI_PTN, PERSONALIZE_PTN, PREFIX_PATTERN_LINE_MESSAGE, PROMOTION_CODE, SHORT_LINK, SHORT_LINK_GENERAL_PTN, SHORT_LINK_INDIVIDUAL_PTN, SHORT_LINK_PTN, SHORT_LINK_TYPE, SHORT_LINK_V2, SHORT_LINK_V2_GENERAL_PTN, SHORT_LINK_V2_INDIVIDUAL_PTN, VIBER_EMOJI_PTN, } from './constants';
12
+ import { CONTENT_SOURCE_GROUP, EMOJI, EMOJI_COLLECTIONS, LINE_EMOJI_PTN, PERSONALIZE_PTN, PREFIX_PATTERN_LINE_MESSAGE, PROMOTION_CODE, SHORT_LINK, SHORT_LINK_GENERAL_PTN, SHORT_LINK_INDIVIDUAL_PTN, SHORT_LINK_PTN, SHORT_LINK_TYPE, SHORT_LINK_V2, SHORT_LINK_V2_GENERAL_PTN, SHORT_LINK_V2_INDIVIDUAL_PTN, VIBER_EMOJI_PTN, UNSUBSCRIBE_WHATSAPP, UNSUBSCRIBE_WHATSAPP_PTN, UNSUBSCRIBE_PTN, } from './constants';
13
13
  /*
14
14
  * Usage to cache compiled regular expressions:
15
15
  * const regex = getCachedRegex(pattern, flags);
@@ -594,6 +594,30 @@ const handleShortlinkV2GeneralPattern = match => {
594
594
  const tag = createTagPattern(tagData);
595
595
  return { isValid, tag, tagData };
596
596
  };
597
+ /**
598
+ * Function to handle whatsapp#public/unsubscribe/${id} pattern
599
+ */
600
+ const handleUnsubscribeWhatsappPattern = match => {
601
+ const [fullMatch, id] = match;
602
+ const isValid = Boolean(id && id.trim().length > 0);
603
+ if (!isValid) {
604
+ console.error(`Invalid WhatsApp unsubscribe pattern: fullMatch:: ${fullMatch}`);
605
+ return {
606
+ isValid,
607
+ tag: '[[Invalid WhatsApp unsubscribe]]',
608
+ tagData: undefined,
609
+ };
610
+ }
611
+ const label = `whatsapp${fullMatch}`;
612
+ const tagData = {
613
+ type: UNSUBSCRIBE_WHATSAPP,
614
+ label,
615
+ value: fullMatch,
616
+ id,
617
+ };
618
+ const tag = createTagPattern(tagData);
619
+ return { isValid, tag, tagData };
620
+ };
597
621
  // Map of regex patterns to their respective wrapped handlers
598
622
  export const patternHandlers = {
599
623
  /*
@@ -653,4 +677,13 @@ export const patternHandlers = {
653
677
  acceptablePattern: VIBER_EMOJI_PTN,
654
678
  handler: errorWrapper(handleViberPattern),
655
679
  },
680
+ /**
681
+ * NOTE: WhatsApp unsubscribe patterns
682
+ */
683
+ [UNSUBSCRIBE_WHATSAPP_PTN]: {
684
+ pattern: '#public\\/unsubscribe\\/([A-Za-z0-9_-]+)(?:\\?(?=.*\\btype=whatsapp\\b).*)',
685
+ name: UNSUBSCRIBE_WHATSAPP_PTN, // Used to cache the regex, please keep the name unique for each pattern
686
+ acceptablePattern: UNSUBSCRIBE_PTN,
687
+ handler: errorWrapper(handleUnsubscribeWhatsappPattern),
688
+ },
656
689
  };
@@ -5,49 +5,49 @@ import { globalToken } from '@antscorp/antsomi-ui/es/constants';
5
5
  import { MIN_H_WRAPPER } from './constants';
6
6
  // Utils
7
7
  import { getBackgroundInputStatus, getTagifyInputStyled, getTagifyStyled, getTagifyTagStyled, } from './utils.style';
8
- export const WrapperPlaceHolder = styled.div `
8
+ export const WrapperPlaceHolder = styled.div `
9
9
  ${({ $isShow }) => $isShow
10
- ? css `
11
- display: block;
12
- float: right;
13
- min-height: ${MIN_H_WRAPPER}px;
10
+ ? css `
11
+ display: block;
12
+ float: right;
13
+ min-height: ${MIN_H_WRAPPER}px;
14
14
  `
15
- : css `
16
- display: none;
17
- `};
15
+ : css `
16
+ display: none;
17
+ `};
18
18
  `;
19
- export const TagifyWrapper = styled.div `
20
- cursor: text;
21
- background: ${globalToken?.bw0};
22
- border-bottom: 1px solid ${({ $status }) => getBackgroundInputStatus($status)};
23
- min-height: ${MIN_H_WRAPPER}px;
24
- width: 100%;
25
-
26
- &::after {
27
- content: '';
28
- display: block;
29
- clear: both;
30
- }
31
-
32
- .tagify {
19
+ export const TagifyWrapper = styled.div `
20
+ cursor: text;
21
+ background: ${globalToken?.bw0};
22
+ border-bottom: 1px solid ${({ $status }) => getBackgroundInputStatus($status)};
23
+ min-height: ${MIN_H_WRAPPER}px;
24
+ width: 100%;
25
+
26
+ &::after {
27
+ content: '';
28
+ display: block;
29
+ clear: both;
30
+ }
31
+
32
+ .tagify {
33
33
  ${({ $cssTagifyVariables }) => $cssTagifyVariables &&
34
34
  Object.entries($cssTagifyVariables)
35
35
  .map(([key, value]) => `${key}: ${value};`)
36
- .join('\n')}
37
-
38
- // --- Section tagify style ---
39
- ${getTagifyStyled}
40
-
41
- // --- Section input style ---
42
- &__input {
43
- ${getTagifyInputStyled}
44
- }
45
-
46
- // --- Section tag style ---
47
- &__tag {
48
- ${getTagifyTagStyled}
49
- }
50
- }
36
+ .join('\n')}
37
+
38
+ // --- Section tagify style ---
39
+ ${getTagifyStyled}
40
+
41
+ // --- Section input style ---
42
+ &__input {
43
+ ${getTagifyInputStyled}
44
+ }
45
+
46
+ // --- Section tag style ---
47
+ &__tag {
48
+ ${getTagifyTagStyled}
49
+ }
50
+ }
51
51
  `;
52
52
  export const TagInput = styled.input ``;
53
53
  export const TagTextArea = styled.textarea ``;
@@ -125,6 +125,10 @@ export interface TagifyInputProps {
125
125
  * @default () => {}
126
126
  */
127
127
  onChange: (inputValue: string) => void;
128
+ /**
129
+ * Defines whether the input text is read but not the whole tags.
130
+ */
131
+ readonlyText?: boolean;
128
132
  }
129
133
  export interface TagifyInputRef {
130
134
  onAddNewTag: (newTag: TagDataCustomize | string) => void;
@@ -135,8 +139,8 @@ export type EmojiCollection = (typeof EMOJI_COLLECTIONS)[keyof typeof EMOJI_COLL
135
139
  export type TagType = (typeof TAG_TYPE)[keyof typeof TAG_TYPE];
136
140
  export type ShortLinkType = (typeof SHORT_LINK_TYPE)[keyof typeof SHORT_LINK_TYPE];
137
141
  export type PatternCacheType = (typeof PATTERN_CACHE_TYPE)[keyof typeof PATTERN_CACHE_TYPE];
138
- export type PatterTagName = Exclude<PatternCacheType, 'shortlink_pattern'>;
139
- export type AcceptablePattern = Exclude<PatternCacheType, 'shortlink_individual_pattern' | 'shortlink_general_pattern'>;
142
+ export type PatterTagName = Exclude<PatternCacheType, 'shortlink_pattern' | 'unsubscribe_pattern'>;
143
+ export type AcceptablePattern = Exclude<PatternCacheType, 'shortlink_individual_pattern' | 'shortlink_general_pattern' | 'unsubscribe_whatsapp_pattern'>;
140
144
  export interface TagDataText extends TagData {
141
145
  value: string;
142
146
  label: string;
@@ -152,7 +156,13 @@ export interface TagDataShortLink extends Omit<TagDataText, 'type'> {
152
156
  type: Extract<TagType, 'shortlink' | 'shortlink_v2'>;
153
157
  shortlinkType: ShortLinkType;
154
158
  }
155
- export type TagDataCustomize = TagDataEmoji | TagDataText | TagDataShortLink;
159
+ export interface TagDataUnsubscribe extends Omit<TagDataText, 'type'> {
160
+ value: string;
161
+ label: string;
162
+ id: string;
163
+ type: Extract<TagType, 'unsubscribe_whatsapp'>;
164
+ }
165
+ export type TagDataCustomize = TagDataEmoji | TagDataText | TagDataShortLink | TagDataUnsubscribe;
156
166
  export interface EmojiTag {
157
167
  src?: string;
158
168
  emoji: string;
@@ -47,6 +47,7 @@ export declare const emojiManufacturer: (text: string, collectionType: EmojiColl
47
47
  export declare const getEmojiTag: ({ src, emoji, code }: EmojiTag) => string;
48
48
  export declare const isPersonalizeTagType: (type: TagType) => boolean;
49
49
  export declare const isShortLinkTagType: (type: TagType) => boolean;
50
+ export declare const isUnsubscribeTagType: (type: TagType) => boolean;
50
51
  export declare const generateTagContent: (params: {
51
52
  tagData: TagDataCustomize;
52
53
  content: string;
@@ -1,7 +1,7 @@
1
1
  // Libraries
2
2
  import stringReplaceToArray from 'string-replace-to-array';
3
3
  // Constants
4
- import { EMOJI_COLLECTIONS, PREFIX_PATTERN_LINE_MESSAGE, READONLY_TAG, SHORT_LINK_V2, TAG_TYPE, } from './constants';
4
+ import { EMOJI_COLLECTIONS, PREFIX_PATTERN_LINE_MESSAGE, READONLY_TAG, SHORT_LINK_V2, TAG_TYPE, UNSUBSCRIBE_WHATSAPP, } from './constants';
5
5
  import { iconsViber } from './iconsViber';
6
6
  // Utils
7
7
  import { acceptablePatternChecking, detectURLRegex, getCachedRegex, patternHandlers, tagRegexStringPattern, } from './patternHandlers';
@@ -379,15 +379,15 @@ export const emojiManufacturer = (text, collectionType) => {
379
379
  return [];
380
380
  }
381
381
  };
382
- export const getEmojiTag = ({ src, emoji, code }) => `
383
- <img
384
- src="${src}"
385
- data-emoji="${emoji}"
386
- data-emoji-code="${code}"
387
- alt="${emoji}"
388
- width="16px"
389
- height="16px"
390
- style="transform: translateY(3.5px); cursor: text;"
382
+ export const getEmojiTag = ({ src, emoji, code }) => `
383
+ <img
384
+ src="${src}"
385
+ data-emoji="${emoji}"
386
+ data-emoji-code="${code}"
387
+ alt="${emoji}"
388
+ width="16px"
389
+ height="16px"
390
+ style="transform: translateY(3.5px); cursor: text;"
391
391
  />`;
392
392
  export const isPersonalizeTagType = (type) => [
393
393
  CUSTOMER,
@@ -402,6 +402,7 @@ export const isPersonalizeTagType = (type) => [
402
402
  CONTENT_SOURCE_GROUP,
403
403
  ].includes(type);
404
404
  export const isShortLinkTagType = (type) => [SHORT_LINK_V2].includes(type);
405
+ export const isUnsubscribeTagType = (type) => [UNSUBSCRIBE_WHATSAPP].includes(type);
405
406
  export const generateTagContent = (params) => {
406
407
  const { tagData, content } = params;
407
408
  let dataAttrsString = '';
@@ -418,10 +419,10 @@ export const generateTagContent = (params) => {
418
419
  dataAttrs.forEach((value, key) => {
419
420
  dataAttrsString = dataAttrsString.concat(` data-${key}="${value}"`);
420
421
  });
421
- return `
422
- <div ${dataAttrsString}>
423
- ${content}
424
- </div>
422
+ return `
423
+ <div ${dataAttrsString}>
424
+ ${content}
425
+ </div>
425
426
  `;
426
427
  };
427
428
  /**