@dreamcommerce/aurora 2.16.7 → 2.16.8-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/_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,112 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var _rollupPluginBabelHelpers = require('../../../../../../../_virtual/_rollupPluginBabelHelpers.js');
|
|
7
|
+
var classnames = require('classnames');
|
|
8
|
+
var reactDom = require('react-dom');
|
|
9
|
+
var constants = require('../../constants.js');
|
|
10
|
+
var css_classes = require('../../css_classes.js');
|
|
11
|
+
var main_module = require('../../../../css/modal_new/main.module.less.js');
|
|
12
|
+
var modal_footer = require('./modal_footer.js');
|
|
13
|
+
var modal_header = require('./modal_header.js');
|
|
14
|
+
var use_modals_context = require('../../hooks/use_modals_context.js');
|
|
15
|
+
|
|
16
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
|
+
|
|
18
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
19
|
+
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
20
|
+
|
|
21
|
+
var ModalNew = function ModalNew(_ref) {
|
|
22
|
+
var name = _ref.name,
|
|
23
|
+
hideAllModalsOnClose = _ref.hideAllModalsOnClose,
|
|
24
|
+
_ref$animationDirecti = _ref.animationDirection,
|
|
25
|
+
animationDirection = _ref$animationDirecti === void 0 ? constants.MODAL_ANIMATION_DIRECTIONS.top : _ref$animationDirecti,
|
|
26
|
+
header = _ref.header,
|
|
27
|
+
footer = _ref.footer,
|
|
28
|
+
minWidth = _ref.minWidth,
|
|
29
|
+
maxWidth = _ref.maxWidth,
|
|
30
|
+
children = _ref.children;
|
|
31
|
+
|
|
32
|
+
var _useState = React.useState(false),
|
|
33
|
+
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
|
34
|
+
visibleClass = _useState2[0],
|
|
35
|
+
setVisibleClass = _useState2[1];
|
|
36
|
+
|
|
37
|
+
var _useModalsContext = use_modals_context.useModalsContext(),
|
|
38
|
+
modalsManagerContainerSelector = _useModalsContext.modalsManagerContainerSelector,
|
|
39
|
+
addModal = _useModalsContext.addModal,
|
|
40
|
+
getModal = _useModalsContext.getModal,
|
|
41
|
+
hideModal = _useModalsContext.hideModal,
|
|
42
|
+
hideAllModals = _useModalsContext.hideAllModals;
|
|
43
|
+
|
|
44
|
+
var $modalsManagerContainer = document.querySelector(modalsManagerContainerSelector);
|
|
45
|
+
var modal = getModal(name);
|
|
46
|
+
|
|
47
|
+
var _useState3 = React.useState(false),
|
|
48
|
+
_useState4 = _rollupPluginBabelHelpers.slicedToArray(_useState3, 2),
|
|
49
|
+
renderModal = _useState4[0],
|
|
50
|
+
setRenderModal = _useState4[1];
|
|
51
|
+
|
|
52
|
+
React.useEffect(function () {
|
|
53
|
+
addModal({
|
|
54
|
+
name: name,
|
|
55
|
+
visibilityState: constants.MODAL_VISIBILITY_STATE.none,
|
|
56
|
+
animationDirection: animationDirection
|
|
57
|
+
});
|
|
58
|
+
}, []);
|
|
59
|
+
React.useEffect(function () {
|
|
60
|
+
var showModalTimeout;
|
|
61
|
+
var hideModalTimeout;
|
|
62
|
+
|
|
63
|
+
if ((modal === null || modal === void 0 ? void 0 : modal.visibilityState) === constants.MODAL_VISIBILITY_STATE.visible) {
|
|
64
|
+
setRenderModal(true);
|
|
65
|
+
showModalTimeout = setTimeout(function () {
|
|
66
|
+
setVisibleClass(true);
|
|
67
|
+
}, constants.MODAL_SLIDE_FADE_DURATION);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if ((modal === null || modal === void 0 ? void 0 : modal.visibilityState) === constants.MODAL_VISIBILITY_STATE.hidden) {
|
|
71
|
+
setVisibleClass(false);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if ((modal === null || modal === void 0 ? void 0 : modal.visibilityState) === constants.MODAL_VISIBILITY_STATE.none) {
|
|
75
|
+
setVisibleClass(false);
|
|
76
|
+
hideModalTimeout = setTimeout(function () {
|
|
77
|
+
setRenderModal(false);
|
|
78
|
+
}, constants.MODAL_SLIDE_FADE_DURATION);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return function () {
|
|
82
|
+
clearTimeout(showModalTimeout);
|
|
83
|
+
clearTimeout(hideModalTimeout);
|
|
84
|
+
};
|
|
85
|
+
}, [modal]);
|
|
86
|
+
|
|
87
|
+
var handleCloseModal = function handleCloseModal() {
|
|
88
|
+
hideAllModalsOnClose ? hideAllModals() : hideModal(name);
|
|
89
|
+
(header === null || header === void 0 ? void 0 : header.closeAction) && header.closeAction();
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
var modalClassNames = classnames__default['default'](main_module['default'][css_classes.cssModal], _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, main_module['default'][css_classes.cssModalShow], visibleClass), main_module['default'][css_classes.cssModalHide], !visibleClass), main_module['default'][css_classes.cssModalAnimationTop], animationDirection === constants.MODAL_ANIMATION_DIRECTIONS.top), main_module['default'][css_classes.cssModalAnimationRight], animationDirection === constants.MODAL_ANIMATION_DIRECTIONS.right), main_module['default'][css_classes.cssModalAnimationBottom], animationDirection === constants.MODAL_ANIMATION_DIRECTIONS.bottom), main_module['default'][css_classes.cssModalAnimationLeft], animationDirection === constants.MODAL_ANIMATION_DIRECTIONS.left));
|
|
93
|
+
if (!$modalsManagerContainer) return null;
|
|
94
|
+
return renderModal ? /*#__PURE__*/reactDom.createPortal( /*#__PURE__*/React__default['default'].createElement("div", {
|
|
95
|
+
id: name,
|
|
96
|
+
className: modalClassNames,
|
|
97
|
+
style: {
|
|
98
|
+
minWidth: minWidth,
|
|
99
|
+
maxHeight: maxWidth
|
|
100
|
+
}
|
|
101
|
+
}, header && /*#__PURE__*/React__default['default'].createElement(modal_header.ModalHeader, {
|
|
102
|
+
content: header.content,
|
|
103
|
+
closeAction: handleCloseModal
|
|
104
|
+
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
105
|
+
className: "".concat(main_module['default'][css_classes.cssModalContent])
|
|
106
|
+
}, children), footer && /*#__PURE__*/React__default['default'].createElement(modal_footer.ModalFooter, {
|
|
107
|
+
content: footer.content
|
|
108
|
+
})), $modalsManagerContainer) : null;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
exports.ModalNew = ModalNew;
|
|
112
|
+
//# sourceMappingURL=modal.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;AACA;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,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var css_classes = require('../../css_classes.js');
|
|
7
|
+
var main_module = require('../../../../css/modal_new/main.module.less.js');
|
|
8
|
+
|
|
9
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
+
|
|
11
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
|
+
|
|
13
|
+
var ModalFooter = function ModalFooter(_ref) {
|
|
14
|
+
var content = _ref.content;
|
|
15
|
+
return /*#__PURE__*/React__default['default'].createElement("footer", {
|
|
16
|
+
className: main_module['default'][css_classes.cssModalFooter]
|
|
17
|
+
}, content);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
exports.ModalFooter = ModalFooter;
|
|
21
|
+
//# sourceMappingURL=modal_footer.js.map
|
package/build/cjs/packages/aurora/src/components/modal_new/components/modal/modal_footer.js.map
ADDED
|
@@ -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;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var icon_close = require('../../../../assets/icon_close.js');
|
|
7
|
+
var css_classes = require('../../css_classes.js');
|
|
8
|
+
var main_module = require('../../../../css/modal_new/main.module.less.js');
|
|
9
|
+
|
|
10
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
|
+
|
|
12
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
13
|
+
|
|
14
|
+
var ModalHeader = function ModalHeader(_ref) {
|
|
15
|
+
var _ref$content = _ref.content,
|
|
16
|
+
content = _ref$content === void 0 ? '' : _ref$content,
|
|
17
|
+
closeAction = _ref.closeAction;
|
|
18
|
+
return /*#__PURE__*/React__default['default'].createElement("header", {
|
|
19
|
+
className: main_module['default'][css_classes.cssModalHeader]
|
|
20
|
+
}, /*#__PURE__*/React__default['default'].createElement("h3", {
|
|
21
|
+
className: main_module['default'][css_classes.cssModalHeaderTitle]
|
|
22
|
+
}, content), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
23
|
+
className: main_module['default'][css_classes.cssModalHeaderActions]
|
|
24
|
+
}, closeAction && /*#__PURE__*/React__default['default'].createElement(icon_close['default'], {
|
|
25
|
+
onClick: closeAction,
|
|
26
|
+
className: main_module['default'][css_classes.cssModalHeaderCloseIcon]
|
|
27
|
+
})));
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
exports.ModalHeader = ModalHeader;
|
|
31
|
+
//# sourceMappingURL=modal_header.js.map
|
package/build/cjs/packages/aurora/src/components/modal_new/components/modal/modal_header.js.map
ADDED
|
@@ -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;"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var _rollupPluginBabelHelpers = require('../../../../../../_virtual/_rollupPluginBabelHelpers.js');
|
|
7
|
+
var classnames = require('classnames');
|
|
8
|
+
var reactDom = require('react-dom');
|
|
9
|
+
var constants = require('../constants.js');
|
|
10
|
+
var css_classes = require('../css_classes.js');
|
|
11
|
+
var main_module = require('../../../css/modal_new/main.module.less.js');
|
|
12
|
+
var use_modals_context = require('../hooks/use_modals_context.js');
|
|
13
|
+
|
|
14
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
|
+
|
|
16
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
17
|
+
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
18
|
+
|
|
19
|
+
var ModalsWrapper = function ModalsWrapper(_ref) {
|
|
20
|
+
var children = _ref.children;
|
|
21
|
+
|
|
22
|
+
var _useState = React.useState(false),
|
|
23
|
+
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
|
24
|
+
showWrapper = _useState2[0],
|
|
25
|
+
setShowWrapper = _useState2[1];
|
|
26
|
+
|
|
27
|
+
var _useState3 = React.useState(false),
|
|
28
|
+
_useState4 = _rollupPluginBabelHelpers.slicedToArray(_useState3, 2),
|
|
29
|
+
visibleClass = _useState4[0],
|
|
30
|
+
setVisibleClass = _useState4[1];
|
|
31
|
+
|
|
32
|
+
var _useModalsContext = use_modals_context.useModalsContext(),
|
|
33
|
+
openedModals = _useModalsContext.openedModals;
|
|
34
|
+
|
|
35
|
+
React.useEffect(function () {
|
|
36
|
+
var showWrapperTimeout;
|
|
37
|
+
|
|
38
|
+
if (openedModals.length) {
|
|
39
|
+
setShowWrapper(true);
|
|
40
|
+
setVisibleClass(true);
|
|
41
|
+
} else {
|
|
42
|
+
setVisibleClass(false);
|
|
43
|
+
showWrapperTimeout = setTimeout(function () {
|
|
44
|
+
setShowWrapper(false);
|
|
45
|
+
}, constants.MODALS_WRAPPER_BACKDROP_FADE_DURATION);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return function () {
|
|
49
|
+
return clearTimeout(showWrapperTimeout);
|
|
50
|
+
};
|
|
51
|
+
}, [openedModals]);
|
|
52
|
+
var modalsWrapperBackdropClassNames = classnames__default['default'](main_module['default'][css_classes.cssModalsManagerWrapperBackdrop], _rollupPluginBabelHelpers.defineProperty({}, main_module['default'][css_classes.cssModalsManagerWrapperBackdropShow], visibleClass));
|
|
53
|
+
return /*#__PURE__*/reactDom.createPortal( /*#__PURE__*/React__default['default'].createElement("div", {
|
|
54
|
+
className: "".concat(main_module['default'][css_classes.cssModalsManager])
|
|
55
|
+
}, showWrapper && /*#__PURE__*/React__default['default'].createElement("div", {
|
|
56
|
+
className: "".concat(main_module['default'][css_classes.cssModalsManagerWrapper])
|
|
57
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
58
|
+
className: modalsWrapperBackdropClassNames
|
|
59
|
+
}), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
60
|
+
id: constants.MODALS_CONTENT_ID,
|
|
61
|
+
className: "".concat(main_module['default'][css_classes.cssModalsManagerWrapperContent])
|
|
62
|
+
})), children), document.body);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
exports.ModalsWrapper = ModalsWrapper;
|
|
66
|
+
//# sourceMappingURL=modals_wrapper.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;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var MODALS_CONTENT_ID = 'modals-content';
|
|
6
|
+
var MODALS_WRAPPER_BACKDROP_FADE_DURATION = 300;
|
|
7
|
+
var MODAL_SLIDE_FADE_DURATION = 200;
|
|
8
|
+
var MODAL_ANIMATION_DIRECTIONS = {
|
|
9
|
+
top: 'top',
|
|
10
|
+
right: 'right',
|
|
11
|
+
bottom: 'bottom',
|
|
12
|
+
left: 'left'
|
|
13
|
+
};
|
|
14
|
+
var MODAL_VISIBILITY_STATE = {
|
|
15
|
+
none: 'none',
|
|
16
|
+
hidden: 'hidden',
|
|
17
|
+
visible: 'visible'
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
exports.MODALS_CONTENT_ID = MODALS_CONTENT_ID;
|
|
21
|
+
exports.MODALS_WRAPPER_BACKDROP_FADE_DURATION = MODALS_WRAPPER_BACKDROP_FADE_DURATION;
|
|
22
|
+
exports.MODAL_ANIMATION_DIRECTIONS = MODAL_ANIMATION_DIRECTIONS;
|
|
23
|
+
exports.MODAL_SLIDE_FADE_DURATION = MODAL_SLIDE_FADE_DURATION;
|
|
24
|
+
exports.MODAL_VISIBILITY_STATE = MODAL_VISIBILITY_STATE;
|
|
25
|
+
//# 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;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
|
|
7
|
+
var ModalsManagerContext = /*#__PURE__*/React.createContext({
|
|
8
|
+
modalsManagerContainerSelector: '',
|
|
9
|
+
addModal: function addModal() {},
|
|
10
|
+
updateModal: function updateModal() {},
|
|
11
|
+
getModal: function getModal() {
|
|
12
|
+
return undefined;
|
|
13
|
+
},
|
|
14
|
+
showModal: function showModal() {},
|
|
15
|
+
hideModal: function hideModal() {},
|
|
16
|
+
hideAllModals: function hideAllModals() {},
|
|
17
|
+
openedModals: []
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
exports.ModalsManagerContext = ModalsManagerContext;
|
|
21
|
+
//# sourceMappingURL=context.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;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var cssModalsManager = 'modals-manager';
|
|
6
|
+
var cssModalsManagerWrapper = 'modals-manager__wrapper';
|
|
7
|
+
var cssModalsManagerWrapperBackdrop = 'modals-manager__wrapper-backdrop';
|
|
8
|
+
var cssModalsManagerWrapperBackdropShow = 'modals-manager__wrapper-backdrop_show';
|
|
9
|
+
var cssModalsManagerWrapperContent = 'modals-manager__wrapper-content';
|
|
10
|
+
var cssModal = 'modal';
|
|
11
|
+
var cssModalHeader = 'modal__header';
|
|
12
|
+
var cssModalHeaderTitle = 'modal__header-title';
|
|
13
|
+
var cssModalHeaderActions = 'modal__header-actions';
|
|
14
|
+
var cssModalHeaderCloseIcon = 'modal__header-close-icon';
|
|
15
|
+
var cssModalShow = 'modal_show';
|
|
16
|
+
var cssModalHide = 'modal_hide';
|
|
17
|
+
var cssModalAnimationTop = 'modal_animation-top';
|
|
18
|
+
var cssModalAnimationRight = 'modal_animation-right';
|
|
19
|
+
var cssModalAnimationBottom = 'modal_animation-bottom';
|
|
20
|
+
var cssModalAnimationLeft = 'modal_animation-left';
|
|
21
|
+
var cssModalContent = 'modal__content';
|
|
22
|
+
var cssModalFooter = 'modal__footer';
|
|
23
|
+
|
|
24
|
+
exports.cssModal = cssModal;
|
|
25
|
+
exports.cssModalAnimationBottom = cssModalAnimationBottom;
|
|
26
|
+
exports.cssModalAnimationLeft = cssModalAnimationLeft;
|
|
27
|
+
exports.cssModalAnimationRight = cssModalAnimationRight;
|
|
28
|
+
exports.cssModalAnimationTop = cssModalAnimationTop;
|
|
29
|
+
exports.cssModalContent = cssModalContent;
|
|
30
|
+
exports.cssModalFooter = cssModalFooter;
|
|
31
|
+
exports.cssModalHeader = cssModalHeader;
|
|
32
|
+
exports.cssModalHeaderActions = cssModalHeaderActions;
|
|
33
|
+
exports.cssModalHeaderCloseIcon = cssModalHeaderCloseIcon;
|
|
34
|
+
exports.cssModalHeaderTitle = cssModalHeaderTitle;
|
|
35
|
+
exports.cssModalHide = cssModalHide;
|
|
36
|
+
exports.cssModalShow = cssModalShow;
|
|
37
|
+
exports.cssModalsManager = cssModalsManager;
|
|
38
|
+
exports.cssModalsManagerWrapper = cssModalsManagerWrapper;
|
|
39
|
+
exports.cssModalsManagerWrapperBackdrop = cssModalsManagerWrapperBackdrop;
|
|
40
|
+
exports.cssModalsManagerWrapperBackdropShow = cssModalsManagerWrapperBackdropShow;
|
|
41
|
+
exports.cssModalsManagerWrapperContent = cssModalsManagerWrapperContent;
|
|
42
|
+
//# sourceMappingURL=css_classes.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;"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var _rollupPluginBabelHelpers = require('../../../../../../_virtual/_rollupPluginBabelHelpers.js');
|
|
7
|
+
var constants = require('../constants.js');
|
|
8
|
+
|
|
9
|
+
var useModals = function useModals() {
|
|
10
|
+
var _useState = React.useState([]),
|
|
11
|
+
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
|
12
|
+
modalsStack = _useState2[0],
|
|
13
|
+
setModalsStack = _useState2[1];
|
|
14
|
+
|
|
15
|
+
var _useState3 = React.useState([]),
|
|
16
|
+
_useState4 = _rollupPluginBabelHelpers.slicedToArray(_useState3, 2),
|
|
17
|
+
openedModals = _useState4[0],
|
|
18
|
+
setOpenedModals = _useState4[1];
|
|
19
|
+
|
|
20
|
+
var modalsManagerContainerSelector = "#".concat(constants.MODALS_CONTENT_ID);
|
|
21
|
+
|
|
22
|
+
var addModal = function addModal(modal) {
|
|
23
|
+
setModalsStack(function (stack) {
|
|
24
|
+
var modalNameAlreadyExist = stack.some(function (stackModal) {
|
|
25
|
+
return stackModal.name === modal.name;
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
if (modalNameAlreadyExist) {
|
|
29
|
+
return _rollupPluginBabelHelpers.toConsumableArray(stack);
|
|
30
|
+
} else {
|
|
31
|
+
return [].concat(_rollupPluginBabelHelpers.toConsumableArray(stack), [modal]);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
var updateModal = function updateModal(modal) {
|
|
37
|
+
setModalsStack(function (previousStack) {
|
|
38
|
+
var updatedStack = previousStack.map(function (stackModal) {
|
|
39
|
+
return stackModal.name === modal.name ? _rollupPluginBabelHelpers.objectSpread2({}, modal) : stackModal;
|
|
40
|
+
});
|
|
41
|
+
return updatedStack;
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
var getModal = function getModal(modalName) {
|
|
46
|
+
return modalsStack.find(function (stackModal) {
|
|
47
|
+
return stackModal.name === modalName;
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
var showModal = function showModal(modalName) {
|
|
52
|
+
setOpenedModals(function (modals) {
|
|
53
|
+
setVisibleState(modals, constants.MODAL_VISIBILITY_STATE.hidden);
|
|
54
|
+
return [].concat(_rollupPluginBabelHelpers.toConsumableArray(modals), [modalName]);
|
|
55
|
+
});
|
|
56
|
+
setVisibleState(modalName, constants.MODAL_VISIBILITY_STATE.visible);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
var hideModal = function hideModal(modalName) {
|
|
60
|
+
setOpenedModals(function (modals) {
|
|
61
|
+
var secondToLastItem = modals[modals.length - 2];
|
|
62
|
+
setVisibleState(secondToLastItem, constants.MODAL_VISIBILITY_STATE.visible);
|
|
63
|
+
return modals.filter(function (modal) {
|
|
64
|
+
return modal !== modalName;
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
setVisibleState(modalName, constants.MODAL_VISIBILITY_STATE.none);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
var hideAllModals = function hideAllModals() {
|
|
71
|
+
setOpenedModals([]);
|
|
72
|
+
setVisibleStatesToNone();
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
var setVisibleState = function setVisibleState(modalName, state) {
|
|
76
|
+
if (typeof modalName === 'string') {
|
|
77
|
+
setModalsStack(function (prevState) {
|
|
78
|
+
return prevState.map(function (modal) {
|
|
79
|
+
return modal.name === modalName ? _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, modal), {}, {
|
|
80
|
+
visibilityState: state
|
|
81
|
+
}) : modal;
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
} else {
|
|
85
|
+
setModalsStack(function (prevState) {
|
|
86
|
+
return prevState.map(function (modal) {
|
|
87
|
+
if (!modalName) return modal;
|
|
88
|
+
return modalName.includes(modal.name) ? _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, modal), {}, {
|
|
89
|
+
visibilityState: state
|
|
90
|
+
}) : modal;
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
var setVisibleStatesToNone = function setVisibleStatesToNone() {
|
|
97
|
+
setModalsStack(function (prevState) {
|
|
98
|
+
return prevState.map(function (modal) {
|
|
99
|
+
return _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, modal), {}, {
|
|
100
|
+
visibilityState: constants.MODAL_VISIBILITY_STATE.none
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
return {
|
|
107
|
+
modalsManagerContainerSelector: modalsManagerContainerSelector,
|
|
108
|
+
addModal: addModal,
|
|
109
|
+
updateModal: updateModal,
|
|
110
|
+
getModal: getModal,
|
|
111
|
+
showModal: showModal,
|
|
112
|
+
hideModal: hideModal,
|
|
113
|
+
hideAllModals: hideAllModals,
|
|
114
|
+
openedModals: openedModals
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
exports.default = useModals;
|
|
119
|
+
//# sourceMappingURL=use_modals.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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var context = require('../context.js');
|
|
7
|
+
|
|
8
|
+
function useModalsContext() {
|
|
9
|
+
var context$1 = React.useContext(context.ModalsManagerContext);
|
|
10
|
+
|
|
11
|
+
if (Object.keys(context$1).length === 0 && context$1.constructor === Object) {
|
|
12
|
+
throw new Error("Modal component cannot be rendered outside the ModalWrapper component");
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return context$1;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
exports.useModalsContext = useModalsContext;
|
|
19
|
+
//# sourceMappingURL=use_modals_context.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;"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var context = require('./context.js');
|
|
7
|
+
var modals_wrapper = require('./components/modals_wrapper.js');
|
|
8
|
+
var use_modals = require('./hooks/use_modals.js');
|
|
9
|
+
|
|
10
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
|
+
|
|
12
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
13
|
+
|
|
14
|
+
var ModalsManager = function ModalsManager(_ref) {
|
|
15
|
+
var children = _ref.children;
|
|
16
|
+
|
|
17
|
+
var _useModals = use_modals['default'](),
|
|
18
|
+
modalsManagerContainerSelector = _useModals.modalsManagerContainerSelector,
|
|
19
|
+
addModal = _useModals.addModal,
|
|
20
|
+
updateModal = _useModals.updateModal,
|
|
21
|
+
getModal = _useModals.getModal,
|
|
22
|
+
showModal = _useModals.showModal,
|
|
23
|
+
hideModal = _useModals.hideModal,
|
|
24
|
+
hideAllModals = _useModals.hideAllModals,
|
|
25
|
+
openedModals = _useModals.openedModals;
|
|
26
|
+
|
|
27
|
+
var value = React.useMemo(function () {
|
|
28
|
+
return {
|
|
29
|
+
modalsManagerContainerSelector: modalsManagerContainerSelector,
|
|
30
|
+
addModal: addModal,
|
|
31
|
+
updateModal: updateModal,
|
|
32
|
+
getModal: getModal,
|
|
33
|
+
showModal: showModal,
|
|
34
|
+
hideModal: hideModal,
|
|
35
|
+
hideAllModals: hideAllModals,
|
|
36
|
+
openedModals: openedModals
|
|
37
|
+
};
|
|
38
|
+
}, [modalsManagerContainerSelector, addModal, updateModal, getModal, showModal, hideModal, hideAllModals, openedModals]);
|
|
39
|
+
return /*#__PURE__*/React__default['default'].createElement(context.ModalsManagerContext.Provider, {
|
|
40
|
+
value: value
|
|
41
|
+
}, /*#__PURE__*/React__default['default'].createElement(modals_wrapper.ModalsWrapper, null, children));
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
exports.default = ModalsManager;
|
|
45
|
+
//# sourceMappingURL=index.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;"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var _rollupPluginBabelHelpers = require('../../../../../_virtual/_rollupPluginBabelHelpers.js');
|
|
7
|
+
require('../../../../../external/@pqina/pintura/pintura.css.js');
|
|
8
|
+
var pintura = require('../../../../../external/@pqina/pintura/pintura.js');
|
|
9
|
+
var PinturaEditor = require('../../../../../external/@pqina/react-pintura/PinturaEditor.js');
|
|
10
|
+
require('../../../../../external/@pqina/react-pintura/PinturaEditorModal.js');
|
|
11
|
+
require('../../../../../external/@pqina/react-pintura/PinturaEditorOverlay.js');
|
|
12
|
+
|
|
13
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
|
+
|
|
15
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
16
|
+
|
|
17
|
+
var Pintura = function Pintura(_ref) {
|
|
18
|
+
var src = _ref.src,
|
|
19
|
+
_ref$height = _ref.height,
|
|
20
|
+
height = _ref$height === void 0 ? '70vh' : _ref$height,
|
|
21
|
+
onPreviewLoaded = _ref.onPreviewLoaded,
|
|
22
|
+
onEditionDone = _ref.onEditionDone;
|
|
23
|
+
|
|
24
|
+
var _useState = React.useState(),
|
|
25
|
+
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
|
26
|
+
inlineResult = _useState2[0],
|
|
27
|
+
setInlineResult = _useState2[1];
|
|
28
|
+
|
|
29
|
+
React.useEffect(function () {
|
|
30
|
+
if (inlineResult && onEditionDone) onEditionDone(inlineResult);
|
|
31
|
+
}, [inlineResult]);
|
|
32
|
+
|
|
33
|
+
var handleLoadPreview = function handleLoadPreview() {
|
|
34
|
+
onPreviewLoaded && onPreviewLoaded();
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
38
|
+
style: {
|
|
39
|
+
height: height
|
|
40
|
+
}
|
|
41
|
+
}, /*#__PURE__*/React__default['default'].createElement(PinturaEditor['default'], _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, pintura.getEditorDefaults()), {}, {
|
|
42
|
+
src: src,
|
|
43
|
+
onProcess: function onProcess(res) {
|
|
44
|
+
return setInlineResult(res.dest);
|
|
45
|
+
},
|
|
46
|
+
onLoadpreview: handleLoadPreview
|
|
47
|
+
})));
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
exports.Pintura = Pintura;
|
|
51
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,uDAA2D;AACnE,sBAAsB,mDAAuD;AAC7E,4BAA4B,+DAAmE;AAC/F,QAAQ,oEAAwE;AAChF,QAAQ,sEAA0E;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|