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

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 (293) hide show
  1. package/es/components/atoms/Alert/Alert.js +13 -6
  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 +4 -15
  5. package/es/components/atoms/DividerPure/styled.js +36 -6
  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 +28 -15
  10. package/es/components/atoms/Input/Input.js +21 -32
  11. package/es/components/atoms/Input/styled.js +102 -12
  12. package/es/components/atoms/InputDynamic/EditCaretPositioning.js +13 -13
  13. package/es/components/atoms/InputDynamic/InputDynamic.d.ts +2 -1
  14. package/es/components/atoms/InputDynamic/InputDynamic.js +83 -97
  15. package/es/components/atoms/InputDynamic/PopupShortLink.js +20 -21
  16. package/es/components/atoms/InputDynamic/styled.d.ts +1 -1
  17. package/es/components/atoms/InputDynamic/styled.js +275 -13
  18. package/es/components/atoms/InputDynamic/utils.js +104 -114
  19. package/es/components/atoms/InputNumber/InputNumber.js +3 -14
  20. package/es/components/atoms/MobileFrame/MobileFrame.js +3 -14
  21. package/es/components/atoms/MobileFrame/constants.js +1 -1
  22. package/es/components/atoms/MobileFrame/styled.js +29 -8
  23. package/es/components/atoms/Pagination/Pagination.js +1 -1
  24. package/es/components/atoms/Popover/Popover.js +1 -1
  25. package/es/components/atoms/Popover/styled.js +1 -6
  26. package/es/components/atoms/PreviewTabs/PreviewTabs.js +20 -31
  27. package/es/components/atoms/PreviewTabs/styled.js +71 -10
  28. package/es/components/atoms/Progress/Progress.js +1 -1
  29. package/es/components/atoms/Radio/index.js +18 -8
  30. package/es/components/atoms/Rate/Rate.js +1 -1
  31. package/es/components/atoms/RateV2/RateV2.js +24 -30
  32. package/es/components/atoms/RequiredLabel/index.js +3 -14
  33. package/es/components/atoms/RequiredLabel/styled.js +5 -7
  34. package/es/components/atoms/ScrollBox/index.js +14 -25
  35. package/es/components/atoms/Segmented/Segmented.js +1 -1
  36. package/es/components/atoms/Skeleton/Skeleton.js +1 -1
  37. package/es/components/atoms/Slider/index.js +7 -18
  38. package/es/components/atoms/Slider/styled.js +38 -10
  39. package/es/components/atoms/SliderV2/index.js +10 -21
  40. package/es/components/atoms/Space/Space.js +6 -7
  41. package/es/components/atoms/Spin/Spin.d.ts +2 -1
  42. package/es/components/atoms/Spin/Spin.js +3 -14
  43. package/es/components/atoms/Spin/styled.d.ts +1 -1
  44. package/es/components/atoms/Spin/styled.js +3 -6
  45. package/es/components/atoms/Statistic/Statistic.js +1 -1
  46. package/es/components/atoms/Steps/Steps.js +1 -1
  47. package/es/components/atoms/Switch/Switch.js +1 -1
  48. package/es/components/atoms/Text/index.js +4 -15
  49. package/es/components/atoms/Text/styled.js +40 -11
  50. package/es/components/atoms/Timeline/Timeline.js +1 -1
  51. package/es/components/atoms/Watermark/Watermark.js +1 -1
  52. package/es/components/common/ConfigProvider/ConfigProvider.js +4 -15
  53. package/es/components/common/ConfigProvider/GlobalStyle.js +569 -8
  54. package/es/components/icons/AccountCircle.js +2 -13
  55. package/es/components/icons/AddShoppingCart.js +2 -13
  56. package/es/components/icons/ArrowGrowIcon.d.ts +2 -1
  57. package/es/components/icons/ArrowGrowIcon.js +2 -13
  58. package/es/components/icons/AssignmentInd.js +2 -13
  59. package/es/components/icons/AudioRecordIcon.d.ts +2 -1
  60. package/es/components/icons/AudioRecordIcon.js +2 -13
  61. package/es/components/icons/BugIcon.d.ts +2 -1
  62. package/es/components/icons/BugIcon.js +2 -13
  63. package/es/components/icons/Call.js +2 -13
  64. package/es/components/icons/CameraIcon.d.ts +2 -1
  65. package/es/components/icons/CameraIcon.js +2 -13
  66. package/es/components/icons/CaptureIcon.d.ts +2 -1
  67. package/es/components/icons/CaptureIcon.js +2 -13
  68. package/es/components/icons/Category.js +2 -13
  69. package/es/components/icons/ChatBubbleOutline.js +2 -13
  70. package/es/components/icons/CheckSlimIcon.d.ts +2 -1
  71. package/es/components/icons/CheckSlimIcon.js +2 -13
  72. package/es/components/icons/CircleNotifications.js +2 -13
  73. package/es/components/icons/CloseIcon.d.ts +2 -1
  74. package/es/components/icons/CloseIcon.js +2 -13
  75. package/es/components/icons/CommentIcon.d.ts +2 -1
  76. package/es/components/icons/CommentIcon.js +2 -13
  77. package/es/components/icons/ConfirmationNumber.js +2 -13
  78. package/es/components/icons/DesktopWindows.js +2 -13
  79. package/es/components/icons/EventIcon.d.ts +2 -1
  80. package/es/components/icons/EventIcon.js +2 -13
  81. package/es/components/icons/FactCheck.js +2 -13
  82. package/es/components/icons/FreeDrawIcon.d.ts +2 -1
  83. package/es/components/icons/FreeDrawIcon.js +2 -13
  84. package/es/components/icons/GPTIcon.d.ts +2 -1
  85. package/es/components/icons/GPTIcon.js +2 -2
  86. package/es/components/icons/GPTIconV2.d.ts +2 -1
  87. package/es/components/icons/GPTIconV2.js +2 -2
  88. package/es/components/icons/GPTIconV3.d.ts +2 -1
  89. package/es/components/icons/GPTIconV3.js +2 -13
  90. package/es/components/icons/HighlightIcon.d.ts +2 -1
  91. package/es/components/icons/HighlightIcon.js +2 -13
  92. package/es/components/icons/HightlightAlt.js +2 -13
  93. package/es/components/icons/HowToReg.js +2 -13
  94. package/es/components/icons/IdeaIcon.d.ts +2 -1
  95. package/es/components/icons/IdeaIcon.js +2 -13
  96. package/es/components/icons/Interactive.js +2 -13
  97. package/es/components/icons/InvisibleIcon.d.ts +2 -1
  98. package/es/components/icons/InvisibleIcon.js +2 -13
  99. package/es/components/icons/List.js +2 -13
  100. package/es/components/icons/LocalMallIcon.js +2 -13
  101. package/es/components/icons/MobileFriendly.js +2 -13
  102. package/es/components/icons/MuteIcon.d.ts +2 -1
  103. package/es/components/icons/MuteIcon.js +2 -13
  104. package/es/components/icons/NotificationsActive.js +2 -13
  105. package/es/components/icons/OpenUrlIcon.d.ts +2 -1
  106. package/es/components/icons/OpenUrlIcon.js +2 -13
  107. package/es/components/icons/PauseIcon.d.ts +2 -1
  108. package/es/components/icons/PauseIcon.js +2 -13
  109. package/es/components/icons/Payment.js +2 -13
  110. package/es/components/icons/PersonAddDisabled.js +2 -13
  111. package/es/components/icons/PhoneCallback.js +2 -13
  112. package/es/components/icons/PlaneIcon.d.ts +2 -1
  113. package/es/components/icons/PlaneIcon.js +2 -13
  114. package/es/components/icons/Preview.js +2 -13
  115. package/es/components/icons/Redeem.js +2 -13
  116. package/es/components/icons/RemoveRedEye.js +2 -13
  117. package/es/components/icons/RemoveShoppingCart.js +2 -13
  118. package/es/components/icons/RequestIcon.d.ts +2 -1
  119. package/es/components/icons/RequestIcon.js +2 -13
  120. package/es/components/icons/Search.js +2 -13
  121. package/es/components/icons/ShoppingBag.js +2 -13
  122. package/es/components/icons/ShoppingCart.js +2 -13
  123. package/es/components/icons/StopRecordIcon.d.ts +2 -1
  124. package/es/components/icons/StopRecordIcon.js +2 -13
  125. package/es/components/icons/Store.js +2 -13
  126. package/es/components/icons/UserIcon.d.ts +2 -1
  127. package/es/components/icons/UserIcon.js +2 -13
  128. package/es/components/icons/VerticalDotsIcon.d.ts +2 -1
  129. package/es/components/icons/VerticalDotsIcon.js +2 -13
  130. package/es/components/icons/WarningIcon.d.ts +2 -1
  131. package/es/components/icons/WarningIcon.js +2 -13
  132. package/es/components/icons/Web.js +2 -13
  133. package/es/components/icons/WebAsset.js +2 -13
  134. package/es/components/molecules/AlignSetting/index.js +9 -20
  135. package/es/components/molecules/AlignSetting/styled.js +5 -6
  136. package/es/components/molecules/AlignSetting/utils.js +2 -2
  137. package/es/components/molecules/CaptureScreen/CaptureScreen.d.ts +2 -1
  138. package/es/components/molecules/CaptureScreen/CaptureScreen.js +240 -269
  139. package/es/components/molecules/CaptureScreen/components/CommentBox/CommentBox.d.ts +2 -1
  140. package/es/components/molecules/CaptureScreen/components/CommentBox/CommentBox.js +25 -36
  141. package/es/components/molecules/CaptureScreen/components/CommentBox/styled.js +129 -15
  142. package/es/components/molecules/CaptureScreen/components/Cursor/Cursor.d.ts +2 -1
  143. package/es/components/molecules/CaptureScreen/components/Cursor/Cursor.js +2 -2
  144. package/es/components/molecules/CaptureScreen/components/Cursor/styled.js +73 -10
  145. package/es/components/molecules/CaptureScreen/constants.js +7 -7
  146. package/es/components/molecules/CaptureScreen/hooks/useImageEditor.d.ts +1 -1
  147. package/es/components/molecules/CaptureScreen/hooks/useImageEditor.js +23 -23
  148. package/es/components/molecules/CaptureScreen/styled.js +247 -28
  149. package/es/components/molecules/CaptureScreen/themes/black.js +1 -1
  150. package/es/components/molecules/CaptureScreen/themes/white.js +1 -1
  151. package/es/components/molecules/CaptureScreen/utils.js +29 -32
  152. package/es/components/molecules/Card/Card.js +1 -1
  153. package/es/components/molecules/ChatBox/ChatBox.js +81 -147
  154. package/es/components/molecules/ChatBox/MessageItem.js +20 -22
  155. package/es/components/molecules/ChatBox/constants.js +2 -2
  156. package/es/components/molecules/ChatBox/styled.js +275 -13
  157. package/es/components/molecules/Collapse/Collapse.js +3 -4
  158. package/es/components/molecules/ColorPicker/ChromePicker/index.js +1 -1
  159. package/es/components/molecules/ColorPicker/ChromePicker/styled.js +11 -6
  160. package/es/components/molecules/ColorPicker/CustomPicker/index.js +21 -33
  161. package/es/components/molecules/ColorPicker/CustomPicker/styled.js +95 -14
  162. package/es/components/molecules/ColorPicker/SketchPicker/index.js +1 -12
  163. package/es/components/molecules/ColorPicker/SketchPicker/styled.js +6 -6
  164. package/es/components/molecules/ColorPicker/index.js +17 -17
  165. package/es/components/molecules/ColorPicker/styled.js +8 -6
  166. package/es/components/molecules/ColorSetting/index.js +15 -35
  167. package/es/components/molecules/ColorSetting/styled.js +36 -9
  168. package/es/components/molecules/DatePicker/DatePicker.js +1 -1
  169. package/es/components/molecules/DatePicker/components/AdvancedPicker/AdvancedPicker.js +112 -146
  170. package/es/components/molecules/DatePicker/components/AdvancedPicker/constants.js +10 -10
  171. package/es/components/molecules/DatePicker/components/AdvancedPicker/styled.js +45 -12
  172. package/es/components/molecules/DatePicker/components/AdvancedPicker/utils.js +3 -8
  173. package/es/components/molecules/DatePicker/components/AdvancedRangePicker/AdvancedRangePicker.js +9 -28
  174. package/es/components/molecules/DatePicker/components/AdvancedRangePicker/constants.js +1 -1
  175. package/es/components/molecules/Drawer/Drawer.js +1 -1
  176. package/es/components/molecules/EdgeSetting/index.js +45 -69
  177. package/es/components/molecules/EdgeSetting/styled.js +13 -8
  178. package/es/components/molecules/FontFamilySelect/constants.js +1 -1
  179. package/es/components/molecules/FontFamilySelect/index.js +10 -33
  180. package/es/components/molecules/FontSetting/constants.js +2 -2
  181. package/es/components/molecules/FontSetting/index.js +22 -36
  182. package/es/components/molecules/FontWeightSelect/constants.js +1 -1
  183. package/es/components/molecules/FontWeightSelect/index.js +9 -32
  184. package/es/components/molecules/GradientSetting/index.js +35 -55
  185. package/es/components/molecules/GradientSetting/styled.js +58 -6
  186. package/es/components/molecules/IconSelection/components/Icon/index.js +8 -19
  187. package/es/components/molecules/IconSelection/constants.js +31 -37
  188. package/es/components/molecules/IconSelection/index.js +43 -56
  189. package/es/components/molecules/IconSelection/styled.js +74 -10
  190. package/es/components/molecules/IconSelection/types.js +1 -3
  191. package/es/components/molecules/IconSelection/utils.js +3 -3
  192. package/es/components/molecules/InputNumber/index.js +12 -23
  193. package/es/components/molecules/InputNumberWithUnit/index.js +5 -19
  194. package/es/components/molecules/InputNumberWithUnit/styled.js +15 -6
  195. package/es/components/molecules/InputSearch/index.js +3 -14
  196. package/es/components/molecules/InputSearch/styled.js +43 -6
  197. package/es/components/molecules/Modal/Modal.d.ts +2 -2
  198. package/es/components/molecules/Modal/Modal.js +8 -23
  199. package/es/components/molecules/Modal/styled.d.ts +1 -1
  200. package/es/components/molecules/Modal/styled.js +69 -17
  201. package/es/components/molecules/ModalV2/ModalV2.js +6 -17
  202. package/es/components/molecules/ModalV2/styled.d.ts +1 -1
  203. package/es/components/molecules/ModalV2/styled.js +19 -6
  204. package/es/components/molecules/Popconfirm/Popconfirm.js +1 -1
  205. package/es/components/molecules/PopupDraggable/PopupDraggable.js +13 -25
  206. package/es/components/molecules/PopupDraggable/styled.js +47 -11
  207. package/es/components/molecules/PreviewModal/PreviewModal.js +5 -16
  208. package/es/components/molecules/PreviewModal/styled.js +30 -9
  209. package/es/components/molecules/RadioGroup/index.js +3 -14
  210. package/es/components/molecules/RadioGroup/styled.js +11 -7
  211. package/es/components/molecules/ResizeGrid/ResizeGrid.js +275 -338
  212. package/es/components/molecules/ResizeGrid/components/Cell/Cell.js +23 -37
  213. package/es/components/molecules/ResizeGrid/components/Cell/styled.js +78 -6
  214. package/es/components/molecules/ResizeGrid/constant.js +26 -37
  215. package/es/components/molecules/ResizeGrid/styled.js +54 -9
  216. package/es/components/molecules/Result/Result.js +1 -1
  217. package/es/components/molecules/RichMenuBlock/RichMenuBlock.js +23 -34
  218. package/es/components/molecules/RichMenuBlock/RichMenuCell/index.js +11 -11
  219. package/es/components/molecules/RichMenuBlock/RichMenuCell/styled.js +34 -18
  220. package/es/components/molecules/RichMenuBlock/constants.js +1 -1
  221. package/es/components/molecules/RichMenuBlock/styled.js +15 -16
  222. package/es/components/molecules/RichMenuChatBar/RichMenuChatBar.js +6 -17
  223. package/es/components/molecules/RichMenuChatBar/TypingChat/index.js +3 -3
  224. package/es/components/molecules/RichMenuChatBar/TypingChat/styled.js +43 -8
  225. package/es/components/molecules/RichMenuChatBar/styled.js +25 -10
  226. package/es/components/molecules/RichMenuMobileView/RichMenuMobileView.js +7 -22
  227. package/es/components/molecules/RichMenuMobileView/styled.js +18 -11
  228. package/es/components/molecules/Select/Select.d.ts +4 -2
  229. package/es/components/molecules/Select/Select.js +9 -20
  230. package/es/components/molecules/Select/Test.d.ts +2 -1
  231. package/es/components/molecules/Select/Test.js +2 -2
  232. package/es/components/molecules/Select/styled.js +34 -7
  233. package/es/components/molecules/SettingWrapper/index.js +2 -2
  234. package/es/components/molecules/SettingWrapper/styled.js +15 -9
  235. package/es/components/molecules/SettingWrapperPopover/index.js +4 -16
  236. package/es/components/molecules/SliderWithInputNumber/index.js +8 -19
  237. package/es/components/molecules/SliderWithInputNumber/styled.js +3 -6
  238. package/es/components/molecules/TextDecorationSelect/constants.js +1 -1
  239. package/es/components/molecules/TextDecorationSelect/index.js +9 -32
  240. package/es/components/molecules/TextTransformSelect/constants.js +1 -1
  241. package/es/components/molecules/TextTransformSelect/index.js +9 -32
  242. package/es/components/molecules/TreeSelect/TreeSelect.d.ts +4 -2
  243. package/es/components/molecules/TreeSelect/TreeSelect.js +1 -1
  244. package/es/components/molecules/UploadImage/MediaIcon.d.ts +2 -1
  245. package/es/components/molecules/UploadImage/MediaIcon.js +2 -2
  246. package/es/components/molecules/UploadImage/index.js +182 -280
  247. package/es/components/molecules/UploadImage/styled.js +129 -16
  248. package/es/components/organism/Help/Help.js +422 -530
  249. package/es/components/organism/Help/constants.js +11 -12
  250. package/es/components/organism/Help/styled.d.ts +6 -2
  251. package/es/components/organism/Help/styled.js +257 -48
  252. package/es/components/organism/Help/utils.js +11 -11
  253. package/es/components/organism/PositionSetting/config.js +2 -2
  254. package/es/components/organism/PositionSetting/index.js +15 -27
  255. package/es/components/organism/PositionSetting/styled.js +1 -6
  256. package/es/components/organism/Table/CrossTabTable/CrossTabTable.js +10 -10
  257. package/es/components/organism/Table/CrossTabTable/components/CustomCell/CustomCell.js +6 -6
  258. package/es/components/organism/Table/CrossTabTable/components/CustomCell/styled.js +12 -6
  259. package/es/components/organism/Table/CrossTabTable/constants.js +3 -3
  260. package/es/components/organism/Table/CrossTabTable/styled.js +12 -6
  261. package/es/components/organism/Table/CrossTabTable/utils.js +1 -1
  262. package/es/components/organism/Table/ExplorePivotTable/ExplorePivotTable.js +12 -23
  263. package/es/components/organism/Table/ExplorePivotTable/components/CustomCell/CustomCell.js +8 -8
  264. package/es/components/organism/Table/ExplorePivotTable/components/CustomCell/styled.js +20 -8
  265. package/es/components/organism/Table/ExplorePivotTable/constants.js +2 -2
  266. package/es/components/organism/Table/ExplorePivotTable/styled.js +13 -7
  267. package/es/components/organism/Table/ExplorePivotTable/utils.js +52 -72
  268. package/es/constants/gradientSetting.js +4 -4
  269. package/es/constants/keyCode.js +387 -387
  270. package/es/constants/richMenu.js +2 -2
  271. package/es/constants/storybook.d.ts +2 -1
  272. package/es/constants/storybook.js +2 -2
  273. package/es/constants/theme.js +6 -6
  274. package/es/hooks/index.js +1 -1
  275. package/es/hooks/useDebounce.js +5 -5
  276. package/es/hooks/useDeepCompareEffect.js +1 -1
  277. package/es/locales/i18n.js +2 -2
  278. package/es/locales/translations.js +7 -23
  279. package/es/models/SavedImage.js +23 -68
  280. package/es/models/Upload.js +19 -64
  281. package/es/models/model.js +3 -5
  282. package/es/services/MediaTemplateDesign/UploadFile/index.js +46 -102
  283. package/es/services/Ticket.js +48 -89
  284. package/es/services/constants.js +3 -3
  285. package/es/services/index.js +19 -30
  286. package/es/test.d.ts +2 -1
  287. package/es/test.js +25 -36
  288. package/es/utils/color.js +22 -22
  289. package/es/utils/common.js +75 -88
  290. package/es/utils/handleError.js +8 -49
  291. package/es/utils/loadable.js +6 -18
  292. package/es/utils/web.js +20 -26
  293. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- export var AREA_LAYOUT_KEYS = {
1
+ export const 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 var AREA_LAYOUT_KEYS = {
12
12
  LAYOUT_11: 'LAYOUT_11',
13
13
  LAYOUT_12: 'LAYOUT_12',
14
14
  };
15
- export var BLOCK_KEYS = {
15
+ export const BLOCK_KEYS = {
16
16
  RICH_MENU: 'RICH_MENU',
17
17
  CELL_ACTION: 'CELL_ACTION',
18
18
  CELL_IMAGE: 'CELL_IMAGE',
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  export declare const TABLE_API_COLUMNS: ({
2
3
  title: string;
3
4
  dataIndex: string;
@@ -7,5 +8,5 @@ export declare const TABLE_API_COLUMNS: ({
7
8
  title: string;
8
9
  dataIndex: string;
9
10
  key: string;
10
- render: (text: any) => JSX.Element;
11
+ render: (text: any) => React.JSX.Element;
11
12
  })[];
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export var TABLE_API_COLUMNS = [
2
+ export const TABLE_API_COLUMNS = [
3
3
  {
4
4
  title: 'Property',
5
5
  dataIndex: 'property',
@@ -14,7 +14,7 @@ export var TABLE_API_COLUMNS = [
14
14
  title: 'Type',
15
15
  dataIndex: 'type',
16
16
  key: 'type',
17
- render: function (text) { return React.createElement("a", { style: { color: 'magenta' } }, text); },
17
+ render: text => 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
- var defaultAlgorithm = theme.defaultAlgorithm, defaultSeed = theme.defaultSeed;
6
- var mapToken = defaultAlgorithm(defaultSeed);
7
- var gold1 = mapToken.gold1, gold6 = mapToken.gold6;
8
- export var THEME = {
5
+ const { defaultAlgorithm, defaultSeed } = theme;
6
+ const mapToken = defaultAlgorithm(defaultSeed);
7
+ const { gold1, gold6 } = mapToken;
8
+ export const THEME = {
9
9
  token: {
10
10
  colorText: '#000000',
11
11
  colorTextBase: '#222222',
@@ -67,8 +67,8 @@ export var THEME = {
67
67
  accent6: '#f2f2f2',
68
68
  accent7: '#cccccc',
69
69
  gray5: '#d9d9d9',
70
- gold1: gold1,
71
- gold6: gold6,
70
+ gold1,
71
+ 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
- var ref = useRef();
10
+ const 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
- 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 () {
3
+ const [value, setValue] = useState(initialValue);
4
+ const [debouncedValue, setDebouncedValue] = useState(initialValue);
5
+ useEffect(() => {
6
+ const debounce = setTimeout(() => {
7
7
  setDebouncedValue(value);
8
8
  }, time);
9
- return function () {
9
+ return () => {
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
- var ref = useRef();
10
+ const 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 var translationsJson = {
7
+ export const translationsJson = {
8
8
  en: {
9
9
  translation: en,
10
10
  },
@@ -16,7 +16,7 @@ export var translationsJson = {
16
16
  convertLanguageJsonToObject(en);
17
17
  // i18next
18
18
  // export const i18n = i18next
19
- var i18nInstance = i18next.createInstance();
19
+ const i18nInstance = i18next.createInstance();
20
20
  i18nInstance
21
21
  // pass the i18n instance to react-i18next.
22
22
  // .use(initReactI18next)
@@ -1,25 +1,15 @@
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
- };
10
1
  // Libraries
11
2
  import i18next from 'i18next';
12
- export var translations = {};
3
+ export const translations = {};
13
4
  /*
14
5
  * Converts the static JSON file into an object where keys are identical
15
6
  * but values are strings concatenated according to syntax.
16
7
  * This is helpful when using the JSON file keys and still having the intellisense support
17
8
  * along with type-safety
18
9
  */
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;
10
+ export const convertLanguageJsonToObject = (json, objToConvertTo = translations, current) => {
11
+ Object.keys(json).forEach(key => {
12
+ const currentLookupKey = current ? `${current}.${key}` : key;
23
13
  if (typeof json[key] === 'object') {
24
14
  objToConvertTo[key] = {};
25
15
  convertLanguageJsonToObject(json[key], objToConvertTo[key], currentLookupKey);
@@ -29,19 +19,13 @@ export var convertLanguageJsonToObject = function (json, objToConvertTo, current
29
19
  }
30
20
  });
31
21
  };
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
- }
22
+ export const t = (id, ...rest) => {
37
23
  if (!id) {
38
24
  id = '_NOT_TRANSLATED_';
39
25
  }
40
- return __spreadArray([id], rest, true);
26
+ return [id, ...rest];
41
27
  };
42
- export var getTranslateMessage = function (id, defaultMessage, value) {
43
- if (defaultMessage === void 0) { defaultMessage = ''; }
44
- if (value === void 0) { value = {}; }
28
+ export const getTranslateMessage = (id, defaultMessage = '', value = {}) => {
45
29
  try {
46
30
  return i18next.t(t(id, defaultMessage), value);
47
31
  }
@@ -1,71 +1,26 @@
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
- })();
16
1
  import moment from 'moment';
17
2
  import { Model } from './model';
18
- var SavedImage = /** @class */ (function (_super) {
19
- __extends(SavedImage, _super);
20
- function SavedImage() {
21
- return _super !== null && _super.apply(this, arguments) || this;
3
+ export class SavedImage extends Model {
4
+ get id() {
5
+ return this.model.image_id || '';
22
6
  }
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 };
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
+ }
@@ -1,66 +1,21 @@
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
- })();
16
1
  import { Model } from './model';
17
- var Upload = /** @class */ (function (_super) {
18
- __extends(Upload, _super);
19
- function Upload() {
20
- return _super !== null && _super.apply(this, arguments) || this;
2
+ export class Upload extends Model {
3
+ get fileName() {
4
+ return this.model.file_name;
21
5
  }
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 };
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
+ }
@@ -1,7 +1,5 @@
1
- var Model = /** @class */ (function () {
2
- function Model(model) {
1
+ export class Model {
2
+ constructor(model) {
3
3
  this.model = model || {};
4
4
  }
5
- return Model;
6
- }());
7
- export { Model };
5
+ }
@@ -1,14 +1,3 @@
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
- };
12
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -18,114 +7,69 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
18
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
19
8
  });
20
9
  };
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
- };
48
10
  /* eslint-disable no-promise-executor-return */
49
11
  // Services
50
12
  import { SavedImage } from '@antscorp/antsomi-ui/es/models/SavedImage';
51
13
  import { Upload } from '@antscorp/antsomi-ui/es/models/Upload';
52
14
  import { services } from '@antscorp/antsomi-ui/es/services';
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) {
15
+ export const getListingSavedImage = (domainUrl, slug, infos) => __awaiter(void 0, void 0, void 0, function* () {
75
16
  try {
76
- return services.mediaTemplateSavedImages.create(__assign({ API_HOST: "".concat(domainUrl, "/").concat(slug, "/saved-image/index") }, data), infos);
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;
77
23
  }
78
24
  catch (error) {
79
- return new Promise(function (_, reject) { return reject(error); });
25
+ return new Promise((_, reject) => reject(error));
26
+ }
27
+ });
28
+ export const createSavedImage = (domainUrl, slug, infos, data) => {
29
+ try {
30
+ return services.mediaTemplateSavedImages.create(Object.assign({ API_HOST: `${domainUrl}/${slug}/saved-image/index` }, data), infos);
31
+ }
32
+ catch (error) {
33
+ return new Promise((_, reject) => reject(error));
80
34
  }
81
35
  };
82
- export var deleteSavedImage = function (domainUrl, slug, infos, id) {
36
+ export const deleteSavedImage = (domainUrl, slug, infos, id) => {
83
37
  try {
84
38
  return services.mediaTemplateSavedImages.create({
85
- API_HOST: "".concat(domainUrl, "/").concat(slug, "/saved-image/index/update-status"),
39
+ API_HOST: `${domainUrl}/${slug}/saved-image/index/update-status`,
86
40
  image_id: [id],
87
41
  status: 80,
88
42
  }, infos);
89
43
  }
90
44
  catch (error) {
91
- return new Promise(function (_, reject) { return reject(error); });
45
+ return new Promise((_, reject) => reject(error));
92
46
  }
93
47
  };
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;
48
+ export const uploadFile = (domainUrl, slug, infos, files) => __awaiter(void 0, void 0, void 0, function* () {
96
49
  var _a;
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
- }); };
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
+ });