@antscorp/antsomi-ui 1.3.3-beta.34 → 1.3.3-beta.35

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 (278) hide show
  1. package/es/components/atoms/Alert/Alert.js +6 -13
  2. package/es/components/atoms/Button/index.js +1 -1
  3. package/es/components/atoms/Button/test.js +6 -6
  4. package/es/components/atoms/DividerPure/DividerPure.js +15 -4
  5. package/es/components/atoms/DividerPure/styled.js +6 -36
  6. package/es/components/atoms/Empty/Empty.js +1 -1
  7. package/es/components/atoms/FloatButton/index.js +1 -1
  8. package/es/components/atoms/Grid/Grid.js +2 -2
  9. package/es/components/atoms/Icon/index.js +15 -28
  10. package/es/components/atoms/Input/Input.js +32 -21
  11. package/es/components/atoms/Input/styled.js +12 -102
  12. package/es/components/atoms/InputDynamic/EditCaretPositioning.js +13 -13
  13. package/es/components/atoms/InputDynamic/InputDynamic.js +97 -83
  14. package/es/components/atoms/InputDynamic/PopupShortLink.js +21 -20
  15. package/es/components/atoms/InputDynamic/styled.js +13 -275
  16. package/es/components/atoms/InputDynamic/utils.js +114 -104
  17. package/es/components/atoms/InputNumber/InputNumber.js +14 -3
  18. package/es/components/atoms/MobileFrame/MobileFrame.js +14 -3
  19. package/es/components/atoms/MobileFrame/constants.js +1 -1
  20. package/es/components/atoms/MobileFrame/styled.js +8 -29
  21. package/es/components/atoms/Pagination/Pagination.js +1 -1
  22. package/es/components/atoms/Popover/Popover.js +1 -1
  23. package/es/components/atoms/Popover/styled.js +6 -1
  24. package/es/components/atoms/PreviewTabs/PreviewTabs.js +31 -20
  25. package/es/components/atoms/PreviewTabs/styled.js +10 -71
  26. package/es/components/atoms/Progress/Progress.js +1 -1
  27. package/es/components/atoms/Radio/index.js +8 -18
  28. package/es/components/atoms/Rate/Rate.js +1 -1
  29. package/es/components/atoms/RateV2/RateV2.js +30 -24
  30. package/es/components/atoms/RequiredLabel/index.js +14 -3
  31. package/es/components/atoms/RequiredLabel/styled.js +7 -5
  32. package/es/components/atoms/ScrollBox/index.js +25 -14
  33. package/es/components/atoms/Segmented/Segmented.js +1 -1
  34. package/es/components/atoms/Skeleton/Skeleton.js +1 -1
  35. package/es/components/atoms/Slider/index.js +18 -7
  36. package/es/components/atoms/Slider/styled.js +10 -38
  37. package/es/components/atoms/SliderV2/index.js +21 -10
  38. package/es/components/atoms/Space/Space.js +7 -6
  39. package/es/components/atoms/Spin/Spin.js +14 -3
  40. package/es/components/atoms/Spin/styled.js +6 -3
  41. package/es/components/atoms/Statistic/Statistic.js +1 -1
  42. package/es/components/atoms/Steps/Steps.js +1 -1
  43. package/es/components/atoms/Switch/Switch.js +1 -1
  44. package/es/components/atoms/Text/index.js +15 -4
  45. package/es/components/atoms/Text/styled.js +11 -40
  46. package/es/components/atoms/Timeline/Timeline.js +1 -1
  47. package/es/components/atoms/Watermark/Watermark.js +1 -1
  48. package/es/components/common/ConfigProvider/ConfigProvider.js +15 -4
  49. package/es/components/common/ConfigProvider/GlobalStyle.js +8 -569
  50. package/es/components/icons/AccountCircle.js +13 -2
  51. package/es/components/icons/AddShoppingCart.js +13 -2
  52. package/es/components/icons/ArrowGrowIcon.js +13 -2
  53. package/es/components/icons/AssignmentInd.js +13 -2
  54. package/es/components/icons/AudioRecordIcon.js +13 -2
  55. package/es/components/icons/BugIcon.js +13 -2
  56. package/es/components/icons/Call.js +13 -2
  57. package/es/components/icons/CameraIcon.js +13 -2
  58. package/es/components/icons/CaptureIcon.js +13 -2
  59. package/es/components/icons/Category.js +13 -2
  60. package/es/components/icons/ChatBubbleOutline.js +13 -2
  61. package/es/components/icons/CheckSlimIcon.js +13 -2
  62. package/es/components/icons/CircleNotifications.js +13 -2
  63. package/es/components/icons/CloseIcon.js +13 -2
  64. package/es/components/icons/CommentIcon.js +13 -2
  65. package/es/components/icons/ConfirmationNumber.js +13 -2
  66. package/es/components/icons/DesktopWindows.js +13 -2
  67. package/es/components/icons/EventIcon.js +13 -2
  68. package/es/components/icons/FactCheck.js +13 -2
  69. package/es/components/icons/FreeDrawIcon.js +13 -2
  70. package/es/components/icons/GPTIcon.js +2 -2
  71. package/es/components/icons/GPTIconV2.js +2 -2
  72. package/es/components/icons/GPTIconV3.js +13 -2
  73. package/es/components/icons/HighlightIcon.js +13 -2
  74. package/es/components/icons/HightlightAlt.js +13 -2
  75. package/es/components/icons/HowToReg.js +13 -2
  76. package/es/components/icons/IdeaIcon.js +13 -2
  77. package/es/components/icons/Interactive.js +13 -2
  78. package/es/components/icons/InvisibleIcon.js +13 -2
  79. package/es/components/icons/List.js +13 -2
  80. package/es/components/icons/LocalMallIcon.js +13 -2
  81. package/es/components/icons/MobileFriendly.js +13 -2
  82. package/es/components/icons/MuteIcon.js +13 -2
  83. package/es/components/icons/NotificationsActive.js +13 -2
  84. package/es/components/icons/OpenUrlIcon.js +13 -2
  85. package/es/components/icons/PauseIcon.js +13 -2
  86. package/es/components/icons/Payment.js +13 -2
  87. package/es/components/icons/PersonAddDisabled.js +13 -2
  88. package/es/components/icons/PhoneCallback.js +13 -2
  89. package/es/components/icons/PlaneIcon.js +13 -2
  90. package/es/components/icons/Preview.js +13 -2
  91. package/es/components/icons/Redeem.js +13 -2
  92. package/es/components/icons/RemoveRedEye.js +13 -2
  93. package/es/components/icons/RemoveShoppingCart.js +13 -2
  94. package/es/components/icons/RequestIcon.js +13 -2
  95. package/es/components/icons/Search.js +13 -2
  96. package/es/components/icons/ShoppingBag.js +13 -2
  97. package/es/components/icons/ShoppingCart.js +13 -2
  98. package/es/components/icons/StopRecordIcon.js +13 -2
  99. package/es/components/icons/Store.js +13 -2
  100. package/es/components/icons/UserIcon.js +13 -2
  101. package/es/components/icons/VerticalDotsIcon.js +13 -2
  102. package/es/components/icons/WarningIcon.js +13 -2
  103. package/es/components/icons/Web.js +13 -2
  104. package/es/components/icons/WebAsset.js +13 -2
  105. package/es/components/molecules/AlignSetting/index.js +20 -9
  106. package/es/components/molecules/AlignSetting/styled.js +6 -5
  107. package/es/components/molecules/AlignSetting/utils.js +2 -2
  108. package/es/components/molecules/CaptureScreen/CaptureScreen.js +269 -240
  109. package/es/components/molecules/CaptureScreen/components/CommentBox/CommentBox.js +36 -25
  110. package/es/components/molecules/CaptureScreen/components/CommentBox/styled.js +15 -129
  111. package/es/components/molecules/CaptureScreen/components/Cursor/Cursor.js +2 -2
  112. package/es/components/molecules/CaptureScreen/components/Cursor/styled.js +10 -73
  113. package/es/components/molecules/CaptureScreen/constants.js +7 -7
  114. package/es/components/molecules/CaptureScreen/hooks/useImageEditor.d.ts +1 -1
  115. package/es/components/molecules/CaptureScreen/hooks/useImageEditor.js +23 -23
  116. package/es/components/molecules/CaptureScreen/styled.js +28 -247
  117. package/es/components/molecules/CaptureScreen/themes/black.js +1 -1
  118. package/es/components/molecules/CaptureScreen/themes/white.js +1 -1
  119. package/es/components/molecules/CaptureScreen/utils.js +32 -29
  120. package/es/components/molecules/Card/Card.js +1 -1
  121. package/es/components/molecules/ChatBox/ChatBox.js +147 -81
  122. package/es/components/molecules/ChatBox/MessageItem.js +22 -20
  123. package/es/components/molecules/ChatBox/constants.js +2 -2
  124. package/es/components/molecules/ChatBox/styled.js +13 -275
  125. package/es/components/molecules/Collapse/Collapse.js +4 -3
  126. package/es/components/molecules/ColorPicker/ChromePicker/index.js +1 -1
  127. package/es/components/molecules/ColorPicker/ChromePicker/styled.js +6 -11
  128. package/es/components/molecules/ColorPicker/CustomPicker/index.js +33 -21
  129. package/es/components/molecules/ColorPicker/CustomPicker/styled.js +14 -95
  130. package/es/components/molecules/ColorPicker/SketchPicker/index.js +12 -1
  131. package/es/components/molecules/ColorPicker/SketchPicker/styled.js +6 -6
  132. package/es/components/molecules/ColorPicker/index.js +17 -17
  133. package/es/components/molecules/ColorPicker/styled.js +6 -8
  134. package/es/components/molecules/ColorSetting/index.js +35 -15
  135. package/es/components/molecules/ColorSetting/styled.js +9 -36
  136. package/es/components/molecules/DatePicker/DatePicker.js +1 -1
  137. package/es/components/molecules/DatePicker/components/AdvancedPicker/AdvancedPicker.js +146 -112
  138. package/es/components/molecules/DatePicker/components/AdvancedPicker/constants.js +10 -10
  139. package/es/components/molecules/DatePicker/components/AdvancedPicker/styled.js +12 -45
  140. package/es/components/molecules/DatePicker/components/AdvancedPicker/utils.js +8 -3
  141. package/es/components/molecules/DatePicker/components/AdvancedRangePicker/AdvancedRangePicker.js +28 -9
  142. package/es/components/molecules/DatePicker/components/AdvancedRangePicker/constants.js +1 -1
  143. package/es/components/molecules/Drawer/Drawer.js +1 -1
  144. package/es/components/molecules/EdgeSetting/index.js +69 -45
  145. package/es/components/molecules/EdgeSetting/styled.js +8 -13
  146. package/es/components/molecules/FontFamilySelect/constants.js +1 -1
  147. package/es/components/molecules/FontFamilySelect/index.js +33 -10
  148. package/es/components/molecules/FontSetting/constants.js +2 -2
  149. package/es/components/molecules/FontSetting/index.js +36 -22
  150. package/es/components/molecules/FontWeightSelect/constants.js +1 -1
  151. package/es/components/molecules/FontWeightSelect/index.js +32 -9
  152. package/es/components/molecules/GradientSetting/index.js +55 -35
  153. package/es/components/molecules/GradientSetting/styled.js +6 -58
  154. package/es/components/molecules/IconSelection/components/Icon/index.js +19 -8
  155. package/es/components/molecules/IconSelection/constants.js +37 -31
  156. package/es/components/molecules/IconSelection/index.js +56 -43
  157. package/es/components/molecules/IconSelection/styled.js +10 -74
  158. package/es/components/molecules/IconSelection/types.js +3 -1
  159. package/es/components/molecules/IconSelection/utils.js +3 -3
  160. package/es/components/molecules/InputNumber/index.js +23 -12
  161. package/es/components/molecules/InputNumberWithUnit/index.js +19 -5
  162. package/es/components/molecules/InputNumberWithUnit/styled.js +6 -15
  163. package/es/components/molecules/InputSearch/index.js +14 -3
  164. package/es/components/molecules/InputSearch/styled.js +6 -43
  165. package/es/components/molecules/Modal/Modal.js +23 -8
  166. package/es/components/molecules/Modal/styled.js +17 -69
  167. package/es/components/molecules/ModalV2/ModalV2.js +17 -6
  168. package/es/components/molecules/ModalV2/styled.js +6 -19
  169. package/es/components/molecules/Popconfirm/Popconfirm.js +1 -1
  170. package/es/components/molecules/PopupDraggable/PopupDraggable.js +25 -13
  171. package/es/components/molecules/PopupDraggable/styled.js +11 -47
  172. package/es/components/molecules/PreviewModal/PreviewModal.js +16 -5
  173. package/es/components/molecules/PreviewModal/styled.js +9 -30
  174. package/es/components/molecules/RadioGroup/index.js +14 -3
  175. package/es/components/molecules/RadioGroup/styled.js +7 -11
  176. package/es/components/molecules/ResizeGrid/ResizeGrid.js +338 -275
  177. package/es/components/molecules/ResizeGrid/components/Cell/Cell.js +37 -23
  178. package/es/components/molecules/ResizeGrid/components/Cell/styled.js +6 -78
  179. package/es/components/molecules/ResizeGrid/constant.js +37 -26
  180. package/es/components/molecules/ResizeGrid/styled.js +9 -54
  181. package/es/components/molecules/Result/Result.js +1 -1
  182. package/es/components/molecules/RichMenuBlock/RichMenuBlock.js +34 -23
  183. package/es/components/molecules/RichMenuBlock/RichMenuCell/index.js +11 -11
  184. package/es/components/molecules/RichMenuBlock/RichMenuCell/styled.js +18 -34
  185. package/es/components/molecules/RichMenuBlock/constants.js +1 -1
  186. package/es/components/molecules/RichMenuBlock/styled.js +16 -15
  187. package/es/components/molecules/RichMenuChatBar/RichMenuChatBar.js +17 -6
  188. package/es/components/molecules/RichMenuChatBar/TypingChat/index.js +3 -3
  189. package/es/components/molecules/RichMenuChatBar/TypingChat/styled.js +8 -43
  190. package/es/components/molecules/RichMenuChatBar/styled.js +10 -25
  191. package/es/components/molecules/RichMenuMobileView/RichMenuMobileView.js +22 -7
  192. package/es/components/molecules/RichMenuMobileView/styled.js +11 -18
  193. package/es/components/molecules/Select/Select.js +20 -9
  194. package/es/components/molecules/Select/Test.js +2 -2
  195. package/es/components/molecules/Select/styled.js +7 -34
  196. package/es/components/molecules/SettingWrapper/index.js +2 -2
  197. package/es/components/molecules/SettingWrapper/styled.js +9 -15
  198. package/es/components/molecules/SettingWrapperPopover/index.js +16 -4
  199. package/es/components/molecules/SliderWithInputNumber/index.js +19 -8
  200. package/es/components/molecules/SliderWithInputNumber/styled.js +6 -3
  201. package/es/components/molecules/TextDecorationSelect/constants.js +1 -1
  202. package/es/components/molecules/TextDecorationSelect/index.js +32 -9
  203. package/es/components/molecules/TextTransformSelect/constants.js +1 -1
  204. package/es/components/molecules/TextTransformSelect/index.js +32 -9
  205. package/es/components/molecules/TreeSelect/TreeSelect.js +1 -1
  206. package/es/components/molecules/UploadImage/MediaIcon.js +2 -2
  207. package/es/components/molecules/UploadImage/index.js +280 -182
  208. package/es/components/molecules/UploadImage/styled.js +16 -129
  209. package/es/components/organism/Help/Help.js +530 -422
  210. package/es/components/organism/Help/constants.js +12 -11
  211. package/es/components/organism/Help/styled.js +48 -257
  212. package/es/components/organism/Help/utils.js +11 -11
  213. package/es/components/organism/PositionSetting/config.js +2 -2
  214. package/es/components/organism/PositionSetting/index.js +27 -15
  215. package/es/components/organism/PositionSetting/styled.js +6 -1
  216. package/es/components/organism/Table/CrossTabTable/CrossTabTable.js +10 -10
  217. package/es/components/organism/Table/CrossTabTable/components/CustomCell/CustomCell.js +6 -6
  218. package/es/components/organism/Table/CrossTabTable/components/CustomCell/styled.js +6 -12
  219. package/es/components/organism/Table/CrossTabTable/constants.js +3 -3
  220. package/es/components/organism/Table/CrossTabTable/styled.js +6 -12
  221. package/es/components/organism/Table/CrossTabTable/utils.js +1 -1
  222. package/es/components/organism/Table/ExplorePivotTable/ExplorePivotTable.js +23 -12
  223. package/es/components/organism/Table/ExplorePivotTable/components/CustomCell/CustomCell.js +8 -8
  224. package/es/components/organism/Table/ExplorePivotTable/components/CustomCell/styled.js +8 -20
  225. package/es/components/organism/Table/ExplorePivotTable/constants.js +2 -2
  226. package/es/components/organism/Table/ExplorePivotTable/styled.js +7 -13
  227. package/es/components/organism/Table/ExplorePivotTable/utils.js +72 -52
  228. package/es/constants/gradientSetting.js +4 -4
  229. package/es/constants/keyCode.js +387 -387
  230. package/es/constants/richMenu.js +2 -2
  231. package/es/constants/storybook.js +2 -2
  232. package/es/constants/theme.js +6 -6
  233. package/es/hooks/index.js +1 -1
  234. package/es/hooks/useDebounce.js +5 -5
  235. package/es/hooks/useDeepCompareEffect.js +1 -1
  236. package/es/locales/i18n.js +2 -2
  237. package/es/locales/translations.js +23 -7
  238. package/es/models/SavedImage.js +68 -23
  239. package/es/models/Upload.js +64 -19
  240. package/es/models/model.js +5 -3
  241. package/es/services/MediaTemplateDesign/UploadFile/index.js +102 -46
  242. package/es/services/Ticket.js +89 -48
  243. package/es/services/constants.js +3 -3
  244. package/es/services/index.js +30 -19
  245. package/es/test.js +36 -25
  246. package/es/utils/color.js +22 -22
  247. package/es/utils/common.js +88 -75
  248. package/es/utils/handleError.js +49 -8
  249. package/es/utils/loadable.js +18 -6
  250. package/es/utils/web.js +26 -20
  251. package/package.json +3 -3
  252. package/dist/02028cc6be94478e1f13.svg +0 -1
  253. package/dist/0dfb9214dfd945cd7290.png +0 -1
  254. package/dist/19a777928d8a4fb24864.svg +0 -1
  255. package/dist/256cc472918edbfc13f3.ttf +0 -0
  256. package/dist/42deb30bedf71d95ec56.woff +0 -0
  257. package/dist/574b7bee0563a9fe9a29.png +0 -1
  258. package/dist/a772098db05052e4b517.eot +0 -0
  259. package/dist/bc6bf11c6f5e6743aa4c.png +0 -1
  260. package/dist/e32f09119052a55cce3c.png +0 -1
  261. package/dist/e3851b9384a984c6fdb5.png +0 -1
  262. package/dist/f422f99dc05cb0013092.png +0 -1
  263. package/dist/index.js +0 -2
  264. package/dist/index.js.LICENSE.txt +0 -69
  265. package/dist/main.css +0 -69
  266. package/dist/public/icons/2d496b55d85a9545d7311c073af442bb.png +0 -0
  267. package/dist/public/icons/2fbb4e0927d18e3f8e5c6511ab88d5b3.png +0 -0
  268. package/dist/public/icons/84d7dd910e6235dc6ce60657dd3bb062.svg +0 -87
  269. package/dist/public/icons/90553767e0a05b9585a54797cfd9ce51.png +0 -0
  270. package/dist/public/icons/97210ba7dc321670f4a144c1b40e88d8.png +0 -0
  271. package/dist/public/icons/d327b24e9c5d8f486f08d253aab58ce6.png +0 -0
  272. package/dist/public/icons/f1cf266d0a0a53ce07f2dbb859869b7a.png +0 -0
  273. package/dist/public/icons/fe347d51ab67ec846138b9a565b3071b.svg +0 -361
  274. package/dist/public/icons/iphone-top-bar.png +0 -0
  275. package/dist/public/icons/iphone.png +0 -0
  276. package/dist/public/icons/placeholder-image.png +0 -0
  277. package/dist/public/icons/stars_slider.png +0 -0
  278. package/dist/public/icons/transparent.svg +0 -1
@@ -1,3 +1,14 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
1
12
  // Libraries
2
13
  import React, { useState, useLayoutEffect, useEffect, useRef, useCallback, } from 'react';
3
14
  import classnames from 'classnames';
@@ -11,53 +22,54 @@ import { getObjectPropSafely, random, safeParse } from '@antscorp/antsomi-ui/es/
11
22
  import { convertBreakTag, convertDivToBreakTag, convertHtmlText, genShortLinkValue, getInsertLinkPatternWithAppendSpaceEnd, handleUpdateInputPersonalization, initialValue, pasteHtmlAtCaret, removeHtmlTag, spacingNonTracking, validateHTMLTags, } from './utils';
12
23
  // Hooks
13
24
  import { useDebounce } from '@antscorp/antsomi-ui/es/hooks/useDebounce';
14
- const PATH = 'src/components/atoms/InputDynamic/InputDynamic.tsx';
15
- const defaultProps = {
25
+ var PATH = 'src/components/atoms/InputDynamic/InputDynamic.tsx';
26
+ var defaultProps = {
16
27
  value: '',
17
28
  isViewMode: false,
18
29
  errors: [],
19
30
  canMultipleLine: false,
20
- onError: () => { },
21
- onChange: () => { },
22
- addMessageToQueue: () => { },
31
+ onError: function () { },
32
+ onChange: function () { },
33
+ addMessageToQueue: function () { },
23
34
  };
24
- export const InputDynamic = (props) => {
25
- const { value, isViewMode, errors, disabledOpts, canMultipleLine, onError, onChange, addMessageToQueue, } = props;
35
+ export var InputDynamic = function (props) {
36
+ var value = props.value, isViewMode = props.isViewMode, errors = props.errors, disabledOpts = props.disabledOpts, canMultipleLine = props.canMultipleLine, onError = props.onError, onChange = props.onChange, addMessageToQueue = props.addMessageToQueue;
26
37
  // States
27
- const [textValue, setTextValue] = useState(initialValue(value));
28
- const [initSelectedProperties, setInitSelectedProperties] = useState({
38
+ var _a = useState(initialValue(value)), textValue = _a[0], setTextValue = _a[1];
39
+ var _b = useState({
29
40
  keyTag: 'shortlink_static',
30
41
  link: '',
31
42
  urlDetected: '',
32
- });
33
- const [popoverOpenShortLink, setPopoverOpenShortLink] = useState(false);
34
- const [tooltipHoverDebounce, _tooltipHover, setTooltipHover] = useDebounce({ x: 0, y: 0 }, 200);
43
+ }), initSelectedProperties = _b[0], setInitSelectedProperties = _b[1];
44
+ var _c = useState(false), popoverOpenShortLink = _c[0], setPopoverOpenShortLink = _c[1];
45
+ var _d = useDebounce({ x: 0, y: 0 }, 200), tooltipHoverDebounce = _d[0], _tooltipHover = _d[1], setTooltipHover = _d[2];
35
46
  // Refs
36
- const caretPositionRef = useRef(null);
37
- const personalizationInputRef = useRef(null);
38
- const onTriggerChange = (event = null) => {
47
+ var caretPositionRef = useRef(null);
48
+ var personalizationInputRef = useRef(null);
49
+ var onTriggerChange = function (event) {
39
50
  var _a;
51
+ if (event === void 0) { event = null; }
40
52
  try {
41
- let tmp = (_a = personalizationInputRef.current) === null || _a === void 0 ? void 0 : _a.innerHTML;
53
+ var tmp = (_a = personalizationInputRef.current) === null || _a === void 0 ? void 0 : _a.innerHTML;
42
54
  if (event !== null) {
43
55
  caretPositionRef.current = CaretPositioning.saveSelection(event.currentTarget);
44
56
  tmp = event.currentTarget.innerHTML;
45
57
  }
46
58
  tmp = tmp === null || tmp === void 0 ? void 0 : tmp.replace(
47
59
  // replace old non tracking url to detect url
48
- /<button(?=[^>]*class="insert-word")[^>]*value=['"]#(?:{nontrackurl\()?(https?:\/\/[0-9a-zA-Z-{}|"\./?_=&%:#*@;]+)(?:\)})?['"][^>]*>.*?<\/button>/g, match => {
49
- const url = match.match(/(https?:\/\/[0-9a-zA-Z-\./?_=&%:#*@;]+)/);
60
+ /<button(?=[^>]*class="insert-word")[^>]*value=['"]#(?:{nontrackurl\()?(https?:\/\/[0-9a-zA-Z-{}|"\./?_=&%:#*@;]+)(?:\)})?['"][^>]*>.*?<\/button>/g, function (match) {
61
+ var url = match.match(/(https?:\/\/[0-9a-zA-Z-\./?_=&%:#*@;]+)/);
50
62
  if (url) {
51
- return `<span id="${random(5)}" class="detect-url">${url[1]}</span>`;
63
+ return "<span id=\"".concat(random(5), "\" class=\"detect-url\">").concat(url[1], "</span>");
52
64
  }
53
65
  return match; // If no match found, return the original string
54
66
  }).replace(
55
67
  // replace url to detect url
56
- /((?<!class="detect-url">|#{shortlink(?:_static)?\(|<span style="line-height: 20px;margin-right: 8px;pointer-events:none;">)\bhttps*:\/\/[0-9a-zA-Z-{}|"\./?_=&%:#*@;]+)/g, match => `<span id="${random(5)}" class="detect-url">${match}</span>`);
68
+ /((?<!class="detect-url">|#{shortlink(?:_static)?\(|<span style="line-height: 20px;margin-right: 8px;pointer-events:none;">)\bhttps*:\/\/[0-9a-zA-Z-{}|"\./?_=&%:#*@;]+)/g, function (match) { return "<span id=\"".concat(random(5), "\" class=\"detect-url\">").concat(match, "</span>"); });
57
69
  tmp = convertDivToBreakTag(tmp);
58
70
  setTextValue(tmp);
59
- const text = convertHtmlText(tmp, 'raw', {}, {}, 'input', 'add');
60
- const textConverted = convertBreakTag(text);
71
+ var text = convertHtmlText(tmp, 'raw', {}, {}, 'input', 'add');
72
+ var textConverted = convertBreakTag(text);
61
73
  onChange(removeHtmlTag(textConverted));
62
74
  }
63
75
  catch (error) {
@@ -72,22 +84,22 @@ export const InputDynamic = (props) => {
72
84
  console.error(error);
73
85
  }
74
86
  };
75
- const callback = (type, data) => {
87
+ var callback = function (type, data) {
76
88
  var _a, _b;
77
89
  switch (type) {
78
90
  case 'REPLACE_DETECTED_URL': {
79
- const innerHTML = getObjectPropSafely(() => { var _a; return (_a = personalizationInputRef.current) === null || _a === void 0 ? void 0 : _a.innerHTML; }, '');
91
+ var innerHTML = getObjectPropSafely(function () { var _a; return (_a = personalizationInputRef.current) === null || _a === void 0 ? void 0 : _a.innerHTML; }, '');
80
92
  if (innerHTML) {
81
93
  // remove span url và focus vào vị trí remove để add tag shortlink vào vị trí này.
82
- const index = Array.from((_a = personalizationInputRef.current) === null || _a === void 0 ? void 0 : _a.childNodes).findIndex((element) => element.id === data.id);
83
- const range = document.createRange(); // Tạo một đối tượng Range
84
- const sel = window.getSelection(); // Lấy đối tượng Selection hiện tại
94
+ var index = Array.from((_a = personalizationInputRef.current) === null || _a === void 0 ? void 0 : _a.childNodes).findIndex(function (element) { return element.id === data.id; });
95
+ var range = document.createRange(); // Tạo một đối tượng Range
96
+ var sel = window.getSelection(); // Lấy đối tượng Selection hiện tại
85
97
  range.setStart((_b = personalizationInputRef.current) === null || _b === void 0 ? void 0 : _b.childNodes[index], 0); // Đặt điểm bắt đầu của Range
86
98
  range.collapse(true); // Thu gọn Range để tập trung vào điểm bắt đầu
87
99
  sel === null || sel === void 0 ? void 0 : sel.removeAllRanges(); // Xóa tất cả các Range hiện có
88
100
  sel === null || sel === void 0 ? void 0 : sel.addRange(range); // Thêm Range mới vào Selection
89
101
  caretPositionRef.current = CaretPositioning.saveSelection(personalizationInputRef.current);
90
- const newDataUpdate = innerHTML.replace(data.outerHTML, '');
102
+ var newDataUpdate = innerHTML.replace(data.outerHTML, '');
91
103
  personalizationInputRef.current.innerHTML = newDataUpdate;
92
104
  }
93
105
  break;
@@ -96,17 +108,17 @@ export const InputDynamic = (props) => {
96
108
  break;
97
109
  }
98
110
  };
99
- const onPaste = (e) => {
111
+ var onPaste = function (e) {
100
112
  // cancel paste
101
113
  e.preventDefault();
102
114
  // get text representation of clipboard
103
- const text = (e.originalEvent || e).clipboardData.getData('text/plain');
115
+ var text = (e.originalEvent || e).clipboardData.getData('text/plain');
104
116
  // insert text manually
105
117
  document.execCommand('insertHTML', false, text);
106
118
  };
107
- const handleInsertSortLink = (url, type) => {
119
+ var handleInsertSortLink = function (url, type) {
108
120
  try {
109
- const { id, value: linkValue, label: linkLabel } = genShortLinkValue(url, type);
121
+ var _a = genShortLinkValue(url, type), id = _a.id, linkValue = _a.value, linkLabel = _a.label;
110
122
  setPopoverOpenShortLink(false);
111
123
  if (personalizationInputRef.current instanceof HTMLElement) {
112
124
  CaretPositioning.restoreSelection(personalizationInputRef.current, caretPositionRef.current);
@@ -126,21 +138,21 @@ export const InputDynamic = (props) => {
126
138
  }
127
139
  }
128
140
  };
129
- const handleKeyPress = (e) => {
141
+ var handleKeyPress = function (e) {
130
142
  if (canMultipleLine)
131
143
  return;
132
144
  if (+e.charCode === 13) {
133
145
  e.preventDefault();
134
146
  }
135
147
  };
136
- const getDangerouslySetInnerHTML = (text) => {
148
+ var getDangerouslySetInnerHTML = function (text) {
137
149
  if (text) {
138
- const regex = /<[^<>]+>/g;
139
- let tag;
150
+ var regex = /<[^<>]+>/g;
151
+ var tag = void 0;
140
152
  // eslint-disable-next-line no-cond-assign
141
153
  while ((tag = regex.exec(text))) {
142
154
  if (!validateHTMLTags.isValidTag(tag[0])) {
143
- const finalTag = tag[0].replace('<', '&#60').replace('>', '&#62');
155
+ var finalTag = tag[0].replace('<', '&#60').replace('>', '&#62');
144
156
  text = text.replace(tag[0], finalTag);
145
157
  }
146
158
  }
@@ -152,22 +164,22 @@ export const InputDynamic = (props) => {
152
164
  }
153
165
  return '';
154
166
  };
155
- const toggleShortLinkModal = useCallback(() => {
167
+ var toggleShortLinkModal = useCallback(function () {
156
168
  setPopoverOpenShortLink(!popoverOpenShortLink);
157
169
  }, [popoverOpenShortLink]);
158
170
  /**
159
171
  * [NOTE:open shortlink modal to edit]
160
172
  */
161
- useEffect(() => {
162
- const handleClickTag = (e) => {
173
+ useEffect(function () {
174
+ var handleClickTag = function (e) {
163
175
  try {
164
176
  e.stopPropagation();
165
177
  if (e.target) {
166
- const { value = '' } = e.target;
167
- const shortLink = value.replace(/#|{|}|/g, '').split('(');
168
- if (shortLink && shortLink.length >= 2) {
169
- const link = shortLink[1].substring(0, shortLink[1].length - 1) || '';
170
- setInitSelectedProperties(prev => (Object.assign(Object.assign({}, prev), { link, keyTag: shortLink[0], urlDetected: e.currentTarget })));
178
+ var _a = e.target.value, value_1 = _a === void 0 ? '' : _a;
179
+ var shortLink_1 = value_1.replace(/#|{|}|/g, '').split('(');
180
+ if (shortLink_1 && shortLink_1.length >= 2) {
181
+ var link_1 = shortLink_1[1].substring(0, shortLink_1[1].length - 1) || '';
182
+ setInitSelectedProperties(function (prev) { return (__assign(__assign({}, prev), { link: link_1, keyTag: shortLink_1[0], urlDetected: e.currentTarget })); });
171
183
  toggleShortLinkModal();
172
184
  }
173
185
  }
@@ -177,75 +189,77 @@ export const InputDynamic = (props) => {
177
189
  console.log('err', err);
178
190
  }
179
191
  };
180
- const listTags = Array.from(document.querySelectorAll('#ants-ui-input-personalization .input-personal .insert-word'));
192
+ var listTags = Array.from(document.querySelectorAll('#ants-ui-input-personalization .input-personal .insert-word'));
181
193
  if (listTags && listTags.length > 0) {
182
- listTags.forEach((tag) => {
194
+ listTags.forEach(function (tag) {
183
195
  tag.addEventListener('click', handleClickTag);
184
196
  });
185
197
  }
186
- return () => {
187
- listTags.forEach((tag) => {
198
+ return function () {
199
+ listTags.forEach(function (tag) {
188
200
  tag.removeEventListener('click', handleClickTag);
189
201
  });
190
202
  };
191
203
  }, [textValue, toggleShortLinkModal]);
192
204
  /** Anchor tooltip */
193
- useEffect(() => {
194
- let listElement = [];
195
- const handleMouseOver = (e, targetRect) => {
205
+ useEffect(function () {
206
+ var listElement = [];
207
+ var handleMouseOver = function (e, targetRect) {
196
208
  e === null || e === void 0 ? void 0 : e.stopPropagation();
197
- const viewportTop = window.pageYOffset;
198
- const viewportLeft = window.pageXOffset;
199
- const offsetWidth = targetRect.width / 2;
200
- const offsetHeight = targetRect.height / 2;
201
- const tooltipHeight = 16;
202
- const x = targetRect.left - viewportLeft + offsetWidth;
203
- const y = targetRect.top - viewportTop - offsetHeight - tooltipHeight;
209
+ var viewportTop = window.pageYOffset;
210
+ var viewportLeft = window.pageXOffset;
211
+ var offsetWidth = targetRect.width / 2;
212
+ var offsetHeight = targetRect.height / 2;
213
+ var tooltipHeight = 16;
214
+ var x = targetRect.left - viewportLeft + offsetWidth;
215
+ var y = targetRect.top - viewportTop - offsetHeight - tooltipHeight;
204
216
  setTooltipHover({
205
- x,
206
- y,
217
+ x: x,
218
+ y: y,
207
219
  });
208
220
  };
209
- const handleMouseOut = (e) => {
221
+ var handleMouseOut = function (e) {
210
222
  e === null || e === void 0 ? void 0 : e.stopPropagation();
211
223
  setTooltipHover({ x: 0, y: 0 });
212
224
  };
213
- const handleClickDetectUrl = (e) => {
225
+ var handleClickDetectUrl = function (e) {
214
226
  e === null || e === void 0 ? void 0 : e.stopPropagation();
215
- setInitSelectedProperties(prev => {
227
+ setInitSelectedProperties(function (prev) {
216
228
  var _a;
217
- return (Object.assign(Object.assign({}, prev), { link: ((_a = e === null || e === void 0 ? void 0 : e.currentTarget) === null || _a === void 0 ? void 0 : _a.textContent) || '', urlDetected: e === null || e === void 0 ? void 0 : e.currentTarget }));
229
+ return (__assign(__assign({}, prev), { link: ((_a = e === null || e === void 0 ? void 0 : e.currentTarget) === null || _a === void 0 ? void 0 : _a.textContent) || '', urlDetected: e === null || e === void 0 ? void 0 : e.currentTarget }));
218
230
  });
219
231
  toggleShortLinkModal();
220
232
  };
221
233
  if (!isViewMode) {
222
- const elements = document.querySelectorAll('#ants-ui-input-personalization .detect-url');
234
+ var elements = document.querySelectorAll('#ants-ui-input-personalization .detect-url');
223
235
  listElement = Array.from(elements);
224
236
  if (listElement.length) {
225
- listElement.forEach((element) => {
226
- element.addEventListener('mouseover', e => handleMouseOver(e, element.getBoundingClientRect()));
237
+ listElement.forEach(function (element) {
238
+ element.addEventListener('mouseover', function (e) {
239
+ return handleMouseOver(e, element.getBoundingClientRect());
240
+ });
227
241
  element.addEventListener('mouseout', handleMouseOut);
228
242
  /** Open shortlink modal */
229
243
  element.addEventListener('click', handleClickDetectUrl);
230
244
  });
231
245
  }
232
246
  }
233
- return () => {
234
- listElement.forEach((element) => {
247
+ return function () {
248
+ listElement.forEach(function (element) {
235
249
  element.removeEventListener('mouseover', handleMouseOver);
236
250
  element.removeEventListener('mouseout', handleMouseOut);
237
251
  });
238
252
  };
239
253
  }, [textValue, isViewMode, setTooltipHover, toggleShortLinkModal]);
240
254
  /** Style & remove for tag shortlink button & icon remove */
241
- useLayoutEffect(() => {
255
+ useLayoutEffect(function () {
242
256
  // get button Els [x] to create hover and style it
243
- const iconRemoveEls = document.querySelectorAll('.editor-icon-remove');
244
- const listIconRemove = iconRemoveEls && Array.from(iconRemoveEls);
257
+ var iconRemoveEls = document.querySelectorAll('.editor-icon-remove');
258
+ var listIconRemove = iconRemoveEls && Array.from(iconRemoveEls);
245
259
  // get button elements
246
- const buttonElement = document.querySelectorAll('.insert-word');
247
- const listBtnElement = buttonElement && Array.from(buttonElement);
248
- const handleRemoveTag = (e) => {
260
+ var buttonElement = document.querySelectorAll('.insert-word');
261
+ var listBtnElement = buttonElement && Array.from(buttonElement);
262
+ var handleRemoveTag = function (e) {
249
263
  var _a, _b, _c, _d, _e;
250
264
  if (e && ((_a = e.target) === null || _a === void 0 ? void 0 : _a.nodeName) === 'EM' && ((_b = e.target) === null || _b === void 0 ? void 0 : _b.className) === 'editor-icon-remove') {
251
265
  e.stopPropagation();
@@ -253,17 +267,17 @@ export const InputDynamic = (props) => {
253
267
  setTextValue(personalizationInputRef && ((_e = personalizationInputRef.current) === null || _e === void 0 ? void 0 : _e.innerHTML));
254
268
  }
255
269
  };
256
- listIconRemove.forEach(eachIcon => {
270
+ listIconRemove.forEach(function (eachIcon) {
257
271
  eachIcon.addEventListener('click', handleRemoveTag);
258
272
  });
259
273
  handleUpdateInputPersonalization(listIconRemove, listBtnElement);
260
- return () => {
261
- listIconRemove.forEach(eachIcon => {
274
+ return function () {
275
+ listIconRemove.forEach(function (eachIcon) {
262
276
  eachIcon.removeEventListener('click', handleRemoveTag);
263
277
  });
264
278
  };
265
279
  }, [textValue]);
266
- useLayoutEffect(() => {
280
+ useLayoutEffect(function () {
267
281
  try {
268
282
  // save caret position
269
283
  if (!personalizationInputRef.current) {
@@ -297,12 +311,12 @@ export const InputDynamic = (props) => {
297
311
  'input-wrapper-outter': true,
298
312
  'styles-input-wrapper': !isViewMode,
299
313
  'input-error': (errors === null || errors === void 0 ? void 0 : errors.length) && (errors === null || errors === void 0 ? void 0 : errors.length) > 0,
300
- }), style: Object.assign(Object.assign({}, (isViewMode && {
314
+ }), style: __assign(__assign({}, (isViewMode && {
301
315
  padding: 0,
302
316
  minHeight: 0,
303
317
  fontSize: 12,
304
318
  border: 'none',
305
- })), { width: '100%' }), onClick: () => { var _a; return (_a = personalizationInputRef.current) === null || _a === void 0 ? void 0 : _a.focus(); } },
319
+ })), { width: '100%' }), onClick: function () { var _a; return (_a = personalizationInputRef.current) === null || _a === void 0 ? void 0 : _a.focus(); } },
306
320
  React.createElement("div", { className: "input-personal", style: {
307
321
  display: textValue && textValue !== '<br>' ? 'inline-block' : undefined,
308
322
  }, contentEditable: !isViewMode, onBlur: onTriggerChange, onKeyPress: handleKeyPress, ref: personalizationInputRef,
@@ -310,7 +324,7 @@ export const InputDynamic = (props) => {
310
324
  dangerouslySetInnerHTML: {
311
325
  __html: getDangerouslySetInnerHTML(textValue),
312
326
  }, onPaste: onPaste }),
313
- React.createElement(Icon, { type: "icon-ants-search-2", onClick: e => {
327
+ React.createElement(Icon, { type: "icon-ants-search-2", onClick: function (e) {
314
328
  e.stopPropagation();
315
329
  toggleShortLinkModal();
316
330
  }, className: "customize-antsomi-profile", style: { width: 24, height: 24 } })),
@@ -10,7 +10,7 @@ import { Radio } from '../Radio';
10
10
  import { InputShortLink, InputWrapper } from './styled';
11
11
  // Utils
12
12
  import { validateURL } from './utils';
13
- const OPTIONS = [
13
+ var OPTIONS = [
14
14
  {
15
15
  value: 'individual',
16
16
  label: 'Individual',
@@ -20,49 +20,50 @@ const OPTIONS = [
20
20
  label: 'General',
21
21
  },
22
22
  ];
23
- export const PopupShortLink = props => {
24
- const { open, onClose, onOk, disabledOpts, initSelectedProperties, callback } = props;
25
- const [state, setState] = useImmer({
23
+ export var PopupShortLink = function (props) {
24
+ var open = props.open, onClose = props.onClose, onOk = props.onOk, disabledOpts = props.disabledOpts, initSelectedProperties = props.initSelectedProperties, callback = props.callback;
25
+ var _a = useImmer({
26
26
  link: '',
27
27
  type: 'individual',
28
28
  error: '',
29
- });
30
- useEffect(() => {
31
- let type = 'individual';
29
+ }), state = _a[0], setState = _a[1];
30
+ useEffect(function () {
31
+ var type = 'individual';
32
32
  if (initSelectedProperties && initSelectedProperties.keyTag) {
33
33
  type = initSelectedProperties.keyTag === 'shortlink' ? 'individual' : 'general';
34
34
  }
35
- setState(draft => {
35
+ setState(function (draft) {
36
36
  draft.link = initSelectedProperties.link;
37
37
  draft.type = type;
38
38
  });
39
39
  }, [initSelectedProperties, setState]);
40
- const handleClose = () => {
41
- setState(draft => {
40
+ var handleClose = function () {
41
+ setState(function (draft) {
42
42
  draft.link = '';
43
43
  draft.error = '';
44
44
  });
45
45
  if (onClose)
46
46
  onClose();
47
47
  };
48
- const handleValidate = ({ urlString = state.link, afterValidate }) => {
49
- const isValid = validateURL(urlString);
50
- setState(draft => {
48
+ var handleValidate = function (_a) {
49
+ var _b = _a.urlString, urlString = _b === void 0 ? state.link : _b, afterValidate = _a.afterValidate;
50
+ var isValid = validateURL(urlString);
51
+ setState(function (draft) {
51
52
  draft.error = isValid ? '' : 'Invalid URL';
52
53
  });
53
54
  if (typeof afterValidate === 'function')
54
55
  afterValidate(isValid);
55
56
  };
56
- const handleOnChange = (value) => {
57
+ var handleOnChange = function (value) {
57
58
  if (state.error)
58
59
  handleValidate({ urlString: value });
59
- setState(draft => {
60
+ setState(function (draft) {
60
61
  draft.link = value;
61
62
  });
62
63
  };
63
- const handleOnOK = () => {
64
+ var handleOnOK = function () {
64
65
  handleValidate({
65
- afterValidate: (isValid) => {
66
+ afterValidate: function (isValid) {
66
67
  if (isValid && onOk) {
67
68
  if (initSelectedProperties.urlDetected) {
68
69
  callback('REPLACE_DETECTED_URL', initSelectedProperties.urlDetected);
@@ -73,8 +74,8 @@ export const PopupShortLink = props => {
73
74
  },
74
75
  });
75
76
  };
76
- const onChangeType = (event) => {
77
- setState(draft => {
77
+ var onChangeType = function (event) {
78
+ setState(function (draft) {
78
79
  draft.type = event.target.value;
79
80
  });
80
81
  };
@@ -86,7 +87,7 @@ export const PopupShortLink = props => {
86
87
  React.createElement(Col, { span: 6 },
87
88
  React.createElement("span", { style: { fontSize: 12, color: '#000' } }, "Short link type")),
88
89
  React.createElement(Col, { span: 18 },
89
- React.createElement(Radio.Group, { onChange: onChangeType, value: state.type }, OPTIONS.map(each => (React.createElement(Radio, { key: each.value, disabled: disabledOpts && disabledOpts[each.value], name: "shortlink-type", value: each.value }, each.label)))))),
90
+ React.createElement(Radio.Group, { onChange: onChangeType, value: state.type }, OPTIONS.map(function (each) { return (React.createElement(Radio, { key: each.value, disabled: disabledOpts && disabledOpts[each.value], name: "shortlink-type", value: each.value }, each.label)); })))),
90
91
  React.createElement(Row, null,
91
92
  React.createElement(Col, { span: 24 },
92
93
  React.createElement(InputWrapper, null,