@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,4 +1,4 @@
1
- export const AREA_LAYOUT_KEYS = {
1
+ export var AREA_LAYOUT_KEYS = {
2
2
  LAYOUT_1: 'LAYOUT_1',
3
3
  LAYOUT_2: 'LAYOUT_2',
4
4
  LAYOUT_3: 'LAYOUT_3',
@@ -12,7 +12,7 @@ export const AREA_LAYOUT_KEYS = {
12
12
  LAYOUT_11: 'LAYOUT_11',
13
13
  LAYOUT_12: 'LAYOUT_12',
14
14
  };
15
- export const BLOCK_KEYS = {
15
+ export var BLOCK_KEYS = {
16
16
  RICH_MENU: 'RICH_MENU',
17
17
  CELL_ACTION: 'CELL_ACTION',
18
18
  CELL_IMAGE: 'CELL_IMAGE',
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export const TABLE_API_COLUMNS = [
2
+ export var TABLE_API_COLUMNS = [
3
3
  {
4
4
  title: 'Property',
5
5
  dataIndex: 'property',
@@ -14,7 +14,7 @@ export const TABLE_API_COLUMNS = [
14
14
  title: 'Type',
15
15
  dataIndex: 'type',
16
16
  key: 'type',
17
- render: text => React.createElement("a", { style: { color: 'magenta' } }, text),
17
+ render: function (text) { return React.createElement("a", { style: { color: 'magenta' } }, text); },
18
18
  },
19
19
  {
20
20
  title: 'Default',
@@ -2,10 +2,10 @@ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
2
2
  // Types
3
3
  import { theme } from 'antd';
4
4
  // Variables
5
- const { defaultAlgorithm, defaultSeed } = theme;
6
- const mapToken = defaultAlgorithm(defaultSeed);
7
- const { gold1, gold6 } = mapToken;
8
- export const THEME = {
5
+ var defaultAlgorithm = theme.defaultAlgorithm, defaultSeed = theme.defaultSeed;
6
+ var mapToken = defaultAlgorithm(defaultSeed);
7
+ var gold1 = mapToken.gold1, gold6 = mapToken.gold6;
8
+ export var THEME = {
9
9
  token: {
10
10
  colorText: '#000000',
11
11
  colorTextBase: '#222222',
@@ -67,8 +67,8 @@ export const THEME = {
67
67
  accent6: '#f2f2f2',
68
68
  accent7: '#cccccc',
69
69
  gray5: '#d9d9d9',
70
- gold1,
71
- gold6,
70
+ gold1: gold1,
71
+ gold6: gold6,
72
72
  scrollBarSize: '8px',
73
73
  },
74
74
  };
package/es/hooks/index.js CHANGED
@@ -7,7 +7,7 @@ function deepCompareEquals(a, b) {
7
7
  return isEqual(a, b);
8
8
  }
9
9
  function useDeepCompareMemoize(value) {
10
- const ref = useRef();
10
+ var ref = useRef();
11
11
  // it can be done by using useMemo as well
12
12
  // but useRef is rather cleaner and easier
13
13
  if (!deepCompareEquals(value, ref.current)) {
@@ -1,12 +1,12 @@
1
1
  import { useState, useEffect } from 'react';
2
2
  function useDebounce(initialValue, time) {
3
- const [value, setValue] = useState(initialValue);
4
- const [debouncedValue, setDebouncedValue] = useState(initialValue);
5
- useEffect(() => {
6
- const debounce = setTimeout(() => {
3
+ var _a = useState(initialValue), value = _a[0], setValue = _a[1];
4
+ var _b = useState(initialValue), debouncedValue = _b[0], setDebouncedValue = _b[1];
5
+ useEffect(function () {
6
+ var debounce = setTimeout(function () {
7
7
  setDebouncedValue(value);
8
8
  }, time);
9
- return () => {
9
+ return function () {
10
10
  clearTimeout(debounce);
11
11
  };
12
12
  }, [value, time]);
@@ -7,7 +7,7 @@ function deepCompareEquals(a, b) {
7
7
  return isEqual(a, b);
8
8
  }
9
9
  function useDeepCompareMemoize(value) {
10
- const ref = useRef();
10
+ var ref = useRef();
11
11
  // it can be done by using useMemo as well
12
12
  // but useRef is rather cleaner and easier
13
13
  if (!deepCompareEquals(value, ref.current)) {
@@ -4,7 +4,7 @@ import LanguageDetector from 'i18next-browser-languagedetector';
4
4
  import en from './en/translation.json';
5
5
  import vi from './vi/translation.json';
6
6
  import { convertLanguageJsonToObject } from './translations';
7
- export const translationsJson = {
7
+ export var translationsJson = {
8
8
  en: {
9
9
  translation: en,
10
10
  },
@@ -16,7 +16,7 @@ export const translationsJson = {
16
16
  convertLanguageJsonToObject(en);
17
17
  // i18next
18
18
  // export const i18n = i18next
19
- const i18nInstance = i18next.createInstance();
19
+ var i18nInstance = i18next.createInstance();
20
20
  i18nInstance
21
21
  // pass the i18n instance to react-i18next.
22
22
  // .use(initReactI18next)
@@ -1,15 +1,25 @@
1
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
2
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
3
+ if (ar || !(i in from)) {
4
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
5
+ ar[i] = from[i];
6
+ }
7
+ }
8
+ return to.concat(ar || Array.prototype.slice.call(from));
9
+ };
1
10
  // Libraries
2
11
  import i18next from 'i18next';
3
- export const translations = {};
12
+ export var translations = {};
4
13
  /*
5
14
  * Converts the static JSON file into an object where keys are identical
6
15
  * but values are strings concatenated according to syntax.
7
16
  * This is helpful when using the JSON file keys and still having the intellisense support
8
17
  * along with type-safety
9
18
  */
10
- export const convertLanguageJsonToObject = (json, objToConvertTo = translations, current) => {
11
- Object.keys(json).forEach(key => {
12
- const currentLookupKey = current ? `${current}.${key}` : key;
19
+ export var convertLanguageJsonToObject = function (json, objToConvertTo, current) {
20
+ if (objToConvertTo === void 0) { objToConvertTo = translations; }
21
+ Object.keys(json).forEach(function (key) {
22
+ var currentLookupKey = current ? "".concat(current, ".").concat(key) : key;
13
23
  if (typeof json[key] === 'object') {
14
24
  objToConvertTo[key] = {};
15
25
  convertLanguageJsonToObject(json[key], objToConvertTo[key], currentLookupKey);
@@ -19,13 +29,19 @@ export const convertLanguageJsonToObject = (json, objToConvertTo = translations,
19
29
  }
20
30
  });
21
31
  };
22
- export const t = (id, ...rest) => {
32
+ export var t = function (id) {
33
+ var rest = [];
34
+ for (var _i = 1; _i < arguments.length; _i++) {
35
+ rest[_i - 1] = arguments[_i];
36
+ }
23
37
  if (!id) {
24
38
  id = '_NOT_TRANSLATED_';
25
39
  }
26
- return [id, ...rest];
40
+ return __spreadArray([id], rest, true);
27
41
  };
28
- export const getTranslateMessage = (id, defaultMessage = '', value = {}) => {
42
+ export var getTranslateMessage = function (id, defaultMessage, value) {
43
+ if (defaultMessage === void 0) { defaultMessage = ''; }
44
+ if (value === void 0) { value = {}; }
29
45
  try {
30
46
  return i18next.t(t(id, defaultMessage), value);
31
47
  }
@@ -1,26 +1,71 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
1
16
  import moment from 'moment';
2
17
  import { Model } from './model';
3
- export class SavedImage extends Model {
4
- get id() {
5
- return this.model.image_id || '';
18
+ var SavedImage = /** @class */ (function (_super) {
19
+ __extends(SavedImage, _super);
20
+ function SavedImage() {
21
+ return _super !== null && _super.apply(this, arguments) || this;
6
22
  }
7
- get name() {
8
- return this.model.image_name || '';
9
- }
10
- get url() {
11
- var _a;
12
- return ((_a = this.model.properties) === null || _a === void 0 ? void 0 : _a.url) || '';
13
- }
14
- get createdAt() {
15
- return moment(this.model.ctime, true).isValid() ? moment(this.model.ctime) : null;
16
- }
17
- get size() {
18
- var _a;
19
- return +(((_a = this.model.properties) === null || _a === void 0 ? void 0 : _a.size) || 0);
20
- }
21
- get sizeString() {
22
- const { properties } = this.model;
23
- const dimensionsFile = properties === null || properties === void 0 ? void 0 : properties.dimensions_file;
24
- return `${Math.round(10 * (((properties === null || properties === void 0 ? void 0 : properties.size) || 0) / 1024)) / 10} KB, ${dimensionsFile === null || dimensionsFile === void 0 ? void 0 : dimensionsFile.width} x ${dimensionsFile === null || dimensionsFile === void 0 ? void 0 : dimensionsFile.height} `;
25
- }
26
- }
23
+ Object.defineProperty(SavedImage.prototype, "id", {
24
+ get: function () {
25
+ return this.model.image_id || '';
26
+ },
27
+ enumerable: false,
28
+ configurable: true
29
+ });
30
+ Object.defineProperty(SavedImage.prototype, "name", {
31
+ get: function () {
32
+ return this.model.image_name || '';
33
+ },
34
+ enumerable: false,
35
+ configurable: true
36
+ });
37
+ Object.defineProperty(SavedImage.prototype, "url", {
38
+ get: function () {
39
+ var _a;
40
+ return ((_a = this.model.properties) === null || _a === void 0 ? void 0 : _a.url) || '';
41
+ },
42
+ enumerable: false,
43
+ configurable: true
44
+ });
45
+ Object.defineProperty(SavedImage.prototype, "createdAt", {
46
+ get: function () {
47
+ return moment(this.model.ctime, true).isValid() ? moment(this.model.ctime) : null;
48
+ },
49
+ enumerable: false,
50
+ configurable: true
51
+ });
52
+ Object.defineProperty(SavedImage.prototype, "size", {
53
+ get: function () {
54
+ var _a;
55
+ return +(((_a = this.model.properties) === null || _a === void 0 ? void 0 : _a.size) || 0);
56
+ },
57
+ enumerable: false,
58
+ configurable: true
59
+ });
60
+ Object.defineProperty(SavedImage.prototype, "sizeString", {
61
+ get: function () {
62
+ var properties = this.model.properties;
63
+ var dimensionsFile = properties === null || properties === void 0 ? void 0 : properties.dimensions_file;
64
+ return "".concat(Math.round(10 * (((properties === null || properties === void 0 ? void 0 : properties.size) || 0) / 1024)) / 10, " KB, ").concat(dimensionsFile === null || dimensionsFile === void 0 ? void 0 : dimensionsFile.width, " x ").concat(dimensionsFile === null || dimensionsFile === void 0 ? void 0 : dimensionsFile.height, " ");
65
+ },
66
+ enumerable: false,
67
+ configurable: true
68
+ });
69
+ return SavedImage;
70
+ }(Model));
71
+ export { SavedImage };
@@ -1,21 +1,66 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
1
16
  import { Model } from './model';
2
- export class Upload extends Model {
3
- get fileName() {
4
- return this.model.file_name;
17
+ var Upload = /** @class */ (function (_super) {
18
+ __extends(Upload, _super);
19
+ function Upload() {
20
+ return _super !== null && _super.apply(this, arguments) || this;
5
21
  }
6
- get file() {
7
- return this.model.file;
8
- }
9
- get url() {
10
- return this.model.url || '';
11
- }
12
- get extension() {
13
- return this.model.extension || '';
14
- }
15
- get dimensionsFile() {
16
- return this.model.dimensions_file;
17
- }
18
- get size() {
19
- return +(this.model.size || 0);
20
- }
21
- }
22
+ Object.defineProperty(Upload.prototype, "fileName", {
23
+ get: function () {
24
+ return this.model.file_name;
25
+ },
26
+ enumerable: false,
27
+ configurable: true
28
+ });
29
+ Object.defineProperty(Upload.prototype, "file", {
30
+ get: function () {
31
+ return this.model.file;
32
+ },
33
+ enumerable: false,
34
+ configurable: true
35
+ });
36
+ Object.defineProperty(Upload.prototype, "url", {
37
+ get: function () {
38
+ return this.model.url || '';
39
+ },
40
+ enumerable: false,
41
+ configurable: true
42
+ });
43
+ Object.defineProperty(Upload.prototype, "extension", {
44
+ get: function () {
45
+ return this.model.extension || '';
46
+ },
47
+ enumerable: false,
48
+ configurable: true
49
+ });
50
+ Object.defineProperty(Upload.prototype, "dimensionsFile", {
51
+ get: function () {
52
+ return this.model.dimensions_file;
53
+ },
54
+ enumerable: false,
55
+ configurable: true
56
+ });
57
+ Object.defineProperty(Upload.prototype, "size", {
58
+ get: function () {
59
+ return +(this.model.size || 0);
60
+ },
61
+ enumerable: false,
62
+ configurable: true
63
+ });
64
+ return Upload;
65
+ }(Model));
66
+ export { Upload };
@@ -1,5 +1,7 @@
1
- export class Model {
2
- constructor(model) {
1
+ var Model = /** @class */ (function () {
2
+ function Model(model) {
3
3
  this.model = model || {};
4
4
  }
5
- }
5
+ return Model;
6
+ }());
7
+ export { Model };
@@ -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
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
13
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
14
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -7,69 +18,114 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
18
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
19
  });
9
20
  };
21
+ var __generator = (this && this.__generator) || function (thisArg, body) {
22
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
+ function verb(n) { return function (v) { return step([n, v]); }; }
25
+ function step(op) {
26
+ if (f) throw new TypeError("Generator is already executing.");
27
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
28
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
+ if (y = 0, t) op = [op[0] & 2, t.value];
30
+ switch (op[0]) {
31
+ case 0: case 1: t = op; break;
32
+ case 4: _.label++; return { value: op[1], done: false };
33
+ case 5: _.label++; y = op[1]; op = [0]; continue;
34
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
+ default:
36
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
+ if (t[2]) _.ops.pop();
41
+ _.trys.pop(); continue;
42
+ }
43
+ op = body.call(thisArg, _);
44
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
+ }
47
+ };
10
48
  /* eslint-disable no-promise-executor-return */
11
49
  // Services
12
50
  import { SavedImage } from '@antscorp/antsomi-ui/es/models/SavedImage';
13
51
  import { Upload } from '@antscorp/antsomi-ui/es/models/Upload';
14
52
  import { services } from '@antscorp/antsomi-ui/es/services';
15
- export const getListingSavedImage = (domainUrl, slug, infos) => __awaiter(void 0, void 0, void 0, function* () {
16
- try {
17
- const { data } = yield services.mediaTemplateSavedImages.getList({
18
- API_HOST: `${domainUrl}/${slug}/saved-image/index`,
19
- }, infos);
20
- let savedImages = (data === null || data === void 0 ? void 0 : data.data) || [];
21
- savedImages = savedImages.map(savedImage => new SavedImage(savedImage));
22
- return savedImages;
23
- }
24
- catch (error) {
25
- return new Promise((_, reject) => reject(error));
26
- }
27
- });
28
- export const createSavedImage = (domainUrl, slug, infos, data) => {
53
+ export var getListingSavedImage = function (domainUrl, slug, infos) { return __awaiter(void 0, void 0, void 0, function () {
54
+ var data, savedImages, error_1;
55
+ return __generator(this, function (_a) {
56
+ switch (_a.label) {
57
+ case 0:
58
+ _a.trys.push([0, 2, , 3]);
59
+ return [4 /*yield*/, services.mediaTemplateSavedImages.getList({
60
+ API_HOST: "".concat(domainUrl, "/").concat(slug, "/saved-image/index"),
61
+ }, infos)];
62
+ case 1:
63
+ data = (_a.sent()).data;
64
+ savedImages = (data === null || data === void 0 ? void 0 : data.data) || [];
65
+ savedImages = savedImages.map(function (savedImage) { return new SavedImage(savedImage); });
66
+ return [2 /*return*/, savedImages];
67
+ case 2:
68
+ error_1 = _a.sent();
69
+ return [2 /*return*/, new Promise(function (_, reject) { return reject(error_1); })];
70
+ case 3: return [2 /*return*/];
71
+ }
72
+ });
73
+ }); };
74
+ export var createSavedImage = function (domainUrl, slug, infos, data) {
29
75
  try {
30
- return services.mediaTemplateSavedImages.create(Object.assign({ API_HOST: `${domainUrl}/${slug}/saved-image/index` }, data), infos);
76
+ return services.mediaTemplateSavedImages.create(__assign({ API_HOST: "".concat(domainUrl, "/").concat(slug, "/saved-image/index") }, data), infos);
31
77
  }
32
78
  catch (error) {
33
- return new Promise((_, reject) => reject(error));
79
+ return new Promise(function (_, reject) { return reject(error); });
34
80
  }
35
81
  };
36
- export const deleteSavedImage = (domainUrl, slug, infos, id) => {
82
+ export var deleteSavedImage = function (domainUrl, slug, infos, id) {
37
83
  try {
38
84
  return services.mediaTemplateSavedImages.create({
39
- API_HOST: `${domainUrl}/${slug}/saved-image/index/update-status`,
85
+ API_HOST: "".concat(domainUrl, "/").concat(slug, "/saved-image/index/update-status"),
40
86
  image_id: [id],
41
87
  status: 80,
42
88
  }, infos);
43
89
  }
44
90
  catch (error) {
45
- return new Promise((_, reject) => reject(error));
91
+ return new Promise(function (_, reject) { return reject(error); });
46
92
  }
47
93
  };
48
- export const uploadFile = (domainUrl, slug, infos, files) => __awaiter(void 0, void 0, void 0, function* () {
94
+ export var uploadFile = function (domainUrl, slug, infos, files) { return __awaiter(void 0, void 0, void 0, function () {
95
+ var formData_1, result, uploadData, error_2;
49
96
  var _a;
50
- try {
51
- const formData = new FormData();
52
- files.forEach(file => {
53
- formData.append('files', file);
54
- });
55
- const result = yield services.mediaTemplateSavedImages.upload({
56
- API_HOST: `${domainUrl}/${slug}/file-upload/file`,
57
- formData,
58
- }, infos);
59
- const uploadData = result ? (_a = result.data) === null || _a === void 0 ? void 0 : _a.data : null;
60
- return (uploadData === null || uploadData === void 0 ? void 0 : uploadData.length)
61
- ? uploadData.map(file => new Upload({
62
- url: file.url,
63
- file: file.file,
64
- extension: file.extension,
65
- dimensions_file: file.dimensions_file,
66
- size: file.size,
67
- file_name: file.file_name,
68
- }))
69
- : [];
70
- }
71
- catch (error) {
72
- // eslint-disable-next-line no-promise-executor-return
73
- return new Promise((_, reject) => reject(error));
74
- }
75
- });
97
+ return __generator(this, function (_b) {
98
+ switch (_b.label) {
99
+ case 0:
100
+ _b.trys.push([0, 2, , 3]);
101
+ formData_1 = new FormData();
102
+ files.forEach(function (file) {
103
+ formData_1.append('files', file);
104
+ });
105
+ return [4 /*yield*/, services.mediaTemplateSavedImages.upload({
106
+ API_HOST: "".concat(domainUrl, "/").concat(slug, "/file-upload/file"),
107
+ formData: formData_1,
108
+ }, infos)];
109
+ case 1:
110
+ result = _b.sent();
111
+ uploadData = result ? (_a = result.data) === null || _a === void 0 ? void 0 : _a.data : null;
112
+ return [2 /*return*/, (uploadData === null || uploadData === void 0 ? void 0 : uploadData.length)
113
+ ? uploadData.map(function (file) {
114
+ return new Upload({
115
+ url: file.url,
116
+ file: file.file,
117
+ extension: file.extension,
118
+ dimensions_file: file.dimensions_file,
119
+ size: file.size,
120
+ file_name: file.file_name,
121
+ });
122
+ })
123
+ : []];
124
+ case 2:
125
+ error_2 = _b.sent();
126
+ // eslint-disable-next-line no-promise-executor-return
127
+ return [2 /*return*/, new Promise(function (_, reject) { return reject(error_2); })];
128
+ case 3: return [2 /*return*/];
129
+ }
130
+ });
131
+ }); };