@dreamcommerce/aurora 2.16.7 → 2.16.8-2
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/_virtual/_rollupPluginBabelHelpers.js +191 -0
- package/build/cjs/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
- package/build/cjs/external/@pqina/pintura/pintura.css.js +11 -0
- package/build/cjs/external/@pqina/pintura/pintura.css.js.map +1 -0
- package/build/cjs/external/@pqina/pintura/pintura.js +121 -0
- package/build/cjs/external/@pqina/pintura/pintura.js.map +1 -0
- package/build/cjs/external/@pqina/react-pintura/PinturaEditor.js +83 -0
- package/build/cjs/external/@pqina/react-pintura/PinturaEditor.js.map +1 -0
- package/build/cjs/external/@pqina/react-pintura/PinturaEditorModal.js +95 -0
- package/build/cjs/external/@pqina/react-pintura/PinturaEditorModal.js.map +1 -0
- package/build/cjs/external/@pqina/react-pintura/PinturaEditorOverlay.js +83 -0
- package/build/cjs/external/@pqina/react-pintura/PinturaEditorOverlay.js.map +1 -0
- package/build/cjs/external/@pqina/react-pintura/events.js +46 -0
- package/build/cjs/external/@pqina/react-pintura/events.js.map +1 -0
- package/build/cjs/packages/aurora/src/assets/icon_image.js +32 -0
- package/build/cjs/packages/aurora/src/assets/icon_image.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_xhr_image_picker/index.js +4 -2
- package/build/cjs/packages/aurora/src/components/controls/hoc/control_xhr_image_picker/index.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/dropdown/components/content.js +1 -1
- package/build/cjs/packages/aurora/src/components/file_picker/use_file_picker.js +6 -2
- package/build/cjs/packages/aurora/src/components/file_picker/use_file_picker.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/image_picker/css_classes.js +2 -0
- package/build/cjs/packages/aurora/src/components/image_picker/css_classes.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/image_picker/index.js +25 -4
- package/build/cjs/packages/aurora/src/components/image_picker/index.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/modal/hoc/absolute_modal/index.js +5 -5
- package/build/cjs/packages/aurora/src/components/modal/hoc/absolute_modal/index.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/modal/hoc/relative_modal/index.js +5 -5
- package/build/cjs/packages/aurora/src/components/modal/hoc/relative_modal/index.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/modal_new/components/modal/modal.js +112 -0
- package/build/cjs/packages/aurora/src/components/modal_new/components/modal/modal.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/modal_new/components/modal/modal_footer.js +21 -0
- package/build/cjs/packages/aurora/src/components/modal_new/components/modal/modal_footer.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/modal_new/components/modal/modal_header.js +31 -0
- package/build/cjs/packages/aurora/src/components/modal_new/components/modal/modal_header.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/modal_new/components/modals_wrapper.js +66 -0
- package/build/cjs/packages/aurora/src/components/modal_new/components/modals_wrapper.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/modal_new/constants.js +25 -0
- package/build/cjs/packages/aurora/src/components/modal_new/constants.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/modal_new/context.js +21 -0
- package/build/cjs/packages/aurora/src/components/modal_new/context.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/modal_new/css_classes.js +42 -0
- package/build/cjs/packages/aurora/src/components/modal_new/css_classes.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/modal_new/hooks/use_modals.js +119 -0
- package/build/cjs/packages/aurora/src/components/modal_new/hooks/use_modals.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/modal_new/hooks/use_modals_context.js +19 -0
- package/build/cjs/packages/aurora/src/components/modal_new/hooks/use_modals_context.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/modal_new/index.js +45 -0
- package/build/cjs/packages/aurora/src/components/modal_new/index.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/pintura/index.js +51 -0
- package/build/cjs/packages/aurora/src/components/pintura/index.js.map +1 -0
- package/build/cjs/packages/aurora/src/components/xhr_image_picker/index.js +52 -9
- 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 +3 -1
- package/build/cjs/packages/aurora/src/css/image_picker/main.module.less.js.map +1 -1
- package/build/cjs/packages/aurora/src/css/modal_new/main.module.less.js +34 -0
- package/build/cjs/packages/aurora/src/css/modal_new/main.module.less.js.map +1 -0
- package/build/cjs/packages/aurora/src/index.js +57 -49
- package/build/cjs/packages/aurora/src/index.js.map +1 -1
- 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/_virtual/_rollupPluginBabelHelpers.js +181 -1
- package/build/esm/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
- package/build/esm/external/@pqina/pintura/pintura.css.js +7 -0
- package/build/esm/external/@pqina/pintura/pintura.css.js.map +1 -0
- package/build/esm/external/@pqina/pintura/pintura.js +15 -0
- package/build/esm/external/@pqina/pintura/pintura.js.map +1 -0
- package/build/esm/external/@pqina/react-pintura/PinturaEditor.js +75 -0
- package/build/esm/external/@pqina/react-pintura/PinturaEditor.js.map +1 -0
- package/build/esm/external/@pqina/react-pintura/PinturaEditorModal.js +87 -0
- package/build/esm/external/@pqina/react-pintura/PinturaEditorModal.js.map +1 -0
- package/build/esm/external/@pqina/react-pintura/PinturaEditorOverlay.js +75 -0
- package/build/esm/external/@pqina/react-pintura/PinturaEditorOverlay.js.map +1 -0
- package/build/esm/external/@pqina/react-pintura/events.js +41 -0
- package/build/esm/external/@pqina/react-pintura/events.js.map +1 -0
- package/build/esm/packages/aurora/src/assets/icon_image.d.ts +4 -0
- package/build/esm/packages/aurora/src/assets/icon_image.js +24 -0
- package/build/esm/packages/aurora/src/assets/icon_image.js.map +1 -0
- package/build/esm/packages/aurora/src/components/controls/hoc/control_xhr_image_picker/index.js +4 -2
- package/build/esm/packages/aurora/src/components/controls/hoc/control_xhr_image_picker/index.js.map +1 -1
- package/build/esm/packages/aurora/src/components/controls/types.d.ts +1 -0
- package/build/esm/packages/aurora/src/components/dropdown/components/content.js +1 -1
- package/build/esm/packages/aurora/src/components/file_picker/types.d.ts +1 -0
- package/build/esm/packages/aurora/src/components/file_picker/use_file_picker.js +6 -2
- package/build/esm/packages/aurora/src/components/file_picker/use_file_picker.js.map +1 -1
- package/build/esm/packages/aurora/src/components/gallery/index.js +3 -3
- package/build/esm/packages/aurora/src/components/image_picker/css_classes.d.ts +2 -0
- package/build/esm/packages/aurora/src/components/image_picker/css_classes.js +2 -0
- package/build/esm/packages/aurora/src/components/image_picker/css_classes.js.map +1 -1
- package/build/esm/packages/aurora/src/components/image_picker/index.js +25 -4
- package/build/esm/packages/aurora/src/components/image_picker/index.js.map +1 -1
- package/build/esm/packages/aurora/src/components/image_picker/types.d.ts +3 -1
- package/build/esm/packages/aurora/src/components/image_picker/types.js.map +1 -1
- package/build/esm/packages/aurora/src/components/modal/hoc/absolute_modal/index.d.ts +1 -1
- package/build/esm/packages/aurora/src/components/modal/hoc/absolute_modal/index.js +5 -5
- package/build/esm/packages/aurora/src/components/modal/hoc/absolute_modal/index.js.map +1 -1
- package/build/esm/packages/aurora/src/components/modal/hoc/relative_modal/index.js +5 -5
- package/build/esm/packages/aurora/src/components/modal/hoc/relative_modal/index.js.map +1 -1
- package/build/esm/packages/aurora/src/components/modal_new/components/modal/modal.d.ts +3 -0
- package/build/esm/packages/aurora/src/components/modal_new/components/modal/modal.js +103 -0
- package/build/esm/packages/aurora/src/components/modal_new/components/modal/modal.js.map +1 -0
- package/build/esm/packages/aurora/src/components/modal_new/components/modal/modal_footer.d.ts +3 -0
- package/build/esm/packages/aurora/src/components/modal_new/components/modal/modal_footer.js +13 -0
- package/build/esm/packages/aurora/src/components/modal_new/components/modal/modal_footer.js.map +1 -0
- package/build/esm/packages/aurora/src/components/modal_new/components/modal/modal_header.d.ts +3 -0
- package/build/esm/packages/aurora/src/components/modal_new/components/modal/modal_header.js +23 -0
- package/build/esm/packages/aurora/src/components/modal_new/components/modal/modal_header.js.map +1 -0
- package/build/esm/packages/aurora/src/components/modal_new/components/modals_wrapper.d.ts +6 -0
- package/build/esm/packages/aurora/src/components/modal_new/components/modals_wrapper.js +57 -0
- package/build/esm/packages/aurora/src/components/modal_new/components/modals_wrapper.js.map +1 -0
- package/build/esm/packages/aurora/src/components/modal_new/constants.d.ts +14 -0
- package/build/esm/packages/aurora/src/components/modal_new/constants.js +17 -0
- package/build/esm/packages/aurora/src/components/modal_new/constants.js.map +1 -0
- package/build/esm/packages/aurora/src/components/modal_new/context.d.ts +3 -0
- package/build/esm/packages/aurora/src/components/modal_new/context.js +17 -0
- package/build/esm/packages/aurora/src/components/modal_new/context.js.map +1 -0
- package/build/esm/packages/aurora/src/components/modal_new/css_classes.d.ts +18 -0
- package/build/esm/packages/aurora/src/components/modal_new/css_classes.js +21 -0
- package/build/esm/packages/aurora/src/components/modal_new/css_classes.js.map +1 -0
- package/build/esm/packages/aurora/src/components/modal_new/hooks/use_modals.d.ts +12 -0
- package/build/esm/packages/aurora/src/components/modal_new/hooks/use_modals.js +115 -0
- package/build/esm/packages/aurora/src/components/modal_new/hooks/use_modals.js.map +1 -0
- package/build/esm/packages/aurora/src/components/modal_new/hooks/use_modals_context.d.ts +2 -0
- package/build/esm/packages/aurora/src/components/modal_new/hooks/use_modals_context.js +15 -0
- package/build/esm/packages/aurora/src/components/modal_new/hooks/use_modals_context.js.map +1 -0
- package/build/esm/packages/aurora/src/components/modal_new/index.d.ts +6 -0
- package/build/esm/packages/aurora/src/components/modal_new/index.js +37 -0
- package/build/esm/packages/aurora/src/components/modal_new/index.js.map +1 -0
- package/build/esm/packages/aurora/src/components/modal_new/types.d.ts +35 -0
- package/build/esm/packages/aurora/src/components/modal_new/types.js +3 -0
- package/build/esm/packages/aurora/src/components/modal_new/types.js.map +1 -0
- package/build/esm/packages/aurora/src/components/pintura/index.d.ts +10 -0
- package/build/esm/packages/aurora/src/components/pintura/index.js +43 -0
- package/build/esm/packages/aurora/src/components/pintura/index.js.map +1 -0
- package/build/esm/packages/aurora/src/components/xhr_image_picker/index.js +54 -11
- package/build/esm/packages/aurora/src/components/xhr_image_picker/index.js.map +1 -1
- package/build/esm/packages/aurora/src/components/xhr_image_picker/types.d.ts +2 -1
- package/build/esm/packages/aurora/src/css/image_picker/main.module.less.js +3 -1
- package/build/esm/packages/aurora/src/css/image_picker/main.module.less.js.map +1 -1
- package/build/esm/packages/aurora/src/css/modal_new/main.module.less.js +30 -0
- package/build/esm/packages/aurora/src/css/modal_new/main.module.less.js.map +1 -0
- package/build/esm/packages/aurora/src/index.d.ts +5 -1
- package/build/esm/packages/aurora/src/index.js +4 -0
- package/build/esm/packages/aurora/src/index.js.map +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 +3 -1
|
@@ -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;"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { inherits as _inherits, createClass as _createClass, classCallCheck as _classCallCheck, possibleConstructorReturn as _possibleConstructorReturn, getPrototypeOf as _getPrototypeOf, objectSpread2 as _objectSpread2 } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
|
+
import { appendEditor as Pw } from '../pintura/pintura.js';
|
|
4
|
+
import { sub, unsub } from './events.js';
|
|
5
|
+
|
|
6
|
+
function _callSuper(_this, derived, args) {
|
|
7
|
+
function isNativeReflectConstruct() {
|
|
8
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
9
|
+
if (Reflect.construct.sham) return false;
|
|
10
|
+
if (typeof Proxy === "function") return true;
|
|
11
|
+
|
|
12
|
+
try {
|
|
13
|
+
return !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
14
|
+
} catch (e) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
derived = _getPrototypeOf(derived);
|
|
20
|
+
return _possibleConstructorReturn(_this, isNativeReflectConstruct() ? Reflect.construct(derived, args || [], _getPrototypeOf(_this).constructor) : derived.apply(_this, args));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var PinturaEditor = /*#__PURE__*/function (_React$Component) {
|
|
24
|
+
function PinturaEditor(props) {
|
|
25
|
+
var _this2;
|
|
26
|
+
|
|
27
|
+
_classCallCheck(this, PinturaEditor);
|
|
28
|
+
|
|
29
|
+
_this2 = _callSuper(this, PinturaEditor, [props]);
|
|
30
|
+
_this2.elementRef = /*#__PURE__*/React.createRef();
|
|
31
|
+
_this2.editor = undefined;
|
|
32
|
+
return _this2;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
_inherits(PinturaEditor, _React$Component);
|
|
36
|
+
|
|
37
|
+
return _createClass(PinturaEditor, [{
|
|
38
|
+
key: "componentDidMount",
|
|
39
|
+
value: function componentDidMount() {
|
|
40
|
+
if (!this.elementRef.current) return;
|
|
41
|
+
|
|
42
|
+
var props = _objectSpread2({}, this.props);
|
|
43
|
+
|
|
44
|
+
this.editor = Pw(this.elementRef.current, props);
|
|
45
|
+
sub(this, props);
|
|
46
|
+
}
|
|
47
|
+
}, {
|
|
48
|
+
key: "componentDidUpdate",
|
|
49
|
+
value: function componentDidUpdate() {
|
|
50
|
+
var props = _objectSpread2({}, this.props);
|
|
51
|
+
|
|
52
|
+
Object.assign(this.editor, props);
|
|
53
|
+
sub(this, props);
|
|
54
|
+
}
|
|
55
|
+
}, {
|
|
56
|
+
key: "componentWillUnmount",
|
|
57
|
+
value: function componentWillUnmount() {
|
|
58
|
+
if (!this.editor) return;
|
|
59
|
+
unsub(this);
|
|
60
|
+
this.editor.destroy();
|
|
61
|
+
this.editor = undefined;
|
|
62
|
+
}
|
|
63
|
+
}, {
|
|
64
|
+
key: "render",
|
|
65
|
+
value: function render() {
|
|
66
|
+
return /*#__PURE__*/React.createElement('div', {
|
|
67
|
+
className: "PinturaRootWrapper ".concat(this.props.className ? this.props.className : '').trim(),
|
|
68
|
+
ref: this.elementRef
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}]);
|
|
72
|
+
}(React.Component);
|
|
73
|
+
|
|
74
|
+
export default PinturaEditor;
|
|
75
|
+
//# sourceMappingURL=PinturaEditor.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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,87 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { inherits as _inherits, createClass as _createClass, classCallCheck as _classCallCheck, possibleConstructorReturn as _possibleConstructorReturn, getPrototypeOf as _getPrototypeOf, objectSpread2 as _objectSpread2 } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
|
+
import { openEditor as Ew } from '../pintura/pintura.js';
|
|
4
|
+
import { sub, unsub } from './events.js';
|
|
5
|
+
|
|
6
|
+
function _callSuper(_this, derived, args) {
|
|
7
|
+
function isNativeReflectConstruct() {
|
|
8
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
9
|
+
if (Reflect.construct.sham) return false;
|
|
10
|
+
if (typeof Proxy === "function") return true;
|
|
11
|
+
|
|
12
|
+
try {
|
|
13
|
+
return !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
14
|
+
} catch (e) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
derived = _getPrototypeOf(derived);
|
|
20
|
+
return _possibleConstructorReturn(_this, isNativeReflectConstruct() ? Reflect.construct(derived, args || [], _getPrototypeOf(_this).constructor) : derived.apply(_this, args));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var PinturaEditorModal = /*#__PURE__*/function (_React$Component) {
|
|
24
|
+
function PinturaEditorModal(props) {
|
|
25
|
+
var _this2;
|
|
26
|
+
|
|
27
|
+
_classCallCheck(this, PinturaEditorModal);
|
|
28
|
+
|
|
29
|
+
_this2 = _callSuper(this, PinturaEditorModal, [props]);
|
|
30
|
+
_this2.editor = undefined;
|
|
31
|
+
return _this2;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
_inherits(PinturaEditorModal, _React$Component);
|
|
35
|
+
|
|
36
|
+
return _createClass(PinturaEditorModal, [{
|
|
37
|
+
key: "componentDidMount",
|
|
38
|
+
value: function componentDidMount() {
|
|
39
|
+
// We'll wrap the module in a container so we can use the container as a CSS module target
|
|
40
|
+
this.el = document.createElement('div');
|
|
41
|
+
if (this.props.className) this.el.className = this.props.className;
|
|
42
|
+
document.body.append(this.el); // Create editor and proxy events
|
|
43
|
+
|
|
44
|
+
var props = _objectSpread2({}, this.props);
|
|
45
|
+
|
|
46
|
+
this.editor = Ew(_objectSpread2(_objectSpread2({}, props), {}, {
|
|
47
|
+
enableAutoDestroy: false
|
|
48
|
+
}), this.el);
|
|
49
|
+
sub(this, props);
|
|
50
|
+
}
|
|
51
|
+
}, {
|
|
52
|
+
key: "componentDidUpdate",
|
|
53
|
+
value: function componentDidUpdate() {
|
|
54
|
+
var props = _objectSpread2({}, this.props);
|
|
55
|
+
|
|
56
|
+
Object.assign(this.editor, props);
|
|
57
|
+
sub(this, props);
|
|
58
|
+
}
|
|
59
|
+
}, {
|
|
60
|
+
key: "componentWillUnmount",
|
|
61
|
+
value: function componentWillUnmount() {
|
|
62
|
+
if (!this.editor) return;
|
|
63
|
+
unsub(this);
|
|
64
|
+
this.editor.destroy();
|
|
65
|
+
this.editor = undefined;
|
|
66
|
+
this.el.remove();
|
|
67
|
+
}
|
|
68
|
+
}, {
|
|
69
|
+
key: "show",
|
|
70
|
+
value: function show() {
|
|
71
|
+
this.editor.show();
|
|
72
|
+
}
|
|
73
|
+
}, {
|
|
74
|
+
key: "hide",
|
|
75
|
+
value: function hide() {
|
|
76
|
+
this.editor.hide();
|
|
77
|
+
}
|
|
78
|
+
}, {
|
|
79
|
+
key: "render",
|
|
80
|
+
value: function render() {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
}]);
|
|
84
|
+
}(React.Component);
|
|
85
|
+
|
|
86
|
+
export default PinturaEditorModal;
|
|
87
|
+
//# sourceMappingURL=PinturaEditorModal.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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,75 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { inherits as _inherits, createClass as _createClass, classCallCheck as _classCallCheck, possibleConstructorReturn as _possibleConstructorReturn, getPrototypeOf as _getPrototypeOf, objectSpread2 as _objectSpread2 } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
|
+
import { overlayEditor as Iw } from '../pintura/pintura.js';
|
|
4
|
+
import { sub, unsub } from './events.js';
|
|
5
|
+
|
|
6
|
+
function _callSuper(_this, derived, args) {
|
|
7
|
+
function isNativeReflectConstruct() {
|
|
8
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
9
|
+
if (Reflect.construct.sham) return false;
|
|
10
|
+
if (typeof Proxy === "function") return true;
|
|
11
|
+
|
|
12
|
+
try {
|
|
13
|
+
return !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
14
|
+
} catch (e) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
derived = _getPrototypeOf(derived);
|
|
20
|
+
return _possibleConstructorReturn(_this, isNativeReflectConstruct() ? Reflect.construct(derived, args || [], _getPrototypeOf(_this).constructor) : derived.apply(_this, args));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var PinturaEditorOverlay = /*#__PURE__*/function (_React$Component) {
|
|
24
|
+
function PinturaEditorOverlay(props) {
|
|
25
|
+
var _this2;
|
|
26
|
+
|
|
27
|
+
_classCallCheck(this, PinturaEditorOverlay);
|
|
28
|
+
|
|
29
|
+
_this2 = _callSuper(this, PinturaEditorOverlay, [props]);
|
|
30
|
+
_this2.elementRef = /*#__PURE__*/React.createRef();
|
|
31
|
+
_this2.editor = undefined;
|
|
32
|
+
return _this2;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
_inherits(PinturaEditorOverlay, _React$Component);
|
|
36
|
+
|
|
37
|
+
return _createClass(PinturaEditorOverlay, [{
|
|
38
|
+
key: "componentDidMount",
|
|
39
|
+
value: function componentDidMount() {
|
|
40
|
+
if (!this.elementRef.current) return;
|
|
41
|
+
|
|
42
|
+
var props = _objectSpread2({}, this.props);
|
|
43
|
+
|
|
44
|
+
this.editor = Iw(this.elementRef.current, props);
|
|
45
|
+
sub(this, props);
|
|
46
|
+
}
|
|
47
|
+
}, {
|
|
48
|
+
key: "componentDidUpdate",
|
|
49
|
+
value: function componentDidUpdate() {
|
|
50
|
+
var props = _objectSpread2({}, this.props);
|
|
51
|
+
|
|
52
|
+
Object.assign(this.editor, props);
|
|
53
|
+
sub(this, props);
|
|
54
|
+
}
|
|
55
|
+
}, {
|
|
56
|
+
key: "componentWillUnmount",
|
|
57
|
+
value: function componentWillUnmount() {
|
|
58
|
+
if (!this.editor) return;
|
|
59
|
+
unsub(this);
|
|
60
|
+
this.editor.destroy();
|
|
61
|
+
this.editor = undefined;
|
|
62
|
+
}
|
|
63
|
+
}, {
|
|
64
|
+
key: "render",
|
|
65
|
+
value: function render() {
|
|
66
|
+
return /*#__PURE__*/React.createElement('div', {
|
|
67
|
+
className: "PinturaRootWrapper ".concat(this.props.className ? this.props.className : '').trim(),
|
|
68
|
+
ref: this.elementRef
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}]);
|
|
72
|
+
}(React.Component);
|
|
73
|
+
|
|
74
|
+
export default PinturaEditorOverlay;
|
|
75
|
+
//# sourceMappingURL=PinturaEditorOverlay.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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,41 @@
|
|
|
1
|
+
import { slicedToArray as _slicedToArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
|
|
3
|
+
var isEvent = function isEvent(key) {
|
|
4
|
+
return /^on[A-Z]/.test(key);
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
var getEventsFromProps = function getEventsFromProps(props) {
|
|
8
|
+
return Object.keys(props).filter(isEvent).map(getEventFromKey);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
var getEventFromKey = function getEventFromKey(key) {
|
|
12
|
+
return key.substr(2).toLowerCase();
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
var unsub = function unsub(component) {
|
|
16
|
+
var events = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
|
|
17
|
+
(component.unsubs || [] // events not supplied, or event is in events list
|
|
18
|
+
).filter(function (_ref) {
|
|
19
|
+
var _ref2 = _slicedToArray(_ref, 1),
|
|
20
|
+
event = _ref2[0];
|
|
21
|
+
|
|
22
|
+
return !events || events.includes(event);
|
|
23
|
+
}).forEach(function (_ref3) {
|
|
24
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
25
|
+
unsub = _ref4[1];
|
|
26
|
+
|
|
27
|
+
return unsub();
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
var sub = function sub(component, props) {
|
|
31
|
+
// unsub existing subscriptions
|
|
32
|
+
unsub(component, getEventsFromProps(props)); // subscribe
|
|
33
|
+
|
|
34
|
+
component.unsubs = Object.keys(props).filter(isEvent).map(function (key) {
|
|
35
|
+
var type = getEventFromKey(key);
|
|
36
|
+
return [type, component.editor.on(type, props[key])];
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export { sub, unsub };
|
|
41
|
+
//# sourceMappingURL=events.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;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,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import cssClasses from '../css/icons/main.module.less.js';
|
|
3
|
+
import Icon from './icon.js';
|
|
4
|
+
|
|
5
|
+
var IconImage = function IconImage(_ref) {
|
|
6
|
+
var _ref$className = _ref.className,
|
|
7
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
8
|
+
size = _ref.size;
|
|
9
|
+
return /*#__PURE__*/React.createElement(Icon, null, /*#__PURE__*/React.createElement("svg", {
|
|
10
|
+
width: "12",
|
|
11
|
+
height: "13",
|
|
12
|
+
fill: "none",
|
|
13
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14
|
+
className: "".concat(className || '', " ").concat(cssClasses["icon_".concat(size)])
|
|
15
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
16
|
+
fillRule: "evenodd",
|
|
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"
|
|
20
|
+
})));
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default IconImage;
|
|
24
|
+
//# sourceMappingURL=icon_image.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;AACA;AACA;AACA;AACA;AACA;"}
|
package/build/esm/packages/aurora/src/components/controls/hoc/control_xhr_image_picker/index.js
CHANGED
|
@@ -18,7 +18,8 @@ var ControlXhrImagePicker = function ControlXhrImagePicker(_ref) {
|
|
|
18
18
|
hint = _ref.hint,
|
|
19
19
|
labelAdditionalInfo = _ref.labelAdditionalInfo,
|
|
20
20
|
onUploaded = _ref.onUploaded,
|
|
21
|
-
onImageSizeUpdated = _ref.onImageSizeUpdated
|
|
21
|
+
onImageSizeUpdated = _ref.onImageSizeUpdated,
|
|
22
|
+
hasImageEditor = _ref.hasImageEditor;
|
|
22
23
|
|
|
23
24
|
var _useState = useState(errors),
|
|
24
25
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -61,7 +62,8 @@ var ControlXhrImagePicker = function ControlXhrImagePicker(_ref) {
|
|
|
61
62
|
className: className,
|
|
62
63
|
errors: errors,
|
|
63
64
|
onUploaded: onUploaded,
|
|
64
|
-
onImageSizeUpdated: onImageSizeUpdated
|
|
65
|
+
onImageSizeUpdated: onImageSizeUpdated,
|
|
66
|
+
hasImageEditor: hasImageEditor
|
|
65
67
|
}))), /*#__PURE__*/React.createElement(Control.Errors, null));
|
|
66
68
|
};
|
|
67
69
|
|
package/build/esm/packages/aurora/src/components/controls/hoc/control_xhr_image_picker/index.js.map
CHANGED
|
@@ -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;"}
|
|
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;"}
|
|
@@ -179,6 +179,7 @@ export interface IControlXhrImagePicker extends IImagePicker, IControlCommonProp
|
|
|
179
179
|
onChange?: (file: IUseFilePickerOnChange, size?: TImageSize) => void;
|
|
180
180
|
labelAdditionalInfo?: string | ReactNode;
|
|
181
181
|
onUploaded?: (resp: IRequestResponse<any>, file: File) => void;
|
|
182
|
+
hasImageEditor?: boolean;
|
|
182
183
|
}
|
|
183
184
|
export interface ICellSelector {
|
|
184
185
|
rows?: number;
|
|
@@ -2,8 +2,8 @@ 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 } from '../../../../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
4
4
|
import { UiDomUtils } from '@dreamcommerce/utilities';
|
|
5
|
-
import { createPortal } from 'react-dom';
|
|
6
5
|
import classnames from 'classnames';
|
|
6
|
+
import { createPortal } from 'react-dom';
|
|
7
7
|
import cssClasses$3 from '../../../css/icons/main.module.less.js';
|
|
8
8
|
import { useDropdownContext } from '../context/index.js';
|
|
9
9
|
import { SCREEN_XS } from '../../../constants/responsive_breakpoints.js';
|
|
@@ -40,6 +40,7 @@ export interface IUseFilePicker {
|
|
|
40
40
|
onFileChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
41
41
|
onFileDelete: () => void;
|
|
42
42
|
onPreviewError: () => void;
|
|
43
|
+
changeFile: (files: FileList) => void;
|
|
43
44
|
file: TFilePickerFile | undefined;
|
|
44
45
|
errors: string[];
|
|
45
46
|
isPreview: boolean;
|
|
@@ -93,8 +93,11 @@ var useFilePicker = function useFilePicker(_ref) {
|
|
|
93
93
|
return isValid;
|
|
94
94
|
};
|
|
95
95
|
|
|
96
|
-
var onFileChange = function onFileChange(
|
|
97
|
-
|
|
96
|
+
var onFileChange = function onFileChange(event) {
|
|
97
|
+
changeFile(event.target.files);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
var changeFile = function changeFile(files) {
|
|
98
101
|
setErrors([]);
|
|
99
102
|
updateFile(files);
|
|
100
103
|
};
|
|
@@ -163,6 +166,7 @@ var useFilePicker = function useFilePicker(_ref) {
|
|
|
163
166
|
onDragLeave: onDragLeave,
|
|
164
167
|
onFileDelete: onFileDelete,
|
|
165
168
|
onPreviewError: onPreviewError,
|
|
169
|
+
changeFile: changeFile,
|
|
166
170
|
file: file,
|
|
167
171
|
errors: errors,
|
|
168
172
|
isPreview: isPreview,
|
|
@@ -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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,10 +1,10 @@
|
|
|
1
|
-
import { createClass as _createClass,
|
|
2
|
-
import {
|
|
1
|
+
import { createClass as _createClass, classCallCheck as _classCallCheck, defineProperty as _defineProperty, objectSpread2 as _objectSpread2 } from '../../../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { GALLERY_MODE, JS_CLASSES, DIMENSIONS_TYPE } from './constants.js';
|
|
3
3
|
import { getUrl } from './utilities/get_url.js';
|
|
4
4
|
import { copy } from './utilities/copy_to_clipboard.js';
|
|
5
5
|
import { checkIsTouchDevice } from './utilities/check_is_touch_device.js';
|
|
6
6
|
import { handleHistory } from './utilities/handle_history.js';
|
|
7
|
-
import {
|
|
7
|
+
import { cssGalleryImageContainer, cssGalleryBarCopyLinkConfirmation, cssGalleryBar, cssIconArrowContainer, cssGrabbing, cssZoomOut, cssGalleryImagesWithTransition, cssHide, cssZoomIn, cssGalleryImageAdjusted, cssGallery, cssGalleryMobile, cssIcon, cssIconClose, cssGalleryBarImageClose, cssGalleryBarImageNumbers, cssGalleryBarCopyLink, cssIconLink, cssHideMobile, cssHideDesktop, cssIconSuccess, cssGalleryBarCopyLinkConfirmationText, cssLoaderMask, cssGalleryImage, cssGalleryImagesContainer, cssGalleryImages, cssGalleryBarImageDescription, cssIconArrow, cssIconArrowRotate180, cssIconArrowContainerPrevious, cssIconArrowContainerNext, cssGalleryImageMaxWidth, cssGalleryImageMaxHeight } from './css_classes.js';
|
|
8
8
|
import Hammer from 'hammerjs';
|
|
9
9
|
import cssClasses from '../../css/gallery/main.module.less.js';
|
|
10
10
|
|
|
@@ -3,6 +3,8 @@ declare const _default: {
|
|
|
3
3
|
imagePickerWrapper: string;
|
|
4
4
|
imagePickerWrapperError: string;
|
|
5
5
|
imagePickerWrapperHasFile: string;
|
|
6
|
+
imagePickerWrapperTopButtons: string;
|
|
7
|
+
imagePickerEditButton: string;
|
|
6
8
|
imagePickerLabel: string;
|
|
7
9
|
imagePickerDescription: string;
|
|
8
10
|
imagePickerImagePreview: string;
|
|
@@ -4,6 +4,8 @@ var CSS_CLASSES = {
|
|
|
4
4
|
imagePickerWrapper: "".concat(imagePicker, "__wrapper"),
|
|
5
5
|
imagePickerWrapperError: "".concat(imagePicker, "__wrapper-error"),
|
|
6
6
|
imagePickerWrapperHasFile: "".concat(imagePicker, "__wrapper-has-file"),
|
|
7
|
+
imagePickerWrapperTopButtons: "".concat(imagePicker, "__wrapper-top-buttons"),
|
|
8
|
+
imagePickerEditButton: "".concat(imagePicker, "__edit-button"),
|
|
7
9
|
imagePickerLabel: "".concat(imagePicker, "__label"),
|
|
8
10
|
imagePickerDescription: "".concat(imagePicker, "__description"),
|
|
9
11
|
imagePickerImagePreview: "".concat(imagePicker, "__image-preview"),
|
|
@@ -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;"}
|
|
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;"}
|
|
@@ -2,8 +2,8 @@ import React, { memo, useState, useEffect, createRef } from 'react';
|
|
|
2
2
|
import { useTranslation } from '../../../../../external/react-i18next/dist/es/useTranslation.js';
|
|
3
3
|
import { slicedToArray as _slicedToArray, defineProperty as _defineProperty, asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime } from '../../../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
4
4
|
import { FILES_EXTENSIONS } from '../file_picker/constants.js';
|
|
5
|
-
import { createUseStyles } from '../../../../../external/react-jss/dist/react-jss.esm.js';
|
|
6
5
|
import classnames from 'classnames';
|
|
6
|
+
import { createUseStyles } from '../../../../../external/react-jss/dist/react-jss.esm.js';
|
|
7
7
|
import { ErrorsList } from '../controls/components/errors_list.js';
|
|
8
8
|
import { getAcceptFilesParametersFromAllowedExtensions } from '../file_picker/utils.js';
|
|
9
9
|
import { useFilePicker } from '../file_picker/use_file_picker.js';
|
|
@@ -24,7 +24,9 @@ var ImagePicker = /*#__PURE__*/memo(function (_ref) {
|
|
|
24
24
|
name = _ref.name,
|
|
25
25
|
_ref$className = _ref.className,
|
|
26
26
|
className = _ref$className === void 0 ? '' : _ref$className,
|
|
27
|
-
onImageSizeUpdated = _ref.onImageSizeUpdated
|
|
27
|
+
onImageSizeUpdated = _ref.onImageSizeUpdated,
|
|
28
|
+
topButtons = _ref.topButtons,
|
|
29
|
+
editedImageResult = _ref.editedImageResult;
|
|
28
30
|
|
|
29
31
|
var _useTranslation = useTranslation(),
|
|
30
32
|
_useTranslation2 = _slicedToArray(_useTranslation, 1),
|
|
@@ -46,6 +48,7 @@ var ImagePicker = /*#__PURE__*/memo(function (_ref) {
|
|
|
46
48
|
onDragLeave = _useFilePicker.onDragLeave,
|
|
47
49
|
onFileDelete = _useFilePicker.onFileDelete,
|
|
48
50
|
onPreviewError = _useFilePicker.onPreviewError,
|
|
51
|
+
changeFile = _useFilePicker.changeFile,
|
|
49
52
|
file = _useFilePicker.file,
|
|
50
53
|
errors = _useFilePicker.errors,
|
|
51
54
|
isPreview = _useFilePicker.isPreview,
|
|
@@ -65,6 +68,22 @@ var ImagePicker = /*#__PURE__*/memo(function (_ref) {
|
|
|
65
68
|
useEffect(function () {
|
|
66
69
|
initialFile && setImageSizeBasedOnUrl(initialFile === null || initialFile === void 0 ? void 0 : initialFile.fileUrl);
|
|
67
70
|
}, [initialFile]);
|
|
71
|
+
useEffect(function () {
|
|
72
|
+
console.log('file', file);
|
|
73
|
+
}, [file]);
|
|
74
|
+
useEffect(function () {
|
|
75
|
+
if (!editedImageResult) return;
|
|
76
|
+
console.log('editedImageResult', editedImageResult);
|
|
77
|
+
var fileList = createFileList(editedImageResult);
|
|
78
|
+
changeFile(fileList);
|
|
79
|
+
updateFile(fileList);
|
|
80
|
+
}, [editedImageResult]);
|
|
81
|
+
|
|
82
|
+
var createFileList = function createFileList(file) {
|
|
83
|
+
var fileArray = [];
|
|
84
|
+
fileArray.push(file);
|
|
85
|
+
return fileArray;
|
|
86
|
+
};
|
|
68
87
|
|
|
69
88
|
var setImageSizeBasedOnUrl = function setImageSizeBasedOnUrl(fileUrl) {
|
|
70
89
|
createImageFromUrl(fileUrl).then(function (image) {
|
|
@@ -144,7 +163,9 @@ var ImagePicker = /*#__PURE__*/memo(function (_ref) {
|
|
|
144
163
|
className: imagePickerClassName
|
|
145
164
|
}, /*#__PURE__*/React.createElement("div", {
|
|
146
165
|
className: "".concat(imagePickerWrapperClassName, " ").concat(dragOverStyles.imagePickerWrapper)
|
|
147
|
-
}, file && (isPreview ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(
|
|
166
|
+
}, file && (isPreview ? /*#__PURE__*/React.createElement(React.Fragment, null, topButtons && /*#__PURE__*/React.createElement("div", {
|
|
167
|
+
className: styles[CSS_CLASSES.imagePickerWrapperTopButtons]
|
|
168
|
+
}, topButtons), /*#__PURE__*/React.createElement(ImagePreview, {
|
|
148
169
|
file: file,
|
|
149
170
|
isValid: !(errors !== null && errors !== void 0 && errors.length),
|
|
150
171
|
onError: onPreviewError
|
|
@@ -174,7 +195,7 @@ var ImagePicker = /*#__PURE__*/memo(function (_ref) {
|
|
|
174
195
|
}, function (prev, curr) {
|
|
175
196
|
var _prev$initialFile, _curr$initialFile, _prev$initialFile2, _curr$initialFile2;
|
|
176
197
|
|
|
177
|
-
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;
|
|
198
|
+
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;
|
|
178
199
|
});
|
|
179
200
|
|
|
180
201
|
export default ImagePicker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA,+BAA+B,iEAAqE;AACpG;AACA;AACA,gCAAgC,yDAA6D;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,gCAAgC,yDAA6D;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,11 +1,13 @@
|
|
|
1
1
|
import { IFilePicker, TFilesExtension } from "../file_picker/types";
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { ReactNode } from 'react';
|
|
3
3
|
export declare type TImagePickerFile = {
|
|
4
4
|
fileUrl: string;
|
|
5
5
|
fileName: string;
|
|
6
6
|
};
|
|
7
7
|
export interface IImagePicker extends IFilePicker {
|
|
8
8
|
onImageSizeUpdated?: (imageSize?: TImageSize) => void;
|
|
9
|
+
topButtons?: ReactNode;
|
|
10
|
+
editedImageResult?: File;
|
|
9
11
|
}
|
|
10
12
|
export interface ISelectedImagePreview {
|
|
11
13
|
file: TImagePickerFile;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../src/components/image_picker/types.ts"],"names":[],"mappings":"AAAA,OAA6C,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../src/components/image_picker/types.ts"],"names":[],"mappings":"AAAA,OAA6C,qCAAqC,CAAC;AACnF,OAAiC,OAAO,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React, { useRef, useState, useEffect } from 'react';
|
|
2
2
|
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, objectSpread2 as _objectSpread2 } from '../../../../../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
|
-
import { createPortal } from 'react-dom';
|
|
4
|
-
import { createUseStyles } from '../../../../../../../external/react-jss/dist/react-jss.esm.js';
|
|
5
|
-
import cssClasses from '../../../../css/modal/main.module.less.js';
|
|
6
|
-
import Modal from '../../components/modal.js';
|
|
7
3
|
import { calculateAbsolutePosition, getTransformFromAnimationDirection } from '../../utilities.js';
|
|
8
4
|
import { DEFAULT_TRANSLATE_MOVE } from '../../constants.js';
|
|
9
|
-
import
|
|
5
|
+
import cssClasses from '../../../../css/modal/main.module.less.js';
|
|
6
|
+
import Modal from '../../components/modal.js';
|
|
10
7
|
import classnames from 'classnames';
|
|
8
|
+
import { createPortal } from 'react-dom';
|
|
9
|
+
import { createUseStyles } from '../../../../../../../external/react-jss/dist/react-jss.esm.js';
|
|
10
|
+
import { useResize } from '../../../../hooks/use_resize.js';
|
|
11
11
|
|
|
12
12
|
var _excluded = ["vPosition", "hPosition", "offset", "transform", "transformLength", "children", "animationDirection", "isVisible", "style", "withBackground"];
|
|
13
13
|
var useStyles = createUseStyles({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,+DAAmE;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,13 +1,13 @@
|
|
|
1
1
|
import React, { useRef, useState, useEffect } from 'react';
|
|
2
2
|
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, objectSpread2 as _objectSpread2 } from '../../../../../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
3
|
-
import { createPortal } from 'react-dom';
|
|
4
|
-
import { createUseStyles } from '../../../../../../../external/react-jss/dist/react-jss.esm.js';
|
|
5
|
-
import cssClasses from '../../../../css/modal/main.module.less.js';
|
|
6
|
-
import Modal from '../../components/modal.js';
|
|
7
3
|
import { calculateRelativePosition, getTransformFromAnimationDirection } from '../../utilities.js';
|
|
8
4
|
import { DEFAULT_TRANSLATE_MOVE } from '../../constants.js';
|
|
9
|
-
import
|
|
5
|
+
import cssClasses from '../../../../css/modal/main.module.less.js';
|
|
6
|
+
import Modal from '../../components/modal.js';
|
|
10
7
|
import classnames from 'classnames';
|
|
8
|
+
import { createPortal } from 'react-dom';
|
|
9
|
+
import { createUseStyles } from '../../../../../../../external/react-jss/dist/react-jss.esm.js';
|
|
10
|
+
import { useResize } from '../../../../hooks/use_resize.js';
|
|
11
11
|
|
|
12
12
|
var _excluded = ["position", "offset", "transformLength", "children", "animationDirection", "isVisible", "relativeTo", "withBackground"];
|
|
13
13
|
var useStyles = createUseStyles({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,+DAAmE;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|