@dreamcommerce/aurora 2.23.2 → 2.23.4-1
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/build/cjs/packages/aurora/src/assets/icon_image.js +1 -2
- package/build/cjs/packages/aurora/src/assets/icon_image.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/image_picker/index.js +1 -1
- package/build/cjs/packages/aurora/src/components/xhr_image_picker/index.js +13 -3
- package/build/cjs/packages/aurora/src/components/xhr_image_picker/index.js.map +1 -1
- package/build/cjs/packages/aurora/src/css/image_picker/main.module.less.js +1 -1
- package/build/cjs/packages/aurora/src/index.js +2 -2
- package/build/cjs/packages/star_core/build/esm/packages/star_core/src/classes/axios_http_client/axios_http_client.js +0 -5
- package/build/cjs/packages/star_core/build/esm/packages/star_core/src/classes/axios_http_client/axios_http_client.js.map +1 -1
- package/build/esm/packages/aurora/src/assets/icon_image.js +1 -2
- package/build/esm/packages/aurora/src/assets/icon_image.js.map +1 -1
- package/build/esm/packages/aurora/src/components/image_picker/index.js +1 -1
- package/build/esm/packages/aurora/src/components/xhr_image_picker/index.js +13 -3
- package/build/esm/packages/aurora/src/components/xhr_image_picker/index.js.map +1 -1
- package/build/esm/packages/aurora/src/css/image_picker/main.module.less.js +1 -1
- package/build/esm/packages/aurora/src/index.js +1 -1
- package/build/esm/packages/star_core/build/esm/packages/star_core/src/classes/axios_http_client/axios_http_client.js +0 -5
- package/build/esm/packages/star_core/build/esm/packages/star_core/src/classes/axios_http_client/axios_http_client.js.map +1 -1
- package/package.json +1 -1
|
@@ -23,8 +23,7 @@ var IconImage = function IconImage(_ref) {
|
|
|
23
23
|
}, /*#__PURE__*/React__default['default'].createElement("path", {
|
|
24
24
|
fillRule: "evenodd",
|
|
25
25
|
clipRule: "evenodd",
|
|
26
|
-
d: "M10.667.5c.696 0 1.273.542 1.329 1.224l.004.11v9.333c0 .696-.541 1.273-1.224 1.329l-.11.004H1.334a1.338 1.338 0 0 1-1.329-1.224L0 11.166V1.834C0 1.137.541.56 1.224.504L1.334.5h9.333ZM10.5 2h-9v9h9V2ZM5.464 8.505 4.125 7 2.25 9.25h7.5l-2.41-3-1.876 2.255Z"
|
|
27
|
-
fill: "#3C83EC"
|
|
26
|
+
d: "M10.667.5c.696 0 1.273.542 1.329 1.224l.004.11v9.333c0 .696-.541 1.273-1.224 1.329l-.11.004H1.334a1.338 1.338 0 0 1-1.329-1.224L0 11.166V1.834C0 1.137.541.56 1.224.504L1.334.5h9.333ZM10.5 2h-9v9h9V2ZM5.464 8.505 4.125 7 2.25 9.25h7.5l-2.41-3-1.876 2.255Z"
|
|
28
27
|
})));
|
|
29
28
|
};
|
|
30
29
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -198,7 +198,7 @@ var ImagePicker = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
198
198
|
}, function (prev, curr) {
|
|
199
199
|
var _prev$initialFile, _curr$initialFile, _prev$initialFile2, _curr$initialFile2;
|
|
200
200
|
|
|
201
|
-
return ((_prev$initialFile = prev.initialFile) === null || _prev$initialFile === void 0 ? void 0 : _prev$initialFile.fileUrl) === ((_curr$initialFile = curr.initialFile) === null || _curr$initialFile === void 0 ? void 0 : _curr$initialFile.fileUrl) && ((_prev$initialFile2 = prev.initialFile) === null || _prev$initialFile2 === void 0 ? void 0 : _prev$initialFile2.fileName) === ((_curr$initialFile2 = curr.initialFile) === null || _curr$initialFile2 === void 0 ? void 0 : _curr$initialFile2.fileName) && prev.errors === curr.errors && prev.editedImageResult === curr.editedImageResult;
|
|
201
|
+
return ((_prev$initialFile = prev.initialFile) === null || _prev$initialFile === void 0 ? void 0 : _prev$initialFile.fileUrl) === ((_curr$initialFile = curr.initialFile) === null || _curr$initialFile === void 0 ? void 0 : _curr$initialFile.fileUrl) && ((_prev$initialFile2 = prev.initialFile) === null || _prev$initialFile2 === void 0 ? void 0 : _prev$initialFile2.fileName) === ((_curr$initialFile2 = curr.initialFile) === null || _curr$initialFile2 === void 0 ? void 0 : _curr$initialFile2.fileName) && prev.errors === curr.errors && prev.editedImageResult === curr.editedImageResult && prev.topButtons === curr.topButtons;
|
|
202
202
|
});
|
|
203
203
|
|
|
204
204
|
exports.default = ImagePicker;
|
|
@@ -6,15 +6,16 @@ var React = require('react');
|
|
|
6
6
|
var useTranslation = require('../../../../../external/react-i18next/dist/es/useTranslation.js');
|
|
7
7
|
var _rollupPluginBabelHelpers = require('../../../../../_virtual/_rollupPluginBabelHelpers.js');
|
|
8
8
|
var constants = require('../file_picker/constants.js');
|
|
9
|
+
var utilities = require('@dreamcommerce/utilities');
|
|
9
10
|
var css_classes = require('../image_picker/css_classes.js');
|
|
10
11
|
var icon_image = require('../../assets/icon_image.js');
|
|
11
12
|
var main_module = require('../../css/image_picker/main.module.less.js');
|
|
12
13
|
var index = require('../image_picker/index.js');
|
|
14
|
+
var index$1 = require('../loader/index.js');
|
|
13
15
|
var use_modals_context = require('../modal_new/hooks/use_modals_context.js');
|
|
14
16
|
var modal = require('../modal_new/components/modal/modal.js');
|
|
15
17
|
var http_requester_contants = require('../../../../star_core/build/esm/packages/star_core/src/features/http_requester/http_requester_contants.js');
|
|
16
18
|
var use_http_api = require('../../hooks/use_http_api.js');
|
|
17
|
-
var index$1 = require('../loader/index.js');
|
|
18
19
|
|
|
19
20
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
20
21
|
|
|
@@ -73,6 +74,11 @@ var XhrImagePicker = function XhrImagePicker(_ref) {
|
|
|
73
74
|
isLoading = _useState10[0],
|
|
74
75
|
setIsLoading = _useState10[1];
|
|
75
76
|
|
|
77
|
+
var _useState11 = React.useState(),
|
|
78
|
+
_useState12 = _rollupPluginBabelHelpers.slicedToArray(_useState11, 2),
|
|
79
|
+
imageExtenstion = _useState12[0],
|
|
80
|
+
setImageExtenstion = _useState12[1];
|
|
81
|
+
|
|
76
82
|
var handleControlChange = /*#__PURE__*/function () {
|
|
77
83
|
var _ref2 = _rollupPluginBabelHelpers.asyncToGenerator( /*#__PURE__*/_rollupPluginBabelHelpers.regeneratorRuntime().mark(function _callee(file) {
|
|
78
84
|
var fileList, fileAsDataUrl, _httpApi$fetch, response, cancelRequest, responseObject;
|
|
@@ -132,8 +138,12 @@ var XhrImagePicker = function XhrImagePicker(_ref) {
|
|
|
132
138
|
};
|
|
133
139
|
}();
|
|
134
140
|
|
|
141
|
+
React.useEffect(function () {
|
|
142
|
+
initialFile && setImageExtenstion(utilities.FileUtils.getFileExtension(initialFile === null || initialFile === void 0 ? void 0 : initialFile.fileName));
|
|
143
|
+
}, []);
|
|
135
144
|
React.useEffect(function () {
|
|
136
145
|
initialImageFile.current = initialFile;
|
|
146
|
+
image && setImageExtenstion(utilities.FileUtils.getFileExtension(image === null || image === void 0 ? void 0 : image.name));
|
|
137
147
|
|
|
138
148
|
var setFileFromUrl = /*#__PURE__*/function () {
|
|
139
149
|
var _ref3 = _rollupPluginBabelHelpers.asyncToGenerator( /*#__PURE__*/_rollupPluginBabelHelpers.regeneratorRuntime().mark(function _callee2(fileData) {
|
|
@@ -194,7 +204,7 @@ var XhrImagePicker = function XhrImagePicker(_ref) {
|
|
|
194
204
|
allowedExtensions: allowedExtensions,
|
|
195
205
|
initialFile: initialImageFile.current,
|
|
196
206
|
onImageSizeUpdated: onImageSizeUpdated,
|
|
197
|
-
topButtons: ImageEditor && /*#__PURE__*/React__default['default'].createElement("button", {
|
|
207
|
+
topButtons: !!ImageEditor && imageExtenstion !== 'svg' && /*#__PURE__*/React__default['default'].createElement("button", {
|
|
198
208
|
className: main_module['default'][css_classes['default'].imagePickerEditButton],
|
|
199
209
|
onClick: function onClick() {
|
|
200
210
|
return showModal(modalId);
|
|
@@ -206,7 +216,7 @@ var XhrImagePicker = function XhrImagePicker(_ref) {
|
|
|
206
216
|
className: main_module['default'][css_classes['default'].imagePickerLoadingWrapperContent]
|
|
207
217
|
}, /*#__PURE__*/React__default['default'].createElement(index$1['default'], null), /*#__PURE__*/React__default['default'].createElement("span", {
|
|
208
218
|
className: main_module['default'][css_classes['default'].imagePickerLoadingWrapperContentText]
|
|
209
|
-
}, t('Transfering file...')))), ImageEditor && /*#__PURE__*/React__default['default'].createElement(modal.ModalNew, {
|
|
219
|
+
}, t('Transfering file...')))), !!ImageEditor && /*#__PURE__*/React__default['default'].createElement(modal.ModalNew, {
|
|
210
220
|
name: modalId,
|
|
211
221
|
header: t('Edit image'),
|
|
212
222
|
minWidth: "80vw"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,6BAA6B,iEAAqE;AAClG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,6BAA6B,iEAAqE;AAClG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var styleInject_es = require('../../../../../external/style-inject/dist/style-inject.es.js');
|
|
6
6
|
|
|
7
|
-
var css_248z = "/* font colors */\n/* actions */\n/* background */\n/* errors */\n/* borders */\n/* grid */\n/* scrollBar */\n/* sizes */\n.main-module_image-picker__wrapper__2RK3f {\n position: relative;\n border: 1px dashed #abb4cd;\n border-radius: 2px;\n}\n.main-module_image-picker__wrapper-error__kCZeA {\n border-color: #e60c54;\n}\n.main-module_image-picker__wrapper-error__kCZeA:hover {\n border-color: #e60c54;\n}\n.main-module_image-picker__wrapper-has-file__2zmRc {\n position: relative;\n}\n.main-module_image-picker__wrapper-has-file__2zmRc .main-module_image-picker__label__1i_Fq {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 46px;\n left: 0;\n}\n.main-module_image-picker__wrapper-has-file__2zmRc .main-module_image-picker__description__1v13N {\n display: none;\n}\n.main-module_image-picker__wrapper__2RK3f:hover {\n border-color: #135cc8;\n}\n.main-module_image-picker__wrapper__2RK3f:hover .main-module_image-picker__upload-icon__3sMvN {\n fill: #3c83ec;\n}\n.main-module_image-picker__wrapper-top-buttons__241RY {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n top: 1rem;\n right: 1rem;\n z-index: 10;\n}\n.main-module_image-picker__edit-button__3O-iq {\n display: flex;\n align-items: center;\n gap: 4px;\n background-color: #ffffff;\n background-image: none;\n border:
|
|
7
|
+
var css_248z = "/* font colors */\n/* actions */\n/* background */\n/* errors */\n/* borders */\n/* grid */\n/* scrollBar */\n/* sizes */\n.main-module_image-picker__wrapper__2RK3f {\n position: relative;\n border: 1px dashed #abb4cd;\n border-radius: 2px;\n}\n.main-module_image-picker__wrapper-error__kCZeA {\n border-color: #e60c54;\n}\n.main-module_image-picker__wrapper-error__kCZeA:hover {\n border-color: #e60c54;\n}\n.main-module_image-picker__wrapper-has-file__2zmRc {\n position: relative;\n}\n.main-module_image-picker__wrapper-has-file__2zmRc .main-module_image-picker__label__1i_Fq {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 46px;\n left: 0;\n}\n.main-module_image-picker__wrapper-has-file__2zmRc .main-module_image-picker__description__1v13N {\n display: none;\n}\n.main-module_image-picker__wrapper__2RK3f:hover {\n border-color: #135cc8;\n}\n.main-module_image-picker__wrapper__2RK3f:hover .main-module_image-picker__upload-icon__3sMvN {\n fill: #3c83ec;\n}\n.main-module_image-picker__wrapper-top-buttons__241RY {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n top: 1rem;\n right: 1rem;\n z-index: 10;\n}\n.main-module_image-picker__edit-button__3O-iq {\n display: flex;\n align-items: center;\n gap: 4px;\n background-color: #ffffff;\n background-image: none;\n border: 1px solid #3c83ec;\n border-radius: 2px;\n padding: 0.5rem;\n color: #3c83ec;\n cursor: pointer;\n}\n.main-module_image-picker__edit-button__3O-iq svg {\n fill: #3c83ec;\n}\n.main-module_image-picker__edit-button__3O-iq:hover {\n border-color: #135cc8;\n color: #135cc8;\n}\n.main-module_image-picker__edit-button__3O-iq:hover svg {\n fill: #135cc8;\n}\n.main-module_image-picker__label__1i_Fq {\n cursor: pointer;\n}\n.main-module_image-picker__input__3Wu2I {\n display: none;\n}\n.main-module_image-picker__description__1v13N {\n padding: 2rem 0;\n text-align: center;\n color: #3c83ec;\n}\n.main-module_image-picker__supported-formats__1_R_X {\n font-size: 12px;\n color: #59687e;\n}\n.main-module_image-picker__upload-icon__3sMvN {\n width: 1rem;\n height: auto;\n margin-bottom: 1rem;\n fill: #abb4cd;\n}\n.main-module_image-picker__delete-button__21_kT {\n display: flex;\n align-items: center;\n font-size: 12px;\n color: #3c83ec;\n cursor: pointer;\n background: transparent;\n}\n.main-module_image-picker__delete-button__21_kT:hover .main-module_image-picker__delete-label__3v2ot {\n text-decoration: underline;\n}\n.main-module_image-picker__delete-button__21_kT .main-module_image-picker__delete-label__3v2ot {\n color: #3c83ec;\n}\n.main-module_image-picker__delete-button__21_kT svg {\n fill: #3c83ec;\n}\n.main-module_image-picker__wrong-file-format-icon__X-NL0 {\n margin: 2rem 0 0.5rem;\n fill: #ffffff;\n}\n.main-module_image-picker__delete-icon__30pkO {\n fill: #3c83ec;\n margin-right: 0.5rem;\n}\n.main-module_image-picker__selected-file__3bRqa {\n display: flex;\n align-items: center;\n justify-content: space-between;\n height: 46px;\n}\n.main-module_image-picker__selected-file-name-wrapper__37MKd,\n.main-module_image-picker__selected-file-remove-wrapper__2v4W2 {\n padding: 1rem;\n}\n.main-module_image-picker__selected-file-remove-wrapper__2v4W2 {\n display: flex;\n justify-content: flex-end;\n}\n.main-module_image-picker__selected-file-name-wrapper__37MKd {\n color: #59687e;\n}\n.main-module_image-picker__image-preview-wrapper__1jPXU {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 130px;\n}\n.main-module_image-picker__image-preview-wrapper__1jPXU svg {\n fill: transparent;\n}\n.main-module_image-picker__image-preview__12pRu {\n max-width: 100%;\n max-height: 100%;\n}\n.main-module_image-picker__error-text__rXAvw {\n margin-top: 0.5rem;\n color: #e60c54;\n}\n.main-module_image-picker__loading-wrapper__gBtlh {\n position: relative;\n}\n.main-module_image-picker__loading-wrapper-content__21jzx {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n background-color: #ffffff;\n width: 100%;\n height: 100%;\n border: 1px dashed #abb4cd;\n border-radius: 2px;\n}\n.main-module_image-picker__loading-wrapper-content-text__2-Fup {\n color: #5c657e;\n margin-top: 0.5rem;\n}\n";
|
|
8
8
|
var styles = {
|
|
9
9
|
"image-picker__wrapper": "main-module_image-picker__wrapper__2RK3f",
|
|
10
10
|
"image-picker__wrapper-error": "main-module_image-picker__wrapper-error__kCZeA",
|
|
@@ -45,9 +45,9 @@ var index$x = require('./components/tags_selector/index.js');
|
|
|
45
45
|
var index$y = require('./components/controls/hoc/control_tags_selector/index.js');
|
|
46
46
|
var index$g = require('./components/controls/hoc/control_textarea/index.js');
|
|
47
47
|
var index$F = require('./components/image_picker/index.js');
|
|
48
|
+
var index$L = require('./components/loader/index.js');
|
|
48
49
|
var use_modals_context = require('./components/modal_new/hooks/use_modals_context.js');
|
|
49
50
|
var modal = require('./components/modal_new/components/modal/modal.js');
|
|
50
|
-
var index$L = require('./components/loader/index.js');
|
|
51
51
|
var index$P = require('./components/xhr_image_picker/index.js');
|
|
52
52
|
var index$p = require('./components/controls/hoc/control_xhr_image_picker/index.js');
|
|
53
53
|
var index$z = require('./components/table/index.js');
|
|
@@ -143,9 +143,9 @@ exports.TagsSelector = index$x['default'];
|
|
|
143
143
|
exports.ControlTagsSelector = index$y['default'];
|
|
144
144
|
exports.ControlTextarea = index$g['default'];
|
|
145
145
|
exports.ImagePicker = index$F['default'];
|
|
146
|
+
exports.Loader = index$L['default'];
|
|
146
147
|
exports.useModalsContext = use_modals_context.useModalsContext;
|
|
147
148
|
exports.ModalNew = modal.ModalNew;
|
|
148
|
-
exports.Loader = index$L['default'];
|
|
149
149
|
exports.XhrImagePicker = index$P['default'];
|
|
150
150
|
exports.ControlXhrImagePicker = index$p['default'];
|
|
151
151
|
exports.Table = index$z['default'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -15,8 +15,7 @@ var IconImage = function IconImage(_ref) {
|
|
|
15
15
|
}, /*#__PURE__*/React.createElement("path", {
|
|
16
16
|
fillRule: "evenodd",
|
|
17
17
|
clipRule: "evenodd",
|
|
18
|
-
d: "M10.667.5c.696 0 1.273.542 1.329 1.224l.004.11v9.333c0 .696-.541 1.273-1.224 1.329l-.11.004H1.334a1.338 1.338 0 0 1-1.329-1.224L0 11.166V1.834C0 1.137.541.56 1.224.504L1.334.5h9.333ZM10.5 2h-9v9h9V2ZM5.464 8.505 4.125 7 2.25 9.25h7.5l-2.41-3-1.876 2.255Z"
|
|
19
|
-
fill: "#3C83EC"
|
|
18
|
+
d: "M10.667.5c.696 0 1.273.542 1.329 1.224l.004.11v9.333c0 .696-.541 1.273-1.224 1.329l-.11.004H1.334a1.338 1.338 0 0 1-1.329-1.224L0 11.166V1.834C0 1.137.541.56 1.224.504L1.334.5h9.333ZM10.5 2h-9v9h9V2ZM5.464 8.505 4.125 7 2.25 9.25h7.5l-2.41-3-1.876 2.255Z"
|
|
20
19
|
})));
|
|
21
20
|
};
|
|
22
21
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -189,7 +189,7 @@ var ImagePicker = /*#__PURE__*/memo(function (_ref) {
|
|
|
189
189
|
}, function (prev, curr) {
|
|
190
190
|
var _prev$initialFile, _curr$initialFile, _prev$initialFile2, _curr$initialFile2;
|
|
191
191
|
|
|
192
|
-
return ((_prev$initialFile = prev.initialFile) === null || _prev$initialFile === void 0 ? void 0 : _prev$initialFile.fileUrl) === ((_curr$initialFile = curr.initialFile) === null || _curr$initialFile === void 0 ? void 0 : _curr$initialFile.fileUrl) && ((_prev$initialFile2 = prev.initialFile) === null || _prev$initialFile2 === void 0 ? void 0 : _prev$initialFile2.fileName) === ((_curr$initialFile2 = curr.initialFile) === null || _curr$initialFile2 === void 0 ? void 0 : _curr$initialFile2.fileName) && prev.errors === curr.errors && prev.editedImageResult === curr.editedImageResult;
|
|
192
|
+
return ((_prev$initialFile = prev.initialFile) === null || _prev$initialFile === void 0 ? void 0 : _prev$initialFile.fileUrl) === ((_curr$initialFile = curr.initialFile) === null || _curr$initialFile === void 0 ? void 0 : _curr$initialFile.fileUrl) && ((_prev$initialFile2 = prev.initialFile) === null || _prev$initialFile2 === void 0 ? void 0 : _prev$initialFile2.fileName) === ((_curr$initialFile2 = curr.initialFile) === null || _curr$initialFile2 === void 0 ? void 0 : _curr$initialFile2.fileName) && prev.errors === curr.errors && prev.editedImageResult === curr.editedImageResult && prev.topButtons === curr.topButtons;
|
|
193
193
|
});
|
|
194
194
|
|
|
195
195
|
export default ImagePicker;
|
|
@@ -2,15 +2,16 @@ import React, { useRef, useState, useEffect } from 'react';
|
|
|
2
2
|
import { useTranslation } from '../../../../../external/react-i18next/dist/es/useTranslation.js';
|
|
3
3
|
import { slicedToArray as _slicedToArray, objectSpread2 as _objectSpread2, asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime } from '../../../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
4
4
|
import { FILES_EXTENSIONS } from '../file_picker/constants.js';
|
|
5
|
+
import { FileUtils } from '@dreamcommerce/utilities';
|
|
5
6
|
import CSS_CLASSES from '../image_picker/css_classes.js';
|
|
6
7
|
import IconImage from '../../assets/icon_image.js';
|
|
7
8
|
import styles from '../../css/image_picker/main.module.less.js';
|
|
8
9
|
import ImagePicker from '../image_picker/index.js';
|
|
10
|
+
import Loader from '../loader/index.js';
|
|
9
11
|
import { useModalsContext } from '../modal_new/hooks/use_modals_context.js';
|
|
10
12
|
import { ModalNew } from '../modal_new/components/modal/modal.js';
|
|
11
13
|
import { REQUEST_TYPES } from '../../../../star_core/build/esm/packages/star_core/src/features/http_requester/http_requester_contants.js';
|
|
12
14
|
import { useHttpApi } from '../../hooks/use_http_api.js';
|
|
13
|
-
import Loader from '../loader/index.js';
|
|
14
15
|
|
|
15
16
|
var XhrImagePicker = function XhrImagePicker(_ref) {
|
|
16
17
|
var id = _ref.id,
|
|
@@ -65,6 +66,11 @@ var XhrImagePicker = function XhrImagePicker(_ref) {
|
|
|
65
66
|
isLoading = _useState10[0],
|
|
66
67
|
setIsLoading = _useState10[1];
|
|
67
68
|
|
|
69
|
+
var _useState11 = useState(),
|
|
70
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
71
|
+
imageExtenstion = _useState12[0],
|
|
72
|
+
setImageExtenstion = _useState12[1];
|
|
73
|
+
|
|
68
74
|
var handleControlChange = /*#__PURE__*/function () {
|
|
69
75
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) {
|
|
70
76
|
var fileList, fileAsDataUrl, _httpApi$fetch, response, cancelRequest, responseObject;
|
|
@@ -124,8 +130,12 @@ var XhrImagePicker = function XhrImagePicker(_ref) {
|
|
|
124
130
|
};
|
|
125
131
|
}();
|
|
126
132
|
|
|
133
|
+
useEffect(function () {
|
|
134
|
+
initialFile && setImageExtenstion(FileUtils.getFileExtension(initialFile === null || initialFile === void 0 ? void 0 : initialFile.fileName));
|
|
135
|
+
}, []);
|
|
127
136
|
useEffect(function () {
|
|
128
137
|
initialImageFile.current = initialFile;
|
|
138
|
+
image && setImageExtenstion(FileUtils.getFileExtension(image === null || image === void 0 ? void 0 : image.name));
|
|
129
139
|
|
|
130
140
|
var setFileFromUrl = /*#__PURE__*/function () {
|
|
131
141
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(fileData) {
|
|
@@ -186,7 +196,7 @@ var XhrImagePicker = function XhrImagePicker(_ref) {
|
|
|
186
196
|
allowedExtensions: allowedExtensions,
|
|
187
197
|
initialFile: initialImageFile.current,
|
|
188
198
|
onImageSizeUpdated: onImageSizeUpdated,
|
|
189
|
-
topButtons: ImageEditor && /*#__PURE__*/React.createElement("button", {
|
|
199
|
+
topButtons: !!ImageEditor && imageExtenstion !== 'svg' && /*#__PURE__*/React.createElement("button", {
|
|
190
200
|
className: styles[CSS_CLASSES.imagePickerEditButton],
|
|
191
201
|
onClick: function onClick() {
|
|
192
202
|
return showModal(modalId);
|
|
@@ -198,7 +208,7 @@ var XhrImagePicker = function XhrImagePicker(_ref) {
|
|
|
198
208
|
className: styles[CSS_CLASSES.imagePickerLoadingWrapperContent]
|
|
199
209
|
}, /*#__PURE__*/React.createElement(Loader, null), /*#__PURE__*/React.createElement("span", {
|
|
200
210
|
className: styles[CSS_CLASSES.imagePickerLoadingWrapperContentText]
|
|
201
|
-
}, t('Transfering file...')))), ImageEditor && /*#__PURE__*/React.createElement(ModalNew, {
|
|
211
|
+
}, t('Transfering file...')))), !!ImageEditor && /*#__PURE__*/React.createElement(ModalNew, {
|
|
202
212
|
name: modalId,
|
|
203
213
|
header: t('Edit image'),
|
|
204
214
|
minWidth: "80vw"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA,+BAA+B,iEAAqE;AACpG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA,+BAA+B,iEAAqE;AACpG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styleInject from '../../../../../external/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = "/* font colors */\n/* actions */\n/* background */\n/* errors */\n/* borders */\n/* grid */\n/* scrollBar */\n/* sizes */\n.main-module_image-picker__wrapper__2RK3f {\n position: relative;\n border: 1px dashed #abb4cd;\n border-radius: 2px;\n}\n.main-module_image-picker__wrapper-error__kCZeA {\n border-color: #e60c54;\n}\n.main-module_image-picker__wrapper-error__kCZeA:hover {\n border-color: #e60c54;\n}\n.main-module_image-picker__wrapper-has-file__2zmRc {\n position: relative;\n}\n.main-module_image-picker__wrapper-has-file__2zmRc .main-module_image-picker__label__1i_Fq {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 46px;\n left: 0;\n}\n.main-module_image-picker__wrapper-has-file__2zmRc .main-module_image-picker__description__1v13N {\n display: none;\n}\n.main-module_image-picker__wrapper__2RK3f:hover {\n border-color: #135cc8;\n}\n.main-module_image-picker__wrapper__2RK3f:hover .main-module_image-picker__upload-icon__3sMvN {\n fill: #3c83ec;\n}\n.main-module_image-picker__wrapper-top-buttons__241RY {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n top: 1rem;\n right: 1rem;\n z-index: 10;\n}\n.main-module_image-picker__edit-button__3O-iq {\n display: flex;\n align-items: center;\n gap: 4px;\n background-color: #ffffff;\n background-image: none;\n border:
|
|
3
|
+
var css_248z = "/* font colors */\n/* actions */\n/* background */\n/* errors */\n/* borders */\n/* grid */\n/* scrollBar */\n/* sizes */\n.main-module_image-picker__wrapper__2RK3f {\n position: relative;\n border: 1px dashed #abb4cd;\n border-radius: 2px;\n}\n.main-module_image-picker__wrapper-error__kCZeA {\n border-color: #e60c54;\n}\n.main-module_image-picker__wrapper-error__kCZeA:hover {\n border-color: #e60c54;\n}\n.main-module_image-picker__wrapper-has-file__2zmRc {\n position: relative;\n}\n.main-module_image-picker__wrapper-has-file__2zmRc .main-module_image-picker__label__1i_Fq {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 46px;\n left: 0;\n}\n.main-module_image-picker__wrapper-has-file__2zmRc .main-module_image-picker__description__1v13N {\n display: none;\n}\n.main-module_image-picker__wrapper__2RK3f:hover {\n border-color: #135cc8;\n}\n.main-module_image-picker__wrapper__2RK3f:hover .main-module_image-picker__upload-icon__3sMvN {\n fill: #3c83ec;\n}\n.main-module_image-picker__wrapper-top-buttons__241RY {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n top: 1rem;\n right: 1rem;\n z-index: 10;\n}\n.main-module_image-picker__edit-button__3O-iq {\n display: flex;\n align-items: center;\n gap: 4px;\n background-color: #ffffff;\n background-image: none;\n border: 1px solid #3c83ec;\n border-radius: 2px;\n padding: 0.5rem;\n color: #3c83ec;\n cursor: pointer;\n}\n.main-module_image-picker__edit-button__3O-iq svg {\n fill: #3c83ec;\n}\n.main-module_image-picker__edit-button__3O-iq:hover {\n border-color: #135cc8;\n color: #135cc8;\n}\n.main-module_image-picker__edit-button__3O-iq:hover svg {\n fill: #135cc8;\n}\n.main-module_image-picker__label__1i_Fq {\n cursor: pointer;\n}\n.main-module_image-picker__input__3Wu2I {\n display: none;\n}\n.main-module_image-picker__description__1v13N {\n padding: 2rem 0;\n text-align: center;\n color: #3c83ec;\n}\n.main-module_image-picker__supported-formats__1_R_X {\n font-size: 12px;\n color: #59687e;\n}\n.main-module_image-picker__upload-icon__3sMvN {\n width: 1rem;\n height: auto;\n margin-bottom: 1rem;\n fill: #abb4cd;\n}\n.main-module_image-picker__delete-button__21_kT {\n display: flex;\n align-items: center;\n font-size: 12px;\n color: #3c83ec;\n cursor: pointer;\n background: transparent;\n}\n.main-module_image-picker__delete-button__21_kT:hover .main-module_image-picker__delete-label__3v2ot {\n text-decoration: underline;\n}\n.main-module_image-picker__delete-button__21_kT .main-module_image-picker__delete-label__3v2ot {\n color: #3c83ec;\n}\n.main-module_image-picker__delete-button__21_kT svg {\n fill: #3c83ec;\n}\n.main-module_image-picker__wrong-file-format-icon__X-NL0 {\n margin: 2rem 0 0.5rem;\n fill: #ffffff;\n}\n.main-module_image-picker__delete-icon__30pkO {\n fill: #3c83ec;\n margin-right: 0.5rem;\n}\n.main-module_image-picker__selected-file__3bRqa {\n display: flex;\n align-items: center;\n justify-content: space-between;\n height: 46px;\n}\n.main-module_image-picker__selected-file-name-wrapper__37MKd,\n.main-module_image-picker__selected-file-remove-wrapper__2v4W2 {\n padding: 1rem;\n}\n.main-module_image-picker__selected-file-remove-wrapper__2v4W2 {\n display: flex;\n justify-content: flex-end;\n}\n.main-module_image-picker__selected-file-name-wrapper__37MKd {\n color: #59687e;\n}\n.main-module_image-picker__image-preview-wrapper__1jPXU {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 130px;\n}\n.main-module_image-picker__image-preview-wrapper__1jPXU svg {\n fill: transparent;\n}\n.main-module_image-picker__image-preview__12pRu {\n max-width: 100%;\n max-height: 100%;\n}\n.main-module_image-picker__error-text__rXAvw {\n margin-top: 0.5rem;\n color: #e60c54;\n}\n.main-module_image-picker__loading-wrapper__gBtlh {\n position: relative;\n}\n.main-module_image-picker__loading-wrapper-content__21jzx {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n background-color: #ffffff;\n width: 100%;\n height: 100%;\n border: 1px dashed #abb4cd;\n border-radius: 2px;\n}\n.main-module_image-picker__loading-wrapper-content-text__2-Fup {\n color: #5c657e;\n margin-top: 0.5rem;\n}\n";
|
|
4
4
|
var styles = {
|
|
5
5
|
"image-picker__wrapper": "main-module_image-picker__wrapper__2RK3f",
|
|
6
6
|
"image-picker__wrapper-error": "main-module_image-picker__wrapper-error__kCZeA",
|
|
@@ -41,9 +41,9 @@ export { default as TagsSelector } from './components/tags_selector/index.js';
|
|
|
41
41
|
export { default as ControlTagsSelector } from './components/controls/hoc/control_tags_selector/index.js';
|
|
42
42
|
export { default as ControlTextarea } from './components/controls/hoc/control_textarea/index.js';
|
|
43
43
|
export { default as ImagePicker } from './components/image_picker/index.js';
|
|
44
|
+
export { default as Loader } from './components/loader/index.js';
|
|
44
45
|
export { useModalsContext } from './components/modal_new/hooks/use_modals_context.js';
|
|
45
46
|
export { ModalNew } from './components/modal_new/components/modal/modal.js';
|
|
46
|
-
export { default as Loader } from './components/loader/index.js';
|
|
47
47
|
export { default as XhrImagePicker } from './components/xhr_image_picker/index.js';
|
|
48
48
|
export { default as ControlXhrImagePicker } from './components/controls/hoc/control_xhr_image_picker/index.js';
|
|
49
49
|
export { default as Table } from './components/table/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|