@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
|
@@ -36,26 +36,32 @@ var _Selectors5 = require("../../../Reducers/Configurator/Selectors");
|
|
|
36
36
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
37
37
|
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); }
|
|
38
38
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
39
|
-
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; }; }
|
|
40
39
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
41
40
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
42
41
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
43
42
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
44
43
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
44
|
+
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 }; })(); }
|
|
45
|
+
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"); }
|
|
46
|
+
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; }; }
|
|
47
|
+
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(); }); }
|
|
48
|
+
function _regeneratorAsyncGen(r, e, t, o, n) { return new _regeneratorAsyncIterator(_regenerator().w(r, e, t, o), n || Promise); }
|
|
49
|
+
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); }
|
|
45
50
|
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 }; })(); }
|
|
46
51
|
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); }
|
|
52
|
+
function _OverloadYield(e, d) { this.v = e, this.k = d; }
|
|
47
53
|
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); }
|
|
48
54
|
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); }); }; }
|
|
49
55
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
50
56
|
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); } }
|
|
51
57
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
52
|
-
function
|
|
58
|
+
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); }
|
|
59
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
60
|
+
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); }; }
|
|
53
61
|
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); }
|
|
54
62
|
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
55
63
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
56
64
|
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
57
|
-
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); }
|
|
58
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
59
65
|
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; }
|
|
60
66
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
61
67
|
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); }
|
|
@@ -94,17 +100,19 @@ var isImageInvalidatedByChange = function isImageInvalidatedByChange(imageData1,
|
|
|
94
100
|
});
|
|
95
101
|
};
|
|
96
102
|
var ImageEditDialogContainer = exports.ImageEditDialogContainer = /*#__PURE__*/function (_React$Component) {
|
|
103
|
+
_inherits(ImageEditDialogContainer, _React$Component);
|
|
104
|
+
var _super = _createSuper(ImageEditDialogContainer);
|
|
97
105
|
function ImageEditDialogContainer() {
|
|
98
106
|
var _this;
|
|
99
107
|
_classCallCheck(this, ImageEditDialogContainer);
|
|
100
108
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
101
109
|
args[_key] = arguments[_key];
|
|
102
110
|
}
|
|
103
|
-
_this =
|
|
104
|
-
_defineProperty(_this, "colorAmountNoticeRef", /*#__PURE__*/_react["default"].createRef());
|
|
105
|
-
_defineProperty(_this, "embroideryNoticeRef", /*#__PURE__*/_react["default"].createRef());
|
|
106
|
-
_defineProperty(_this, "imageUploadRef", /*#__PURE__*/_react["default"].createRef());
|
|
107
|
-
_defineProperty(_this, "state", {
|
|
111
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
112
|
+
_defineProperty(_assertThisInitialized(_this), "colorAmountNoticeRef", /*#__PURE__*/_react["default"].createRef());
|
|
113
|
+
_defineProperty(_assertThisInitialized(_this), "embroideryNoticeRef", /*#__PURE__*/_react["default"].createRef());
|
|
114
|
+
_defineProperty(_assertThisInitialized(_this), "imageUploadRef", /*#__PURE__*/_react["default"].createRef());
|
|
115
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
108
116
|
preview: null,
|
|
109
117
|
clipping: null,
|
|
110
118
|
clippingColor: null,
|
|
@@ -120,50 +128,51 @@ var ImageEditDialogContainer = exports.ImageEditDialogContainer = /*#__PURE__*/f
|
|
|
120
128
|
originalImagePreview: null,
|
|
121
129
|
upload: null
|
|
122
130
|
});
|
|
123
|
-
_defineProperty(_this, "lastImageUpdateData", null);
|
|
124
|
-
_defineProperty(_this, "updateOriginalPreview", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
131
|
+
_defineProperty(_assertThisInitialized(_this), "lastImageUpdateData", null);
|
|
132
|
+
_defineProperty(_assertThisInitialized(_this), "updateOriginalPreview", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
125
133
|
var image, url, previewUrl, isSvg, svgContent, preview;
|
|
126
|
-
return
|
|
127
|
-
while (1) switch (_context.
|
|
134
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
135
|
+
while (1) switch (_context.prev = _context.next) {
|
|
128
136
|
case 0:
|
|
129
137
|
image = _this.props.image;
|
|
130
138
|
url = (0, _get["default"])(image, 'preview.url', '');
|
|
131
139
|
previewUrl = (0, _getUrl.getUrl)(url);
|
|
132
140
|
isSvg = previewUrl && /\.svg$/.test(previewUrl);
|
|
133
141
|
if (!isSvg) {
|
|
134
|
-
_context.
|
|
142
|
+
_context.next = 12;
|
|
135
143
|
break;
|
|
136
144
|
}
|
|
137
|
-
_context.
|
|
145
|
+
_context.next = 7;
|
|
138
146
|
return (0, _DesignDataService.getSvgContent)(previewUrl, true);
|
|
139
|
-
case
|
|
140
|
-
svgContent = _context.
|
|
147
|
+
case 7:
|
|
148
|
+
svgContent = _context.sent;
|
|
141
149
|
preview = (0, _DesignDataService.applySvgContentOperations)(image.original, image.preview, null, svgContent);
|
|
142
150
|
_this.setState({
|
|
143
151
|
originalImagePreview: preview
|
|
144
152
|
});
|
|
145
|
-
_context.
|
|
153
|
+
_context.next = 13;
|
|
146
154
|
break;
|
|
147
|
-
case
|
|
155
|
+
case 12:
|
|
148
156
|
_this.setState({
|
|
149
157
|
originalImagePreview: previewUrl
|
|
150
158
|
});
|
|
151
|
-
case
|
|
152
|
-
|
|
159
|
+
case 13:
|
|
160
|
+
case "end":
|
|
161
|
+
return _context.stop();
|
|
153
162
|
}
|
|
154
163
|
}, _callee);
|
|
155
164
|
})));
|
|
156
|
-
_defineProperty(_this, "setUpload", function (upload) {
|
|
165
|
+
_defineProperty(_assertThisInitialized(_this), "setUpload", function (upload) {
|
|
157
166
|
_this.setState({
|
|
158
167
|
upload: upload
|
|
159
168
|
});
|
|
160
169
|
});
|
|
161
|
-
_defineProperty(_this, "resetDerivedImageState", function () {
|
|
170
|
+
_defineProperty(_assertThisInitialized(_this), "resetDerivedImageState", function () {
|
|
162
171
|
_this.setState(_objectSpread({
|
|
163
172
|
originalImagePreview: null
|
|
164
173
|
}, getDerivedOperationStateFromImageData()));
|
|
165
174
|
});
|
|
166
|
-
_defineProperty(_this, "changeSelectedBackground", function (value) {
|
|
175
|
+
_defineProperty(_assertThisInitialized(_this), "changeSelectedBackground", function (value) {
|
|
167
176
|
var partialState = {
|
|
168
177
|
clipping: value
|
|
169
178
|
};
|
|
@@ -177,7 +186,7 @@ var ImageEditDialogContainer = exports.ImageEditDialogContainer = /*#__PURE__*/f
|
|
|
177
186
|
}
|
|
178
187
|
_this.handleStateChange(partialState);
|
|
179
188
|
});
|
|
180
|
-
_defineProperty(_this, "changeColor", function (color) {
|
|
189
|
+
_defineProperty(_assertThisInitialized(_this), "changeColor", function (color) {
|
|
181
190
|
var partialState = {
|
|
182
191
|
clippingColor: color.hex
|
|
183
192
|
};
|
|
@@ -191,8 +200,8 @@ var ImageEditDialogContainer = exports.ImageEditDialogContainer = /*#__PURE__*/f
|
|
|
191
200
|
}
|
|
192
201
|
_this.handleStateChange(partialState);
|
|
193
202
|
});
|
|
194
|
-
_defineProperty(_this, "handleStateChange", /*#__PURE__*/function () {
|
|
195
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/
|
|
203
|
+
_defineProperty(_assertThisInitialized(_this), "handleStateChange", /*#__PURE__*/function () {
|
|
204
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(partialState) {
|
|
196
205
|
var options,
|
|
197
206
|
displayColorPreview,
|
|
198
207
|
image,
|
|
@@ -204,8 +213,8 @@ var ImageEditDialogContainer = exports.ImageEditDialogContainer = /*#__PURE__*/f
|
|
|
204
213
|
vectorizeMaxColorAmount,
|
|
205
214
|
vectorizeOriginalColorsMap,
|
|
206
215
|
_args2 = arguments;
|
|
207
|
-
return
|
|
208
|
-
while (1) switch (_context2.
|
|
216
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
217
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
209
218
|
case 0:
|
|
210
219
|
options = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {};
|
|
211
220
|
displayColorPreview = options.displayColorPreview;
|
|
@@ -214,19 +223,19 @@ var ImageEditDialogContainer = exports.ImageEditDialogContainer = /*#__PURE__*/f
|
|
|
214
223
|
_this.setState(nextState);
|
|
215
224
|
operations = getOperationsFromState(nextState);
|
|
216
225
|
if (!(!image || (0, _isMatch["default"])(image.operations, operations) && image.displayColorPreview === displayColorPreview)) {
|
|
217
|
-
_context2.
|
|
226
|
+
_context2.next = 8;
|
|
218
227
|
break;
|
|
219
228
|
}
|
|
220
|
-
return _context2.
|
|
221
|
-
case
|
|
229
|
+
return _context2.abrupt("return");
|
|
230
|
+
case 8:
|
|
222
231
|
_this.continueBlocked = true;
|
|
223
|
-
_context2.
|
|
224
|
-
_context2.
|
|
232
|
+
_context2.prev = 9;
|
|
233
|
+
_context2.next = 12;
|
|
225
234
|
return _this.props.editFile(operations, image, displayColorPreview !== undefined && {
|
|
226
235
|
displayColorPreview: displayColorPreview
|
|
227
236
|
});
|
|
228
|
-
case
|
|
229
|
-
result = _context2.
|
|
237
|
+
case 12:
|
|
238
|
+
result = _context2.sent;
|
|
230
239
|
vectorizeColorsMap = result.vectorizeColorsMap, vectorizeThreshold = result.vectorizeThreshold, vectorizeMaxColorAmount = result.vectorizeMaxColorAmount, vectorizeOriginalColorsMap = result.vectorizeOriginalColorsMap;
|
|
231
240
|
_this.setState({
|
|
232
241
|
vectorizeColorsMap: vectorizeColorsMap,
|
|
@@ -234,25 +243,26 @@ var ImageEditDialogContainer = exports.ImageEditDialogContainer = /*#__PURE__*/f
|
|
|
234
243
|
vectorizeMaxColorAmount: vectorizeMaxColorAmount,
|
|
235
244
|
vectorizeOriginalColorsMap: vectorizeOriginalColorsMap
|
|
236
245
|
});
|
|
237
|
-
case
|
|
238
|
-
_context2.
|
|
246
|
+
case 15:
|
|
247
|
+
_context2.prev = 15;
|
|
239
248
|
_this.continueBlocked = false;
|
|
240
|
-
return _context2.
|
|
241
|
-
case
|
|
242
|
-
|
|
249
|
+
return _context2.finish(15);
|
|
250
|
+
case 18:
|
|
251
|
+
case "end":
|
|
252
|
+
return _context2.stop();
|
|
243
253
|
}
|
|
244
|
-
}, _callee2, null, [[
|
|
254
|
+
}, _callee2, null, [[9,, 15, 18]]);
|
|
245
255
|
}));
|
|
246
256
|
return function (_x) {
|
|
247
257
|
return _ref2.apply(this, arguments);
|
|
248
258
|
};
|
|
249
259
|
}());
|
|
250
|
-
_defineProperty(_this, "onVectorizeToggleChange", function (value) {
|
|
260
|
+
_defineProperty(_assertThisInitialized(_this), "onVectorizeToggleChange", function (value) {
|
|
251
261
|
_this.handleStateChange({
|
|
252
262
|
vectorize: value
|
|
253
263
|
});
|
|
254
264
|
});
|
|
255
|
-
_defineProperty(_this, "onVectorizeThresholdChange", function (threshold) {
|
|
265
|
+
_defineProperty(_assertThisInitialized(_this), "onVectorizeThresholdChange", function (threshold) {
|
|
256
266
|
var image = _this.props.image;
|
|
257
267
|
|
|
258
268
|
// skip if the threshold is the same as the color count
|
|
@@ -273,49 +283,50 @@ var ImageEditDialogContainer = exports.ImageEditDialogContainer = /*#__PURE__*/f
|
|
|
273
283
|
vectorizeThreshold: threshold
|
|
274
284
|
}));
|
|
275
285
|
});
|
|
276
|
-
_defineProperty(_this, "onColorImageStateReset", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
277
|
-
return
|
|
278
|
-
while (1) switch (_context3.
|
|
286
|
+
_defineProperty(_assertThisInitialized(_this), "onColorImageStateReset", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
287
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
288
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
279
289
|
case 0:
|
|
280
|
-
_context3.
|
|
290
|
+
_context3.next = 2;
|
|
281
291
|
return _this.props.resetColorizing();
|
|
282
|
-
case
|
|
283
|
-
|
|
292
|
+
case 2:
|
|
293
|
+
case "end":
|
|
294
|
+
return _context3.stop();
|
|
284
295
|
}
|
|
285
296
|
}, _callee3);
|
|
286
297
|
})));
|
|
287
|
-
_defineProperty(_this, "selectColor", /*#__PURE__*/function () {
|
|
288
|
-
var _ref4 = _asyncToGenerator(/*#__PURE__*/
|
|
289
|
-
var vectorizeColorsMap, colorKeys, _colorKey, _iterator, _step, _colorKey2
|
|
290
|
-
return
|
|
291
|
-
while (1) switch (_context4.
|
|
298
|
+
_defineProperty(_assertThisInitialized(_this), "selectColor", /*#__PURE__*/function () {
|
|
299
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(colorKey, newColor) {
|
|
300
|
+
var vectorizeColorsMap, colorKeys, _colorKey, _iterator, _step, _colorKey2;
|
|
301
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
302
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
292
303
|
case 0:
|
|
293
304
|
vectorizeColorsMap = (0, _cloneDeep["default"])(_this.state.vectorizeColorsMap);
|
|
294
305
|
colorKeys = (0, _Selectors2.getColorKeysForAggregatedColor)(vectorizeColorsMap, colorKey);
|
|
295
306
|
if (!_ServiceLocator.Services.designData.changeAllColorsNeeded()) {
|
|
296
|
-
_context4.
|
|
307
|
+
_context4.next = 13;
|
|
297
308
|
break;
|
|
298
309
|
}
|
|
299
|
-
|
|
300
|
-
case
|
|
301
|
-
if ((
|
|
302
|
-
_context4.
|
|
310
|
+
_context4.t0 = _regeneratorRuntime().keys(vectorizeColorsMap);
|
|
311
|
+
case 4:
|
|
312
|
+
if ((_context4.t1 = _context4.t0()).done) {
|
|
313
|
+
_context4.next = 11;
|
|
303
314
|
break;
|
|
304
315
|
}
|
|
305
|
-
_colorKey =
|
|
316
|
+
_colorKey = _context4.t1.value;
|
|
306
317
|
if (vectorizeColorsMap.hasOwnProperty(_colorKey)) {
|
|
307
|
-
_context4.
|
|
318
|
+
_context4.next = 8;
|
|
308
319
|
break;
|
|
309
320
|
}
|
|
310
|
-
return _context4.
|
|
311
|
-
case
|
|
321
|
+
return _context4.abrupt("continue", 4);
|
|
322
|
+
case 8:
|
|
312
323
|
vectorizeColorsMap[_colorKey] = newColor;
|
|
313
|
-
_context4.
|
|
324
|
+
_context4.next = 4;
|
|
314
325
|
break;
|
|
315
|
-
case
|
|
316
|
-
_context4.
|
|
326
|
+
case 11:
|
|
327
|
+
_context4.next = 15;
|
|
317
328
|
break;
|
|
318
|
-
case
|
|
329
|
+
case 13:
|
|
319
330
|
_iterator = _createForOfIteratorHelper(colorKeys);
|
|
320
331
|
try {
|
|
321
332
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -329,16 +340,17 @@ var ImageEditDialogContainer = exports.ImageEditDialogContainer = /*#__PURE__*/f
|
|
|
329
340
|
} finally {
|
|
330
341
|
_iterator.f();
|
|
331
342
|
}
|
|
332
|
-
case
|
|
333
|
-
_context4.
|
|
343
|
+
case 15:
|
|
344
|
+
_context4.next = 17;
|
|
334
345
|
return _this.handleStateChange({
|
|
335
346
|
vectorizeColorsMap: vectorizeColorsMap
|
|
336
347
|
});
|
|
337
|
-
case
|
|
348
|
+
case 17:
|
|
338
349
|
_ServiceLocator.Services.designData.setImageAndTextColor(newColor);
|
|
339
350
|
_ServiceLocator.Services.analytics.triggerEvent(_Constant.EventTypes.image_edit_colorize_color, newColor.value.replace('#', ''));
|
|
340
|
-
case
|
|
341
|
-
|
|
351
|
+
case 19:
|
|
352
|
+
case "end":
|
|
353
|
+
return _context4.stop();
|
|
342
354
|
}
|
|
343
355
|
}, _callee4);
|
|
344
356
|
}));
|
|
@@ -346,24 +358,25 @@ var ImageEditDialogContainer = exports.ImageEditDialogContainer = /*#__PURE__*/f
|
|
|
346
358
|
return _ref4.apply(this, arguments);
|
|
347
359
|
};
|
|
348
360
|
}());
|
|
349
|
-
_defineProperty(_this, "removeColor", /*#__PURE__*/function () {
|
|
350
|
-
var _ref5 = _asyncToGenerator(/*#__PURE__*/
|
|
361
|
+
_defineProperty(_assertThisInitialized(_this), "removeColor", /*#__PURE__*/function () {
|
|
362
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(colorKey) {
|
|
351
363
|
var vectorizeColorsMap, closestColor;
|
|
352
|
-
return
|
|
353
|
-
while (1) switch (_context5.
|
|
364
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
365
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
354
366
|
case 0:
|
|
355
367
|
vectorizeColorsMap = _this.state.vectorizeColorsMap;
|
|
356
368
|
if (vectorizeColorsMap[colorKey]) {
|
|
357
|
-
_context5.
|
|
369
|
+
_context5.next = 3;
|
|
358
370
|
break;
|
|
359
371
|
}
|
|
360
372
|
throw new Error('Color key does not exist!');
|
|
361
|
-
case
|
|
373
|
+
case 3:
|
|
362
374
|
closestColor = (0, _ImageEditUtils.getClosestColorFromMap)(vectorizeColorsMap, vectorizeColorsMap[colorKey].value);
|
|
363
|
-
_context5.
|
|
375
|
+
_context5.next = 6;
|
|
364
376
|
return _this.selectColor(colorKey, closestColor);
|
|
365
|
-
case
|
|
366
|
-
|
|
377
|
+
case 6:
|
|
378
|
+
case "end":
|
|
379
|
+
return _context5.stop();
|
|
367
380
|
}
|
|
368
381
|
}, _callee5);
|
|
369
382
|
}));
|
|
@@ -371,7 +384,7 @@ var ImageEditDialogContainer = exports.ImageEditDialogContainer = /*#__PURE__*/f
|
|
|
371
384
|
return _ref5.apply(this, arguments);
|
|
372
385
|
};
|
|
373
386
|
}());
|
|
374
|
-
_defineProperty(_this, "onActiveTabChange", function (activeTabIndex) {
|
|
387
|
+
_defineProperty(_assertThisInitialized(_this), "onActiveTabChange", function (activeTabIndex) {
|
|
375
388
|
var image = _this.props.image;
|
|
376
389
|
var upload = _this.state.upload;
|
|
377
390
|
if (upload !== null) {
|
|
@@ -384,8 +397,8 @@ var ImageEditDialogContainer = exports.ImageEditDialogContainer = /*#__PURE__*/f
|
|
|
384
397
|
activeTabIndex: activeTabIndex
|
|
385
398
|
});
|
|
386
399
|
});
|
|
387
|
-
_defineProperty(_this, "updatePreview", /*#__PURE__*/function () {
|
|
388
|
-
var _ref6 = _asyncToGenerator(/*#__PURE__*/
|
|
400
|
+
_defineProperty(_assertThisInitialized(_this), "updatePreview", /*#__PURE__*/function () {
|
|
401
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(svgContent) {
|
|
389
402
|
var _image$preview;
|
|
390
403
|
var options,
|
|
391
404
|
_options$forceFetch,
|
|
@@ -398,8 +411,8 @@ var ImageEditDialogContainer = exports.ImageEditDialogContainer = /*#__PURE__*/f
|
|
|
398
411
|
updateSVG,
|
|
399
412
|
forceUpdate,
|
|
400
413
|
_args6 = arguments;
|
|
401
|
-
return
|
|
402
|
-
while (1) switch (_context6.
|
|
414
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
415
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
403
416
|
case 0:
|
|
404
417
|
options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
|
|
405
418
|
_options$forceFetch = options.forceFetch, forceFetch = _options$forceFetch === void 0 ? false : _options$forceFetch;
|
|
@@ -409,27 +422,27 @@ var ImageEditDialogContainer = exports.ImageEditDialogContainer = /*#__PURE__*/f
|
|
|
409
422
|
previewUrl = image === null || image === void 0 || (_image$preview = image.preview) === null || _image$preview === void 0 ? void 0 : _image$preview.url;
|
|
410
423
|
isSvg = previewUrl && /\.svg$/.test(previewUrl);
|
|
411
424
|
if (!image) {
|
|
412
|
-
_context6.
|
|
425
|
+
_context6.next = 20;
|
|
413
426
|
break;
|
|
414
427
|
}
|
|
415
428
|
updateSVG = isSvg;
|
|
416
429
|
if (!updateSVG) {
|
|
417
|
-
_context6.
|
|
430
|
+
_context6.next = 17;
|
|
418
431
|
break;
|
|
419
432
|
}
|
|
420
433
|
if (svgContent) {
|
|
421
|
-
_context6.
|
|
434
|
+
_context6.next = 14;
|
|
422
435
|
break;
|
|
423
436
|
}
|
|
424
|
-
_context6.
|
|
437
|
+
_context6.next = 13;
|
|
425
438
|
return (0, _DesignDataService.getSvgContent)(image.preview.url, image.preview.url.startsWith('http'), forceFetch);
|
|
426
|
-
case
|
|
427
|
-
svgContent = _context6.
|
|
428
|
-
case
|
|
439
|
+
case 13:
|
|
440
|
+
svgContent = _context6.sent;
|
|
441
|
+
case 14:
|
|
429
442
|
preview = (0, _DesignDataService.applySvgContentOperations)(image.original, image.preview, image.displayColorPreview ? image.operations : null, svgContent);
|
|
430
|
-
_context6.
|
|
443
|
+
_context6.next = 20;
|
|
431
444
|
break;
|
|
432
|
-
case
|
|
445
|
+
case 17:
|
|
433
446
|
forceUpdate = isImageInvalidatedByChange(_this.lastImageUpdateData, image);
|
|
434
447
|
if (forceUpdate) {
|
|
435
448
|
_this.previewVersion = Math.random();
|
|
@@ -438,14 +451,15 @@ var ImageEditDialogContainer = exports.ImageEditDialogContainer = /*#__PURE__*/f
|
|
|
438
451
|
preview = (0, _Selectors3.getPreviewUrlFromImageData)(previewUrl) + (_this.previewVersion ? "?".concat(_this.previewVersion) : '');
|
|
439
452
|
originalImagePreview = preview;
|
|
440
453
|
}
|
|
441
|
-
case
|
|
454
|
+
case 20:
|
|
442
455
|
_this.lastImageUpdateData = image;
|
|
443
456
|
_this.setState({
|
|
444
457
|
preview: preview,
|
|
445
458
|
originalImagePreview: originalImagePreview
|
|
446
459
|
});
|
|
447
|
-
case
|
|
448
|
-
|
|
460
|
+
case 22:
|
|
461
|
+
case "end":
|
|
462
|
+
return _context6.stop();
|
|
449
463
|
}
|
|
450
464
|
}, _callee6);
|
|
451
465
|
}));
|
|
@@ -453,35 +467,36 @@ var ImageEditDialogContainer = exports.ImageEditDialogContainer = /*#__PURE__*/f
|
|
|
453
467
|
return _ref6.apply(this, arguments);
|
|
454
468
|
};
|
|
455
469
|
}());
|
|
456
|
-
_defineProperty(_this, "closeAddImagePanel", function () {
|
|
470
|
+
_defineProperty(_assertThisInitialized(_this), "closeAddImagePanel", function () {
|
|
457
471
|
return _this.setState({
|
|
458
472
|
showAddImagePanel: false
|
|
459
473
|
});
|
|
460
474
|
});
|
|
461
|
-
_defineProperty(_this, "onSelectImage", /*#__PURE__*/function () {
|
|
462
|
-
var _ref7 = _asyncToGenerator(/*#__PURE__*/
|
|
475
|
+
_defineProperty(_assertThisInitialized(_this), "onSelectImage", /*#__PURE__*/function () {
|
|
476
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(file) {
|
|
463
477
|
var addGalleryImageToUserImages, imageUrl, thumbUrl, fileName, vectorizeColorsMap, svgImageSize;
|
|
464
|
-
return
|
|
465
|
-
while (1) switch (_context7.
|
|
478
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
479
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
466
480
|
case 0:
|
|
467
481
|
addGalleryImageToUserImages = _this.props.addGalleryImageToUserImages;
|
|
468
482
|
imageUrl = file.imageUrl, thumbUrl = file.thumbUrl;
|
|
469
483
|
fileName = imageUrl.replace(/^.*[\\/]/, '') // get filename
|
|
470
484
|
.replace(/\.[^.$]+$/, ''); // remove extension
|
|
471
|
-
_context7.
|
|
485
|
+
_context7.next = 5;
|
|
472
486
|
return _ServiceLocator.Services.designData.getGalleryImageColors(imageUrl);
|
|
473
|
-
case
|
|
474
|
-
vectorizeColorsMap = _context7.
|
|
475
|
-
_context7.
|
|
487
|
+
case 5:
|
|
488
|
+
vectorizeColorsMap = _context7.sent;
|
|
489
|
+
_context7.next = 8;
|
|
476
490
|
return _ServiceLocator.Services.designData.getSVGImageSize(imageUrl);
|
|
477
|
-
case
|
|
478
|
-
svgImageSize = _context7.
|
|
491
|
+
case 8:
|
|
492
|
+
svgImageSize = _context7.sent;
|
|
479
493
|
addGalleryImageToUserImages(imageUrl, thumbUrl, fileName, vectorizeColorsMap, svgImageSize);
|
|
480
494
|
|
|
481
495
|
// exit image upload if a gallery image is selected
|
|
482
496
|
_this.setUpload(null);
|
|
483
|
-
case
|
|
484
|
-
|
|
497
|
+
case 11:
|
|
498
|
+
case "end":
|
|
499
|
+
return _context7.stop();
|
|
485
500
|
}
|
|
486
501
|
}, _callee7);
|
|
487
502
|
}));
|
|
@@ -489,110 +504,111 @@ var ImageEditDialogContainer = exports.ImageEditDialogContainer = /*#__PURE__*/f
|
|
|
489
504
|
return _ref7.apply(this, arguments);
|
|
490
505
|
};
|
|
491
506
|
}());
|
|
492
|
-
_defineProperty(_this, "continueClick", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
507
|
+
_defineProperty(_assertThisInitialized(_this), "continueClick", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
493
508
|
var _this$props, colorDisabled, image, shouldAddImageImmediately, colorPreviewRequirementFulfilled, _this$state, activeTabIndex, continueButtonDisabled;
|
|
494
|
-
return
|
|
495
|
-
while (1) switch (_context8.
|
|
509
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
510
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
496
511
|
case 0:
|
|
497
512
|
if (!_this.continueBlocked) {
|
|
498
|
-
_context8.
|
|
513
|
+
_context8.next = 2;
|
|
499
514
|
break;
|
|
500
515
|
}
|
|
501
|
-
return _context8.
|
|
502
|
-
case
|
|
516
|
+
return _context8.abrupt("return");
|
|
517
|
+
case 2:
|
|
503
518
|
_this$props = _this.props, colorDisabled = _this$props.colorDisabled, image = _this$props.image, shouldAddImageImmediately = _this$props.shouldAddImageImmediately, colorPreviewRequirementFulfilled = _this$props.colorPreviewRequirementFulfilled;
|
|
504
519
|
_this$state = _this.state, activeTabIndex = _this$state.activeTabIndex, continueButtonDisabled = _this$state.continueButtonDisabled;
|
|
505
520
|
if (!(activeTabIndex === 0 && shouldAddImageImmediately(image))) {
|
|
506
|
-
_context8.
|
|
521
|
+
_context8.next = 13;
|
|
507
522
|
break;
|
|
508
523
|
}
|
|
509
524
|
_this.continueBlocked = true;
|
|
510
|
-
_context8.
|
|
511
|
-
_context8.
|
|
525
|
+
_context8.prev = 6;
|
|
526
|
+
_context8.next = 9;
|
|
512
527
|
return _ServiceLocator.Services.designer.imageEditDialogContinueClickHandler();
|
|
513
|
-
case
|
|
514
|
-
_context8.
|
|
528
|
+
case 9:
|
|
529
|
+
_context8.prev = 9;
|
|
515
530
|
_this.continueBlocked = false;
|
|
516
|
-
return _context8.
|
|
517
|
-
case
|
|
518
|
-
return _context8.
|
|
519
|
-
case
|
|
531
|
+
return _context8.finish(9);
|
|
532
|
+
case 12:
|
|
533
|
+
return _context8.abrupt("return");
|
|
534
|
+
case 13:
|
|
520
535
|
if (!(activeTabIndex === 0 && !(image.gallery && colorDisabled))) {
|
|
521
|
-
_context8.
|
|
536
|
+
_context8.next = 16;
|
|
522
537
|
break;
|
|
523
538
|
}
|
|
524
539
|
_this.setState({
|
|
525
540
|
activeTabIndex: image.gallery ? 2 : 1
|
|
526
541
|
});
|
|
527
|
-
return _context8.
|
|
528
|
-
case
|
|
542
|
+
return _context8.abrupt("return");
|
|
543
|
+
case 16:
|
|
529
544
|
if (!(activeTabIndex === 1 && !colorDisabled)) {
|
|
530
|
-
_context8.
|
|
545
|
+
_context8.next = 19;
|
|
531
546
|
break;
|
|
532
547
|
}
|
|
533
548
|
_this.setState({
|
|
534
549
|
activeTabIndex: 2
|
|
535
550
|
});
|
|
536
|
-
return _context8.
|
|
537
|
-
case
|
|
551
|
+
return _context8.abrupt("return");
|
|
552
|
+
case 19:
|
|
538
553
|
if (!(activeTabIndex === 2 && !colorPreviewRequirementFulfilled)) {
|
|
539
|
-
_context8.
|
|
554
|
+
_context8.next = 23;
|
|
540
555
|
break;
|
|
541
556
|
}
|
|
542
557
|
if (!(_this.embroideryNoticeRef && _this.embroideryNoticeRef.current)) {
|
|
543
|
-
_context8.
|
|
558
|
+
_context8.next = 23;
|
|
544
559
|
break;
|
|
545
560
|
}
|
|
546
561
|
_this.embroideryNoticeRef.current.scrollIntoView();
|
|
547
|
-
return _context8.
|
|
548
|
-
case
|
|
562
|
+
return _context8.abrupt("return");
|
|
563
|
+
case 23:
|
|
549
564
|
if (!continueButtonDisabled) {
|
|
550
|
-
_context8.
|
|
565
|
+
_context8.next = 27;
|
|
551
566
|
break;
|
|
552
567
|
}
|
|
553
568
|
if (!(_this.colorAmountNoticeRef && _this.colorAmountNoticeRef.current)) {
|
|
554
|
-
_context8.
|
|
569
|
+
_context8.next = 27;
|
|
555
570
|
break;
|
|
556
571
|
}
|
|
557
572
|
_this.colorAmountNoticeRef.current.scrollIntoView();
|
|
558
|
-
return _context8.
|
|
559
|
-
case
|
|
573
|
+
return _context8.abrupt("return");
|
|
574
|
+
case 27:
|
|
560
575
|
_this.continueBlocked = true;
|
|
561
|
-
_context8.
|
|
562
|
-
_context8.
|
|
576
|
+
_context8.prev = 28;
|
|
577
|
+
_context8.next = 31;
|
|
563
578
|
return _ServiceLocator.Services.designer.imageEditDialogContinueClickHandler();
|
|
564
|
-
case
|
|
565
|
-
_context8.
|
|
579
|
+
case 31:
|
|
580
|
+
_context8.prev = 31;
|
|
566
581
|
_this.continueBlocked = false;
|
|
567
|
-
return _context8.
|
|
568
|
-
case
|
|
569
|
-
|
|
582
|
+
return _context8.finish(31);
|
|
583
|
+
case 34:
|
|
584
|
+
case "end":
|
|
585
|
+
return _context8.stop();
|
|
570
586
|
}
|
|
571
|
-
}, _callee8, null, [[
|
|
587
|
+
}, _callee8, null, [[6,, 9, 12], [28,, 31, 34]]);
|
|
572
588
|
})));
|
|
573
|
-
_defineProperty(_this, "onGalleryClick", function () {
|
|
589
|
+
_defineProperty(_assertThisInitialized(_this), "onGalleryClick", function () {
|
|
574
590
|
_this.setState({
|
|
575
591
|
showAddImagePanel: true
|
|
576
592
|
});
|
|
577
593
|
});
|
|
578
|
-
_defineProperty(_this, "closePreviewDialog", function () {
|
|
594
|
+
_defineProperty(_assertThisInitialized(_this), "closePreviewDialog", function () {
|
|
579
595
|
_ServiceLocator.Services.designer.imageEditDialogCloseHandler();
|
|
580
596
|
});
|
|
581
|
-
_defineProperty(_this, "onOriginalImageAndColorPreviewToggleClick", function () {
|
|
597
|
+
_defineProperty(_assertThisInitialized(_this), "onOriginalImageAndColorPreviewToggleClick", function () {
|
|
582
598
|
_this.handleStateChange({}, {
|
|
583
599
|
displayColorPreview: !_this.props.displayColorPreview
|
|
584
600
|
});
|
|
585
601
|
});
|
|
586
|
-
_defineProperty(_this, "uploadImage", function () {
|
|
602
|
+
_defineProperty(_assertThisInitialized(_this), "uploadImage", function () {
|
|
587
603
|
return _this.imageUploadRef.current.uploadFile();
|
|
588
604
|
});
|
|
589
|
-
_defineProperty(_this, "onNewUploadClick", function () {
|
|
605
|
+
_defineProperty(_assertThisInitialized(_this), "onNewUploadClick", function () {
|
|
590
606
|
_this.setUpload({
|
|
591
607
|
disabled: true
|
|
592
608
|
});
|
|
593
609
|
_this.resetDerivedImageState();
|
|
594
610
|
});
|
|
595
|
-
_defineProperty(_this, "selectUserImage", function (imageIndex) {
|
|
611
|
+
_defineProperty(_assertThisInitialized(_this), "selectUserImage", function (imageIndex) {
|
|
596
612
|
var _this$props2 = _this.props,
|
|
597
613
|
userImages = _this$props2.userImages,
|
|
598
614
|
setSelectedImage = _this$props2.setSelectedImage;
|
|
@@ -601,8 +617,7 @@ var ImageEditDialogContainer = exports.ImageEditDialogContainer = /*#__PURE__*/f
|
|
|
601
617
|
});
|
|
602
618
|
return _this;
|
|
603
619
|
}
|
|
604
|
-
|
|
605
|
-
return _createClass(ImageEditDialogContainer, [{
|
|
620
|
+
_createClass(ImageEditDialogContainer, [{
|
|
606
621
|
key: "componentDidMount",
|
|
607
622
|
value: function componentDidMount() {
|
|
608
623
|
this.updatePreview(null);
|
|
@@ -855,6 +870,7 @@ var ImageEditDialogContainer = exports.ImageEditDialogContainer = /*#__PURE__*/f
|
|
|
855
870
|
}));
|
|
856
871
|
}
|
|
857
872
|
}]);
|
|
873
|
+
return ImageEditDialogContainer;
|
|
858
874
|
}(_react["default"].Component);
|
|
859
875
|
_defineProperty(ImageEditDialogContainer, "defaultProps", {
|
|
860
876
|
colorPreviewRequirementFulfilled: false,
|