@dreamcommerce/aurora 2.5.2 → 2.5.3-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.
Files changed (52) hide show
  1. package/build/cjs/packages/aurora/src/components/file_picker/constants.js +19 -0
  2. package/build/cjs/packages/aurora/src/components/file_picker/constants.js.map +1 -0
  3. package/build/cjs/packages/aurora/src/components/file_picker/use_file_picker.js +50 -2
  4. package/build/cjs/packages/aurora/src/components/file_picker/use_file_picker.js.map +1 -1
  5. package/build/cjs/packages/aurora/src/components/modal/components/modal.js +2 -2
  6. package/build/cjs/packages/aurora/src/css/modal/main.module.less.js +1 -1
  7. package/build/cjs/packages/aurora/src/translations/en.json.js +4 -1
  8. package/build/cjs/packages/aurora/src/translations/en.json.js.map +1 -1
  9. package/build/cjs/packages/aurora/src/translations/pl.json.js +4 -1
  10. package/build/cjs/packages/aurora/src/translations/pl.json.js.map +1 -1
  11. package/build/esm/packages/aurora/src/assets/icon_wrong_file_format.d.ts +4 -0
  12. package/build/esm/packages/aurora/src/assets/icon_wrong_file_format.js +13 -0
  13. package/build/esm/packages/aurora/src/assets/icon_wrong_file_format.js.map +1 -0
  14. package/build/esm/packages/aurora/src/components/controls/hoc/control_image_picker/index.d.ts +4 -0
  15. package/build/esm/packages/aurora/src/components/controls/hoc/control_image_picker/index.js +17 -0
  16. package/build/esm/packages/aurora/src/components/controls/hoc/control_image_picker/index.js.map +1 -0
  17. package/build/esm/packages/aurora/src/components/controls/types.d.ts +10 -0
  18. package/build/esm/packages/aurora/src/components/file_picker/constants.d.ts +8 -0
  19. package/build/esm/packages/aurora/src/components/file_picker/constants.js +11 -0
  20. package/build/esm/packages/aurora/src/components/file_picker/constants.js.map +1 -0
  21. package/build/esm/packages/aurora/src/components/file_picker/types.d.ts +3 -0
  22. package/build/esm/packages/aurora/src/components/file_picker/use_file_picker.d.ts +1 -1
  23. package/build/esm/packages/aurora/src/components/file_picker/use_file_picker.js +50 -2
  24. package/build/esm/packages/aurora/src/components/file_picker/use_file_picker.js.map +1 -1
  25. package/build/esm/packages/aurora/src/components/image_picker/components/image_input.d.ts +4 -0
  26. package/build/esm/packages/aurora/src/components/image_picker/components/image_input.js +22 -0
  27. package/build/esm/packages/aurora/src/components/image_picker/components/image_input.js.map +1 -0
  28. package/build/esm/packages/aurora/src/components/image_picker/components/selected_image_preview.d.ts +4 -0
  29. package/build/esm/packages/aurora/src/components/image_picker/components/selected_image_preview.js +28 -0
  30. package/build/esm/packages/aurora/src/components/image_picker/components/selected_image_preview.js.map +1 -0
  31. package/build/esm/packages/aurora/src/components/image_picker/css_classes.d.ts +22 -0
  32. package/build/esm/packages/aurora/src/components/image_picker/css_classes.js +23 -0
  33. package/build/esm/packages/aurora/src/components/image_picker/css_classes.js.map +1 -0
  34. package/build/esm/packages/aurora/src/components/image_picker/index.d.ts +4 -0
  35. package/build/esm/packages/aurora/src/components/image_picker/index.js +93 -0
  36. package/build/esm/packages/aurora/src/components/image_picker/index.js.map +1 -0
  37. package/build/esm/packages/aurora/src/components/image_picker/types.d.ts +37 -0
  38. package/build/esm/packages/aurora/src/components/image_picker/types.js +2 -0
  39. package/build/esm/packages/aurora/src/components/image_picker/types.js.map +1 -0
  40. package/build/esm/packages/aurora/src/components/image_picker/utils.d.ts +1 -0
  41. package/build/esm/packages/aurora/src/components/image_picker/utils.js +5 -0
  42. package/build/esm/packages/aurora/src/components/image_picker/utils.js.map +1 -0
  43. package/build/esm/packages/aurora/src/components/modal/components/modal.js +2 -2
  44. package/build/esm/packages/aurora/src/css/modal/main.module.less.js +1 -1
  45. package/build/esm/packages/aurora/src/hooks/use_fixed_child_position.d.ts +1 -1
  46. package/build/esm/packages/aurora/src/translations/en.json +4 -1
  47. package/build/esm/packages/aurora/src/translations/en.json.js +4 -1
  48. package/build/esm/packages/aurora/src/translations/en.json.js.map +1 -1
  49. package/build/esm/packages/aurora/src/translations/pl.json +4 -1
  50. package/build/esm/packages/aurora/src/translations/pl.json.js +4 -1
  51. package/build/esm/packages/aurora/src/translations/pl.json.js.map +1 -1
  52. package/package.json +1 -1
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const FILE_PICKER_ERROR = {
6
+ invalidFileFormat: 'Invalid file format',
7
+ invalidInputWidth: 'The value cannot be greater than the width of the uploaded file'
8
+ };
9
+ const JPG_EXTENSION = 'jpg';
10
+ const JPEG_EXTENSION = 'jpeg';
11
+ const SVG_MIME_TYPE = 'svg+xml';
12
+ const SVG_EXTENSION = 'svg';
13
+
14
+ exports.FILE_PICKER_ERROR = FILE_PICKER_ERROR;
15
+ exports.JPEG_EXTENSION = JPEG_EXTENSION;
16
+ exports.JPG_EXTENSION = JPG_EXTENSION;
17
+ exports.SVG_EXTENSION = SVG_EXTENSION;
18
+ exports.SVG_MIME_TYPE = SVG_MIME_TYPE;
19
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +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;"}
@@ -3,11 +3,14 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
+ var constants = require('./constants.js');
6
7
 
7
- const useFilePicker = ({ onChange, initialFile }) => {
8
+ const useFilePicker = ({ onChange, initialFile, allowedExtensions }) => {
8
9
  const [file, setFile] = React.useState(initialFile);
10
+ const [errors, setErrors] = React.useState([]);
9
11
  const [isDragOver, setDragOver] = React.useState(false);
10
12
  const [isPreview, setPreview] = React.useState(true);
13
+ const [isVectorImage, setIsVectorImage] = React.useState(false);
11
14
  React.useEffect(() => {
12
15
  setFile(initialFile);
13
16
  }, [initialFile]);
@@ -15,9 +18,49 @@ const useFilePicker = ({ onChange, initialFile }) => {
15
18
  event.stopPropagation();
16
19
  event.preventDefault();
17
20
  const { dataTransfer: { files } } = event;
21
+ setFileFormatError(checkIfFileIsInCorrectFormat(allowedExtensions, files[0].type));
22
+ checkIfImageIsVector(files[0].type);
18
23
  setDragOver(false);
19
24
  updateFile(files);
20
25
  };
26
+ const checkIfFileIsInCorrectFormat = (allowedExtensions, fileType) => {
27
+ if (!allowedExtensions)
28
+ return;
29
+ const fileExtension = getFileExtension(fileType);
30
+ let formatIsCorrect;
31
+ if (Array.isArray(fileExtension)) {
32
+ formatIsCorrect = allowedExtensions.some((extension) => fileExtension.includes(extension.toLowerCase()));
33
+ }
34
+ else {
35
+ formatIsCorrect = allowedExtensions === null || allowedExtensions === void 0 ? void 0 : allowedExtensions.some((extension) => {
36
+ return extension.toLowerCase() === fileExtension.toLowerCase();
37
+ });
38
+ }
39
+ return formatIsCorrect;
40
+ };
41
+ const setFileFormatError = (isFileFormatCorrect) => {
42
+ if (!isFileFormatCorrect) {
43
+ setErrors([...errors, constants.FILE_PICKER_ERROR.invalidFileFormat]);
44
+ }
45
+ else {
46
+ setErrors([]);
47
+ }
48
+ };
49
+ const getFileExtension = (fileType) => {
50
+ const substringIndex = fileType.lastIndexOf('/');
51
+ const fileExtension = fileType.substring(substringIndex + 1);
52
+ if (fileExtension === constants.JPG_EXTENSION || fileExtension === constants.JPEG_EXTENSION) {
53
+ return [constants.JPG_EXTENSION, constants.JPEG_EXTENSION];
54
+ }
55
+ else if (fileExtension === constants.SVG_MIME_TYPE) {
56
+ return constants.SVG_EXTENSION;
57
+ }
58
+ return fileExtension;
59
+ };
60
+ const checkIfImageIsVector = (fileType) => {
61
+ const fileExtenstion = getFileExtension(fileType);
62
+ fileExtenstion === 'svg' ? setIsVectorImage(true) : setIsVectorImage(false);
63
+ };
21
64
  const onFileChange = ({ target: { files } }) => {
22
65
  updateFile(files);
23
66
  };
@@ -27,6 +70,8 @@ const useFilePicker = ({ onChange, initialFile }) => {
27
70
  fileName: files === null || files === void 0 ? void 0 : files[0].name,
28
71
  fileUrl: URL.createObjectURL(files === null || files === void 0 ? void 0 : files[0])
29
72
  });
73
+ setFileFormatError(checkIfFileIsInCorrectFormat(allowedExtensions, files[0].type));
74
+ checkIfImageIsVector(files[0].type);
30
75
  }
31
76
  else {
32
77
  setFile(undefined);
@@ -48,6 +93,7 @@ const useFilePicker = ({ onChange, initialFile }) => {
48
93
  const onFileDelete = () => {
49
94
  setFile(undefined);
50
95
  setPreview(true);
96
+ setErrors([]);
51
97
  onChange === null || onChange === void 0 ? void 0 : onChange(null);
52
98
  };
53
99
  const onPreviewError = () => {
@@ -61,8 +107,10 @@ const useFilePicker = ({ onChange, initialFile }) => {
61
107
  onFileDelete,
62
108
  onPreviewError,
63
109
  file,
110
+ errors,
64
111
  isPreview,
65
- isDragOver
112
+ isDragOver,
113
+ isVectorImage
66
114
  };
67
115
  };
68
116
 
@@ -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;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -9,8 +9,8 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
9
9
 
10
10
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
11
11
 
12
- const Modal = ({ children, className, modalRef }) => {
13
- return (React__default['default'].createElement("div", { "data-test-id": "modal", ref: modalRef, className: `${main_module['default']['modal-window']} ${main_module['default']['modal-window_visible']} ${className}` },
12
+ const Modal = ({ children, className, modalRef, style = {} }) => {
13
+ return (React__default['default'].createElement("div", { style: style, "data-test-id": "modal", ref: modalRef, className: `${main_module['default']['modal-window']} ${main_module['default']['modal-window_visible']} ${className}` },
14
14
  React__default['default'].createElement("div", { className: main_module['default']['modal-window__body'] }, children)));
15
15
  };
16
16
 
@@ -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_modal-window__1epDY {\n flex-direction: column;\n position: relative;\n z-index: 2000;\n max-width: 1400px;\n max-height: 100%;\n min-width: 320px;\n background-color: #ffffff;\n border-radius: 5px;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.33);\n transition: all 0.25s ease;\n}\n.main-module_modal-window_show-transition-start__20Zyy,\n.main-module_modal-window_hide-transition-end__2tbM7 {\n opacity: 0;\n transform: translate3d(0, -20vh, 0);\n}\n.main-module_modal-window_show-transition-end__1bGXM,\n.main-module_modal-window_hide-transition-start__3v2ve {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n}\n.main-module_modal-window_show-tooltip-transition-start__3T6jk,\n.main-module_modal-window_hide-tooltip-transition-end__1-Elu {\n opacity: 0;\n}\n.main-module_modal-window_show-tooltip-transition-end__3qcFY,\n.main-module_modal-window_hide-tooltip-transition-start__1LrQS {\n opacity: 1;\n}\n.main-module_modal-window_visible__Y9ArZ {\n display: flex;\n}\n.main-module_modal-window_relative__2bV4q {\n position: absolute;\n}\n.main-module_modal-window_loading__i6ehQ {\n min-width: auto;\n}\n.main-module_modal-window_small__2ohvZ {\n max-width: 440px;\n}\n.main-module_modal-window__body__o4m8Y {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n max-height: calc(var(--vh, 1vh) * 100 - (2 * 1rem));\n}\n.main-module_modal-window__body_no-overflow__144M5 {\n overflow: visible;\n}\n.main-module_modal-window__header__vMn-j {\n flex: 0 0 auto;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 2rem 2rem 0.5rem 2rem;\n}\n.main-module_modal-window__header-actions__Qj4RZ {\n margin-left: 2rem;\n}\n.main-module_modal-window__close-icon__32GlC {\n cursor: pointer;\n fill: #5c657e;\n}\n.main-module_modal-window__close-icon__32GlC * {\n fill: #5c657e;\n}\n.main-module_modal-window__content__2Yq_0 {\n overflow-y: auto;\n -ms-scroll-chaining: none;\n overscroll-behavior: none;\n padding: 1rem 2rem 1rem 2rem;\n}\n.main-module_modal-window__content_no-overflow__d24L_ {\n overflow-y: visible;\n}\n.main-module_modal-window__footer__1o3OM {\n padding: 0.75rem 2rem;\n text-align: right;\n border-top: 1px solid #ececec;\n border-bottom: 2px solid transparent;\n}\n.main-module_modal-window-mask__mR_gM {\n align-items: center;\n justify-content: center;\n position: fixed;\n top: 0;\n left: 0;\n z-index: 1900;\n background-color: rgba(0, 0, 0, 0.5);\n width: calc(100vw);\n height: calc(100vh);\n height: calc(var(--vh, 1vh) * 100);\n transition: all 0.25s ease;\n}\n.main-module_modal-window-mask_show-transition-start__2F24Y,\n.main-module_modal-window-mask_hide-transition-end__1SeMQ {\n opacity: 0;\n}\n.main-module_modal-window-mask_show-transition-end__3QHf6,\n.main-module_modal-window-mask_hide-transition-start__1FESf {\n opacity: 1;\n}\n";
7
+ var css_248z = "/* font colors */\n/* actions */\n/* background */\n/* errors */\n/* borders */\n/* grid */\n/* scrollBar */\n/* sizes */\n.main-module_modal-window__1epDY {\n flex-direction: column;\n position: relative;\n z-index: 2000;\n max-width: 1400px;\n max-height: 100%;\n min-width: 320px;\n background-color: #ffffff;\n border-radius: 5px;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.33);\n transition: all 0.25s ease;\n}\n.main-module_modal-window_show-transition-start__20Zyy,\n.main-module_modal-window_hide-transition-end__2tbM7 {\n opacity: 0;\n transform: translate3d(0, -20vh, 0);\n}\n.main-module_modal-window_show-transition-end__1bGXM,\n.main-module_modal-window_hide-transition-start__3v2ve {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n}\n.main-module_modal-window_show-tooltip-transition-start__3T6jk,\n.main-module_modal-window_hide-tooltip-transition-end__1-Elu {\n opacity: 0;\n}\n.main-module_modal-window_show-tooltip-transition-end__3qcFY,\n.main-module_modal-window_hide-tooltip-transition-start__1LrQS {\n opacity: 1;\n}\n.main-module_modal-window_visible__Y9ArZ {\n display: flex;\n}\n.main-module_modal-window_relative__2bV4q {\n position: absolute;\n}\n.main-module_modal-window_loading__i6ehQ {\n min-width: auto;\n}\n.main-module_modal-window_small__2ohvZ {\n max-width: 440px;\n}\n.main-module_modal-window__body__o4m8Y {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n max-height: calc(var(--vh, 1vh) * 100 - (2 * 1rem));\n}\n.main-module_modal-window__body_no-overflow__144M5 {\n overflow: visible;\n}\n.main-module_modal-window__header__vMn-j {\n flex: 0 0 auto;\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n padding: 2rem 2rem 0.5rem 2rem;\n}\n.main-module_modal-window__header-actions__Qj4RZ {\n margin-left: 2rem;\n}\n.main-module_modal-window__close-icon__32GlC {\n cursor: pointer;\n fill: #5c657e;\n}\n.main-module_modal-window__close-icon__32GlC * {\n fill: #5c657e;\n}\n.main-module_modal-window__content__2Yq_0 {\n overflow-y: auto;\n -ms-scroll-chaining: none;\n overscroll-behavior: none;\n padding: 1rem 2rem 1rem 2rem;\n}\n.main-module_modal-window__content_no-overflow__d24L_ {\n overflow-y: visible;\n}\n.main-module_modal-window__footer__1o3OM {\n padding: 0.75rem 2rem;\n text-align: right;\n border-top: 1px solid #ececec;\n border-bottom: 2px solid transparent;\n}\n.main-module_modal-window-mask__mR_gM {\n align-items: center;\n justify-content: center;\n position: fixed;\n top: 0;\n left: 0;\n z-index: 1900;\n background-color: rgba(0, 0, 0, 0.5);\n width: calc(100vw);\n height: calc(var(--vh, 1vh) * 100);\n transition: all 0.25s ease;\n}\n.main-module_modal-window-mask_show-transition-start__2F24Y,\n.main-module_modal-window-mask_hide-transition-end__1SeMQ {\n opacity: 0;\n}\n.main-module_modal-window-mask_show-transition-end__3QHf6,\n.main-module_modal-window-mask_hide-transition-start__1FESf {\n opacity: 1;\n}\n";
8
8
  var cssClasses = {"modal-window":"main-module_modal-window__1epDY","modal-window_show-transition-start":"main-module_modal-window_show-transition-start__20Zyy","modal-window_hide-transition-end":"main-module_modal-window_hide-transition-end__2tbM7","modal-window_show-transition-end":"main-module_modal-window_show-transition-end__1bGXM","modal-window_hide-transition-start":"main-module_modal-window_hide-transition-start__3v2ve","modal-window_show-tooltip-transition-start":"main-module_modal-window_show-tooltip-transition-start__3T6jk","modal-window_hide-tooltip-transition-end":"main-module_modal-window_hide-tooltip-transition-end__1-Elu","modal-window_show-tooltip-transition-end":"main-module_modal-window_show-tooltip-transition-end__3qcFY","modal-window_hide-tooltip-transition-start":"main-module_modal-window_hide-tooltip-transition-start__1LrQS","modal-window_visible":"main-module_modal-window_visible__Y9ArZ","modal-window_relative":"main-module_modal-window_relative__2bV4q","modal-window_loading":"main-module_modal-window_loading__i6ehQ","modal-window_small":"main-module_modal-window_small__2ohvZ","modal-window__body":"main-module_modal-window__body__o4m8Y","modal-window__body_no-overflow":"main-module_modal-window__body_no-overflow__144M5","modal-window__header":"main-module_modal-window__header__vMn-j","modal-window__header-actions":"main-module_modal-window__header-actions__Qj4RZ","modal-window__close-icon":"main-module_modal-window__close-icon__32GlC","modal-window__content":"main-module_modal-window__content__2Yq_0","modal-window__content_no-overflow":"main-module_modal-window__content_no-overflow__d24L_","modal-window__footer":"main-module_modal-window__footer__1o3OM","modal-window-mask":"main-module_modal-window-mask__mR_gM","modal-window-mask_show-transition-start":"main-module_modal-window-mask_show-transition-start__2F24Y","modal-window-mask_hide-transition-end":"main-module_modal-window-mask_hide-transition-end__1SeMQ","modal-window-mask_show-transition-end":"main-module_modal-window-mask_show-transition-end__3QHf6","modal-window-mask_hide-transition-start":"main-module_modal-window-mask_hide-transition-start__1FESf"};
9
9
  styleInject_es['default'](css_248z);
10
10
 
@@ -79,7 +79,10 @@ var en = {
79
79
  "Selected cell 6": "Bottom left",
80
80
  "Selected cell 7": "Bottom center",
81
81
  "Selected cell 8": "Bottom right",
82
- "Drag file or select": "Drag file or select"
82
+ "Drag file or select": "Drag file or select",
83
+ "Drag a file here or browse": "Drag a file here or browse",
84
+ "supported format": "supported format",
85
+ "The value cannot be greater than the width of the uploaded file": "The value cannot be greater than the width of the uploaded file"
83
86
  };
84
87
 
85
88
  exports.Add = Add;
@@ -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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -79,7 +79,10 @@ var pl = {
79
79
  "Selected cell 6": "Dół z lewej",
80
80
  "Selected cell 7": "Dół na środku",
81
81
  "Selected cell 8": "Dół z prawej",
82
- "Drag file or select": "Przeciągnij plik lub wybierz"
82
+ "Drag file or select": "Przeciągnij plik lub wybierz",
83
+ "Drag a file here or browse": "Przeciągnij lub wybierz plik z dysku",
84
+ "supported format": "obsługiwany format",
85
+ "The value cannot be greater than the width of the uploaded file": "Wartość nie może być większa od szerokości wgranego pliku"
83
86
  };
84
87
 
85
88
  exports.Add = Add;
@@ -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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -0,0 +1,4 @@
1
+ import { IIconProps } from './types';
2
+ import React from 'react';
3
+ declare const IconWrongFileFormat: React.FC<IIconProps>;
4
+ export default IconWrongFileFormat;
@@ -0,0 +1,13 @@
1
+ import './types';
2
+ import Icon from './icon';
3
+ import React from 'react';
4
+ import cssClasses from '../css/icons/main.module.less';
5
+ const IconWrongFileFormat = ({ className = '', size }) => (React.createElement(Icon, null,
6
+ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 67 52", width: "67", height: "52", className: `${className || ''} ${cssClasses[`icon_${size}`]}` },
7
+ React.createElement("path", { d: "M36.9768 2H1.5V49.9829H29.9977M44.5374 2H65.4745V49.9829H39.8847", stroke: "#ABB4CD", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "3" }),
8
+ React.createElement("path", { d: "m36.976 2-7.5606 7.7972 9.8869 10.196-9.8869 10.196 9.8869 10.196-9.3053 9.5965", stroke: "#ABB4CD", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "3" }),
9
+ React.createElement("path", { d: "m34.069 45.784-15.703-15.594-16.866 16.794v2.9989h28.498l4.0711-4.1985z", fill: "#ABB4CD", stroke: "#ABB4CD", strokeLinejoin: "round", strokeWidth: "2" }),
10
+ React.createElement("path", { d: "m45.726 24.793 19.774 20.393v4.7983h-26.753c-0.1938 0.1999 1.1365-1.3195 5.7892-6.5976 4.6526-5.2782-2.3263-8.3971-5.2076-11.996l6.3974-6.5976z", fill: "#ABB4CD", stroke: "#ABB4CD", strokeLinejoin: "round", strokeWidth: "3" }),
11
+ React.createElement("circle", { cx: "54.352", cy: "13.197", r: "4", fill: "#ABB4CD" }))));
12
+ export default IconWrongFileFormat;
13
+ //# sourceMappingURL=icon_wrong_file_format.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon_wrong_file_format.js","sourceRoot":"","sources":["../../../../../../src/assets/icon_wrong_file_format.tsx"],"names":[],"mappings":"AAAA,OAA2B,SAAS,CAAC;AACrC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,+BAA+B,CAAC;AAEvD,MAAM,mBAAmB,GAAyB,CAAC,EAAE,SAAS,GAAG,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAC5E,oBAAC,IAAI;IACD,6BACI,KAAK,EAAC,4BAA4B,EAClC,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,SAAS,EAAE,GAAG,SAAS,IAAI,EAAE,IAAI,UAAU,CAAC,QAAQ,IAAI,EAAE,CAAC,EAAE;QAE7D,8BACI,CAAC,EAAC,kEAAkE,EACpE,MAAM,EAAC,SAAS,EAChB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,WAAW,EAAC,GAAG,GACjB;QACF,8BACI,CAAC,EAAC,iFAAiF,EACnF,MAAM,EAAC,SAAS,EAChB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,WAAW,EAAC,GAAG,GACjB;QACF,8BACI,CAAC,EAAC,yEAAyE,EAC3E,IAAI,EAAC,SAAS,EACd,MAAM,EAAC,SAAS,EAChB,cAAc,EAAC,OAAO,EACtB,WAAW,EAAC,GAAG,GACjB;QACF,8BACI,CAAC,EAAC,iJAAiJ,EACnJ,IAAI,EAAC,SAAS,EACd,MAAM,EAAC,SAAS,EAChB,cAAc,EAAC,OAAO,EACtB,WAAW,EAAC,GAAG,GACjB;QACF,gCAAQ,EAAE,EAAC,QAAQ,EAAC,EAAE,EAAC,QAAQ,EAAC,CAAC,EAAC,GAAG,EAAC,IAAI,EAAC,SAAS,GAAG,CACrD,CACH,CACV,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { IControlImagePicker } from '../../types';
2
+ import React from 'react';
3
+ declare const ControlImagePicker: React.FC<IControlImagePicker>;
4
+ export default ControlImagePicker;
@@ -0,0 +1,17 @@
1
+ import Control from '../../index';
2
+ import Hint from '@auroraComponents/hint';
3
+ import '../../types';
4
+ import ImagePicker from '@auroraComponents/image_picker';
5
+ import React from 'react';
6
+ const ControlImagePicker = ({ label, isRequired, id, name, onChange, allowedExtensions, initialFile, className, errors, hint, labelAdditionalInfo, hasWidthInput, widthInputPostfix, widthInputLabel, widthInputHint }) => {
7
+ return (React.createElement(Control, { errors: errors, name: name, id: id },
8
+ (label || hint) && (React.createElement(Control.Label, { id: id, isRequired: isRequired, additionalInfo: labelAdditionalInfo },
9
+ label,
10
+ hint && React.createElement(Hint, { hint: hint, spacingLeft: true }))),
11
+ React.createElement(Control.Content, null,
12
+ React.createElement(Control.Element, null,
13
+ React.createElement(ImagePicker, { id: id, name: name, onChange: onChange, allowedExtensions: allowedExtensions, initialFile: initialFile, className: className, hasWidthInput: hasWidthInput, widthInputPostfix: widthInputPostfix, widthInputLabel: widthInputLabel, widthInputHint: widthInputHint }))),
14
+ React.createElement(Control.Errors, null)));
15
+ };
16
+ export default ControlImagePicker;
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../src/components/controls/hoc/control_image_picker/index.tsx"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAClC,OAAO,IAAI,MAAM,wBAAwB,CAAC;AAC1C,OAAoC,aAAa,CAAC;AAClD,OAAO,WAAW,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,kBAAkB,GAAkC,CAAC,EACvD,KAAK,EACL,UAAU,EACV,EAAE,EACF,IAAI,EACJ,QAAQ,EACR,iBAAiB,EACjB,WAAW,EACX,SAAS,EACT,MAAM,EACN,IAAI,EACJ,mBAAmB,EACnB,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,cAAc,EACjB,EAAE,EAAE;IACD,OAAO,CACH,oBAAC,OAAO,IAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE;QACtC,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,CAChB,oBAAC,OAAO,CAAC,KAAK,IAAC,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,mBAAmB;YAC7E,KAAK;YACL,IAAI,IAAI,oBAAC,IAAI,IAAC,IAAI,EAAE,IAAI,EAAE,WAAW,SAAG,CAC7B,CACnB;QACD,oBAAC,OAAO,CAAC,OAAO;YACZ,oBAAC,OAAO,CAAC,OAAO;gBACZ,oBAAC,WAAW,IACR,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,iBAAiB,EAAE,iBAAiB,EACpC,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,aAAa,EAC5B,iBAAiB,EAAE,iBAAiB,EACpC,eAAe,EAAE,eAAe,EAChC,cAAc,EAAE,cAAc,GAChC,CACY,CACJ;QAClB,oBAAC,OAAO,CAAC,MAAM,OAAG,CACZ,CACb,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -169,6 +169,16 @@ export interface IControlFilePicker extends IFilePicker, IControlCommonProps {
169
169
  name?: string;
170
170
  labelAdditionalInfo?: string | ReactNode;
171
171
  }
172
+ export interface IControlImagePicker extends IFilePicker, IControlCommonProps {
173
+ label?: string;
174
+ isRequired?: boolean;
175
+ name?: string;
176
+ labelAdditionalInfo?: string | ReactNode;
177
+ hasWidthInput?: boolean;
178
+ widthInputPostfix?: string;
179
+ widthInputLabel?: string;
180
+ widthInputHint?: string;
181
+ }
172
182
  export interface ICellSelector {
173
183
  rows?: number;
174
184
  cols?: number;
@@ -0,0 +1,8 @@
1
+ export declare const FILE_PICKER_ERROR: {
2
+ invalidFileFormat: string;
3
+ invalidInputWidth: string;
4
+ };
5
+ export declare const JPG_EXTENSION = "jpg";
6
+ export declare const JPEG_EXTENSION = "jpeg";
7
+ export declare const SVG_MIME_TYPE = "svg+xml";
8
+ export declare const SVG_EXTENSION = "svg";
@@ -0,0 +1,11 @@
1
+ const FILE_PICKER_ERROR = {
2
+ invalidFileFormat: 'Invalid file format',
3
+ invalidInputWidth: 'The value cannot be greater than the width of the uploaded file'
4
+ };
5
+ const JPG_EXTENSION = 'jpg';
6
+ const JPEG_EXTENSION = 'jpeg';
7
+ const SVG_MIME_TYPE = 'svg+xml';
8
+ const SVG_EXTENSION = 'svg';
9
+
10
+ export { FILE_PICKER_ERROR, JPEG_EXTENSION, JPG_EXTENSION, SVG_EXTENSION, SVG_MIME_TYPE };
11
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -33,10 +33,13 @@ export interface IUseFilePicker {
33
33
  onFileDelete: () => void;
34
34
  onPreviewError: () => void;
35
35
  file: TFilePickerFile | undefined;
36
+ errors?: string[];
36
37
  isPreview: boolean;
37
38
  isDragOver: boolean;
39
+ isVectorImage?: boolean;
38
40
  }
39
41
  export interface IUseFilePickerProps {
40
42
  onChange?: (fileList: FileList | null) => void;
41
43
  initialFile?: TFilePickerFile;
44
+ allowedExtensions?: string[];
42
45
  }
@@ -1,2 +1,2 @@
1
1
  import { IUseFilePicker, IUseFilePickerProps } from "./types";
2
- export declare const useFilePicker: ({ onChange, initialFile }: IUseFilePickerProps) => IUseFilePicker;
2
+ export declare const useFilePicker: ({ onChange, initialFile, allowedExtensions }: IUseFilePickerProps) => IUseFilePicker;
@@ -1,9 +1,12 @@
1
1
  import { useState, useEffect } from 'react';
2
+ import { FILE_PICKER_ERROR, JPG_EXTENSION, JPEG_EXTENSION, SVG_MIME_TYPE, SVG_EXTENSION } from './constants.js';
2
3
 
3
- const useFilePicker = ({ onChange, initialFile }) => {
4
+ const useFilePicker = ({ onChange, initialFile, allowedExtensions }) => {
4
5
  const [file, setFile] = useState(initialFile);
6
+ const [errors, setErrors] = useState([]);
5
7
  const [isDragOver, setDragOver] = useState(false);
6
8
  const [isPreview, setPreview] = useState(true);
9
+ const [isVectorImage, setIsVectorImage] = useState(false);
7
10
  useEffect(() => {
8
11
  setFile(initialFile);
9
12
  }, [initialFile]);
@@ -11,9 +14,49 @@ const useFilePicker = ({ onChange, initialFile }) => {
11
14
  event.stopPropagation();
12
15
  event.preventDefault();
13
16
  const { dataTransfer: { files } } = event;
17
+ setFileFormatError(checkIfFileIsInCorrectFormat(allowedExtensions, files[0].type));
18
+ checkIfImageIsVector(files[0].type);
14
19
  setDragOver(false);
15
20
  updateFile(files);
16
21
  };
22
+ const checkIfFileIsInCorrectFormat = (allowedExtensions, fileType) => {
23
+ if (!allowedExtensions)
24
+ return;
25
+ const fileExtension = getFileExtension(fileType);
26
+ let formatIsCorrect;
27
+ if (Array.isArray(fileExtension)) {
28
+ formatIsCorrect = allowedExtensions.some((extension) => fileExtension.includes(extension.toLowerCase()));
29
+ }
30
+ else {
31
+ formatIsCorrect = allowedExtensions === null || allowedExtensions === void 0 ? void 0 : allowedExtensions.some((extension) => {
32
+ return extension.toLowerCase() === fileExtension.toLowerCase();
33
+ });
34
+ }
35
+ return formatIsCorrect;
36
+ };
37
+ const setFileFormatError = (isFileFormatCorrect) => {
38
+ if (!isFileFormatCorrect) {
39
+ setErrors([...errors, FILE_PICKER_ERROR.invalidFileFormat]);
40
+ }
41
+ else {
42
+ setErrors([]);
43
+ }
44
+ };
45
+ const getFileExtension = (fileType) => {
46
+ const substringIndex = fileType.lastIndexOf('/');
47
+ const fileExtension = fileType.substring(substringIndex + 1);
48
+ if (fileExtension === JPG_EXTENSION || fileExtension === JPEG_EXTENSION) {
49
+ return [JPG_EXTENSION, JPEG_EXTENSION];
50
+ }
51
+ else if (fileExtension === SVG_MIME_TYPE) {
52
+ return SVG_EXTENSION;
53
+ }
54
+ return fileExtension;
55
+ };
56
+ const checkIfImageIsVector = (fileType) => {
57
+ const fileExtenstion = getFileExtension(fileType);
58
+ fileExtenstion === 'svg' ? setIsVectorImage(true) : setIsVectorImage(false);
59
+ };
17
60
  const onFileChange = ({ target: { files } }) => {
18
61
  updateFile(files);
19
62
  };
@@ -23,6 +66,8 @@ const useFilePicker = ({ onChange, initialFile }) => {
23
66
  fileName: files === null || files === void 0 ? void 0 : files[0].name,
24
67
  fileUrl: URL.createObjectURL(files === null || files === void 0 ? void 0 : files[0])
25
68
  });
69
+ setFileFormatError(checkIfFileIsInCorrectFormat(allowedExtensions, files[0].type));
70
+ checkIfImageIsVector(files[0].type);
26
71
  }
27
72
  else {
28
73
  setFile(undefined);
@@ -44,6 +89,7 @@ const useFilePicker = ({ onChange, initialFile }) => {
44
89
  const onFileDelete = () => {
45
90
  setFile(undefined);
46
91
  setPreview(true);
92
+ setErrors([]);
47
93
  onChange === null || onChange === void 0 ? void 0 : onChange(null);
48
94
  };
49
95
  const onPreviewError = () => {
@@ -57,8 +103,10 @@ const useFilePicker = ({ onChange, initialFile }) => {
57
103
  onFileDelete,
58
104
  onPreviewError,
59
105
  file,
106
+ errors,
60
107
  isPreview,
61
- isDragOver
108
+ isDragOver,
109
+ isVectorImage
62
110
  };
63
111
  };
64
112
 
@@ -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;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -0,0 +1,4 @@
1
+ import { IImagePickerInput } from '../types';
2
+ import React from 'react';
3
+ declare const _default: React.FC<IImagePickerInput>;
4
+ export default _default;
@@ -0,0 +1,22 @@
1
+ import CSS_CLASSES from '@auroraComponents/image_picker/css_classes';
2
+ import '../types';
3
+ import IconUpload from '@auroraAssets/icon_upload';
4
+ import React from 'react';
5
+ import styles from '@auroraCss/image_picker/main.module.less';
6
+ import { useTranslation } from 'react-i18next';
7
+ import withTranslation from '@auroraUtilities/translation/with_translation';
8
+ const ImageInput = ({ id, onDropFile, onDragOver, onDragLeave, allowedExtensions, isDragOver }) => {
9
+ const [t] = useTranslation();
10
+ return (React.createElement("label", { htmlFor: id, onDrop: onDropFile, onDragOver: onDragOver, onDragLeave: onDragLeave, className: styles[CSS_CLASSES.imagePickerLabel] },
11
+ React.createElement("div", { className: styles[CSS_CLASSES.imagePickerDescription] },
12
+ React.createElement(IconUpload, { className: styles[CSS_CLASSES.imagePickerUploadIcon] }),
13
+ React.createElement("p", null, t('Drag a file here or browse')),
14
+ React.createElement("span", null,
15
+ "(",
16
+ t('supported format'),
17
+ ": ",
18
+ allowedExtensions.join(', '),
19
+ ")"))));
20
+ };
21
+ export default withTranslation(ImageInput);
22
+ //# sourceMappingURL=image_input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image_input.js","sourceRoot":"","sources":["../../../../../../../../src/components/image_picker/components/image_input.tsx"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,4CAA4C,CAAC;AACrE,OAAkC,UAAU,CAAC;AAC7C,OAAO,UAAU,MAAM,2BAA2B,CAAC;AACnD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,0CAA0C,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,eAAe,MAAM,+CAA+C,CAAC;AAE5E,MAAM,UAAU,GAAgC,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,UAAU,EAAE,EAAE,EAAE;IAC3H,MAAM,CAAC,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;IAE7B,OAAO,CACH,+BACI,OAAO,EAAE,EAAE,EACX,MAAM,EAAE,UAAU,EAClB,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC;QAE/C,6BAAK,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,sBAAsB,CAAC;YACtD,oBAAC,UAAU,IAAC,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,qBAAqB,CAAC,GAAI;YACpE,+BAAI,CAAC,CAAC,4BAA4B,CAAC,CAAK;YACxC;;gBACM,CAAC,CAAC,kBAAkB,CAAC;;gBAAI,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC;oBACpD,CACL,CACF,CACX,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC,UAAU,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { ISelectedImagePreview } from '../types';
2
+ import React from 'react';
3
+ declare const SelectedImagePreview: React.FC<ISelectedImagePreview>;
4
+ export default SelectedImagePreview;
@@ -0,0 +1,28 @@
1
+ import CSS_CLASSES from '@auroraComponents/image_picker/css_classes';
2
+ import { FileUtils } from '@dreamcommerce/utilities';
3
+ import '../types';
4
+ import IconDelete from '@auroraAssets/icon_delete';
5
+ import IconWrongFileFormat from '@auroraAssets/icon_wrong_file_format';
6
+ import React from 'react';
7
+ import styles from '@auroraCss/image_picker/main.module.less';
8
+ import { useTranslation } from 'react-i18next';
9
+ const SelectedImagePreview = ({ file, isPreview, fileFormatIsCorrect, imageSize, onPreviewError, onFileDelete }) => {
10
+ const [t] = useTranslation();
11
+ const imageName = FileUtils.getFileName(file.fileName);
12
+ const imageExtension = FileUtils.getFileExtension(file.fileName);
13
+ const imageWidth = imageSize && imageSize.width;
14
+ const imageHeight = imageSize && imageSize.height;
15
+ const previewMarkupJsx = fileFormatIsCorrect ? (React.createElement("img", { alt: "", src: (file === null || file === void 0 ? void 0 : file.fileUrl) || '', onError: onPreviewError, className: styles[CSS_CLASSES.imagePickerImagePreview] })) : (React.createElement(IconWrongFileFormat, { className: styles[CSS_CLASSES.imagePickerWrongFileFormatIcon] }));
16
+ return (React.createElement("div", null,
17
+ isPreview ? (React.createElement("div", { className: styles[CSS_CLASSES.imagePickerImagePreviewWrapper] }, previewMarkupJsx)) : (React.createElement("div", null, t('No preview'))),
18
+ React.createElement("div", { className: styles[CSS_CLASSES.imagePickerSelectedFile] },
19
+ React.createElement("div", { className: styles[CSS_CLASSES.imagePickerSelectedFileNameWrapper] }, fileFormatIsCorrect && (React.createElement("span", { className: styles[CSS_CLASSES.imagePickerSelectedFileFullName] },
20
+ React.createElement("span", null, FileUtils.getFileNameShortenInMiddle(imageName, 10, 5, 1)),
21
+ React.createElement("span", null, `.${imageExtension} (${imageWidth}x${imageHeight}px)`)))),
22
+ React.createElement("div", { className: styles[CSS_CLASSES.imagePickerSelectedFileRemoveWrapper] },
23
+ React.createElement("span", { onClick: onFileDelete, className: styles[CSS_CLASSES.imagePickerDeleteButton] },
24
+ React.createElement(IconDelete, { className: styles[CSS_CLASSES.imagePickerDeleteIcon] }),
25
+ React.createElement("span", { className: styles[CSS_CLASSES.imagePickerDeleteLabel] }, t('Remove')))))));
26
+ };
27
+ export default SelectedImagePreview;
28
+ //# sourceMappingURL=selected_image_preview.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selected_image_preview.js","sourceRoot":"","sources":["../../../../../../../../src/components/image_picker/components/selected_image_preview.tsx"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,4CAA4C,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAsC,UAAU,CAAC;AACjD,OAAO,UAAU,MAAM,2BAA2B,CAAC;AACnD,OAAO,mBAAmB,MAAM,sCAAsC,CAAC;AACvE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,0CAA0C,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,MAAM,oBAAoB,GAAoC,CAAC,EAC3D,IAAI,EACJ,SAAS,EACT,mBAAmB,EACnB,SAAS,EACT,cAAc,EACd,YAAY,EACf,EAAE,EAAE;IACD,MAAM,CAAC,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;IAC7B,MAAM,SAAS,GAAG,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvD,MAAM,cAAc,GAAG,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACjE,MAAM,UAAU,GAAG,SAAS,IAAI,SAAS,CAAC,KAAK,CAAC;IAChD,MAAM,WAAW,GAAG,SAAS,IAAI,SAAS,CAAC,MAAM,CAAC;IAElD,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAC3C,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AAC,CAAQ,CAC9E,CACL,CACJ,CACJ,CACT,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,22 @@
1
+ declare const _default: {
2
+ imagePicker: string;
3
+ imagePickerWrapper: string;
4
+ imagePickerWrapperError: string;
5
+ imagePickerWrapperHasFile: string;
6
+ imagePickerLabel: string;
7
+ imagePickerDescription: string;
8
+ imagePickerImagePreview: string;
9
+ imagePickerImagePreviewWrapper: string;
10
+ imagePickerWrongFileFormatIcon: string;
11
+ imagePickerErrorText: string;
12
+ imagePickerUploadIcon: string;
13
+ imagePickerDeleteButton: string;
14
+ imagePickerDeleteLabel: string;
15
+ imagePickerDeleteIcon: string;
16
+ imagePickerInput: string;
17
+ imagePickerSelectedFile: string;
18
+ imagePickerSelectedFileNameWrapper: string;
19
+ imagePickerSelectedFileRemoveWrapper: string;
20
+ imagePickerSelectedFileFullName: string;
21
+ };
22
+ export default _default;
@@ -0,0 +1,23 @@
1
+ const imagePicker = 'image-picker';
2
+ export default {
3
+ imagePicker: `${imagePicker}`,
4
+ imagePickerWrapper: `${imagePicker}__wrapper`,
5
+ imagePickerWrapperError: `${imagePicker}__wrapper-error`,
6
+ imagePickerWrapperHasFile: `${imagePicker}__wrapper-has-file`,
7
+ imagePickerLabel: `${imagePicker}__label`,
8
+ imagePickerDescription: `${imagePicker}__description`,
9
+ imagePickerImagePreview: `${imagePicker}__image-preview`,
10
+ imagePickerImagePreviewWrapper: `${imagePicker}__image-preview-wrapper`,
11
+ imagePickerWrongFileFormatIcon: `${imagePicker}__wrong-file-format-icon`,
12
+ imagePickerErrorText: `${imagePicker}__error-text`,
13
+ imagePickerUploadIcon: `${imagePicker}__upload-icon`,
14
+ imagePickerDeleteButton: `${imagePicker}__delete-button`,
15
+ imagePickerDeleteLabel: `${imagePicker}__delete-label`,
16
+ imagePickerDeleteIcon: `${imagePicker}__delete-icon`,
17
+ imagePickerInput: `${imagePicker}__input`,
18
+ imagePickerSelectedFile: `${imagePicker}__selected-file`,
19
+ imagePickerSelectedFileNameWrapper: `${imagePicker}__selected-file-name-wrapper`,
20
+ imagePickerSelectedFileRemoveWrapper: `${imagePicker}__selected-file-remove-wrapper`,
21
+ imagePickerSelectedFileFullName: `${imagePicker}__selected-file-full-name`
22
+ };
23
+ //# sourceMappingURL=css_classes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"css_classes.js","sourceRoot":"","sources":["../../../../../../../src/components/image_picker/css_classes.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG,cAAc,CAAC;AAEnC,eAAe;IACX,WAAW,EAAE,GAAG,WAAW,EAAE;IAC7B,kBAAkB,EAAE,GAAG,WAAW,WAAW;IAC7C,uBAAuB,EAAE,GAAG,WAAW,iBAAiB;IACxD,yBAAyB,EAAE,GAAG,WAAW,oBAAoB;IAC7D,gBAAgB,EAAE,GAAG,WAAW,SAAS;IACzC,sBAAsB,EAAE,GAAG,WAAW,eAAe;IACrD,uBAAuB,EAAE,GAAG,WAAW,iBAAiB;IACxD,8BAA8B,EAAE,GAAG,WAAW,yBAAyB;IACvE,8BAA8B,EAAE,GAAG,WAAW,0BAA0B;IACxE,oBAAoB,EAAE,GAAG,WAAW,cAAc;IAClD,qBAAqB,EAAE,GAAG,WAAW,eAAe;IACpD,uBAAuB,EAAE,GAAG,WAAW,iBAAiB;IACxD,sBAAsB,EAAE,GAAG,WAAW,gBAAgB;IACtD,qBAAqB,EAAE,GAAG,WAAW,eAAe;IACpD,gBAAgB,EAAE,GAAG,WAAW,SAAS;IACzC,uBAAuB,EAAE,GAAG,WAAW,iBAAiB;IACxD,kCAAkC,EAAE,GAAG,WAAW,8BAA8B;IAChF,oCAAoC,EAAE,GAAG,WAAW,gCAAgC;IACpF,+BAA+B,EAAE,GAAG,WAAW,2BAA2B;CAC7E,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { IImagePicker } from "./types";
2
+ import React from 'react';
3
+ declare const ImagePicker: React.FC<IImagePicker>;
4
+ export default ImagePicker;
@@ -0,0 +1,93 @@
1
+ import '@auroraComponents/image_picker/types';
2
+ import React, { useEffect, useState } from 'react';
3
+ import CSS_CLASSES from '@auroraComponents/image_picker/css_classes';
4
+ import ControlInput from '@auroraComponents/controls/hoc/control_input';
5
+ import { FILE_PICKER_ERROR } from '@auroraComponents/file_picker/constants';
6
+ import ImageInput from '@auroraComponents/image_picker/components/image_input';
7
+ import SelectedImagePreview from '@auroraComponents/image_picker/components/selected_image_preview';
8
+ import Spacing from '@auroraComponents/spacing';
9
+ import { checkIfInvalideFileFormatErrorOccured } from './utils';
10
+ import classnames from 'classnames';
11
+ import { createUseStyles } from 'react-jss';
12
+ import { getAcceptFilesParametersFromAllowedExtensions } from '@auroraComponents/file_picker/utils';
13
+ import styles from '@auroraCss/image_picker/main.module.less';
14
+ import { useFilePicker } from '@auroraComponents/file_picker/use_file_picker';
15
+ import { useTranslation } from 'react-i18next';
16
+ const ImagePicker = ({ id, onChange, allowedExtensions = ['WEBP', 'JPG', 'PNG', 'GIF'], initialFile, name, className = '', hasWidthInput, widthInputPostfix = 'px', widthInputLabel, widthInputHint }) => {
17
+ const [t] = useTranslation();
18
+ const [fileFormatIsCorrect, setFileFormatIsCorrect] = useState(true);
19
+ const [imageSize, setImageSize] = useState({ width: 0, height: 0 });
20
+ const [widthInputValue, setWidthInputValue] = useState();
21
+ const [isInputWidthTooBig, setIsInputWidthTooBig] = useState(false);
22
+ const { onDropFile, onFileChange, onDragOver, onDragLeave, onFileDelete, onPreviewError, file, errors, isPreview, isDragOver, isVectorImage } = useFilePicker({ initialFile, onChange, allowedExtensions });
23
+ const acceptFiles = getAcceptFilesParametersFromAllowedExtensions(allowedExtensions);
24
+ const showMaxWidthInput = hasWidthInput && file && fileFormatIsCorrect && !isVectorImage;
25
+ const imagePickerClassName = classnames(styles[CSS_CLASSES.imagePicker], className && className);
26
+ const imagePickerWrapperClassName = classnames(styles[CSS_CLASSES.imagePickerWrapper], file && styles[CSS_CLASSES.imagePickerWrapperHasFile], !fileFormatIsCorrect && styles[CSS_CLASSES.imagePickerWrapperError]);
27
+ const useStyles = createUseStyles({
28
+ imagePickerWrapper: {
29
+ border: ({ isDragOver }) => (isDragOver ? '1px solid #135cc8' : ''),
30
+ backgroundColor: ({ isDragOver }) => (isDragOver ? 'rgba(208, 230, 255, 0.5)' : ''),
31
+ '& svg': {
32
+ // @ts-ignore
33
+ fill: ({ isDragOver }) => (isDragOver ? '#3c83ec' : '')
34
+ }
35
+ }
36
+ });
37
+ const dragOverStyles = useStyles({ isDragOver });
38
+ const getImageWidth = (event) => {
39
+ let selectedImage;
40
+ if (event.target instanceof HTMLInputElement) {
41
+ const { target: { files } } = event;
42
+ selectedImage = files[0];
43
+ }
44
+ else {
45
+ const { dataTransfer: { files } } = event;
46
+ selectedImage = files[0];
47
+ }
48
+ const imgElement = document.createElement('img');
49
+ const objectURL = URL.createObjectURL(selectedImage);
50
+ imgElement.onload = () => {
51
+ setImageSize({ width: imgElement.width, height: imgElement.height });
52
+ URL.revokeObjectURL(objectURL);
53
+ };
54
+ imgElement.src = objectURL;
55
+ };
56
+ const checkIfInputMaxWidthIsGreaterThenImageWidth = () => {
57
+ if (!widthInputValue || !imageSize.width)
58
+ return;
59
+ widthInputValue > imageSize.width ? setIsInputWidthTooBig(true) : setIsInputWidthTooBig(false);
60
+ };
61
+ const handleonDropFile = (event) => {
62
+ onDropFile(event);
63
+ getImageWidth(event);
64
+ };
65
+ const handleOnFileChange = (event) => {
66
+ onFileChange(event);
67
+ getImageWidth(event);
68
+ };
69
+ const handleOnFileDelete = () => {
70
+ setImageSize({ width: 0, height: 0 });
71
+ onFileDelete();
72
+ };
73
+ const handleOnWidthInputChange = (event) => {
74
+ setWidthInputValue(event.target.valueAsNumber);
75
+ };
76
+ useEffect(() => {
77
+ checkIfInvalideFileFormatErrorOccured(errors) ? setFileFormatIsCorrect(false) : setFileFormatIsCorrect(true);
78
+ file && checkIfInputMaxWidthIsGreaterThenImageWidth();
79
+ }, [errors, file, widthInputValue]);
80
+ useEffect(() => {
81
+ setWidthInputValue(imageSize.width);
82
+ }, [imageSize]);
83
+ return (React.createElement("div", { className: imagePickerClassName },
84
+ React.createElement("div", { className: `${imagePickerWrapperClassName} ${dragOverStyles.imagePickerWrapper}` },
85
+ file && (React.createElement(SelectedImagePreview, { file: file, onFileDelete: handleOnFileDelete, onPreviewError: onPreviewError, isPreview: isPreview, fileFormatIsCorrect: fileFormatIsCorrect, imageSize: imageSize })),
86
+ React.createElement(ImageInput, { onDragLeave: onDragLeave, onDragOver: onDragOver, isDragOver: isDragOver, allowedExtensions: allowedExtensions, id: id, onDropFile: handleonDropFile }),
87
+ React.createElement("input", { onChange: handleOnFileChange, id: id, type: "file", name: name, className: styles[CSS_CLASSES.imagePickerInput], accept: acceptFiles })),
88
+ !fileFormatIsCorrect && React.createElement("p", { className: styles[CSS_CLASSES.imagePickerErrorText] }, t('Invalid file format')),
89
+ showMaxWidthInput && (React.createElement(Spacing, { as: "div", "mt-xs": 2 },
90
+ React.createElement(ControlInput, { id: `${id}-image-width`, type: "number", postfix: widthInputPostfix, value: widthInputValue, isRequired: true, label: widthInputLabel, hint: widthInputHint, onChange: handleOnWidthInputChange, errors: isInputWidthTooBig ? [`${t(FILE_PICKER_ERROR.invalidInputWidth)}`] : null })))));
91
+ };
92
+ export default ImagePicker;
93
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/components/image_picker/index.tsx"],"names":[],"mappings":"AAAA,OAAyC,sCAAsC,CAAC;AAChF,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,WAAW,MAAM,4CAA4C,CAAC;AACrE,OAAO,YAAY,MAAM,8CAA8C,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,UAAU,MAAM,uDAAuD,CAAC;AAC/E,OA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AM,EACX,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC,EAC/C,MAAM,EAAE,WAAW,GACrB,CACA;QAEL,CAAC,mBAAmB,IAAI,2BAAG,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,oBAAoB,CAAC,IAAG,CAAC,CAAC,qBAAqB,CAAC,CAAK;QAE9G,iBAAiB,IAAI,CAClB,oBAAC,OAAO,IAAC,EAAE,EAAC,KAAK,WAAQ,CAAC;YACtB,oBAAC,YAAY,IACT,EAAE,EAAE,GAAG,EAAE,cAAc,EACvB,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAE,eAAe,EACtB,UAAU,QACV,KAAK,EAAE,eAAe,EACtB,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,wBAAwB,EAClC,MAAM,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,GACnF,CACI,CACb,CACC,CACT,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,37 @@
1
+ import React from 'react';
2
+ export declare type TImagePickerFile = {
3
+ fileUrl: string;
4
+ fileName: string;
5
+ };
6
+ export interface IImagePicker {
7
+ id: string;
8
+ name?: string;
9
+ className?: string;
10
+ onChange?: (imageList: FileList | null) => void;
11
+ allowedExtensions?: string[];
12
+ initialFile?: TImagePickerFile;
13
+ hasWidthInput?: boolean;
14
+ widthInputPostfix?: string;
15
+ widthInputLabel?: string;
16
+ widthInputHint?: string;
17
+ }
18
+ export interface ISelectedImagePreview {
19
+ file: TImagePickerFile;
20
+ isPreview: boolean;
21
+ fileFormatIsCorrect?: boolean;
22
+ imageSize?: TImageSize;
23
+ onPreviewError: () => void;
24
+ onFileDelete: () => void;
25
+ }
26
+ export interface IImagePickerInput {
27
+ id: string;
28
+ onDropFile: (event: React.DragEvent<HTMLLabelElement>) => void;
29
+ onDragOver: (event: React.DragEvent<HTMLLabelElement>) => void;
30
+ onDragLeave: (event: React.DragEvent<HTMLLabelElement>) => void;
31
+ allowedExtensions: string[];
32
+ isDragOver: boolean;
33
+ }
34
+ export declare type TImageSize = {
35
+ width: number;
36
+ height: number;
37
+ };
@@ -0,0 +1,2 @@
1
+ import 'react';
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../src/components/image_picker/types.ts"],"names":[],"mappings":"AAAA,OAAkB,OAAO,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const checkIfInvalideFileFormatErrorOccured: (errorsArray: string[] | undefined) => boolean | undefined;
@@ -0,0 +1,5 @@
1
+ import { FILE_PICKER_ERROR } from '@auroraComponents/file_picker/constants';
2
+ export const checkIfInvalideFileFormatErrorOccured = (errorsArray) => {
3
+ return errorsArray && errorsArray.includes(FILE_PICKER_ERROR.invalidFileFormat);
4
+ };
5
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../../src/components/image_picker/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAE5E,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC,WAAiC,EAAuB,EAAE;IAC5G,OAAO,WAAW,IAAI,WAAW,CAAC,QAAQ,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;AACpF,CAAC,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import cssClasses from '../../../css/modal/main.module.less.js';
3
3
 
4
- const Modal = ({ children, className, modalRef }) => {
5
- return (React.createElement("div", { "data-test-id": "modal", ref: modalRef, className: `${cssClasses['modal-window']} ${cssClasses['modal-window_visible']} ${className}` },
4
+ const Modal = ({ children, className, modalRef, style = {} }) => {
5
+ return (React.createElement("div", { style: style, "data-test-id": "modal", ref: modalRef, className: `${cssClasses['modal-window']} ${cssClasses['modal-window_visible']} ${className}` },
6
6
  React.createElement("div", { className: cssClasses['modal-window__body'] }, children)));
7
7
  };
8
8
 
@@ -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_modal-window__1epDY {\n flex-direction: column;\n position: relative;\n z-index: 2000;\n max-width: 1400px;\n max-height: 100%;\n min-width: 320px;\n background-color: #ffffff;\n border-radius: 5px;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.33);\n transition: all 0.25s ease;\n}\n.main-module_modal-window_show-transition-start__20Zyy,\n.main-module_modal-window_hide-transition-end__2tbM7 {\n opacity: 0;\n transform: translate3d(0, -20vh, 0);\n}\n.main-module_modal-window_show-transition-end__1bGXM,\n.main-module_modal-window_hide-transition-start__3v2ve {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n}\n.main-module_modal-window_show-tooltip-transition-start__3T6jk,\n.main-module_modal-window_hide-tooltip-transition-end__1-Elu {\n opacity: 0;\n}\n.main-module_modal-window_show-tooltip-transition-end__3qcFY,\n.main-module_modal-window_hide-tooltip-transition-start__1LrQS {\n opacity: 1;\n}\n.main-module_modal-window_visible__Y9ArZ {\n display: flex;\n}\n.main-module_modal-window_relative__2bV4q {\n position: absolute;\n}\n.main-module_modal-window_loading__i6ehQ {\n min-width: auto;\n}\n.main-module_modal-window_small__2ohvZ {\n max-width: 440px;\n}\n.main-module_modal-window__body__o4m8Y {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n max-height: calc(var(--vh, 1vh) * 100 - (2 * 1rem));\n}\n.main-module_modal-window__body_no-overflow__144M5 {\n overflow: visible;\n}\n.main-module_modal-window__header__vMn-j {\n flex: 0 0 auto;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 2rem 2rem 0.5rem 2rem;\n}\n.main-module_modal-window__header-actions__Qj4RZ {\n margin-left: 2rem;\n}\n.main-module_modal-window__close-icon__32GlC {\n cursor: pointer;\n fill: #5c657e;\n}\n.main-module_modal-window__close-icon__32GlC * {\n fill: #5c657e;\n}\n.main-module_modal-window__content__2Yq_0 {\n overflow-y: auto;\n -ms-scroll-chaining: none;\n overscroll-behavior: none;\n padding: 1rem 2rem 1rem 2rem;\n}\n.main-module_modal-window__content_no-overflow__d24L_ {\n overflow-y: visible;\n}\n.main-module_modal-window__footer__1o3OM {\n padding: 0.75rem 2rem;\n text-align: right;\n border-top: 1px solid #ececec;\n border-bottom: 2px solid transparent;\n}\n.main-module_modal-window-mask__mR_gM {\n align-items: center;\n justify-content: center;\n position: fixed;\n top: 0;\n left: 0;\n z-index: 1900;\n background-color: rgba(0, 0, 0, 0.5);\n width: calc(100vw);\n height: calc(100vh);\n height: calc(var(--vh, 1vh) * 100);\n transition: all 0.25s ease;\n}\n.main-module_modal-window-mask_show-transition-start__2F24Y,\n.main-module_modal-window-mask_hide-transition-end__1SeMQ {\n opacity: 0;\n}\n.main-module_modal-window-mask_show-transition-end__3QHf6,\n.main-module_modal-window-mask_hide-transition-start__1FESf {\n opacity: 1;\n}\n";
3
+ var css_248z = "/* font colors */\n/* actions */\n/* background */\n/* errors */\n/* borders */\n/* grid */\n/* scrollBar */\n/* sizes */\n.main-module_modal-window__1epDY {\n flex-direction: column;\n position: relative;\n z-index: 2000;\n max-width: 1400px;\n max-height: 100%;\n min-width: 320px;\n background-color: #ffffff;\n border-radius: 5px;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.33);\n transition: all 0.25s ease;\n}\n.main-module_modal-window_show-transition-start__20Zyy,\n.main-module_modal-window_hide-transition-end__2tbM7 {\n opacity: 0;\n transform: translate3d(0, -20vh, 0);\n}\n.main-module_modal-window_show-transition-end__1bGXM,\n.main-module_modal-window_hide-transition-start__3v2ve {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n}\n.main-module_modal-window_show-tooltip-transition-start__3T6jk,\n.main-module_modal-window_hide-tooltip-transition-end__1-Elu {\n opacity: 0;\n}\n.main-module_modal-window_show-tooltip-transition-end__3qcFY,\n.main-module_modal-window_hide-tooltip-transition-start__1LrQS {\n opacity: 1;\n}\n.main-module_modal-window_visible__Y9ArZ {\n display: flex;\n}\n.main-module_modal-window_relative__2bV4q {\n position: absolute;\n}\n.main-module_modal-window_loading__i6ehQ {\n min-width: auto;\n}\n.main-module_modal-window_small__2ohvZ {\n max-width: 440px;\n}\n.main-module_modal-window__body__o4m8Y {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n max-height: calc(var(--vh, 1vh) * 100 - (2 * 1rem));\n}\n.main-module_modal-window__body_no-overflow__144M5 {\n overflow: visible;\n}\n.main-module_modal-window__header__vMn-j {\n flex: 0 0 auto;\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n padding: 2rem 2rem 0.5rem 2rem;\n}\n.main-module_modal-window__header-actions__Qj4RZ {\n margin-left: 2rem;\n}\n.main-module_modal-window__close-icon__32GlC {\n cursor: pointer;\n fill: #5c657e;\n}\n.main-module_modal-window__close-icon__32GlC * {\n fill: #5c657e;\n}\n.main-module_modal-window__content__2Yq_0 {\n overflow-y: auto;\n -ms-scroll-chaining: none;\n overscroll-behavior: none;\n padding: 1rem 2rem 1rem 2rem;\n}\n.main-module_modal-window__content_no-overflow__d24L_ {\n overflow-y: visible;\n}\n.main-module_modal-window__footer__1o3OM {\n padding: 0.75rem 2rem;\n text-align: right;\n border-top: 1px solid #ececec;\n border-bottom: 2px solid transparent;\n}\n.main-module_modal-window-mask__mR_gM {\n align-items: center;\n justify-content: center;\n position: fixed;\n top: 0;\n left: 0;\n z-index: 1900;\n background-color: rgba(0, 0, 0, 0.5);\n width: calc(100vw);\n height: calc(var(--vh, 1vh) * 100);\n transition: all 0.25s ease;\n}\n.main-module_modal-window-mask_show-transition-start__2F24Y,\n.main-module_modal-window-mask_hide-transition-end__1SeMQ {\n opacity: 0;\n}\n.main-module_modal-window-mask_show-transition-end__3QHf6,\n.main-module_modal-window-mask_hide-transition-start__1FESf {\n opacity: 1;\n}\n";
4
4
  var cssClasses = {"modal-window":"main-module_modal-window__1epDY","modal-window_show-transition-start":"main-module_modal-window_show-transition-start__20Zyy","modal-window_hide-transition-end":"main-module_modal-window_hide-transition-end__2tbM7","modal-window_show-transition-end":"main-module_modal-window_show-transition-end__1bGXM","modal-window_hide-transition-start":"main-module_modal-window_hide-transition-start__3v2ve","modal-window_show-tooltip-transition-start":"main-module_modal-window_show-tooltip-transition-start__3T6jk","modal-window_hide-tooltip-transition-end":"main-module_modal-window_hide-tooltip-transition-end__1-Elu","modal-window_show-tooltip-transition-end":"main-module_modal-window_show-tooltip-transition-end__3qcFY","modal-window_hide-tooltip-transition-start":"main-module_modal-window_hide-tooltip-transition-start__1LrQS","modal-window_visible":"main-module_modal-window_visible__Y9ArZ","modal-window_relative":"main-module_modal-window_relative__2bV4q","modal-window_loading":"main-module_modal-window_loading__i6ehQ","modal-window_small":"main-module_modal-window_small__2ohvZ","modal-window__body":"main-module_modal-window__body__o4m8Y","modal-window__body_no-overflow":"main-module_modal-window__body_no-overflow__144M5","modal-window__header":"main-module_modal-window__header__vMn-j","modal-window__header-actions":"main-module_modal-window__header-actions__Qj4RZ","modal-window__close-icon":"main-module_modal-window__close-icon__32GlC","modal-window__content":"main-module_modal-window__content__2Yq_0","modal-window__content_no-overflow":"main-module_modal-window__content_no-overflow__d24L_","modal-window__footer":"main-module_modal-window__footer__1o3OM","modal-window-mask":"main-module_modal-window-mask__mR_gM","modal-window-mask_show-transition-start":"main-module_modal-window-mask_show-transition-start__2F24Y","modal-window-mask_hide-transition-end":"main-module_modal-window-mask_hide-transition-end__1SeMQ","modal-window-mask_show-transition-end":"main-module_modal-window-mask_show-transition-end__3QHf6","modal-window-mask_hide-transition-start":"main-module_modal-window-mask_hide-transition-start__1FESf"};
5
5
  styleInject(css_248z);
6
6
 
@@ -1,7 +1,7 @@
1
1
  import React, { RefObject } from 'react';
2
2
  export declare const useFixedChildPosition: ({ useFixed, childRef, vPosition, hPosition }: {
3
3
  useFixed?: boolean | undefined;
4
- vPosition?: "top" | "bottom" | undefined;
4
+ vPosition?: "bottom" | "top" | undefined;
5
5
  hPosition?: "left" | "right" | "center" | undefined;
6
6
  childRef?: React.RefObject<HTMLDivElement> | undefined;
7
7
  }) => {
@@ -48,5 +48,8 @@
48
48
  "Selected cell 6": "Bottom left",
49
49
  "Selected cell 7": "Bottom center",
50
50
  "Selected cell 8": "Bottom right",
51
- "Drag file or select": "Drag file or select"
51
+ "Drag file or select": "Drag file or select",
52
+ "Drag a file here or browse": "Drag a file here or browse",
53
+ "supported format": "supported format",
54
+ "The value cannot be greater than the width of the uploaded file": "The value cannot be greater than the width of the uploaded file"
52
55
  }
@@ -75,7 +75,10 @@ var en = {
75
75
  "Selected cell 6": "Bottom left",
76
76
  "Selected cell 7": "Bottom center",
77
77
  "Selected cell 8": "Bottom right",
78
- "Drag file or select": "Drag file or select"
78
+ "Drag file or select": "Drag file or select",
79
+ "Drag a file here or browse": "Drag a file here or browse",
80
+ "supported format": "supported format",
81
+ "The value cannot be greater than the width of the uploaded file": "The value cannot be greater than the width of the uploaded file"
79
82
  };
80
83
 
81
84
  export default en;
@@ -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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -48,5 +48,8 @@
48
48
  "Selected cell 6": "Dół z lewej",
49
49
  "Selected cell 7": "Dół na środku",
50
50
  "Selected cell 8": "Dół z prawej",
51
- "Drag file or select": "Przeciągnij plik lub wybierz"
51
+ "Drag file or select": "Przeciągnij plik lub wybierz",
52
+ "Drag a file here or browse": "Przeciągnij lub wybierz plik z dysku",
53
+ "supported format": "obsługiwany format",
54
+ "The value cannot be greater than the width of the uploaded file": "Wartość nie może być większa od szerokości wgranego pliku"
52
55
  }
@@ -75,7 +75,10 @@ var pl = {
75
75
  "Selected cell 6": "Dół z lewej",
76
76
  "Selected cell 7": "Dół na środku",
77
77
  "Selected cell 8": "Dół z prawej",
78
- "Drag file or select": "Przeciągnij plik lub wybierz"
78
+ "Drag file or select": "Przeciągnij plik lub wybierz",
79
+ "Drag a file here or browse": "Przeciągnij lub wybierz plik z dysku",
80
+ "supported format": "obsługiwany format",
81
+ "The value cannot be greater than the width of the uploaded file": "Wartość nie może być większa od szerokości wgranego pliku"
79
82
  };
80
83
 
81
84
  export default pl;
@@ -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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@dreamcommerce/aurora",
3
3
  "packageManager": "yarn@3.2.0",
4
4
  "sideEffects": false,
5
- "version": "2.5.2",
5
+ "version": "2.5.3-1",
6
6
  "description": "aurora",
7
7
  "author": "k0ssak",
8
8
  "license": "MIT",