@configuratorware/configurator-frontendgui 1.56.2 → 1.56.4
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/App/Error/ErrorBoundary.js +8 -6
- package/App/Frame.js +8 -6
- package/App/Modules/Creator/Components/ConfigurationvariantItem/index.js +10 -8
- package/App/Modules/Creator/Components/ConfigurationvariantSelection/index.js +10 -8
- package/App/Modules/Creator/Components/CustomTitleEditor/index.js +10 -8
- package/App/Modules/Creator/Components/ExternalVisualization/index.js +9 -7
- package/App/Modules/Creator/Components/FastConfigurationRow/index.js +8 -6
- package/App/Modules/Creator/Components/FastConfigurationSelect/index.js +8 -6
- package/App/Modules/Creator/Components/FullScreenView/FullScreenView.js +11 -10
- package/App/Modules/Creator/Components/Incompatibility/OptionExclusionRule/index.js +8 -6
- package/App/Modules/Creator/Components/Incompatibility/OptionRule/index.js +8 -6
- package/App/Modules/Creator/Components/Incompatibility/RuleComponent.js +9 -7
- package/App/Modules/Creator/Components/Incompatibility/index.js +9 -8
- package/App/Modules/Creator/Components/Option/index.js +1 -0
- package/App/Modules/Creator/Components/OptionAmount/index.js +14 -6
- package/App/Modules/Creator/Components/Optiondetail/ZoomImage/index.js +7 -6
- package/App/Modules/Creator/Components/Optiondetail/index.js +17 -15
- package/App/Modules/Creator/Components/OptionsList/index.js +12 -11
- package/App/Modules/Creator/Components/Price/index.js +8 -6
- package/App/Modules/Creator/Components/ProductPart/index.js +8 -7
- package/App/Modules/Creator/Components/Tools/index.js +8 -6
- package/App/Modules/Creator/Layouts/DefaultLayout.js +30 -28
- package/App/Modules/Designer/Components/AddGalleryImage/index.js +11 -9
- package/App/Modules/Designer/Components/AddGalleryImage/index.story.js +4 -4
- package/App/Modules/Designer/Components/AddGalleryImage/index.test.js +6 -6
- package/App/Modules/Designer/Components/AddVisualElement/index.js +8 -6
- package/App/Modules/Designer/Components/AddVisualElement/index.test.js +3 -3
- package/App/Modules/Designer/Components/CloseDesignEditor/index.js +8 -6
- package/App/Modules/Designer/Components/CloseGraphicsEditorButton/index.js +5 -4
- package/App/Modules/Designer/Components/ColorPalettes/index.js +26 -21
- package/App/Modules/Designer/Components/ColorPalettes/index.test.js +3 -3
- package/App/Modules/Designer/Components/DesignAreaControlbox/index.js +23 -20
- package/App/Modules/Designer/Components/DesignAreaControlbox/index.test.js +7 -7
- package/App/Modules/Designer/Components/Dialog/index.js +13 -10
- package/App/Modules/Designer/Components/FeedbackNotice/index.js +9 -7
- package/App/Modules/Designer/Components/FeedbackNotice/index.test.js +1 -1
- package/App/Modules/Designer/Components/FullScreenView/FullScreenView.js +7 -6
- package/App/Modules/Designer/Components/ImageColorPicker/ImageColorPicker.js +12 -10
- package/App/Modules/Designer/Components/ImageColorize/index.js +39 -29
- package/App/Modules/Designer/Components/ImageControlbox/index.js +16 -13
- package/App/Modules/Designer/Components/ImageEditDialog/ImageThumbnail.js +24 -14
- package/App/Modules/Designer/Components/ImageEditDialog/ImageUpload.js +85 -69
- package/App/Modules/Designer/Components/ImageEditDialog/index.js +45 -42
- package/App/Modules/Designer/Components/ImageLibraryThumbnail/index.js +9 -7
- package/App/Modules/Designer/Components/ObjectTools/index.js +8 -6
- package/App/Modules/Designer/Components/Select/index.js +8 -6
- package/App/Modules/Designer/Components/TextControlbox/index.js +26 -21
- package/App/Modules/Designer/Components/TextControlbox/index.test.js +10 -10
- package/App/Modules/Designer/Containers/AddVisualElement.js +21 -11
- package/App/Modules/Designer/Containers/ImageEditDialog.js +173 -157
- package/App/Modules/Designer/Designer.js +7 -6
- package/App/Modules/Designer/Layouts/DefaultLayout.js +20 -17
- package/App/Modules/Designer/Layouts/PopupAreaProvider.js +18 -15
- package/App/Modules/Designer/Utils/Transformers.js +23 -13
- package/App/Modules/Designer/setupDesigner.js +27 -16
- package/App/Modules/Designer/withActiveCanvas.js +10 -8
- package/App/Modules/Visualization/AlignTargetContainer.js +1 -0
- package/App/Modules/Visualization/CreatorAlignTarget.js +12 -11
- package/App/Modules/Visualization/DefaultVisualizationProvider.js +10 -8
- package/App/Modules/Visualization/DesignerAlignTarget.js +10 -9
- package/App/Reducers/Actions.js +44 -36
- package/App/Reducers/Configurator/Actions.js +92 -78
- package/App/Reducers/Configurator/Selectors.js +5 -5
- package/App/Reducers/Confirm/Actions.js +16 -6
- package/App/Reducers/DesignArea/Selectors.js +2 -1
- package/App/Reducers/ImageGallery/Actions.js +31 -18
- package/App/Reducers/ImageGallery/Reducer.js +1 -0
- package/App/Reducers/ImageGallery/Selectors.js +1 -0
- package/App/Reducers/UI/Actions.js +40 -26
- package/App/Routing.js +8 -6
- package/App/Screens/Configurator/Components/AmountSelection/index.js +11 -9
- package/App/Screens/Configurator/Components/CalculationWidget/index.js +19 -17
- package/App/Screens/Configurator/Components/CalculationWidget/index.test.js +8 -8
- package/App/Screens/Configurator/Components/Confirm/index.js +8 -6
- package/App/Screens/Configurator/Components/Error/index.js +9 -7
- package/App/Screens/Configurator/Components/FullScreenView/index.js +24 -21
- package/App/Screens/Configurator/Components/FullScreenView/index.test.js +2 -2
- package/App/Screens/Configurator/Components/ItemTile/ItemTile.js +13 -5
- package/App/Screens/Configurator/Components/PreviewPortal/index.js +10 -8
- package/App/Screens/Configurator/Components/Thumbnail/index.js +27 -24
- package/App/Screens/Configurator/Components/Thumbnail/index.test.js +2 -2
- package/App/Screens/Configurator/Containers/AmountPrice.js +6 -5
- package/App/Screens/Configurator/Containers/ConfigurationModeSwitch.js +19 -10
- package/App/Screens/DesignerProductPreview/DesignerProductPreviewManager.js +88 -73
- package/App/Screens/DesignerProductPreview/Screen.js +21 -14
- package/App/Screens/ItemOverview/Components/ItemOverview.js +47 -32
- package/App/ServiceLocator.js +4 -2
- package/App/Services/AdminareaCommunicationService.js +24 -14
- package/App/Services/AnalyticsService.js +48 -47
- package/App/Services/ConfiguratorService.js +142 -121
- package/App/Services/DesignDataService.js +619 -555
- package/App/Services/DesignerService.js +100 -79
- package/App/Services/InteractionService.js +236 -210
- package/App/Services/UIService.js +10 -7
- package/App/Services/VisualizationService.js +104 -86
- package/App/Shared/Components/AcceptDesign/index.js +19 -16
- package/App/Shared/Components/AcceptPrivacy/index.js +8 -6
- package/App/Shared/Components/AddToBasket/index.js +8 -6
- package/App/Shared/Components/AlertDialog/index.js +9 -7
- package/App/Shared/Components/AmountInput/index.js +24 -21
- package/App/Shared/Components/AmountPrice/index.js +128 -115
- package/App/Shared/Components/AmountPrice/index.test.js +5 -5
- package/App/Shared/Components/BulkNames/index.js +8 -6
- package/App/Shared/Components/ConfigurationOverview/index.js +8 -6
- package/App/Shared/Components/InformationTag/InformationTag.js +11 -9
- package/App/Shared/Components/LicenseNotice/LicenseNotice.js +8 -6
- package/App/Shared/Components/LoadConfiguration/index.js +9 -7
- package/App/Shared/Components/Notification/index.js +8 -6
- package/App/Shared/Components/PdfDownload/index.js +25 -15
- package/App/Shared/Components/PriceList/index.js +16 -13
- package/App/Shared/Components/PriceOverview/index.js +13 -10
- package/App/Shared/Components/ProductVariant/index.js +25 -22
- package/App/Shared/Components/ProductVariant/index.story.js +1 -0
- package/App/Shared/Components/ReceiveOfferForm/index.js +12 -10
- package/App/Shared/Components/ReceiveOfferForm/index.test.js +2 -2
- package/App/Shared/Components/SaveConfiguration/index.js +32 -22
- package/App/Shared/Components/Stepper/index.js +10 -8
- package/App/Shared/Components/ToolbarList/index.js +11 -9
- package/App/Shared/Components/VariantChooser/index.js +13 -10
- package/App/Shared/Containers/BulkNames.js +15 -13
- package/App/Shared/Containers/Header/index.js +15 -7
- package/App/Shared/Containers/LoadConfiguration/LoadConfiguration.js +22 -15
- package/App/Shared/Containers/ProductVariant/ProductVariant.js +23 -15
- package/App/Translations.js +56 -40
- package/App/Utils/Request/lazyFetch.js +27 -19
- package/App/configuration.js +4 -0
- package/App/index.js +24 -14
- package/Framework/Api.js +2 -1
- package/Framework/ComponentContainer.js +14 -11
- package/Framework/Components/Carousel/index.js +13 -11
- package/Framework/Components/Dialog/index.js +35 -33
- package/Framework/Components/DialogSelect/index.js +19 -16
- package/Framework/Components/Input/index.js +12 -10
- package/Framework/CustomError.js +6 -5
- package/Framework/Helpers/TransitionDetect.js +2 -1
- package/Framework/Services/AbstractAdminareaCommunicationService.js +2 -1
- package/Framework/Services/AbstractAsyncService.js +2 -1
- package/Framework/Services/AbstractConfiguratorService.js +2 -1
- package/Framework/Services/AbstractInteractionService.js +2 -1
- package/Framework/Services/AbstractStoreService.js +2 -1
- package/Framework/Services/AbstractUIService.js +2 -1
- package/Framework/Services/AbstractVisualizationService.js +2 -1
- package/Framework/Services/AsyncService.js +8 -6
- package/Framework/Services/StoreService.js +27 -17
- package/Framework/bindDecorator.js +7 -6
- package/Framework/i18n.js +10 -8
- package/Shared/ErrorTypes/DeferredError.js +6 -5
- package/Shared/HOCs/ResizeDetect/ResizeDetect.js +11 -9
- package/Utils/Async/AsyncManager.js +30 -20
- package/Utils/Async/Deferred.js +4 -2
- package/Utils/Decorators/Observable.js +2 -1
- package/Utils/Dev/HOCs/withFilePicker.js +10 -8
- package/Utils/Immutable/set.js +6 -6
- package/Utils/Test/mountWithState.js +1 -1
- package/package.json +4 -4
|
@@ -12,8 +12,15 @@ var _Selectors = require("../../../../Reducers/ImageGallery/Selectors");
|
|
|
12
12
|
var _DesignDataService = require("../../../../Services/DesignDataService");
|
|
13
13
|
var _Transformers = require("../../Utils/Transformers");
|
|
14
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
15
|
+
function _regeneratorRuntime() { "use strict"; var r = _regenerator(), e = r.m(_regeneratorRuntime), t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor; function n(r) { var e = "function" == typeof r && r.constructor; return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name)); } var o = { "throw": 1, "return": 2, "break": 3, "continue": 3 }; function a(r) { var e, t; return function (n) { e || (e = { stop: function stop() { return t(n.a, 2); }, "catch": function _catch() { return n.v; }, abrupt: function abrupt(r, e) { return t(n.a, o[r], e); }, delegateYield: function delegateYield(r, o, a) { return e.resultName = o, t(n.d, _regeneratorValues(r), a); }, finish: function finish(r) { return t(n.f, r); } }, t = function t(r, _t, o) { n.p = e.prev, n.n = e.next; try { return r(_t, o); } finally { e.next = n.n; } }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n; try { return r.call(this, e); } finally { n.p = e.prev, n.n = e.next; } }; } return (_regeneratorRuntime = function _regeneratorRuntime() { return { wrap: function wrap(e, t, n, o) { return r.w(a(e), t, n, o && o.reverse()); }, isGeneratorFunction: n, mark: r.m, awrap: function awrap(r, e) { return new _OverloadYield(r, e); }, AsyncIterator: _regeneratorAsyncIterator, async: function async(r, e, t, o, u) { return (n(e) ? _regeneratorAsyncGen : _regeneratorAsync)(a(r), e, t, o, u); }, keys: _regeneratorKeys, values: _regeneratorValues }; })(); }
|
|
16
|
+
function _regeneratorValues(e) { if (null != e) { var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"], r = 0; if (t) return t.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) return { next: function next() { return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e }; } }; } throw new TypeError(_typeof(e) + " is not iterable"); }
|
|
17
|
+
function _regeneratorKeys(e) { var n = Object(e), r = []; for (var t in n) r.unshift(t); return function e() { for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e; return e.done = !0, e; }; }
|
|
18
|
+
function _regeneratorAsync(n, e, r, t, o) { var a = _regeneratorAsyncGen(n, e, r, t, o); return a.next().then(function (n) { return n.done ? n.value : a.next(); }); }
|
|
19
|
+
function _regeneratorAsyncGen(r, e, t, o, n) { return new _regeneratorAsyncIterator(_regenerator().w(r, e, t, o), n || Promise); }
|
|
20
|
+
function _regeneratorAsyncIterator(t, e) { function n(r, o, i, f) { try { var c = t[r](o), u = c.value; return u instanceof _OverloadYield ? e.resolve(u.v).then(function (t) { n("next", t, i, f); }, function (t) { n("throw", t, i, f); }) : e.resolve(u).then(function (t) { c.value = t, i(c); }, function (t) { return n("throw", t, i, f); }); } catch (t) { f(t); } } var r; this.next || (_regeneratorDefine2(_regeneratorAsyncIterator.prototype), _regeneratorDefine2(_regeneratorAsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () { return this; })), _regeneratorDefine2(this, "_invoke", function (t, o, i) { function f() { return new e(function (e, r) { n(t, i, e, r); }); } return r = r ? r.then(f, f) : f(); }, !0); }
|
|
15
21
|
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
16
22
|
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
23
|
+
function _OverloadYield(e, d) { this.v = e, this.k = d; }
|
|
17
24
|
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
18
25
|
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
19
26
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
@@ -21,13 +28,13 @@ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o =
|
|
|
21
28
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
22
29
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
23
30
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
24
|
-
function
|
|
31
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
32
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
33
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
25
34
|
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
26
35
|
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
27
36
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
28
37
|
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
29
|
-
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
30
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
31
38
|
var styles = function styles() {
|
|
32
39
|
return {
|
|
33
40
|
image: function image(_ref) {
|
|
@@ -42,17 +49,18 @@ var styles = function styles() {
|
|
|
42
49
|
};
|
|
43
50
|
};
|
|
44
51
|
var ImageThumbnail = /*#__PURE__*/function (_React$Component) {
|
|
52
|
+
_inherits(ImageThumbnail, _React$Component);
|
|
53
|
+
var _super = _createSuper(ImageThumbnail);
|
|
45
54
|
function ImageThumbnail(props) {
|
|
46
55
|
var _this;
|
|
47
56
|
_classCallCheck(this, ImageThumbnail);
|
|
48
|
-
_this =
|
|
57
|
+
_this = _super.call(this, props);
|
|
49
58
|
_this.state = {
|
|
50
59
|
src: null
|
|
51
60
|
};
|
|
52
61
|
return _this;
|
|
53
62
|
}
|
|
54
|
-
|
|
55
|
-
return _createClass(ImageThumbnail, [{
|
|
63
|
+
_createClass(ImageThumbnail, [{
|
|
56
64
|
key: "componentDidMount",
|
|
57
65
|
value: function componentDidMount() {
|
|
58
66
|
this.setState({
|
|
@@ -85,20 +93,21 @@ var ImageThumbnail = /*#__PURE__*/function (_React$Component) {
|
|
|
85
93
|
}, {
|
|
86
94
|
key: "downloadSvg",
|
|
87
95
|
value: function () {
|
|
88
|
-
var _downloadSvg = _asyncToGenerator(/*#__PURE__*/
|
|
96
|
+
var _downloadSvg = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(image) {
|
|
89
97
|
var svgContent;
|
|
90
|
-
return
|
|
91
|
-
while (1) switch (_context.
|
|
98
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
99
|
+
while (1) switch (_context.prev = _context.next) {
|
|
92
100
|
case 0:
|
|
93
|
-
_context.
|
|
101
|
+
_context.next = 2;
|
|
94
102
|
return (0, _DesignDataService.getSvgContent)((0, _Selectors.getPreviewUrlFromImageData)(image.preview), true);
|
|
95
|
-
case
|
|
96
|
-
svgContent = _context.
|
|
103
|
+
case 2:
|
|
104
|
+
svgContent = _context.sent;
|
|
97
105
|
this.setState({
|
|
98
106
|
src: (0, _DesignDataService.applySvgContentOperations)(image.original, image.preview, image.operations, svgContent)
|
|
99
107
|
});
|
|
100
|
-
case
|
|
101
|
-
|
|
108
|
+
case 4:
|
|
109
|
+
case "end":
|
|
110
|
+
return _context.stop();
|
|
102
111
|
}
|
|
103
112
|
}, _callee, this);
|
|
104
113
|
}));
|
|
@@ -118,6 +127,7 @@ var ImageThumbnail = /*#__PURE__*/function (_React$Component) {
|
|
|
118
127
|
});
|
|
119
128
|
}
|
|
120
129
|
}]);
|
|
130
|
+
return ImageThumbnail;
|
|
121
131
|
}(_react["default"].Component);
|
|
122
132
|
var _default = exports["default"] = (0, _styles.withStyles)(styles, {
|
|
123
133
|
name: 'ImageThumbnail'
|
|
@@ -26,33 +26,41 @@ var _DesignDataService = require("../../../../Services/DesignDataService");
|
|
|
26
26
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
|
|
27
27
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
28
28
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
29
|
+
function _regeneratorRuntime() { "use strict"; var r = _regenerator(), e = r.m(_regeneratorRuntime), t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor; function n(r) { var e = "function" == typeof r && r.constructor; return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name)); } var o = { "throw": 1, "return": 2, "break": 3, "continue": 3 }; function a(r) { var e, t; return function (n) { e || (e = { stop: function stop() { return t(n.a, 2); }, "catch": function _catch() { return n.v; }, abrupt: function abrupt(r, e) { return t(n.a, o[r], e); }, delegateYield: function delegateYield(r, o, a) { return e.resultName = o, t(n.d, _regeneratorValues(r), a); }, finish: function finish(r) { return t(n.f, r); } }, t = function t(r, _t, o) { n.p = e.prev, n.n = e.next; try { return r(_t, o); } finally { e.next = n.n; } }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n; try { return r.call(this, e); } finally { n.p = e.prev, n.n = e.next; } }; } return (_regeneratorRuntime = function _regeneratorRuntime() { return { wrap: function wrap(e, t, n, o) { return r.w(a(e), t, n, o && o.reverse()); }, isGeneratorFunction: n, mark: r.m, awrap: function awrap(r, e) { return new _OverloadYield(r, e); }, AsyncIterator: _regeneratorAsyncIterator, async: function async(r, e, t, o, u) { return (n(e) ? _regeneratorAsyncGen : _regeneratorAsync)(a(r), e, t, o, u); }, keys: _regeneratorKeys, values: _regeneratorValues }; })(); }
|
|
30
|
+
function _regeneratorValues(e) { if (null != e) { var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"], r = 0; if (t) return t.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) return { next: function next() { return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e }; } }; } throw new TypeError(_typeof(e) + " is not iterable"); }
|
|
31
|
+
function _regeneratorKeys(e) { var n = Object(e), r = []; for (var t in n) r.unshift(t); return function e() { for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e; return e.done = !0, e; }; }
|
|
32
|
+
function _regeneratorAsync(n, e, r, t, o) { var a = _regeneratorAsyncGen(n, e, r, t, o); return a.next().then(function (n) { return n.done ? n.value : a.next(); }); }
|
|
33
|
+
function _regeneratorAsyncGen(r, e, t, o, n) { return new _regeneratorAsyncIterator(_regenerator().w(r, e, t, o), n || Promise); }
|
|
34
|
+
function _regeneratorAsyncIterator(t, e) { function n(r, o, i, f) { try { var c = t[r](o), u = c.value; return u instanceof _OverloadYield ? e.resolve(u.v).then(function (t) { n("next", t, i, f); }, function (t) { n("throw", t, i, f); }) : e.resolve(u).then(function (t) { c.value = t, i(c); }, function (t) { return n("throw", t, i, f); }); } catch (t) { f(t); } } var r; this.next || (_regeneratorDefine2(_regeneratorAsyncIterator.prototype), _regeneratorDefine2(_regeneratorAsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () { return this; })), _regeneratorDefine2(this, "_invoke", function (t, o, i) { function f() { return new e(function (e, r) { n(t, i, e, r); }); } return r = r ? r.then(f, f) : f(); }, !0); }
|
|
29
35
|
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
30
36
|
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
37
|
+
function _OverloadYield(e, d) { this.v = e, this.k = d; }
|
|
31
38
|
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
32
39
|
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
33
40
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
34
41
|
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
35
42
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
36
|
-
function
|
|
43
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
44
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
45
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
37
46
|
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
38
47
|
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
39
48
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
40
49
|
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
41
|
-
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
42
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
43
50
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
44
51
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
45
52
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
46
53
|
var styles = function styles(theme) {
|
|
54
|
+
var _imagePreview, _imageUploadDropZone, _imageUploadContainer, _imageUploadButton, _imageUploadTextSucce;
|
|
47
55
|
return {
|
|
48
|
-
imagePreview:
|
|
56
|
+
imagePreview: (_imagePreview = {
|
|
49
57
|
maxWidth: 400,
|
|
50
58
|
maxHeight: 200
|
|
51
|
-
}, theme.breakpoints.down('sm'), {
|
|
59
|
+
}, _defineProperty(_imagePreview, theme.breakpoints.down('sm'), {
|
|
52
60
|
maxWidth: 300,
|
|
53
61
|
maxHeight: 160
|
|
54
|
-
}), "resizeMode", 'contain'), "boxShadow", theme.shadows[4]),
|
|
55
|
-
imageUploadDropZone:
|
|
62
|
+
}), _defineProperty(_imagePreview, "resizeMode", 'contain'), _defineProperty(_imagePreview, "boxShadow", theme.shadows[4]), _imagePreview),
|
|
63
|
+
imageUploadDropZone: (_imageUploadDropZone = {
|
|
56
64
|
background: 'white',
|
|
57
65
|
height: 335,
|
|
58
66
|
width: 450,
|
|
@@ -61,19 +69,19 @@ var styles = function styles(theme) {
|
|
|
61
69
|
display: 'flex',
|
|
62
70
|
alignItems: 'center',
|
|
63
71
|
justifyContent: 'center'
|
|
64
|
-
}, theme.breakpoints.down('sm'), {
|
|
72
|
+
}, _defineProperty(_imageUploadDropZone, theme.breakpoints.down('sm'), {
|
|
65
73
|
width: 'auto'
|
|
66
|
-
}), theme.breakpoints.down('xs'), {
|
|
74
|
+
}), _defineProperty(_imageUploadDropZone, theme.breakpoints.down('xs'), {
|
|
67
75
|
height: 300
|
|
68
|
-
}),
|
|
69
|
-
imageUploadContainer:
|
|
76
|
+
}), _imageUploadDropZone),
|
|
77
|
+
imageUploadContainer: (_imageUploadContainer = {
|
|
70
78
|
background: 'white',
|
|
71
79
|
width: '100%',
|
|
72
80
|
margin: 30,
|
|
73
81
|
borderRadius: 4
|
|
74
|
-
}, theme.breakpoints.down('xs'), {
|
|
82
|
+
}, _defineProperty(_imageUploadContainer, theme.breakpoints.down('xs'), {
|
|
75
83
|
margin: 16
|
|
76
|
-
}), "display", 'flex'), "flexDirection", 'column'), "alignItems", 'center'),
|
|
84
|
+
}), _defineProperty(_imageUploadContainer, "display", 'flex'), _defineProperty(_imageUploadContainer, "flexDirection", 'column'), _defineProperty(_imageUploadContainer, "alignItems", 'center'), _imageUploadContainer),
|
|
77
85
|
imageUploadIcon: {
|
|
78
86
|
fontSize: 30,
|
|
79
87
|
marginRight: 5,
|
|
@@ -87,12 +95,12 @@ var styles = function styles(theme) {
|
|
|
87
95
|
imageUploadIconSuccess: {
|
|
88
96
|
color: '#4FC36D'
|
|
89
97
|
},
|
|
90
|
-
imageUploadButton:
|
|
98
|
+
imageUploadButton: (_imageUploadButton = {
|
|
91
99
|
fontSize: 15
|
|
92
|
-
}, theme.breakpoints.down('xs'), {
|
|
100
|
+
}, _defineProperty(_imageUploadButton, theme.breakpoints.down('xs'), {
|
|
93
101
|
padding: '0 24px',
|
|
94
102
|
height: 56
|
|
95
|
-
}), '& input', {
|
|
103
|
+
}), _defineProperty(_imageUploadButton, '& input', {
|
|
96
104
|
position: 'absolute',
|
|
97
105
|
top: 0,
|
|
98
106
|
left: 0,
|
|
@@ -102,7 +110,7 @@ var styles = function styles(theme) {
|
|
|
102
110
|
'&:hover': {
|
|
103
111
|
cursor: 'pointer'
|
|
104
112
|
}
|
|
105
|
-
}),
|
|
113
|
+
}), _imageUploadButton),
|
|
106
114
|
imageUploadOwnership: _defineProperty({
|
|
107
115
|
padding: '20px 0px 20px 12px',
|
|
108
116
|
maxWidth: 450,
|
|
@@ -141,14 +149,14 @@ var styles = function styles(theme) {
|
|
|
141
149
|
color: 'red',
|
|
142
150
|
margin: '0 45px 20px'
|
|
143
151
|
},
|
|
144
|
-
imageUploadTextSuccess:
|
|
152
|
+
imageUploadTextSuccess: (_imageUploadTextSucce = {
|
|
145
153
|
overflow: 'hidden',
|
|
146
154
|
textOverflow: 'ellipsis',
|
|
147
155
|
textAlign: 'left'
|
|
148
|
-
}, theme.breakpoints.down('sm'), {
|
|
156
|
+
}, _defineProperty(_imageUploadTextSucce, theme.breakpoints.down('sm'), {
|
|
149
157
|
marginLeft: 0,
|
|
150
158
|
marginRight: 0
|
|
151
|
-
}), "color", '#4FC36D'), "fontWeight", 'bold'),
|
|
159
|
+
}), _defineProperty(_imageUploadTextSucce, "color", '#4FC36D'), _defineProperty(_imageUploadTextSucce, "fontWeight", 'bold'), _imageUploadTextSucce),
|
|
152
160
|
termsAndConditionsLink: {
|
|
153
161
|
color: 'black'
|
|
154
162
|
},
|
|
@@ -175,25 +183,30 @@ var styles = function styles(theme) {
|
|
|
175
183
|
};
|
|
176
184
|
};
|
|
177
185
|
var ImageEditDialog = /*#__PURE__*/function (_React$Component) {
|
|
186
|
+
_inherits(ImageEditDialog, _React$Component);
|
|
187
|
+
var _super = _createSuper(ImageEditDialog);
|
|
178
188
|
function ImageEditDialog(props) {
|
|
179
189
|
var _this;
|
|
180
190
|
_classCallCheck(this, ImageEditDialog);
|
|
181
|
-
_this =
|
|
182
|
-
_defineProperty(_this, "handleInputChange", function (evt) {
|
|
191
|
+
_this = _super.call(this, props);
|
|
192
|
+
_defineProperty(_assertThisInitialized(_this), "handleInputChange", function (evt) {
|
|
183
193
|
return _this.updateFile(evt.target.files[0]);
|
|
184
194
|
});
|
|
185
|
-
_defineProperty(_this, "handleDrop", function (files) {
|
|
195
|
+
_defineProperty(_assertThisInitialized(_this), "handleDrop", function (files) {
|
|
186
196
|
return _this.updateFile(files[0]);
|
|
187
197
|
});
|
|
188
|
-
_defineProperty(_this, "handleUpload", /*#__PURE__*/function () {
|
|
189
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/
|
|
190
|
-
return
|
|
191
|
-
while (1) switch (_context.
|
|
198
|
+
_defineProperty(_assertThisInitialized(_this), "handleUpload", /*#__PURE__*/function () {
|
|
199
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(image) {
|
|
200
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
201
|
+
while (1) switch (_context.prev = _context.next) {
|
|
192
202
|
case 0:
|
|
193
|
-
_context.
|
|
203
|
+
_context.next = 2;
|
|
194
204
|
return (0, _DesignDataService.calculateImageBrightness)(image);
|
|
195
|
-
case
|
|
196
|
-
return _context.
|
|
205
|
+
case 2:
|
|
206
|
+
return _context.abrupt("return", _context.sent);
|
|
207
|
+
case 3:
|
|
208
|
+
case "end":
|
|
209
|
+
return _context.stop();
|
|
197
210
|
}
|
|
198
211
|
}, _callee);
|
|
199
212
|
}));
|
|
@@ -201,7 +214,7 @@ var ImageEditDialog = /*#__PURE__*/function (_React$Component) {
|
|
|
201
214
|
return _ref.apply(this, arguments);
|
|
202
215
|
};
|
|
203
216
|
}());
|
|
204
|
-
_defineProperty(_this, "updateFile", function (file) {
|
|
217
|
+
_defineProperty(_assertThisInitialized(_this), "updateFile", function (file) {
|
|
205
218
|
if (!file) {
|
|
206
219
|
return;
|
|
207
220
|
}
|
|
@@ -237,31 +250,33 @@ var ImageEditDialog = /*#__PURE__*/function (_React$Component) {
|
|
|
237
250
|
if (isRenderable && file.type && file.type.match('image.*')) {
|
|
238
251
|
var reader = new FileReader();
|
|
239
252
|
reader.onload = /*#__PURE__*/function () {
|
|
240
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/
|
|
253
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(e) {
|
|
241
254
|
var image;
|
|
242
|
-
return
|
|
243
|
-
while (1) switch (_context3.
|
|
255
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
256
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
244
257
|
case 0:
|
|
245
258
|
image = new Image();
|
|
246
|
-
image.onload = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
247
|
-
return
|
|
248
|
-
while (1) switch (_context2.
|
|
259
|
+
image.onload = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
260
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
261
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
249
262
|
case 0:
|
|
250
|
-
_context2.
|
|
263
|
+
_context2.next = 2;
|
|
251
264
|
return _this.handleUpload(image);
|
|
252
|
-
case
|
|
253
|
-
image = _context2.
|
|
265
|
+
case 2:
|
|
266
|
+
image = _context2.sent;
|
|
254
267
|
_this.setState({
|
|
255
268
|
imageData: image
|
|
256
269
|
});
|
|
257
|
-
case
|
|
258
|
-
|
|
270
|
+
case 4:
|
|
271
|
+
case "end":
|
|
272
|
+
return _context2.stop();
|
|
259
273
|
}
|
|
260
274
|
}, _callee2);
|
|
261
275
|
}));
|
|
262
276
|
image.src = e.target.result;
|
|
263
|
-
case
|
|
264
|
-
|
|
277
|
+
case 3:
|
|
278
|
+
case "end":
|
|
279
|
+
return _context3.stop();
|
|
265
280
|
}
|
|
266
281
|
}, _callee3);
|
|
267
282
|
}));
|
|
@@ -272,27 +287,27 @@ var ImageEditDialog = /*#__PURE__*/function (_React$Component) {
|
|
|
272
287
|
reader.readAsDataURL(file);
|
|
273
288
|
}
|
|
274
289
|
});
|
|
275
|
-
_defineProperty(_this, "handleImageOwnershipChange", function (event, checked) {
|
|
290
|
+
_defineProperty(_assertThisInitialized(_this), "handleImageOwnershipChange", function (event, checked) {
|
|
276
291
|
_this.setState({
|
|
277
292
|
ownershipErrorVisible: false,
|
|
278
293
|
ownershipChecked: checked
|
|
279
294
|
});
|
|
280
295
|
});
|
|
281
|
-
_defineProperty(_this, "uploadFile", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
282
|
-
var _this$state, ownershipChecked, selectedFile, checkOwnership, onUploadFinished
|
|
283
|
-
return
|
|
284
|
-
while (1) switch (_context4.
|
|
296
|
+
_defineProperty(_assertThisInitialized(_this), "uploadFile", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
297
|
+
var _this$state, ownershipChecked, selectedFile, checkOwnership, onUploadFinished;
|
|
298
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
299
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
285
300
|
case 0:
|
|
286
301
|
_this$state = _this.state, ownershipChecked = _this$state.ownershipChecked, selectedFile = _this$state.selectedFile;
|
|
287
302
|
checkOwnership = _this.props.checkOwnership;
|
|
288
303
|
if (selectedFile) {
|
|
289
|
-
_context4.
|
|
304
|
+
_context4.next = 4;
|
|
290
305
|
break;
|
|
291
306
|
}
|
|
292
|
-
return _context4.
|
|
293
|
-
case
|
|
307
|
+
return _context4.abrupt("return");
|
|
308
|
+
case 4:
|
|
294
309
|
if (!(checkOwnership && !ownershipChecked)) {
|
|
295
|
-
_context4.
|
|
310
|
+
_context4.next = 8;
|
|
296
311
|
break;
|
|
297
312
|
}
|
|
298
313
|
_this.setState({
|
|
@@ -301,37 +316,38 @@ var ImageEditDialog = /*#__PURE__*/function (_React$Component) {
|
|
|
301
316
|
if (_this.ownershipGroup && _this.ownershipGroup.current && typeof _this.ownershipGroup.current.scrollIntoView === 'function') {
|
|
302
317
|
_this.ownershipGroup.current.scrollIntoView();
|
|
303
318
|
}
|
|
304
|
-
return _context4.
|
|
305
|
-
case
|
|
319
|
+
return _context4.abrupt("return");
|
|
320
|
+
case 8:
|
|
306
321
|
// reset the error before the next upload
|
|
307
322
|
_this.setState({
|
|
308
323
|
error: null
|
|
309
324
|
});
|
|
310
|
-
_context4.
|
|
311
|
-
_context4.
|
|
325
|
+
_context4.prev = 9;
|
|
326
|
+
_context4.next = 12;
|
|
312
327
|
return _ServiceLocator.Services.designer.uploadFile(selectedFile);
|
|
313
|
-
case
|
|
328
|
+
case 12:
|
|
314
329
|
if (_this.dropZone.current && _this.dropZone.current && typeof _this.dropZone.current.scrollIntoView === 'function') {
|
|
315
330
|
_this.dropZone.current.scrollIntoView();
|
|
316
331
|
}
|
|
317
332
|
onUploadFinished = _this.props.onUploadFinished;
|
|
318
333
|
onUploadFinished && onUploadFinished();
|
|
319
|
-
_context4.
|
|
334
|
+
_context4.next = 21;
|
|
320
335
|
break;
|
|
321
|
-
case
|
|
322
|
-
_context4.
|
|
323
|
-
|
|
336
|
+
case 17:
|
|
337
|
+
_context4.prev = 17;
|
|
338
|
+
_context4.t0 = _context4["catch"](9);
|
|
324
339
|
// eslint-disable-next-line no-console
|
|
325
|
-
console.error(
|
|
340
|
+
console.error(_context4.t0);
|
|
326
341
|
_this.setState({
|
|
327
342
|
error: (0, _i18n.t)('fileUpload.processingFailed')
|
|
328
343
|
});
|
|
329
|
-
case
|
|
330
|
-
|
|
344
|
+
case 21:
|
|
345
|
+
case "end":
|
|
346
|
+
return _context4.stop();
|
|
331
347
|
}
|
|
332
|
-
}, _callee4, null, [[
|
|
348
|
+
}, _callee4, null, [[9, 17]]);
|
|
333
349
|
})));
|
|
334
|
-
_defineProperty(_this, "getAllowedImageFormats", function () {
|
|
350
|
+
_defineProperty(_assertThisInitialized(_this), "getAllowedImageFormats", function () {
|
|
335
351
|
var formats = (0, _configuration.getConf)('designer.allowedImageUploadFormats').split(',');
|
|
336
352
|
return formats ? formats.map(function (format) {
|
|
337
353
|
return ".".concat(format);
|
|
@@ -349,8 +365,7 @@ var ImageEditDialog = /*#__PURE__*/function (_React$Component) {
|
|
|
349
365
|
_this.dropZone = /*#__PURE__*/_react["default"].createRef();
|
|
350
366
|
return _this;
|
|
351
367
|
}
|
|
352
|
-
|
|
353
|
-
return _createClass(ImageEditDialog, [{
|
|
368
|
+
_createClass(ImageEditDialog, [{
|
|
354
369
|
key: "render",
|
|
355
370
|
value: function render() {
|
|
356
371
|
var _this$props2 = this.props,
|
|
@@ -443,6 +458,7 @@ var ImageEditDialog = /*#__PURE__*/function (_React$Component) {
|
|
|
443
458
|
}, (0, _i18n.t)('fileUpload.imageOwnershipError'))));
|
|
444
459
|
}
|
|
445
460
|
}]);
|
|
461
|
+
return ImageEditDialog;
|
|
446
462
|
}(_react["default"].Component);
|
|
447
463
|
_defineProperty(ImageEditDialog, "defaultProps", {
|
|
448
464
|
checkOwnership: true
|