@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.
- package/es/components/atoms/Alert/Alert.js +6 -13
- package/es/components/atoms/Button/index.js +1 -1
- package/es/components/atoms/Button/test.js +6 -6
- package/es/components/atoms/DividerPure/DividerPure.js +15 -4
- package/es/components/atoms/DividerPure/styled.js +6 -36
- package/es/components/atoms/Empty/Empty.js +1 -1
- package/es/components/atoms/FloatButton/index.js +1 -1
- package/es/components/atoms/Grid/Grid.js +2 -2
- package/es/components/atoms/Icon/index.js +15 -28
- package/es/components/atoms/Input/Input.js +32 -21
- package/es/components/atoms/Input/styled.js +12 -102
- package/es/components/atoms/InputDynamic/EditCaretPositioning.js +13 -13
- package/es/components/atoms/InputDynamic/InputDynamic.js +97 -83
- package/es/components/atoms/InputDynamic/PopupShortLink.js +21 -20
- package/es/components/atoms/InputDynamic/styled.js +13 -275
- package/es/components/atoms/InputDynamic/utils.js +114 -104
- package/es/components/atoms/InputNumber/InputNumber.js +14 -3
- package/es/components/atoms/MobileFrame/MobileFrame.js +14 -3
- package/es/components/atoms/MobileFrame/constants.js +1 -1
- package/es/components/atoms/MobileFrame/styled.js +8 -29
- package/es/components/atoms/Pagination/Pagination.js +1 -1
- package/es/components/atoms/Popover/Popover.js +1 -1
- package/es/components/atoms/Popover/styled.js +6 -1
- package/es/components/atoms/PreviewTabs/PreviewTabs.js +31 -20
- package/es/components/atoms/PreviewTabs/styled.js +10 -71
- package/es/components/atoms/Progress/Progress.js +1 -1
- package/es/components/atoms/Radio/index.js +8 -18
- package/es/components/atoms/Rate/Rate.js +1 -1
- package/es/components/atoms/RateV2/RateV2.js +30 -24
- package/es/components/atoms/RequiredLabel/index.js +14 -3
- package/es/components/atoms/RequiredLabel/styled.js +7 -5
- package/es/components/atoms/ScrollBox/index.js +25 -14
- package/es/components/atoms/Segmented/Segmented.js +1 -1
- package/es/components/atoms/Skeleton/Skeleton.js +1 -1
- package/es/components/atoms/Slider/index.js +18 -7
- package/es/components/atoms/Slider/styled.js +10 -38
- package/es/components/atoms/SliderV2/index.js +21 -10
- package/es/components/atoms/Space/Space.js +7 -6
- package/es/components/atoms/Spin/Spin.js +14 -3
- package/es/components/atoms/Spin/styled.js +6 -3
- package/es/components/atoms/Statistic/Statistic.js +1 -1
- package/es/components/atoms/Steps/Steps.js +1 -1
- package/es/components/atoms/Switch/Switch.js +1 -1
- package/es/components/atoms/Text/index.js +15 -4
- package/es/components/atoms/Text/styled.js +11 -40
- package/es/components/atoms/Timeline/Timeline.js +1 -1
- package/es/components/atoms/Watermark/Watermark.js +1 -1
- package/es/components/common/ConfigProvider/ConfigProvider.js +15 -4
- package/es/components/common/ConfigProvider/GlobalStyle.js +8 -569
- package/es/components/icons/AccountCircle.js +13 -2
- package/es/components/icons/AddShoppingCart.js +13 -2
- package/es/components/icons/ArrowGrowIcon.js +13 -2
- package/es/components/icons/AssignmentInd.js +13 -2
- package/es/components/icons/AudioRecordIcon.js +13 -2
- package/es/components/icons/BugIcon.js +13 -2
- package/es/components/icons/Call.js +13 -2
- package/es/components/icons/CameraIcon.js +13 -2
- package/es/components/icons/CaptureIcon.js +13 -2
- package/es/components/icons/Category.js +13 -2
- package/es/components/icons/ChatBubbleOutline.js +13 -2
- package/es/components/icons/CheckSlimIcon.js +13 -2
- package/es/components/icons/CircleNotifications.js +13 -2
- package/es/components/icons/CloseIcon.js +13 -2
- package/es/components/icons/CommentIcon.js +13 -2
- package/es/components/icons/ConfirmationNumber.js +13 -2
- package/es/components/icons/DesktopWindows.js +13 -2
- package/es/components/icons/EventIcon.js +13 -2
- package/es/components/icons/FactCheck.js +13 -2
- package/es/components/icons/FreeDrawIcon.js +13 -2
- package/es/components/icons/GPTIcon.js +2 -2
- package/es/components/icons/GPTIconV2.js +2 -2
- package/es/components/icons/GPTIconV3.js +13 -2
- package/es/components/icons/HighlightIcon.js +13 -2
- package/es/components/icons/HightlightAlt.js +13 -2
- package/es/components/icons/HowToReg.js +13 -2
- package/es/components/icons/IdeaIcon.js +13 -2
- package/es/components/icons/Interactive.js +13 -2
- package/es/components/icons/InvisibleIcon.js +13 -2
- package/es/components/icons/List.js +13 -2
- package/es/components/icons/LocalMallIcon.js +13 -2
- package/es/components/icons/MobileFriendly.js +13 -2
- package/es/components/icons/MuteIcon.js +13 -2
- package/es/components/icons/NotificationsActive.js +13 -2
- package/es/components/icons/OpenUrlIcon.js +13 -2
- package/es/components/icons/PauseIcon.js +13 -2
- package/es/components/icons/Payment.js +13 -2
- package/es/components/icons/PersonAddDisabled.js +13 -2
- package/es/components/icons/PhoneCallback.js +13 -2
- package/es/components/icons/PlaneIcon.js +13 -2
- package/es/components/icons/Preview.js +13 -2
- package/es/components/icons/Redeem.js +13 -2
- package/es/components/icons/RemoveRedEye.js +13 -2
- package/es/components/icons/RemoveShoppingCart.js +13 -2
- package/es/components/icons/RequestIcon.js +13 -2
- package/es/components/icons/Search.js +13 -2
- package/es/components/icons/ShoppingBag.js +13 -2
- package/es/components/icons/ShoppingCart.js +13 -2
- package/es/components/icons/StopRecordIcon.js +13 -2
- package/es/components/icons/Store.js +13 -2
- package/es/components/icons/UserIcon.js +13 -2
- package/es/components/icons/VerticalDotsIcon.js +13 -2
- package/es/components/icons/WarningIcon.js +13 -2
- package/es/components/icons/Web.js +13 -2
- package/es/components/icons/WebAsset.js +13 -2
- package/es/components/molecules/AlignSetting/index.js +20 -9
- package/es/components/molecules/AlignSetting/styled.js +6 -5
- package/es/components/molecules/AlignSetting/utils.js +2 -2
- package/es/components/molecules/CaptureScreen/CaptureScreen.js +269 -240
- package/es/components/molecules/CaptureScreen/components/CommentBox/CommentBox.js +36 -25
- package/es/components/molecules/CaptureScreen/components/CommentBox/styled.js +15 -129
- package/es/components/molecules/CaptureScreen/components/Cursor/Cursor.js +2 -2
- package/es/components/molecules/CaptureScreen/components/Cursor/styled.js +10 -73
- package/es/components/molecules/CaptureScreen/constants.js +7 -7
- package/es/components/molecules/CaptureScreen/hooks/useImageEditor.d.ts +1 -1
- package/es/components/molecules/CaptureScreen/hooks/useImageEditor.js +23 -23
- package/es/components/molecules/CaptureScreen/styled.js +28 -247
- package/es/components/molecules/CaptureScreen/themes/black.js +1 -1
- package/es/components/molecules/CaptureScreen/themes/white.js +1 -1
- package/es/components/molecules/CaptureScreen/utils.js +32 -29
- package/es/components/molecules/Card/Card.js +1 -1
- package/es/components/molecules/ChatBox/ChatBox.js +147 -81
- package/es/components/molecules/ChatBox/MessageItem.js +22 -20
- package/es/components/molecules/ChatBox/constants.js +2 -2
- package/es/components/molecules/ChatBox/styled.js +13 -275
- package/es/components/molecules/Collapse/Collapse.js +4 -3
- package/es/components/molecules/ColorPicker/ChromePicker/index.js +1 -1
- package/es/components/molecules/ColorPicker/ChromePicker/styled.js +6 -11
- package/es/components/molecules/ColorPicker/CustomPicker/index.js +33 -21
- package/es/components/molecules/ColorPicker/CustomPicker/styled.js +14 -95
- package/es/components/molecules/ColorPicker/SketchPicker/index.js +12 -1
- package/es/components/molecules/ColorPicker/SketchPicker/styled.js +6 -6
- package/es/components/molecules/ColorPicker/index.js +17 -17
- package/es/components/molecules/ColorPicker/styled.js +6 -8
- package/es/components/molecules/ColorSetting/index.js +35 -15
- package/es/components/molecules/ColorSetting/styled.js +9 -36
- package/es/components/molecules/DatePicker/DatePicker.js +1 -1
- package/es/components/molecules/DatePicker/components/AdvancedPicker/AdvancedPicker.js +146 -112
- package/es/components/molecules/DatePicker/components/AdvancedPicker/constants.js +10 -10
- package/es/components/molecules/DatePicker/components/AdvancedPicker/styled.js +12 -45
- package/es/components/molecules/DatePicker/components/AdvancedPicker/utils.js +8 -3
- package/es/components/molecules/DatePicker/components/AdvancedRangePicker/AdvancedRangePicker.js +28 -9
- package/es/components/molecules/DatePicker/components/AdvancedRangePicker/constants.js +1 -1
- package/es/components/molecules/Drawer/Drawer.js +1 -1
- package/es/components/molecules/EdgeSetting/index.js +69 -45
- package/es/components/molecules/EdgeSetting/styled.js +8 -13
- package/es/components/molecules/FontFamilySelect/constants.js +1 -1
- package/es/components/molecules/FontFamilySelect/index.js +33 -10
- package/es/components/molecules/FontSetting/constants.js +2 -2
- package/es/components/molecules/FontSetting/index.js +36 -22
- package/es/components/molecules/FontWeightSelect/constants.js +1 -1
- package/es/components/molecules/FontWeightSelect/index.js +32 -9
- package/es/components/molecules/GradientSetting/index.js +55 -35
- package/es/components/molecules/GradientSetting/styled.js +6 -58
- package/es/components/molecules/IconSelection/components/Icon/index.js +19 -8
- package/es/components/molecules/IconSelection/constants.js +37 -31
- package/es/components/molecules/IconSelection/index.js +56 -43
- package/es/components/molecules/IconSelection/styled.js +10 -74
- package/es/components/molecules/IconSelection/types.js +3 -1
- package/es/components/molecules/IconSelection/utils.js +3 -3
- package/es/components/molecules/InputNumber/index.js +23 -12
- package/es/components/molecules/InputNumberWithUnit/index.js +19 -5
- package/es/components/molecules/InputNumberWithUnit/styled.js +6 -15
- package/es/components/molecules/InputSearch/index.js +14 -3
- package/es/components/molecules/InputSearch/styled.js +6 -43
- package/es/components/molecules/Modal/Modal.js +23 -8
- package/es/components/molecules/Modal/styled.js +17 -69
- package/es/components/molecules/ModalV2/ModalV2.js +17 -6
- package/es/components/molecules/ModalV2/styled.js +6 -19
- package/es/components/molecules/Popconfirm/Popconfirm.js +1 -1
- package/es/components/molecules/PopupDraggable/PopupDraggable.js +25 -13
- package/es/components/molecules/PopupDraggable/styled.js +11 -47
- package/es/components/molecules/PreviewModal/PreviewModal.js +16 -5
- package/es/components/molecules/PreviewModal/styled.js +9 -30
- package/es/components/molecules/RadioGroup/index.js +14 -3
- package/es/components/molecules/RadioGroup/styled.js +7 -11
- package/es/components/molecules/ResizeGrid/ResizeGrid.js +338 -275
- package/es/components/molecules/ResizeGrid/components/Cell/Cell.js +37 -23
- package/es/components/molecules/ResizeGrid/components/Cell/styled.js +6 -78
- package/es/components/molecules/ResizeGrid/constant.js +37 -26
- package/es/components/molecules/ResizeGrid/styled.js +9 -54
- package/es/components/molecules/Result/Result.js +1 -1
- package/es/components/molecules/RichMenuBlock/RichMenuBlock.js +34 -23
- package/es/components/molecules/RichMenuBlock/RichMenuCell/index.js +11 -11
- package/es/components/molecules/RichMenuBlock/RichMenuCell/styled.js +18 -34
- package/es/components/molecules/RichMenuBlock/constants.js +1 -1
- package/es/components/molecules/RichMenuBlock/styled.js +16 -15
- package/es/components/molecules/RichMenuChatBar/RichMenuChatBar.js +17 -6
- package/es/components/molecules/RichMenuChatBar/TypingChat/index.js +3 -3
- package/es/components/molecules/RichMenuChatBar/TypingChat/styled.js +8 -43
- package/es/components/molecules/RichMenuChatBar/styled.js +10 -25
- package/es/components/molecules/RichMenuMobileView/RichMenuMobileView.js +22 -7
- package/es/components/molecules/RichMenuMobileView/styled.js +11 -18
- package/es/components/molecules/Select/Select.js +20 -9
- package/es/components/molecules/Select/Test.js +2 -2
- package/es/components/molecules/Select/styled.js +7 -34
- package/es/components/molecules/SettingWrapper/index.js +2 -2
- package/es/components/molecules/SettingWrapper/styled.js +9 -15
- package/es/components/molecules/SettingWrapperPopover/index.js +16 -4
- package/es/components/molecules/SliderWithInputNumber/index.js +19 -8
- package/es/components/molecules/SliderWithInputNumber/styled.js +6 -3
- package/es/components/molecules/TextDecorationSelect/constants.js +1 -1
- package/es/components/molecules/TextDecorationSelect/index.js +32 -9
- package/es/components/molecules/TextTransformSelect/constants.js +1 -1
- package/es/components/molecules/TextTransformSelect/index.js +32 -9
- package/es/components/molecules/TreeSelect/TreeSelect.js +1 -1
- package/es/components/molecules/UploadImage/MediaIcon.js +2 -2
- package/es/components/molecules/UploadImage/index.js +280 -182
- package/es/components/molecules/UploadImage/styled.js +16 -129
- package/es/components/organism/Help/Help.js +530 -422
- package/es/components/organism/Help/constants.js +12 -11
- package/es/components/organism/Help/styled.js +48 -257
- package/es/components/organism/Help/utils.js +11 -11
- package/es/components/organism/PositionSetting/config.js +2 -2
- package/es/components/organism/PositionSetting/index.js +27 -15
- package/es/components/organism/PositionSetting/styled.js +6 -1
- package/es/components/organism/Table/CrossTabTable/CrossTabTable.js +10 -10
- package/es/components/organism/Table/CrossTabTable/components/CustomCell/CustomCell.js +6 -6
- package/es/components/organism/Table/CrossTabTable/components/CustomCell/styled.js +6 -12
- package/es/components/organism/Table/CrossTabTable/constants.js +3 -3
- package/es/components/organism/Table/CrossTabTable/styled.js +6 -12
- package/es/components/organism/Table/CrossTabTable/utils.js +1 -1
- package/es/components/organism/Table/ExplorePivotTable/ExplorePivotTable.js +23 -12
- package/es/components/organism/Table/ExplorePivotTable/components/CustomCell/CustomCell.js +8 -8
- package/es/components/organism/Table/ExplorePivotTable/components/CustomCell/styled.js +8 -20
- package/es/components/organism/Table/ExplorePivotTable/constants.js +2 -2
- package/es/components/organism/Table/ExplorePivotTable/styled.js +7 -13
- package/es/components/organism/Table/ExplorePivotTable/utils.js +72 -52
- package/es/constants/gradientSetting.js +4 -4
- package/es/constants/keyCode.js +387 -387
- package/es/constants/richMenu.js +2 -2
- package/es/constants/storybook.js +2 -2
- package/es/constants/theme.js +6 -6
- package/es/hooks/index.js +1 -1
- package/es/hooks/useDebounce.js +5 -5
- package/es/hooks/useDeepCompareEffect.js +1 -1
- package/es/locales/i18n.js +2 -2
- package/es/locales/translations.js +23 -7
- package/es/models/SavedImage.js +68 -23
- package/es/models/Upload.js +64 -19
- package/es/models/model.js +5 -3
- package/es/services/MediaTemplateDesign/UploadFile/index.js +102 -46
- package/es/services/Ticket.js +89 -48
- package/es/services/constants.js +3 -3
- package/es/services/index.js +30 -19
- package/es/test.js +36 -25
- package/es/utils/color.js +22 -22
- package/es/utils/common.js +88 -75
- package/es/utils/handleError.js +49 -8
- package/es/utils/loadable.js +18 -6
- package/es/utils/web.js +26 -20
- package/package.json +3 -3
- package/dist/02028cc6be94478e1f13.svg +0 -1
- package/dist/0dfb9214dfd945cd7290.png +0 -1
- package/dist/19a777928d8a4fb24864.svg +0 -1
- package/dist/256cc472918edbfc13f3.ttf +0 -0
- package/dist/42deb30bedf71d95ec56.woff +0 -0
- package/dist/574b7bee0563a9fe9a29.png +0 -1
- package/dist/a772098db05052e4b517.eot +0 -0
- package/dist/bc6bf11c6f5e6743aa4c.png +0 -1
- package/dist/e32f09119052a55cce3c.png +0 -1
- package/dist/e3851b9384a984c6fdb5.png +0 -1
- package/dist/f422f99dc05cb0013092.png +0 -1
- package/dist/index.js +0 -2
- package/dist/index.js.LICENSE.txt +0 -69
- package/dist/main.css +0 -69
- package/dist/public/icons/2d496b55d85a9545d7311c073af442bb.png +0 -0
- package/dist/public/icons/2fbb4e0927d18e3f8e5c6511ab88d5b3.png +0 -0
- package/dist/public/icons/84d7dd910e6235dc6ce60657dd3bb062.svg +0 -87
- package/dist/public/icons/90553767e0a05b9585a54797cfd9ce51.png +0 -0
- package/dist/public/icons/97210ba7dc321670f4a144c1b40e88d8.png +0 -0
- package/dist/public/icons/d327b24e9c5d8f486f08d253aab58ce6.png +0 -0
- package/dist/public/icons/f1cf266d0a0a53ce07f2dbb859869b7a.png +0 -0
- package/dist/public/icons/fe347d51ab67ec846138b9a565b3071b.svg +0 -361
- package/dist/public/icons/iphone-top-bar.png +0 -0
- package/dist/public/icons/iphone.png +0 -0
- package/dist/public/icons/placeholder-image.png +0 -0
- package/dist/public/icons/stars_slider.png +0 -0
- package/dist/public/icons/transparent.svg +0 -1
package/es/constants/richMenu.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
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
|
|
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
|
|
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
|
|
17
|
+
render: function (text) { return React.createElement("a", { style: { color: 'magenta' } }, text); },
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
20
|
title: 'Default',
|
package/es/constants/theme.js
CHANGED
|
@@ -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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export
|
|
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
|
-
|
|
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)) {
|
package/es/hooks/useDebounce.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react';
|
|
2
2
|
function useDebounce(initialValue, time) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
useEffect(()
|
|
6
|
-
|
|
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
|
-
|
|
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)) {
|
package/es/locales/i18n.js
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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
|
|
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
|
|
11
|
-
|
|
12
|
-
|
|
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
|
|
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,
|
|
40
|
+
return __spreadArray([id], rest, true);
|
|
27
41
|
};
|
|
28
|
-
export
|
|
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
|
}
|
package/es/models/SavedImage.js
CHANGED
|
@@ -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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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 };
|
package/es/models/Upload.js
CHANGED
|
@@ -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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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 };
|
package/es/models/model.js
CHANGED
|
@@ -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
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
});
|
|
28
|
-
|
|
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(
|
|
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)
|
|
79
|
+
return new Promise(function (_, reject) { return reject(error); });
|
|
34
80
|
}
|
|
35
81
|
};
|
|
36
|
-
export
|
|
82
|
+
export var deleteSavedImage = function (domainUrl, slug, infos, id) {
|
|
37
83
|
try {
|
|
38
84
|
return services.mediaTemplateSavedImages.create({
|
|
39
|
-
API_HOST:
|
|
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)
|
|
91
|
+
return new Promise(function (_, reject) { return reject(error); });
|
|
46
92
|
}
|
|
47
93
|
};
|
|
48
|
-
export
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
+
}); };
|