@configuratorware/configurator-frontendgui 1.56.1 → 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
|
@@ -46,7 +46,6 @@ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLim
|
|
|
46
46
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
47
47
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
48
48
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
49
|
-
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"); }
|
|
50
49
|
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; }
|
|
51
50
|
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; }
|
|
52
51
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
@@ -55,8 +54,15 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
|
|
|
55
54
|
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; }
|
|
56
55
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
57
56
|
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); }
|
|
57
|
+
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 }; })(); }
|
|
58
|
+
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"); }
|
|
59
|
+
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; }; }
|
|
60
|
+
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(); }); }
|
|
61
|
+
function _regeneratorAsyncGen(r, e, t, o, n) { return new _regeneratorAsyncIterator(_regenerator().w(r, e, t, o), n || Promise); }
|
|
62
|
+
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); }
|
|
58
63
|
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 }; })(); }
|
|
59
64
|
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); }
|
|
65
|
+
function _OverloadYield(e, d) { this.v = e, this.k = d; }
|
|
60
66
|
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); }
|
|
61
67
|
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); }); }; }
|
|
62
68
|
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; } } }; }
|
|
@@ -310,16 +316,19 @@ var getSvgContent = exports.getSvgContent = function () {
|
|
|
310
316
|
return svgContentMap.get(absUrl);
|
|
311
317
|
}
|
|
312
318
|
try {
|
|
313
|
-
var promise = _asyncToGenerator(/*#__PURE__*/
|
|
319
|
+
var promise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
314
320
|
var result;
|
|
315
|
-
return
|
|
316
|
-
while (1) switch (_context.
|
|
321
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
322
|
+
while (1) switch (_context.prev = _context.next) {
|
|
317
323
|
case 0:
|
|
318
|
-
_context.
|
|
324
|
+
_context.next = 2;
|
|
319
325
|
return _axios["default"].get(absUrl);
|
|
320
|
-
case
|
|
321
|
-
result = _context.
|
|
322
|
-
return _context.
|
|
326
|
+
case 2:
|
|
327
|
+
result = _context.sent;
|
|
328
|
+
return _context.abrupt("return", (0, _Transformers.initDefaultColor)(result.data));
|
|
329
|
+
case 4:
|
|
330
|
+
case "end":
|
|
331
|
+
return _context.stop();
|
|
323
332
|
}
|
|
324
333
|
}, _callee);
|
|
325
334
|
}))();
|
|
@@ -508,25 +517,26 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
508
517
|
_defineProperty(this, "_syncCanvasChange", null);
|
|
509
518
|
_defineProperty(this, "_isCanvasDataUpdateEnabled", true);
|
|
510
519
|
_defineProperty(this, "handleDesignProductionMethodChangeFromVectorizationToNonVectorization", /*#__PURE__*/function () {
|
|
511
|
-
var _ref4 = _asyncToGenerator(/*#__PURE__*/
|
|
520
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(designProductionMethodIdentifier) {
|
|
512
521
|
var state, _getVectorizeForDesig, currentVectorsRequired, newVectorsRequired, designArea, images;
|
|
513
|
-
return
|
|
514
|
-
while (1) switch (_context2.
|
|
522
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
523
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
515
524
|
case 0:
|
|
516
525
|
state = _ServiceLocator.Services.store.state;
|
|
517
526
|
_getVectorizeForDesig = (0, _Selectors.getVectorizeForDesignProductionMethods)(state, designProductionMethodIdentifier), currentVectorsRequired = _getVectorizeForDesig.currentVectorsRequired, newVectorsRequired = _getVectorizeForDesig.newVectorsRequired;
|
|
518
527
|
designArea = (0, _Selectors.getSelectedDesignArea)(state);
|
|
519
528
|
images = (0, _Selectors.getImagesByDesignArea)(state, designArea.identifier);
|
|
520
529
|
if (!(currentVectorsRequired && !newVectorsRequired && images.length)) {
|
|
521
|
-
_context2.
|
|
530
|
+
_context2.next = 8;
|
|
522
531
|
break;
|
|
523
532
|
}
|
|
524
|
-
_context2.
|
|
533
|
+
_context2.next = 7;
|
|
525
534
|
return _ServiceLocator.Services.store.dispatch((0, _Actions.showSwitchToProductionMethodWithoutVectorization)());
|
|
526
|
-
case
|
|
527
|
-
return _context2.
|
|
528
|
-
case
|
|
529
|
-
|
|
535
|
+
case 7:
|
|
536
|
+
return _context2.abrupt("return", true);
|
|
537
|
+
case 8:
|
|
538
|
+
case "end":
|
|
539
|
+
return _context2.stop();
|
|
530
540
|
}
|
|
531
541
|
}, _callee2);
|
|
532
542
|
}));
|
|
@@ -535,10 +545,10 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
535
545
|
};
|
|
536
546
|
}());
|
|
537
547
|
_defineProperty(this, "handleDesignProductionMethodChangeFromNonVectorizationToVectorization", /*#__PURE__*/function () {
|
|
538
|
-
var _ref5 = _asyncToGenerator(/*#__PURE__*/
|
|
548
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(designProductionMethodIdentifier) {
|
|
539
549
|
var state, _getVectorizeForDesig2, currentVectorsRequired, newVectorsRequired, designArea, nonVectorizedImages;
|
|
540
|
-
return
|
|
541
|
-
while (1) switch (_context3.
|
|
550
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
551
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
542
552
|
case 0:
|
|
543
553
|
state = _ServiceLocator.Services.store.state;
|
|
544
554
|
_getVectorizeForDesig2 = (0, _Selectors.getVectorizeForDesignProductionMethods)(state, designProductionMethodIdentifier), currentVectorsRequired = _getVectorizeForDesig2.currentVectorsRequired, newVectorsRequired = _getVectorizeForDesig2.newVectorsRequired;
|
|
@@ -547,15 +557,16 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
547
557
|
return !(0, _get2["default"])(obj, 'imageData.operations.vectorize');
|
|
548
558
|
});
|
|
549
559
|
if (!(nonVectorizedImages.length === 1 && (!currentVectorsRequired && newVectorsRequired || !(0, _Selectors2.isColorPreviewCompatible)(state, nonVectorizedImages[0].imageData, designProductionMethodIdentifier)))) {
|
|
550
|
-
_context3.
|
|
560
|
+
_context3.next = 8;
|
|
551
561
|
break;
|
|
552
562
|
}
|
|
553
|
-
_context3.
|
|
563
|
+
_context3.next = 7;
|
|
554
564
|
return _ServiceLocator.Services.store.dispatch((0, _Actions.showSwitchToProductionMethodWithVectorization)());
|
|
555
|
-
case
|
|
556
|
-
return _context3.
|
|
557
|
-
case
|
|
558
|
-
|
|
565
|
+
case 7:
|
|
566
|
+
return _context3.abrupt("return", true);
|
|
567
|
+
case 8:
|
|
568
|
+
case "end":
|
|
569
|
+
return _context3.stop();
|
|
559
570
|
}
|
|
560
571
|
}, _callee3);
|
|
561
572
|
}));
|
|
@@ -564,10 +575,10 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
564
575
|
};
|
|
565
576
|
}());
|
|
566
577
|
_defineProperty(this, "handleDesignProductionMethodChangeToMandatoryVectorization", /*#__PURE__*/function () {
|
|
567
|
-
var _ref6 = _asyncToGenerator(/*#__PURE__*/
|
|
578
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(designProductionMethodIdentifier) {
|
|
568
579
|
var state, _getMandatoryVectoriz, currentVectorsMandatory, newVectorsMandatory, designArea, nonColorizedImages;
|
|
569
|
-
return
|
|
570
|
-
while (1) switch (_context4.
|
|
580
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
581
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
571
582
|
case 0:
|
|
572
583
|
state = _ServiceLocator.Services.store.state;
|
|
573
584
|
_getMandatoryVectoriz = (0, _Selectors.getMandatoryVectorizationForDesignProductionMethods)(state, designProductionMethodIdentifier), currentVectorsMandatory = _getMandatoryVectoriz.currentVectorsMandatory, newVectorsMandatory = _getMandatoryVectoriz.newVectorsMandatory;
|
|
@@ -576,15 +587,16 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
576
587
|
return !(0, _get2["default"])(obj, 'imageData.gallery') && !(0, _get2["default"])(obj, 'imageData.displayColorPreview');
|
|
577
588
|
});
|
|
578
589
|
if (!(nonColorizedImages.length === 1 && (!currentVectorsMandatory && newVectorsMandatory || !(0, _Selectors2.isColorPreviewCompatible)(state, nonColorizedImages[0].imageData, designProductionMethodIdentifier)))) {
|
|
579
|
-
_context4.
|
|
590
|
+
_context4.next = 8;
|
|
580
591
|
break;
|
|
581
592
|
}
|
|
582
|
-
_context4.
|
|
593
|
+
_context4.next = 7;
|
|
583
594
|
return _ServiceLocator.Services.store.dispatch((0, _Actions.showSwitchToProductionMethodWithVectorization)());
|
|
584
|
-
case
|
|
585
|
-
return _context4.
|
|
586
|
-
case
|
|
587
|
-
|
|
595
|
+
case 7:
|
|
596
|
+
return _context4.abrupt("return", true);
|
|
597
|
+
case 8:
|
|
598
|
+
case "end":
|
|
599
|
+
return _context4.stop();
|
|
588
600
|
}
|
|
589
601
|
}, _callee4);
|
|
590
602
|
}));
|
|
@@ -593,10 +605,10 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
593
605
|
};
|
|
594
606
|
}());
|
|
595
607
|
_defineProperty(this, "checkColorUsageForDesignProductionMethod", /*#__PURE__*/function () {
|
|
596
|
-
var _ref7 = _asyncToGenerator(/*#__PURE__*/
|
|
608
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(designProductionMethodIdentifier) {
|
|
597
609
|
var state, _getSelectedDesignAre2, maxColorAmount, designProductionMethod, newProductionMethod, newMaxColorAmount, currentVectorsRequired, newVectorsRequired, designArea, colorPreviewRequired, canvas, images, missingColorPalettesColors;
|
|
598
|
-
return
|
|
599
|
-
while (1) switch (_context5.
|
|
610
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
611
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
600
612
|
case 0:
|
|
601
613
|
state = _ServiceLocator.Services.store.state;
|
|
602
614
|
_getSelectedDesignAre2 = (0, _Selectors.getSelectedDesignAreaProperties)(state), maxColorAmount = _getSelectedDesignAre2.maxColorAmount, designProductionMethod = _getSelectedDesignAre2.designProductionMethod;
|
|
@@ -607,7 +619,7 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
607
619
|
designArea = (0, _Selectors.getSelectedDesignArea)(state);
|
|
608
620
|
colorPreviewRequired = (0, _Selectors.designProductionMethodHasEmbroideryVisualizationEffect)(newProductionMethod) || (0, _Selectors.isVectorizedLogoMandatory)(newProductionMethod);
|
|
609
621
|
if (!(newMaxColorAmount !== 0 && newMaxColorAmount < maxColorAmount || !currentVectorsRequired && newVectorsRequired || colorPreviewRequired)) {
|
|
610
|
-
_context5.
|
|
622
|
+
_context5.next = 17;
|
|
611
623
|
break;
|
|
612
624
|
}
|
|
613
625
|
canvas = _this2._getCanvas(designArea);
|
|
@@ -618,34 +630,35 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
618
630
|
return !(0, _get2["default"])(obj, 'imageData.operations.vectorize') || !(0, _Selectors2.isColorPreviewCompatible)(state, obj.imageData, designProductionMethodIdentifier);
|
|
619
631
|
}) : [];
|
|
620
632
|
if (!(images.length > 1)) {
|
|
621
|
-
_context5.
|
|
633
|
+
_context5.next = 17;
|
|
622
634
|
break;
|
|
623
635
|
}
|
|
624
|
-
_context5.
|
|
636
|
+
_context5.next = 14;
|
|
625
637
|
return _ServiceLocator.Services.store.dispatch((0, _Actions.showProductionMethodRemoveImagesConfirm)());
|
|
626
|
-
case
|
|
638
|
+
case 14:
|
|
627
639
|
images.forEach(function (object) {
|
|
628
640
|
object.remove();
|
|
629
641
|
});
|
|
630
|
-
_context5.
|
|
642
|
+
_context5.next = 17;
|
|
631
643
|
return _this2.updateCanvasData(canvas);
|
|
632
|
-
case
|
|
644
|
+
case 17:
|
|
633
645
|
missingColorPalettesColors = getMissingColorPalettesColors((0, _Selectors.getColorsWithPalette)(state), newProductionMethod.colorPalettes, !currentVectorsRequired && newVectorsRequired);
|
|
634
646
|
if (!missingColorPalettesColors.length) {
|
|
635
|
-
_context5.
|
|
647
|
+
_context5.next = 24;
|
|
636
648
|
break;
|
|
637
649
|
}
|
|
638
650
|
if ((0, _Selectors.isColoringDisabled)(state, newProductionMethod.identifier)) {
|
|
639
|
-
_context5.
|
|
651
|
+
_context5.next = 24;
|
|
640
652
|
break;
|
|
641
653
|
}
|
|
642
|
-
_context5.
|
|
654
|
+
_context5.next = 22;
|
|
643
655
|
return _ServiceLocator.Services.store.dispatch((0, _Actions.showProductionMethodChangeColorsConfirm)());
|
|
644
|
-
case
|
|
645
|
-
_context5.
|
|
656
|
+
case 22:
|
|
657
|
+
_context5.next = 24;
|
|
646
658
|
return _this2.replaceSelectedDesignAreaElementsColor(missingColorPalettesColors, newProductionMethod);
|
|
647
|
-
case
|
|
648
|
-
|
|
659
|
+
case 24:
|
|
660
|
+
case "end":
|
|
661
|
+
return _context5.stop();
|
|
649
662
|
}
|
|
650
663
|
}, _callee5);
|
|
651
664
|
}));
|
|
@@ -654,16 +667,16 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
654
667
|
};
|
|
655
668
|
}());
|
|
656
669
|
_defineProperty(this, "replaceSelectedDesignAreaElementsColor", /*#__PURE__*/function () {
|
|
657
|
-
var _ref8 = _asyncToGenerator(/*#__PURE__*/
|
|
670
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(missingColorPalettesColors, designProductionMethod) {
|
|
658
671
|
var state, designArea, designData, objects, _iterator7, _step7, missingColor;
|
|
659
|
-
return
|
|
660
|
-
while (1) switch (_context6.
|
|
672
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
673
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
661
674
|
case 0:
|
|
662
675
|
state = _ServiceLocator.Services.store.state;
|
|
663
676
|
designArea = (0, _Selectors.getSelectedDesignArea)(state);
|
|
664
677
|
designData = (0, _Selectors.getDesignDataByDesignAreaIdentifier)(state, designArea.identifier);
|
|
665
678
|
objects = (0, _get2["default"])(designData, 'canvasData.objects', []);
|
|
666
|
-
_context6.
|
|
679
|
+
_context6.next = 6;
|
|
667
680
|
return Promise.all(objects.filter(function (_ref9) {
|
|
668
681
|
var type = _ref9.type;
|
|
669
682
|
return type === 'Image';
|
|
@@ -684,7 +697,7 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
684
697
|
designProductionMethod: designProductionMethod
|
|
685
698
|
});
|
|
686
699
|
}));
|
|
687
|
-
case
|
|
700
|
+
case 6:
|
|
688
701
|
_iterator7 = _createForOfIteratorHelper(missingColorPalettesColors);
|
|
689
702
|
try {
|
|
690
703
|
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
@@ -699,10 +712,11 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
699
712
|
} finally {
|
|
700
713
|
_iterator7.f();
|
|
701
714
|
}
|
|
702
|
-
_context6.
|
|
715
|
+
_context6.next = 10;
|
|
703
716
|
return _this2.loadCanvasDataFromState([designArea]);
|
|
704
|
-
case
|
|
705
|
-
|
|
717
|
+
case 10:
|
|
718
|
+
case "end":
|
|
719
|
+
return _context6.stop();
|
|
706
720
|
}
|
|
707
721
|
}, _callee6);
|
|
708
722
|
}));
|
|
@@ -711,23 +725,23 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
711
725
|
};
|
|
712
726
|
}());
|
|
713
727
|
}
|
|
714
|
-
|
|
728
|
+
_createClass(DesignDataService, [{
|
|
715
729
|
key: "init",
|
|
716
730
|
value: function init() {
|
|
717
731
|
var _this3 = this;
|
|
718
732
|
_ServiceLocator.Services.store.observeStore(function (state) {
|
|
719
733
|
return state.designArea.filteredDesignAreas;
|
|
720
734
|
}, /*#__PURE__*/function () {
|
|
721
|
-
var _ref1 = _asyncToGenerator(/*#__PURE__*/
|
|
722
|
-
var initList, areasToLoad
|
|
723
|
-
return
|
|
724
|
-
while (1) switch (_context7.
|
|
735
|
+
var _ref1 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(filteredDesignAreas, prevDesignAreas) {
|
|
736
|
+
var initList, areasToLoad;
|
|
737
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
738
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
725
739
|
case 0:
|
|
726
|
-
_context7.
|
|
727
|
-
_context7.
|
|
740
|
+
_context7.prev = 0;
|
|
741
|
+
_context7.next = 3;
|
|
728
742
|
return _this3.initCanvases(filteredDesignAreas, prevDesignAreas);
|
|
729
|
-
case
|
|
730
|
-
initList = _context7.
|
|
743
|
+
case 3:
|
|
744
|
+
initList = _context7.sent;
|
|
731
745
|
// only the newly initialized canvases has to be loaded
|
|
732
746
|
areasToLoad = initList.filter(function (_ref10) {
|
|
733
747
|
var isNew = _ref10.isNew;
|
|
@@ -737,28 +751,29 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
737
751
|
return designArea;
|
|
738
752
|
}); // the canvas data is there first with the configuration, but since the canvas instances are
|
|
739
753
|
// associated with the design areas the data can be loaded only when the design areas are available
|
|
740
|
-
|
|
741
|
-
if (!
|
|
742
|
-
_context7.
|
|
754
|
+
_context7.t0 = !(0, _Selectors3.isDesignerProductPreviewMode)() && areasToLoad.length;
|
|
755
|
+
if (!_context7.t0) {
|
|
756
|
+
_context7.next = 9;
|
|
743
757
|
break;
|
|
744
758
|
}
|
|
745
|
-
_context7.
|
|
759
|
+
_context7.next = 9;
|
|
746
760
|
return _this3.loadCanvasDataFromState(areasToLoad);
|
|
747
|
-
case
|
|
761
|
+
case 9:
|
|
748
762
|
_this3.selectInitialDesignView();
|
|
749
763
|
_this3.designAreaListChangeListener(filteredDesignAreas, prevDesignAreas);
|
|
750
764
|
_this3.openDesignAreaEditorIfEditingParamIsSet();
|
|
751
|
-
_context7.
|
|
765
|
+
_context7.next = 17;
|
|
752
766
|
break;
|
|
753
|
-
case
|
|
754
|
-
_context7.
|
|
755
|
-
|
|
767
|
+
case 14:
|
|
768
|
+
_context7.prev = 14;
|
|
769
|
+
_context7.t1 = _context7["catch"](0);
|
|
756
770
|
// eslint-disable-next-line no-console
|
|
757
|
-
console.error('Error occurred in processing design area list change:',
|
|
758
|
-
case
|
|
759
|
-
|
|
771
|
+
console.error('Error occurred in processing design area list change:', _context7.t1);
|
|
772
|
+
case 17:
|
|
773
|
+
case "end":
|
|
774
|
+
return _context7.stop();
|
|
760
775
|
}
|
|
761
|
-
}, _callee7, null, [[0,
|
|
776
|
+
}, _callee7, null, [[0, 14]]);
|
|
762
777
|
}));
|
|
763
778
|
return function (_x7, _x8) {
|
|
764
779
|
return _ref1.apply(this, arguments);
|
|
@@ -786,47 +801,48 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
786
801
|
}, {
|
|
787
802
|
key: "openDesignAreaEditorIfEditingParamIsSet",
|
|
788
803
|
value: function () {
|
|
789
|
-
var _openDesignAreaEditorIfEditingParamIsSet = _asyncToGenerator(/*#__PURE__*/
|
|
804
|
+
var _openDesignAreaEditorIfEditingParamIsSet = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
790
805
|
var query, isDesignerModeAvailable, selectedMode, viewChangedPromise;
|
|
791
|
-
return
|
|
792
|
-
while (1) switch (_context8.
|
|
806
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
807
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
793
808
|
case 0:
|
|
794
809
|
if (!this._editingHandlerDone) {
|
|
795
|
-
_context8.
|
|
810
|
+
_context8.next = 2;
|
|
796
811
|
break;
|
|
797
812
|
}
|
|
798
|
-
return _context8.
|
|
799
|
-
case
|
|
813
|
+
return _context8.abrupt("return");
|
|
814
|
+
case 2:
|
|
800
815
|
query = new URLSearchParams(location.search);
|
|
801
816
|
if (query.has('_editing')) {
|
|
802
|
-
_context8.
|
|
817
|
+
_context8.next = 5;
|
|
803
818
|
break;
|
|
804
819
|
}
|
|
805
|
-
return _context8.
|
|
806
|
-
case
|
|
820
|
+
return _context8.abrupt("return");
|
|
821
|
+
case 5:
|
|
807
822
|
isDesignerModeAvailable = (0, _get2["default"])(_ServiceLocator.Services.store.state, 'configurationMode.availableModes.designer');
|
|
808
823
|
if (isDesignerModeAvailable) {
|
|
809
|
-
_context8.
|
|
824
|
+
_context8.next = 8;
|
|
810
825
|
break;
|
|
811
826
|
}
|
|
812
|
-
return _context8.
|
|
813
|
-
case
|
|
827
|
+
return _context8.abrupt("return");
|
|
828
|
+
case 8:
|
|
814
829
|
selectedMode = (0, _get2["default"])(_ServiceLocator.Services.store.state, 'configurationMode.selectedMode');
|
|
815
830
|
if (selectedMode !== 'designer') {
|
|
816
831
|
_ServiceLocator.Services.store.dispatch((0, _Actions6.selectConfigurationMode)('designer'));
|
|
817
832
|
}
|
|
818
833
|
viewChangedPromise = _ServiceLocator.Services.visualization.getViewChangedPromise();
|
|
819
834
|
if (!viewChangedPromise) {
|
|
820
|
-
_context8.
|
|
835
|
+
_context8.next = 16;
|
|
821
836
|
break;
|
|
822
837
|
}
|
|
823
|
-
_context8.
|
|
838
|
+
_context8.next = 14;
|
|
824
839
|
return viewChangedPromise;
|
|
825
|
-
case
|
|
840
|
+
case 14:
|
|
826
841
|
this.openDesignAreaEditor();
|
|
827
842
|
this._editingHandlerDone = true;
|
|
828
|
-
case
|
|
829
|
-
|
|
843
|
+
case 16:
|
|
844
|
+
case "end":
|
|
845
|
+
return _context8.stop();
|
|
830
846
|
}
|
|
831
847
|
}, _callee8, this);
|
|
832
848
|
}));
|
|
@@ -930,12 +946,12 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
930
946
|
*/
|
|
931
947
|
}, {
|
|
932
948
|
key: "initCanvases",
|
|
933
|
-
value:
|
|
934
|
-
var _initCanvases = _asyncToGenerator(/*#__PURE__*/
|
|
949
|
+
value: function () {
|
|
950
|
+
var _initCanvases = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(designAreas, prevDesignAreas) {
|
|
935
951
|
var _this4 = this;
|
|
936
952
|
var state;
|
|
937
|
-
return
|
|
938
|
-
while (1) switch (_context9.
|
|
953
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
954
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
939
955
|
case 0:
|
|
940
956
|
// clean up first: remove canvases that are not mapped to any design areas
|
|
941
957
|
this._removeCanvas && prevDesignAreas.filter(function (prevArea) {
|
|
@@ -946,7 +962,7 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
946
962
|
return _this4._removeCanvas(prevArea);
|
|
947
963
|
});
|
|
948
964
|
state = _ServiceLocator.Services.store.state;
|
|
949
|
-
_context9.
|
|
965
|
+
_context9.next = 4;
|
|
950
966
|
return Promise.all(designAreas.map(function (designArea) {
|
|
951
967
|
var maskData = (0, _Selectors.getMaskDataForDesignArea)(state, designArea);
|
|
952
968
|
var canvasSize = (0, _Selectors.getCanvasSizeFromDesignArea)(state, designArea);
|
|
@@ -962,8 +978,11 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
962
978
|
colorOverlayData: colorOverlayData
|
|
963
979
|
});
|
|
964
980
|
}));
|
|
965
|
-
case
|
|
966
|
-
return _context9.
|
|
981
|
+
case 4:
|
|
982
|
+
return _context9.abrupt("return", _context9.sent);
|
|
983
|
+
case 5:
|
|
984
|
+
case "end":
|
|
985
|
+
return _context9.stop();
|
|
967
986
|
}
|
|
968
987
|
}, _callee9, this);
|
|
969
988
|
}));
|
|
@@ -976,21 +995,23 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
976
995
|
* Calls syncCanvases with the registered _loadCanvasData function
|
|
977
996
|
* @param {array} designAreas
|
|
978
997
|
*/
|
|
979
|
-
)
|
|
980
998
|
}, {
|
|
981
999
|
key: "updateCanvasDataFromState",
|
|
982
|
-
value:
|
|
983
|
-
var _updateCanvasDataFromState = _asyncToGenerator(/*#__PURE__*/
|
|
1000
|
+
value: function () {
|
|
1001
|
+
var _updateCanvasDataFromState = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee0() {
|
|
984
1002
|
var designAreas,
|
|
985
1003
|
_args0 = arguments;
|
|
986
|
-
return
|
|
987
|
-
while (1) switch (_context0.
|
|
1004
|
+
return _regeneratorRuntime().wrap(function _callee0$(_context0) {
|
|
1005
|
+
while (1) switch (_context0.prev = _context0.next) {
|
|
988
1006
|
case 0:
|
|
989
1007
|
designAreas = _args0.length > 0 && _args0[0] !== undefined ? _args0[0] : this.getDesignAreas();
|
|
990
|
-
_context0.
|
|
1008
|
+
_context0.next = 3;
|
|
991
1009
|
return this.syncCanvases(this._updateCanvasData, designAreas);
|
|
992
|
-
case
|
|
993
|
-
return _context0.
|
|
1010
|
+
case 3:
|
|
1011
|
+
return _context0.abrupt("return", _context0.sent);
|
|
1012
|
+
case 4:
|
|
1013
|
+
case "end":
|
|
1014
|
+
return _context0.stop();
|
|
994
1015
|
}
|
|
995
1016
|
}, _callee0, this);
|
|
996
1017
|
}));
|
|
@@ -1003,21 +1024,23 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
1003
1024
|
* Calls syncCanvases with the registered _loadCanvasData function
|
|
1004
1025
|
* @param {array} designAreas
|
|
1005
1026
|
*/
|
|
1006
|
-
)
|
|
1007
1027
|
}, {
|
|
1008
1028
|
key: "loadCanvasDataFromState",
|
|
1009
|
-
value:
|
|
1010
|
-
var _loadCanvasDataFromState = _asyncToGenerator(/*#__PURE__*/
|
|
1029
|
+
value: function () {
|
|
1030
|
+
var _loadCanvasDataFromState = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee1() {
|
|
1011
1031
|
var designAreas,
|
|
1012
1032
|
_args1 = arguments;
|
|
1013
|
-
return
|
|
1014
|
-
while (1) switch (_context1.
|
|
1033
|
+
return _regeneratorRuntime().wrap(function _callee1$(_context1) {
|
|
1034
|
+
while (1) switch (_context1.prev = _context1.next) {
|
|
1015
1035
|
case 0:
|
|
1016
1036
|
designAreas = _args1.length > 0 && _args1[0] !== undefined ? _args1[0] : this.getDesignAreas();
|
|
1017
|
-
_context1.
|
|
1037
|
+
_context1.next = 3;
|
|
1018
1038
|
return this.syncCanvases(this._loadCanvasData, designAreas);
|
|
1019
|
-
case
|
|
1020
|
-
return _context1.
|
|
1039
|
+
case 3:
|
|
1040
|
+
return _context1.abrupt("return", _context1.sent);
|
|
1041
|
+
case 4:
|
|
1042
|
+
case "end":
|
|
1043
|
+
return _context1.stop();
|
|
1021
1044
|
}
|
|
1022
1045
|
}, _callee1, this);
|
|
1023
1046
|
}));
|
|
@@ -1033,37 +1056,37 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
1033
1056
|
* @param {array} designAreas
|
|
1034
1057
|
* @return {Promise<void>}
|
|
1035
1058
|
*/
|
|
1036
|
-
)
|
|
1037
1059
|
}, {
|
|
1038
1060
|
key: "syncCanvases",
|
|
1039
|
-
value:
|
|
1040
|
-
var _syncCanvases = _asyncToGenerator(/*#__PURE__*/
|
|
1061
|
+
value: function () {
|
|
1062
|
+
var _syncCanvases = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(updateFn, designAreas) {
|
|
1041
1063
|
var _this5 = this;
|
|
1042
1064
|
var state;
|
|
1043
|
-
return
|
|
1044
|
-
while (1) switch (_context11.
|
|
1065
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
1066
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
1045
1067
|
case 0:
|
|
1046
1068
|
state = _ServiceLocator.Services.store.state;
|
|
1047
|
-
_context11.
|
|
1048
|
-
return Promise.all(designAreas.map(/*#__PURE__*/function () {
|
|
1049
|
-
var _ref13 = _asyncToGenerator(/*#__PURE__*/
|
|
1069
|
+
_context11.next = 3;
|
|
1070
|
+
return Promise.all(designAreas.map( /*#__PURE__*/function () {
|
|
1071
|
+
var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(designArea) {
|
|
1050
1072
|
var designData, canvasData, canvasSize;
|
|
1051
|
-
return
|
|
1052
|
-
while (1) switch (_context10.
|
|
1073
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
1074
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
1053
1075
|
case 0:
|
|
1054
1076
|
designData = (0, _Selectors.getDesignDataByDesignAreaIdentifier)(state, designArea.identifier);
|
|
1055
1077
|
canvasData = (0, _get2["default"])(designData, 'canvasData');
|
|
1056
1078
|
if (!canvasData) {
|
|
1057
|
-
_context10.
|
|
1079
|
+
_context10.next = 7;
|
|
1058
1080
|
break;
|
|
1059
1081
|
}
|
|
1060
|
-
_context10.
|
|
1082
|
+
_context10.next = 5;
|
|
1061
1083
|
return preloadFonts(canvasData);
|
|
1062
|
-
case
|
|
1084
|
+
case 5:
|
|
1063
1085
|
canvasSize = (0, _Selectors.getCanvasSizeFromDesignArea)(state, designArea);
|
|
1064
|
-
return _context10.
|
|
1065
|
-
case
|
|
1066
|
-
|
|
1086
|
+
return _context10.abrupt("return", updateFn && updateFn(canvasData, designArea, canvasSize));
|
|
1087
|
+
case 7:
|
|
1088
|
+
case "end":
|
|
1089
|
+
return _context10.stop();
|
|
1067
1090
|
}
|
|
1068
1091
|
}, _callee10);
|
|
1069
1092
|
}));
|
|
@@ -1071,12 +1094,13 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
1071
1094
|
return _ref13.apply(this, arguments);
|
|
1072
1095
|
};
|
|
1073
1096
|
}()));
|
|
1074
|
-
case
|
|
1097
|
+
case 3:
|
|
1075
1098
|
window.setTimeout(function () {
|
|
1076
1099
|
_this5.updateVisualization();
|
|
1077
1100
|
}, 100);
|
|
1078
|
-
case
|
|
1079
|
-
|
|
1101
|
+
case 4:
|
|
1102
|
+
case "end":
|
|
1103
|
+
return _context11.stop();
|
|
1080
1104
|
}
|
|
1081
1105
|
}, _callee11);
|
|
1082
1106
|
}));
|
|
@@ -1084,7 +1108,7 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
1084
1108
|
return _syncCanvases.apply(this, arguments);
|
|
1085
1109
|
}
|
|
1086
1110
|
return syncCanvases;
|
|
1087
|
-
}()
|
|
1111
|
+
}()
|
|
1088
1112
|
}, {
|
|
1089
1113
|
key: "getDesignAreas",
|
|
1090
1114
|
value: function getDesignAreas() {
|
|
@@ -1133,34 +1157,35 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
1133
1157
|
}, {
|
|
1134
1158
|
key: "updateCanvasData",
|
|
1135
1159
|
value: function () {
|
|
1136
|
-
var _updateCanvasData = _asyncToGenerator(/*#__PURE__*/
|
|
1160
|
+
var _updateCanvasData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(canvas, eventData) {
|
|
1137
1161
|
var canvasDataJSON, showAlert, _getDesignDataForSele, canvasData;
|
|
1138
|
-
return
|
|
1139
|
-
while (1) switch (_context12.
|
|
1162
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
1163
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
1140
1164
|
case 0:
|
|
1141
1165
|
if (this._serializeCanvas) {
|
|
1142
|
-
_context12.
|
|
1166
|
+
_context12.next = 2;
|
|
1143
1167
|
break;
|
|
1144
1168
|
}
|
|
1145
1169
|
throw new TypeError("The registerCanvasSerializer method has to be called first with a valid function!");
|
|
1146
|
-
case
|
|
1170
|
+
case 2:
|
|
1147
1171
|
canvasDataJSON = this._serializeCanvas(canvas); // check the color usage before storing the canvas data, so the user can decide to
|
|
1148
1172
|
// 1. proceed with more colors than the allowed or
|
|
1149
1173
|
// 2. undo the changes
|
|
1150
1174
|
//added check to avoid the checkColorUsage in Widget view(as evenData is undefined)
|
|
1151
1175
|
showAlert = eventData ? checkColorUsage(canvasDataJSON, eventData.changeEvent) : false;
|
|
1152
1176
|
if (!(showAlert && (0, _configuration.getConf)('displayColorAmountWarnings', true))) {
|
|
1153
|
-
_context12.
|
|
1177
|
+
_context12.next = 9;
|
|
1154
1178
|
break;
|
|
1155
1179
|
}
|
|
1156
1180
|
_ServiceLocator.Services.ui.reportError((0, _i18n.t)('colorAmountAlert.colorChangeReverted'));
|
|
1157
1181
|
_getDesignDataForSele = (0, _Selectors.getDesignDataForSelectedDesignArea)(_ServiceLocator.Services.store.state), canvasData = _getDesignDataForSele.canvasData; // Restore Graphics Editor state
|
|
1158
1182
|
this._loadCanvasData && this._loadCanvasData(canvasData);
|
|
1159
|
-
return _context12.
|
|
1160
|
-
case
|
|
1183
|
+
return _context12.abrupt("return");
|
|
1184
|
+
case 9:
|
|
1161
1185
|
this.setCanvasData(canvasDataJSON);
|
|
1162
|
-
case
|
|
1163
|
-
|
|
1186
|
+
case 10:
|
|
1187
|
+
case "end":
|
|
1188
|
+
return _context12.stop();
|
|
1164
1189
|
}
|
|
1165
1190
|
}, _callee12, this);
|
|
1166
1191
|
}));
|
|
@@ -1175,19 +1200,20 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
1175
1200
|
var _this6 = this;
|
|
1176
1201
|
var syncCanvasChange = _ref15.syncCanvasChange;
|
|
1177
1202
|
this._syncCanvasChange = syncCanvasChange;
|
|
1178
|
-
return /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
1203
|
+
return /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
|
|
1179
1204
|
var _args13 = arguments;
|
|
1180
|
-
return
|
|
1181
|
-
while (1) switch (_context13.
|
|
1205
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
1206
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
1182
1207
|
case 0:
|
|
1183
1208
|
if (!_this6._isCanvasDataUpdateEnabled) {
|
|
1184
|
-
_context13.
|
|
1209
|
+
_context13.next = 3;
|
|
1185
1210
|
break;
|
|
1186
1211
|
}
|
|
1187
|
-
_context13.
|
|
1212
|
+
_context13.next = 3;
|
|
1188
1213
|
return _this6.updateCanvasData.apply(_this6, _args13);
|
|
1189
|
-
case
|
|
1190
|
-
|
|
1214
|
+
case 3:
|
|
1215
|
+
case "end":
|
|
1216
|
+
return _context13.stop();
|
|
1191
1217
|
}
|
|
1192
1218
|
}, _callee13);
|
|
1193
1219
|
}));
|
|
@@ -1415,27 +1441,27 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
1415
1441
|
}, {
|
|
1416
1442
|
key: "vectorizeSingleImageAndShowEditDialog",
|
|
1417
1443
|
value: function () {
|
|
1418
|
-
var _vectorizeSingleImageAndShowEditDialog = _asyncToGenerator(/*#__PURE__*/
|
|
1419
|
-
var showImageEditDialog, state, designArea, canvas, images, firstNonVectorizedImage, operations, imageData, imageToSelect
|
|
1420
|
-
return
|
|
1421
|
-
while (1) switch (_context14.
|
|
1444
|
+
var _vectorizeSingleImageAndShowEditDialog = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(identifier) {
|
|
1445
|
+
var showImageEditDialog, state, designArea, canvas, images, firstNonVectorizedImage, operations, imageData, imageToSelect;
|
|
1446
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
1447
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
1422
1448
|
case 0:
|
|
1423
|
-
_context14.
|
|
1449
|
+
_context14.next = 2;
|
|
1424
1450
|
return this.handleDesignProductionMethodChangeFromNonVectorizationToVectorization(identifier);
|
|
1425
|
-
case
|
|
1426
|
-
|
|
1427
|
-
if (
|
|
1428
|
-
_context14.
|
|
1451
|
+
case 2:
|
|
1452
|
+
_context14.t0 = _context14.sent;
|
|
1453
|
+
if (_context14.t0) {
|
|
1454
|
+
_context14.next = 7;
|
|
1429
1455
|
break;
|
|
1430
1456
|
}
|
|
1431
|
-
_context14.
|
|
1457
|
+
_context14.next = 6;
|
|
1432
1458
|
return this.handleDesignProductionMethodChangeToMandatoryVectorization(identifier);
|
|
1433
|
-
case
|
|
1434
|
-
|
|
1435
|
-
case
|
|
1436
|
-
showImageEditDialog =
|
|
1459
|
+
case 6:
|
|
1460
|
+
_context14.t0 = _context14.sent;
|
|
1461
|
+
case 7:
|
|
1462
|
+
showImageEditDialog = _context14.t0;
|
|
1437
1463
|
if (!showImageEditDialog) {
|
|
1438
|
-
_context14.
|
|
1464
|
+
_context14.next = 29;
|
|
1439
1465
|
break;
|
|
1440
1466
|
}
|
|
1441
1467
|
_ServiceLocator.Services.ui.show('globalLoader');
|
|
@@ -1446,41 +1472,42 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
1446
1472
|
firstNonVectorizedImage = images.find(function (obj) {
|
|
1447
1473
|
return !(0, _get2["default"])(obj, 'imageData.gallery') && (!(0, _get2["default"])(obj, 'imageData.operations.vectorize') || !(0, _get2["default"])(obj, 'imageData.displayColorPreview'));
|
|
1448
1474
|
});
|
|
1449
|
-
_context14.
|
|
1475
|
+
_context14.prev = 15;
|
|
1450
1476
|
operations = _objectSpread(_objectSpread({}, firstNonVectorizedImage.imageData.operations), {}, {
|
|
1451
1477
|
vectorize: true
|
|
1452
1478
|
});
|
|
1453
1479
|
imageData = firstNonVectorizedImage.imageData; //returing if placeHolderImage, from executing edit operations
|
|
1454
1480
|
if (!imageData.isPlaceHolderImage) {
|
|
1455
|
-
_context14.
|
|
1481
|
+
_context14.next = 20;
|
|
1456
1482
|
break;
|
|
1457
1483
|
}
|
|
1458
|
-
return _context14.
|
|
1459
|
-
case
|
|
1460
|
-
_context14.
|
|
1484
|
+
return _context14.abrupt("return");
|
|
1485
|
+
case 20:
|
|
1486
|
+
_context14.next = 22;
|
|
1461
1487
|
return _ServiceLocator.Services.designData.editFile(operations, imageData, {
|
|
1462
1488
|
immediateCommit: true
|
|
1463
1489
|
});
|
|
1464
|
-
case
|
|
1490
|
+
case 22:
|
|
1465
1491
|
imageToSelect = canvas.objects.filter(function (object) {
|
|
1466
1492
|
return object.type === 'Image';
|
|
1467
1493
|
}).find(function (obj) {
|
|
1468
1494
|
return obj._imageData.identifier === imageData.identifier;
|
|
1469
1495
|
});
|
|
1470
1496
|
imageToSelect.selected = true;
|
|
1471
|
-
_context14.
|
|
1497
|
+
_context14.next = 26;
|
|
1472
1498
|
return _ServiceLocator.Services.designer.openImageEditDialog(firstNonVectorizedImage.imageData.identifier, canvas, {
|
|
1473
1499
|
placeholderImageUpdate: false,
|
|
1474
1500
|
submitOnExitClick: true
|
|
1475
1501
|
});
|
|
1476
|
-
case
|
|
1477
|
-
_context14.
|
|
1502
|
+
case 26:
|
|
1503
|
+
_context14.prev = 26;
|
|
1478
1504
|
_ServiceLocator.Services.ui.hide('globalLoader');
|
|
1479
|
-
return _context14.
|
|
1480
|
-
case
|
|
1481
|
-
|
|
1505
|
+
return _context14.finish(26);
|
|
1506
|
+
case 29:
|
|
1507
|
+
case "end":
|
|
1508
|
+
return _context14.stop();
|
|
1482
1509
|
}
|
|
1483
|
-
}, _callee14, this, [[
|
|
1510
|
+
}, _callee14, this, [[15,, 26, 29]]);
|
|
1484
1511
|
}));
|
|
1485
1512
|
function vectorizeSingleImageAndShowEditDialog(_x14) {
|
|
1486
1513
|
return _vectorizeSingleImageAndShowEditDialog.apply(this, arguments);
|
|
@@ -1490,17 +1517,17 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
1490
1517
|
}, {
|
|
1491
1518
|
key: "restoreVectorizedImages",
|
|
1492
1519
|
value: function () {
|
|
1493
|
-
var _restoreVectorizedImages = _asyncToGenerator(/*#__PURE__*/
|
|
1494
|
-
var displayImagesAsUnVectorized, state, designArea, images, _iterator8, _step8, image, operations
|
|
1495
|
-
return
|
|
1496
|
-
while (1) switch (_context15.
|
|
1520
|
+
var _restoreVectorizedImages = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(identifier) {
|
|
1521
|
+
var displayImagesAsUnVectorized, state, designArea, images, _iterator8, _step8, image, operations;
|
|
1522
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
1523
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
1497
1524
|
case 0:
|
|
1498
|
-
_context15.
|
|
1525
|
+
_context15.next = 2;
|
|
1499
1526
|
return this.handleDesignProductionMethodChangeFromVectorizationToNonVectorization(identifier);
|
|
1500
|
-
case
|
|
1501
|
-
displayImagesAsUnVectorized = _context15.
|
|
1527
|
+
case 2:
|
|
1528
|
+
displayImagesAsUnVectorized = _context15.sent;
|
|
1502
1529
|
if (!displayImagesAsUnVectorized) {
|
|
1503
|
-
_context15.
|
|
1530
|
+
_context15.next = 28;
|
|
1504
1531
|
break;
|
|
1505
1532
|
}
|
|
1506
1533
|
state = _ServiceLocator.Services.store.state;
|
|
@@ -1510,41 +1537,42 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
1510
1537
|
return !(0, _get2["default"])(img, 'imageData.isPlaceHolderImage', false);
|
|
1511
1538
|
}); //excluding placeHolderImage from executing edit operations
|
|
1512
1539
|
_iterator8 = _createForOfIteratorHelper(images);
|
|
1513
|
-
_context15.
|
|
1540
|
+
_context15.prev = 9;
|
|
1514
1541
|
_iterator8.s();
|
|
1515
|
-
case
|
|
1542
|
+
case 11:
|
|
1516
1543
|
if ((_step8 = _iterator8.n()).done) {
|
|
1517
|
-
_context15.
|
|
1544
|
+
_context15.next = 18;
|
|
1518
1545
|
break;
|
|
1519
1546
|
}
|
|
1520
1547
|
image = _step8.value;
|
|
1521
1548
|
operations = (0, _Modifiers.removeVectorizeFromOperations)(image.imageData.operations);
|
|
1522
|
-
_context15.
|
|
1549
|
+
_context15.next = 16;
|
|
1523
1550
|
return _ServiceLocator.Services.designData.editFile(operations, image.imageData, {
|
|
1524
1551
|
immediateCommit: true,
|
|
1525
1552
|
displayColorPreview: (0, _configuration.getConf)('autoPreviewVectorization', true)
|
|
1526
1553
|
});
|
|
1527
|
-
case
|
|
1528
|
-
_context15.
|
|
1554
|
+
case 16:
|
|
1555
|
+
_context15.next = 11;
|
|
1529
1556
|
break;
|
|
1530
|
-
case
|
|
1531
|
-
_context15.
|
|
1557
|
+
case 18:
|
|
1558
|
+
_context15.next = 23;
|
|
1532
1559
|
break;
|
|
1533
|
-
case
|
|
1534
|
-
_context15.
|
|
1535
|
-
|
|
1536
|
-
_iterator8.e(
|
|
1537
|
-
case
|
|
1538
|
-
_context15.
|
|
1560
|
+
case 20:
|
|
1561
|
+
_context15.prev = 20;
|
|
1562
|
+
_context15.t0 = _context15["catch"](9);
|
|
1563
|
+
_iterator8.e(_context15.t0);
|
|
1564
|
+
case 23:
|
|
1565
|
+
_context15.prev = 23;
|
|
1539
1566
|
_iterator8.f();
|
|
1540
|
-
return _context15.
|
|
1541
|
-
case
|
|
1542
|
-
_context15.
|
|
1567
|
+
return _context15.finish(23);
|
|
1568
|
+
case 26:
|
|
1569
|
+
_context15.next = 28;
|
|
1543
1570
|
return this.loadCanvasDataFromState([designArea]);
|
|
1544
|
-
case
|
|
1545
|
-
|
|
1571
|
+
case 28:
|
|
1572
|
+
case "end":
|
|
1573
|
+
return _context15.stop();
|
|
1546
1574
|
}
|
|
1547
|
-
}, _callee15, this, [[
|
|
1575
|
+
}, _callee15, this, [[9, 20, 23, 26]]);
|
|
1548
1576
|
}));
|
|
1549
1577
|
function restoreVectorizedImages(_x15) {
|
|
1550
1578
|
return _restoreVectorizedImages.apply(this, arguments);
|
|
@@ -1554,34 +1582,35 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
1554
1582
|
}, {
|
|
1555
1583
|
key: "updateObjectsAfterProductionMethodChange",
|
|
1556
1584
|
value: function () {
|
|
1557
|
-
var _updateObjectsAfterProductionMethodChange = _asyncToGenerator(/*#__PURE__*/
|
|
1585
|
+
var _updateObjectsAfterProductionMethodChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(oldProductionMethod, newProductionMethod) {
|
|
1558
1586
|
var _getDesignDataForSele2, canvasData, objects, newObjects, designArea;
|
|
1559
|
-
return
|
|
1560
|
-
while (1) switch (_context16.
|
|
1587
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
1588
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
1561
1589
|
case 0:
|
|
1562
1590
|
_getDesignDataForSele2 = (0, _Selectors.getDesignDataForSelectedDesignArea)(_ServiceLocator.Services.store.state), canvasData = _getDesignDataForSele2.canvasData;
|
|
1563
1591
|
if (canvasData) {
|
|
1564
|
-
_context16.
|
|
1592
|
+
_context16.next = 3;
|
|
1565
1593
|
break;
|
|
1566
1594
|
}
|
|
1567
|
-
return _context16.
|
|
1568
|
-
case
|
|
1595
|
+
return _context16.abrupt("return");
|
|
1596
|
+
case 3:
|
|
1569
1597
|
objects = canvasData.objects;
|
|
1570
1598
|
newObjects = (0, _Modifiers.applyProductionMethodChangeToCanvasObjects)(newProductionMethod, oldProductionMethod, objects);
|
|
1571
1599
|
if (!(newObjects === objects)) {
|
|
1572
|
-
_context16.
|
|
1600
|
+
_context16.next = 7;
|
|
1573
1601
|
break;
|
|
1574
1602
|
}
|
|
1575
|
-
return _context16.
|
|
1576
|
-
case
|
|
1603
|
+
return _context16.abrupt("return");
|
|
1604
|
+
case 7:
|
|
1577
1605
|
this.setCanvasData(_objectSpread(_objectSpread({}, canvasData), {}, {
|
|
1578
1606
|
objects: newObjects
|
|
1579
1607
|
}));
|
|
1580
1608
|
designArea = (0, _Selectors.getSelectedDesignArea)(_ServiceLocator.Services.store.state);
|
|
1581
|
-
_context16.
|
|
1609
|
+
_context16.next = 11;
|
|
1582
1610
|
return this.updateCanvasDataFromState([designArea]);
|
|
1583
|
-
case
|
|
1584
|
-
|
|
1611
|
+
case 11:
|
|
1612
|
+
case "end":
|
|
1613
|
+
return _context16.stop();
|
|
1585
1614
|
}
|
|
1586
1615
|
}, _callee16, this);
|
|
1587
1616
|
}));
|
|
@@ -1606,17 +1635,17 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
1606
1635
|
}, {
|
|
1607
1636
|
key: "setDesignProductionMethod",
|
|
1608
1637
|
value: function () {
|
|
1609
|
-
var _setDesignProductionMethod2 = _asyncToGenerator(/*#__PURE__*/
|
|
1610
|
-
var state, designData, selectedDesignProduction, bulkNameSelected, fontSizeMin, smallestFontSize, oldDesignProductionMethod
|
|
1611
|
-
return
|
|
1612
|
-
while (1) switch (_context17.
|
|
1638
|
+
var _setDesignProductionMethod2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(identifier) {
|
|
1639
|
+
var state, designData, selectedDesignProduction, bulkNameSelected, fontSizeMin, smallestFontSize, oldDesignProductionMethod;
|
|
1640
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
1641
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
1613
1642
|
case 0:
|
|
1614
1643
|
if (this.checkDesignElementRestrictions(identifier)) {
|
|
1615
|
-
_context17.
|
|
1644
|
+
_context17.next = 2;
|
|
1616
1645
|
break;
|
|
1617
1646
|
}
|
|
1618
|
-
return _context17.
|
|
1619
|
-
case
|
|
1647
|
+
return _context17.abrupt("return");
|
|
1648
|
+
case 2:
|
|
1620
1649
|
this.clearSelectionOnCurrentDesignArea();
|
|
1621
1650
|
// check if the selected design production method has a higher minimum font size
|
|
1622
1651
|
// than any of the text elements on the canvas
|
|
@@ -1625,66 +1654,66 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
1625
1654
|
selectedDesignProduction = (0, _Selectors.getDesignProductionMethodByIdentifier)(state, identifier);
|
|
1626
1655
|
bulkNameSelected = (0, _Selectors.hasSelectedBulkName)(designData);
|
|
1627
1656
|
if (isWidget(location.pathname)) {
|
|
1628
|
-
_context17.
|
|
1657
|
+
_context17.next = 44;
|
|
1629
1658
|
break;
|
|
1630
1659
|
}
|
|
1631
1660
|
fontSizeMin = (0, _Selectors.getFontSizeMin)(state, identifier);
|
|
1632
1661
|
smallestFontSize = (0, _Selectors.findSmallestFontSizeInCanvasData)(designData.canvasData);
|
|
1633
|
-
_context17.
|
|
1634
|
-
|
|
1635
|
-
if (!
|
|
1636
|
-
_context17.
|
|
1662
|
+
_context17.prev = 10;
|
|
1663
|
+
_context17.t0 = smallestFontSize < fontSizeMin;
|
|
1664
|
+
if (!_context17.t0) {
|
|
1665
|
+
_context17.next = 15;
|
|
1637
1666
|
break;
|
|
1638
1667
|
}
|
|
1639
|
-
_context17.
|
|
1668
|
+
_context17.next = 15;
|
|
1640
1669
|
return _ServiceLocator.Services.store.dispatch((0, _Actions.showMinFontSizeConfirm)(fontSizeMin));
|
|
1641
|
-
case
|
|
1642
|
-
_context17.
|
|
1670
|
+
case 15:
|
|
1671
|
+
_context17.next = 20;
|
|
1643
1672
|
break;
|
|
1644
|
-
case
|
|
1645
|
-
_context17.
|
|
1646
|
-
|
|
1647
|
-
return _context17.
|
|
1648
|
-
case
|
|
1649
|
-
_context17.
|
|
1650
|
-
_context17.
|
|
1673
|
+
case 17:
|
|
1674
|
+
_context17.prev = 17;
|
|
1675
|
+
_context17.t1 = _context17["catch"](10);
|
|
1676
|
+
return _context17.abrupt("return");
|
|
1677
|
+
case 20:
|
|
1678
|
+
_context17.prev = 20;
|
|
1679
|
+
_context17.next = 23;
|
|
1651
1680
|
return this.checkColorUsageForDesignProductionMethod(identifier);
|
|
1652
|
-
case
|
|
1653
|
-
_context17.
|
|
1681
|
+
case 23:
|
|
1682
|
+
_context17.next = 25;
|
|
1654
1683
|
return this.vectorizeSingleImageAndShowEditDialog(identifier);
|
|
1655
|
-
case
|
|
1656
|
-
_context17.
|
|
1684
|
+
case 25:
|
|
1685
|
+
_context17.next = 27;
|
|
1657
1686
|
return this.restoreVectorizedImages(identifier);
|
|
1658
|
-
case
|
|
1659
|
-
_context17.
|
|
1687
|
+
case 27:
|
|
1688
|
+
_context17.next = 34;
|
|
1660
1689
|
break;
|
|
1661
|
-
case
|
|
1662
|
-
_context17.
|
|
1663
|
-
|
|
1664
|
-
if (!(0, _Actions5.isConfirmResult)(
|
|
1665
|
-
_context17.
|
|
1690
|
+
case 29:
|
|
1691
|
+
_context17.prev = 29;
|
|
1692
|
+
_context17.t2 = _context17["catch"](20);
|
|
1693
|
+
if (!(0, _Actions5.isConfirmResult)(_context17.t2)) {
|
|
1694
|
+
_context17.next = 33;
|
|
1666
1695
|
break;
|
|
1667
1696
|
}
|
|
1668
|
-
return _context17.
|
|
1669
|
-
case
|
|
1670
|
-
throw
|
|
1671
|
-
case
|
|
1672
|
-
_context17.
|
|
1673
|
-
|
|
1674
|
-
if (!
|
|
1675
|
-
_context17.
|
|
1697
|
+
return _context17.abrupt("return");
|
|
1698
|
+
case 33:
|
|
1699
|
+
throw _context17.t2;
|
|
1700
|
+
case 34:
|
|
1701
|
+
_context17.prev = 34;
|
|
1702
|
+
_context17.t3 = bulkNameSelected && !selectedDesignProduction.allowBulkNames;
|
|
1703
|
+
if (!_context17.t3) {
|
|
1704
|
+
_context17.next = 39;
|
|
1676
1705
|
break;
|
|
1677
1706
|
}
|
|
1678
|
-
_context17.
|
|
1707
|
+
_context17.next = 39;
|
|
1679
1708
|
return _ServiceLocator.Services.store.dispatch((0, _Actions.showProductionMethodChangeConfirm)());
|
|
1680
|
-
case
|
|
1681
|
-
_context17.
|
|
1709
|
+
case 39:
|
|
1710
|
+
_context17.next = 44;
|
|
1682
1711
|
break;
|
|
1683
|
-
case
|
|
1684
|
-
_context17.
|
|
1685
|
-
|
|
1686
|
-
return _context17.
|
|
1687
|
-
case
|
|
1712
|
+
case 41:
|
|
1713
|
+
_context17.prev = 41;
|
|
1714
|
+
_context17.t4 = _context17["catch"](34);
|
|
1715
|
+
return _context17.abrupt("return");
|
|
1716
|
+
case 44:
|
|
1688
1717
|
oldDesignProductionMethod = (0, _Selectors.getSelectedDesignProductionMethod)(state);
|
|
1689
1718
|
_ServiceLocator.Services.store.dispatch((0, _Actions.setDesignProductionMethod)(identifier));
|
|
1690
1719
|
if ((0, _Selectors.isCanvasUpdateRequired)((0, _Selectors.getSelectedDesignArea)(state), selectedDesignProduction)) {
|
|
@@ -1695,12 +1724,13 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
1695
1724
|
this.removeBulkNameItems(designData);
|
|
1696
1725
|
!(0, _Selectors.isBulkNamesSelected)(_ServiceLocator.Services.store.state.configurator) && _ServiceLocator.Services.configurator.clearBulkNames();
|
|
1697
1726
|
}
|
|
1698
|
-
_context17.
|
|
1727
|
+
_context17.next = 51;
|
|
1699
1728
|
return this.updateObjectsAfterProductionMethodChange(oldDesignProductionMethod, selectedDesignProduction);
|
|
1700
|
-
case
|
|
1701
|
-
|
|
1729
|
+
case 51:
|
|
1730
|
+
case "end":
|
|
1731
|
+
return _context17.stop();
|
|
1702
1732
|
}
|
|
1703
|
-
}, _callee17, this, [[
|
|
1733
|
+
}, _callee17, this, [[10, 17], [20, 29], [34, 41]]);
|
|
1704
1734
|
}));
|
|
1705
1735
|
function setDesignProductionMethod(_x18) {
|
|
1706
1736
|
return _setDesignProductionMethod2.apply(this, arguments);
|
|
@@ -1747,10 +1777,10 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
1747
1777
|
}, {
|
|
1748
1778
|
key: "setColorAmount",
|
|
1749
1779
|
value: function () {
|
|
1750
|
-
var _setColorAmount2 = _asyncToGenerator(/*#__PURE__*/
|
|
1751
|
-
var currentColorCount, colorCount
|
|
1752
|
-
return
|
|
1753
|
-
while (1) switch (_context18.
|
|
1780
|
+
var _setColorAmount2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(maxColorCount) {
|
|
1781
|
+
var currentColorCount, colorCount;
|
|
1782
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
1783
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
1754
1784
|
case 0:
|
|
1755
1785
|
// check the current color usage before applying the selected color count
|
|
1756
1786
|
// so if the color count is more than the selected maxColorCount the user can decide to
|
|
@@ -1759,25 +1789,26 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
1759
1789
|
currentColorCount = (0, _Selectors.getSelectedDesignAreaProperties)(_ServiceLocator.Services.store.state).colorAmount;
|
|
1760
1790
|
colorCount = (0, _Selectors.getColors)(_ServiceLocator.Services.store.state).length;
|
|
1761
1791
|
if (!(maxColorCount && colorCount > maxColorCount && !isWidget(location.pathname) && (0, _configuration.getConf)('displayColorAmountWarnings', true))) {
|
|
1762
|
-
_context18.
|
|
1792
|
+
_context18.next = 11;
|
|
1763
1793
|
break;
|
|
1764
1794
|
}
|
|
1765
|
-
_context18.
|
|
1766
|
-
_context18.
|
|
1795
|
+
_context18.prev = 3;
|
|
1796
|
+
_context18.next = 6;
|
|
1767
1797
|
return _ServiceLocator.Services.store.dispatch((0, _Actions.showMaxColorChangeConfirm)(colorCount, maxColorCount, currentColorCount));
|
|
1768
|
-
case
|
|
1769
|
-
_context18.
|
|
1798
|
+
case 6:
|
|
1799
|
+
_context18.next = 11;
|
|
1770
1800
|
break;
|
|
1771
|
-
case
|
|
1772
|
-
_context18.
|
|
1773
|
-
|
|
1774
|
-
return _context18.
|
|
1775
|
-
case
|
|
1801
|
+
case 8:
|
|
1802
|
+
_context18.prev = 8;
|
|
1803
|
+
_context18.t0 = _context18["catch"](3);
|
|
1804
|
+
return _context18.abrupt("return");
|
|
1805
|
+
case 11:
|
|
1776
1806
|
_ServiceLocator.Services.store.dispatch((0, _Actions.setColorAmount)(maxColorCount));
|
|
1777
|
-
case
|
|
1778
|
-
|
|
1807
|
+
case 12:
|
|
1808
|
+
case "end":
|
|
1809
|
+
return _context18.stop();
|
|
1779
1810
|
}
|
|
1780
|
-
}, _callee18, null, [[
|
|
1811
|
+
}, _callee18, null, [[3, 8]]);
|
|
1781
1812
|
}));
|
|
1782
1813
|
function setColorAmount(_x19) {
|
|
1783
1814
|
return _setColorAmount2.apply(this, arguments);
|
|
@@ -1791,42 +1822,43 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
1791
1822
|
*/
|
|
1792
1823
|
}, {
|
|
1793
1824
|
key: "updateVisualization",
|
|
1794
|
-
value:
|
|
1795
|
-
var _updateVisualization = _asyncToGenerator(/*#__PURE__*/
|
|
1825
|
+
value: function () {
|
|
1826
|
+
var _updateVisualization = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
|
|
1796
1827
|
var updateEventObject,
|
|
1797
1828
|
isDesignAreaSelected,
|
|
1798
1829
|
isDesignerOpen,
|
|
1799
1830
|
isScreenshotEvent,
|
|
1800
1831
|
drawingFunction,
|
|
1801
1832
|
_args19 = arguments;
|
|
1802
|
-
return
|
|
1803
|
-
while (1) switch (_context19.
|
|
1833
|
+
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
|
1834
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
1804
1835
|
case 0:
|
|
1805
1836
|
updateEventObject = _args19.length > 0 && _args19[0] !== undefined ? _args19[0] : {};
|
|
1806
1837
|
if (_ServiceLocator.Services.visualization.isReadyToRender()) {
|
|
1807
|
-
_context19.
|
|
1838
|
+
_context19.next = 3;
|
|
1808
1839
|
break;
|
|
1809
1840
|
}
|
|
1810
|
-
return _context19.
|
|
1811
|
-
case
|
|
1841
|
+
return _context19.abrupt("return");
|
|
1842
|
+
case 3:
|
|
1812
1843
|
if (_ServiceLocator.Services.visualization.isReadyToRenderCustomDesign()) {
|
|
1813
|
-
_context19.
|
|
1844
|
+
_context19.next = 6;
|
|
1814
1845
|
break;
|
|
1815
1846
|
}
|
|
1816
1847
|
_ServiceLocator.Services.visualization.render();
|
|
1817
|
-
return _context19.
|
|
1818
|
-
case
|
|
1848
|
+
return _context19.abrupt("return");
|
|
1849
|
+
case 6:
|
|
1819
1850
|
isDesignAreaSelected = !!(0, _Selectors.getSelectedDesignArea)(_ServiceLocator.Services.store.state).identifier;
|
|
1820
1851
|
isDesignerOpen = isDesignAreaSelected && _ServiceLocator.Services.ui.isVisible('designer');
|
|
1821
1852
|
isScreenshotEvent = (0, _get2["default"])(updateEventObject, 'data.screenshot');
|
|
1822
1853
|
drawingFunction = isDesignerOpen && !isScreenshotEvent && !this.isInPreviewMode ? this.redrawEmptyAreas : this.redrawAllDesignAreas;
|
|
1823
|
-
_context19.
|
|
1854
|
+
_context19.next = 12;
|
|
1824
1855
|
return _ServiceLocator.Services.visualization.updateTexture({
|
|
1825
1856
|
updateEventObject: updateEventObject,
|
|
1826
1857
|
drawingFunction: drawingFunction.bind(this)
|
|
1827
1858
|
});
|
|
1828
|
-
case
|
|
1829
|
-
|
|
1859
|
+
case 12:
|
|
1860
|
+
case "end":
|
|
1861
|
+
return _context19.stop();
|
|
1830
1862
|
}
|
|
1831
1863
|
}, _callee19, this);
|
|
1832
1864
|
}));
|
|
@@ -1834,7 +1866,7 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
1834
1866
|
return _updateVisualization.apply(this, arguments);
|
|
1835
1867
|
}
|
|
1836
1868
|
return updateVisualization;
|
|
1837
|
-
}()
|
|
1869
|
+
}()
|
|
1838
1870
|
}, {
|
|
1839
1871
|
key: "getFontSizeMin",
|
|
1840
1872
|
value: function getFontSizeMin() {
|
|
@@ -1849,8 +1881,8 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
1849
1881
|
*/
|
|
1850
1882
|
}, {
|
|
1851
1883
|
key: "redrawAllDesignAreas",
|
|
1852
|
-
value:
|
|
1853
|
-
var _redrawAllDesignAreas = _asyncToGenerator(/*#__PURE__*/
|
|
1884
|
+
value: function () {
|
|
1885
|
+
var _redrawAllDesignAreas = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(getDrawingContext, updateEventObject) {
|
|
1854
1886
|
var _this8 = this;
|
|
1855
1887
|
var options,
|
|
1856
1888
|
state,
|
|
@@ -1859,10 +1891,9 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
1859
1891
|
variantIdentifier,
|
|
1860
1892
|
effectEnabled,
|
|
1861
1893
|
drawingFn,
|
|
1862
|
-
_args22 = arguments
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
while (1) switch (_context22.p = _context22.n) {
|
|
1894
|
+
_args22 = arguments;
|
|
1895
|
+
return _regeneratorRuntime().wrap(function _callee21$(_context22) {
|
|
1896
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
1866
1897
|
case 0:
|
|
1867
1898
|
options = _args22.length > 2 && _args22[2] !== undefined ? _args22[2] : {};
|
|
1868
1899
|
state = _ServiceLocator.Services.store.state;
|
|
@@ -1876,7 +1907,7 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
1876
1907
|
variantIdentifier = (0, _get2["default"])(updateEventObject, 'data.variant', false);
|
|
1877
1908
|
effectEnabled = !(0, _Selectors3.isDesignerProductPreviewMode)();
|
|
1878
1909
|
drawingFn = /*#__PURE__*/function () {
|
|
1879
|
-
var _ref17 = _asyncToGenerator(/*#__PURE__*/
|
|
1910
|
+
var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(textureCtx, getTextureBuilder) {
|
|
1880
1911
|
var designAreas,
|
|
1881
1912
|
_getTextureBuilder,
|
|
1882
1913
|
getTextureImage,
|
|
@@ -1897,49 +1928,47 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
1897
1928
|
_iterator0,
|
|
1898
1929
|
_step0,
|
|
1899
1930
|
_loop,
|
|
1900
|
-
_args21 = arguments
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
return _regenerator().w(function (_context21) {
|
|
1904
|
-
while (1) switch (_context21.p = _context21.n) {
|
|
1931
|
+
_args21 = arguments;
|
|
1932
|
+
return _regeneratorRuntime().wrap(function _callee20$(_context21) {
|
|
1933
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
1905
1934
|
case 0:
|
|
1906
1935
|
designAreas = _args21.length > 2 && _args21[2] !== undefined ? _args21[2] : _this8.getDesignAreas();
|
|
1907
1936
|
_getTextureBuilder = getTextureBuilder(textureBuilderConfig), getTextureImage = _getTextureBuilder.getTextureImage, drawCanvasToArea = _getTextureBuilder.drawCanvasToArea, drawCanvasToAreaDirect = _getTextureBuilder.drawCanvasToAreaDirect, highlightDesignArea = _getTextureBuilder.highlightDesignArea, drawOn = _getTextureBuilder.drawOn, getParams = _getTextureBuilder.getParams;
|
|
1908
1937
|
if (getTextureImage()) {
|
|
1909
|
-
_context21.
|
|
1938
|
+
_context21.next = 5;
|
|
1910
1939
|
break;
|
|
1911
1940
|
}
|
|
1912
1941
|
// eslint-disable-next-line no-console
|
|
1913
1942
|
console.warn('Texture image is missing!', designAreas);
|
|
1914
|
-
return _context21.
|
|
1915
|
-
case
|
|
1943
|
+
return _context21.abrupt("return");
|
|
1944
|
+
case 5:
|
|
1916
1945
|
if (!showHighlight) {
|
|
1917
|
-
_context21.
|
|
1946
|
+
_context21.next = 40;
|
|
1918
1947
|
break;
|
|
1919
1948
|
}
|
|
1920
1949
|
_iterator9 = _createForOfIteratorHelper(designAreas);
|
|
1921
|
-
_context21.
|
|
1950
|
+
_context21.prev = 7;
|
|
1922
1951
|
_iterator9.s();
|
|
1923
|
-
case
|
|
1952
|
+
case 9:
|
|
1924
1953
|
if ((_step9 = _iterator9.n()).done) {
|
|
1925
|
-
_context21.
|
|
1954
|
+
_context21.next = 32;
|
|
1926
1955
|
break;
|
|
1927
1956
|
}
|
|
1928
1957
|
designArea = _step9.value;
|
|
1929
1958
|
canvas = _this8._getCanvas(_this8.getDesignAreaByIdentifier(designArea.identifier));
|
|
1930
1959
|
if (canvas) {
|
|
1931
|
-
_context21.
|
|
1960
|
+
_context21.next = 14;
|
|
1932
1961
|
break;
|
|
1933
1962
|
}
|
|
1934
|
-
return _context21.
|
|
1935
|
-
case
|
|
1936
|
-
_context21.
|
|
1963
|
+
return _context21.abrupt("continue", 30);
|
|
1964
|
+
case 14:
|
|
1965
|
+
_context21.next = 16;
|
|
1937
1966
|
return (0, _ObjectLock.requestLock)(canvas);
|
|
1938
|
-
case
|
|
1939
|
-
releaseLock = _context21.
|
|
1967
|
+
case 16:
|
|
1968
|
+
releaseLock = _context21.sent;
|
|
1940
1969
|
maskHandler = canvas.getMaskHandler();
|
|
1941
1970
|
if (!((0, _Selectors.designAreaAppliesMask)(state, designArea) && maskHandler)) {
|
|
1942
|
-
_context21.
|
|
1971
|
+
_context21.next = 28;
|
|
1943
1972
|
break;
|
|
1944
1973
|
}
|
|
1945
1974
|
restoreOutlineVisibility = maskHandler.toggleOutline(true, {
|
|
@@ -1952,55 +1981,55 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
1952
1981
|
});
|
|
1953
1982
|
restoreOutlineOnly = maskHandler.showOutlineOnly();
|
|
1954
1983
|
drawToContext = canvas.drawToContext.bind(canvas);
|
|
1955
|
-
_context21.
|
|
1984
|
+
_context21.next = 24;
|
|
1956
1985
|
return drawCanvasToAreaDirect({
|
|
1957
1986
|
drawToContext: drawToContext,
|
|
1958
1987
|
designArea: designArea
|
|
1959
1988
|
});
|
|
1960
|
-
case
|
|
1989
|
+
case 24:
|
|
1961
1990
|
restoreOutlineVisibility === null || restoreOutlineVisibility === void 0 || restoreOutlineVisibility();
|
|
1962
1991
|
restoreOutlineOnly === null || restoreOutlineOnly === void 0 || restoreOutlineOnly();
|
|
1963
|
-
_context21.
|
|
1992
|
+
_context21.next = 29;
|
|
1964
1993
|
break;
|
|
1965
|
-
case
|
|
1994
|
+
case 28:
|
|
1966
1995
|
highlightDesignArea(designArea);
|
|
1967
|
-
case
|
|
1996
|
+
case 29:
|
|
1968
1997
|
releaseLock();
|
|
1969
|
-
case
|
|
1970
|
-
_context21.
|
|
1998
|
+
case 30:
|
|
1999
|
+
_context21.next = 9;
|
|
1971
2000
|
break;
|
|
1972
|
-
case
|
|
1973
|
-
_context21.
|
|
2001
|
+
case 32:
|
|
2002
|
+
_context21.next = 37;
|
|
1974
2003
|
break;
|
|
1975
|
-
case
|
|
1976
|
-
_context21.
|
|
1977
|
-
|
|
1978
|
-
_iterator9.e(
|
|
1979
|
-
case
|
|
1980
|
-
_context21.
|
|
2004
|
+
case 34:
|
|
2005
|
+
_context21.prev = 34;
|
|
2006
|
+
_context21.t0 = _context21["catch"](7);
|
|
2007
|
+
_iterator9.e(_context21.t0);
|
|
2008
|
+
case 37:
|
|
2009
|
+
_context21.prev = 37;
|
|
1981
2010
|
_iterator9.f();
|
|
1982
|
-
return _context21.
|
|
1983
|
-
case
|
|
2011
|
+
return _context21.finish(37);
|
|
2012
|
+
case 40:
|
|
1984
2013
|
_iterator0 = _createForOfIteratorHelper(designAreas);
|
|
1985
|
-
_context21.
|
|
1986
|
-
_loop = /*#__PURE__*/
|
|
2014
|
+
_context21.prev = 41;
|
|
2015
|
+
_loop = /*#__PURE__*/_regeneratorRuntime().mark(function _loop() {
|
|
1987
2016
|
var _canvas$getColorOverl, _canvas$getMaskHandle;
|
|
1988
2017
|
var designArea, canvas, releaseLock, selectedObject, restoreColorOverlayVisibility, restoreOutlineVisibility, drawToContext, getSvg;
|
|
1989
|
-
return
|
|
1990
|
-
while (1) switch (_context20.
|
|
2018
|
+
return _regeneratorRuntime().wrap(function _loop$(_context20) {
|
|
2019
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
1991
2020
|
case 0:
|
|
1992
2021
|
designArea = _step0.value;
|
|
1993
2022
|
canvas = _this8._getCanvas(_this8.getDesignAreaByIdentifier(designArea.identifier));
|
|
1994
2023
|
if (canvas) {
|
|
1995
|
-
_context20.
|
|
2024
|
+
_context20.next = 4;
|
|
1996
2025
|
break;
|
|
1997
2026
|
}
|
|
1998
|
-
return _context20.
|
|
1999
|
-
case
|
|
2000
|
-
_context20.
|
|
2027
|
+
return _context20.abrupt("return", 1);
|
|
2028
|
+
case 4:
|
|
2029
|
+
_context20.next = 6;
|
|
2001
2030
|
return (0, _ObjectLock.requestLock)(canvas);
|
|
2002
|
-
case
|
|
2003
|
-
releaseLock = _context20.
|
|
2031
|
+
case 6:
|
|
2032
|
+
releaseLock = _context20.sent;
|
|
2004
2033
|
selectedObject = (0, _get2["default"])(canvas, 'selectedObject');
|
|
2005
2034
|
if (selectedObject) {
|
|
2006
2035
|
selectedObject.selected = false;
|
|
@@ -2011,88 +2040,92 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
2011
2040
|
getSvg = function getSvg() {
|
|
2012
2041
|
return canvas.getScreenshot((0, _Selectors4.getFontMapping)(state));
|
|
2013
2042
|
};
|
|
2014
|
-
_context20.
|
|
2043
|
+
_context20.next = 15;
|
|
2015
2044
|
return drawCanvasToArea(_objectSpread({
|
|
2016
2045
|
drawToContext: drawToContext,
|
|
2017
2046
|
designArea: designArea,
|
|
2018
2047
|
getSvg: getSvg
|
|
2019
2048
|
}, effectEnabled && (0, _Selectors.getVisualizationEffectWithOptions)(state, designArea, variantIdentifier)));
|
|
2020
|
-
case
|
|
2049
|
+
case 15:
|
|
2021
2050
|
restoreColorOverlayVisibility === null || restoreColorOverlayVisibility === void 0 || restoreColorOverlayVisibility();
|
|
2022
2051
|
restoreOutlineVisibility === null || restoreOutlineVisibility === void 0 || restoreOutlineVisibility();
|
|
2023
2052
|
releaseLock();
|
|
2024
|
-
case
|
|
2025
|
-
|
|
2053
|
+
case 18:
|
|
2054
|
+
case "end":
|
|
2055
|
+
return _context20.stop();
|
|
2026
2056
|
}
|
|
2027
2057
|
}, _loop);
|
|
2028
2058
|
});
|
|
2029
2059
|
_iterator0.s();
|
|
2030
|
-
case
|
|
2060
|
+
case 44:
|
|
2031
2061
|
if ((_step0 = _iterator0.n()).done) {
|
|
2032
|
-
_context21.
|
|
2062
|
+
_context21.next = 50;
|
|
2033
2063
|
break;
|
|
2034
2064
|
}
|
|
2035
|
-
return _context21.
|
|
2036
|
-
case
|
|
2037
|
-
if (!_context21.
|
|
2038
|
-
_context21.
|
|
2065
|
+
return _context21.delegateYield(_loop(), "t1", 46);
|
|
2066
|
+
case 46:
|
|
2067
|
+
if (!_context21.t1) {
|
|
2068
|
+
_context21.next = 48;
|
|
2039
2069
|
break;
|
|
2040
2070
|
}
|
|
2041
|
-
return _context21.
|
|
2042
|
-
case
|
|
2043
|
-
_context21.
|
|
2071
|
+
return _context21.abrupt("continue", 48);
|
|
2072
|
+
case 48:
|
|
2073
|
+
_context21.next = 44;
|
|
2044
2074
|
break;
|
|
2045
|
-
case
|
|
2046
|
-
_context21.
|
|
2075
|
+
case 50:
|
|
2076
|
+
_context21.next = 55;
|
|
2047
2077
|
break;
|
|
2048
|
-
case
|
|
2049
|
-
_context21.
|
|
2050
|
-
|
|
2051
|
-
_iterator0.e(
|
|
2052
|
-
case
|
|
2053
|
-
_context21.
|
|
2078
|
+
case 52:
|
|
2079
|
+
_context21.prev = 52;
|
|
2080
|
+
_context21.t2 = _context21["catch"](41);
|
|
2081
|
+
_iterator0.e(_context21.t2);
|
|
2082
|
+
case 55:
|
|
2083
|
+
_context21.prev = 55;
|
|
2054
2084
|
_iterator0.f();
|
|
2055
|
-
return _context21.
|
|
2056
|
-
case
|
|
2085
|
+
return _context21.finish(55);
|
|
2086
|
+
case 58:
|
|
2057
2087
|
drawOn(textureCtx);
|
|
2058
|
-
case
|
|
2059
|
-
|
|
2088
|
+
case 59:
|
|
2089
|
+
case "end":
|
|
2090
|
+
return _context21.stop();
|
|
2060
2091
|
}
|
|
2061
|
-
}, _callee20, null, [[
|
|
2092
|
+
}, _callee20, null, [[7, 34, 37, 40], [41, 52, 55, 58]]);
|
|
2062
2093
|
}));
|
|
2063
2094
|
return function drawingFn(_x22, _x23) {
|
|
2064
2095
|
return _ref17.apply(this, arguments);
|
|
2065
2096
|
};
|
|
2066
2097
|
}();
|
|
2067
|
-
_context22.
|
|
2068
|
-
_context22.
|
|
2098
|
+
_context22.prev = 7;
|
|
2099
|
+
_context22.next = 10;
|
|
2069
2100
|
return getDrawingContext(drawingFn, true /* update alpha */, true /* clean up texture before drawing */);
|
|
2070
|
-
case
|
|
2071
|
-
_context22.
|
|
2101
|
+
case 10:
|
|
2102
|
+
_context22.next = 15;
|
|
2072
2103
|
break;
|
|
2073
|
-
case
|
|
2074
|
-
_context22.
|
|
2075
|
-
|
|
2104
|
+
case 12:
|
|
2105
|
+
_context22.prev = 12;
|
|
2106
|
+
_context22.t0 = _context22["catch"](7);
|
|
2076
2107
|
// eslint-disable-next-line no-console
|
|
2077
|
-
console.warn('Could not get drawing context, texture update is skipped!',
|
|
2078
|
-
case
|
|
2079
|
-
|
|
2108
|
+
console.warn('Could not get drawing context, texture update is skipped!', _context22.t0.message);
|
|
2109
|
+
case 15:
|
|
2110
|
+
case "end":
|
|
2111
|
+
return _context22.stop();
|
|
2080
2112
|
}
|
|
2081
|
-
}, _callee21, null, [[
|
|
2113
|
+
}, _callee21, null, [[7, 12]]);
|
|
2082
2114
|
}));
|
|
2083
2115
|
function redrawAllDesignAreas(_x20, _x21) {
|
|
2084
2116
|
return _redrawAllDesignAreas.apply(this, arguments);
|
|
2085
2117
|
}
|
|
2086
2118
|
return redrawAllDesignAreas;
|
|
2087
|
-
}()
|
|
2119
|
+
}()
|
|
2088
2120
|
}, {
|
|
2089
2121
|
key: "redrawEmptyAreas",
|
|
2090
2122
|
value: function redrawEmptyAreas(getDrawingContext) {
|
|
2091
|
-
getDrawingContext(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
2092
|
-
return
|
|
2093
|
-
while (1) switch (_context23.
|
|
2123
|
+
getDrawingContext( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
|
|
2124
|
+
return _regeneratorRuntime().wrap(function _callee22$(_context23) {
|
|
2125
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
2094
2126
|
case 0:
|
|
2095
|
-
|
|
2127
|
+
case "end":
|
|
2128
|
+
return _context23.stop();
|
|
2096
2129
|
}
|
|
2097
2130
|
}, _callee22);
|
|
2098
2131
|
})), true /* update alpha */, true /* clean up texture before drawing */);
|
|
@@ -2132,18 +2165,18 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
2132
2165
|
}, {
|
|
2133
2166
|
key: "getScreenshots",
|
|
2134
2167
|
value: function () {
|
|
2135
|
-
var _getScreenshots = _asyncToGenerator(/*#__PURE__*/
|
|
2168
|
+
var _getScreenshots = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(fontMapping) {
|
|
2136
2169
|
var _this0 = this;
|
|
2137
2170
|
var options,
|
|
2138
2171
|
_options$screenshotFn,
|
|
2139
2172
|
screenshotFn,
|
|
2140
2173
|
_args25 = arguments;
|
|
2141
|
-
return
|
|
2142
|
-
while (1) switch (_context25.
|
|
2174
|
+
return _regeneratorRuntime().wrap(function _callee24$(_context25) {
|
|
2175
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
2143
2176
|
case 0:
|
|
2144
2177
|
options = _args25.length > 1 && _args25[1] !== undefined ? _args25[1] : {};
|
|
2145
2178
|
_options$screenshotFn = options.screenshotFn, screenshotFn = _options$screenshotFn === void 0 ? 'getScreenshot' : _options$screenshotFn;
|
|
2146
|
-
_context25.
|
|
2179
|
+
_context25.next = 4;
|
|
2147
2180
|
return Promise.all(this.getDesignAreas().map(function (area) {
|
|
2148
2181
|
return {
|
|
2149
2182
|
id: area.identifier,
|
|
@@ -2152,30 +2185,33 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
2152
2185
|
}).filter(function (_ref20) {
|
|
2153
2186
|
var canvas = _ref20.canvas;
|
|
2154
2187
|
return canvas && canvas[screenshotFn] && canvas.objects && canvas.objects.length > 0;
|
|
2155
|
-
}).map(/*#__PURE__*/function () {
|
|
2156
|
-
var _ref22 = _asyncToGenerator(/*#__PURE__*/
|
|
2188
|
+
}).map( /*#__PURE__*/function () {
|
|
2189
|
+
var _ref22 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(_ref21) {
|
|
2157
2190
|
var _canvas$getMaskHandle2, _canvas$getColorOverl2;
|
|
2158
|
-
var id, canvas, releaseLock, restoreOutlineVisibility, restoreColorOverlayVisibility, result
|
|
2159
|
-
return
|
|
2160
|
-
while (1) switch (_context24.
|
|
2191
|
+
var id, canvas, releaseLock, restoreOutlineVisibility, restoreColorOverlayVisibility, result;
|
|
2192
|
+
return _regeneratorRuntime().wrap(function _callee23$(_context24) {
|
|
2193
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
2161
2194
|
case 0:
|
|
2162
2195
|
id = _ref21.id, canvas = _ref21.canvas;
|
|
2163
|
-
_context24.
|
|
2196
|
+
_context24.next = 3;
|
|
2164
2197
|
return (0, _ObjectLock.requestLock)(canvas);
|
|
2165
|
-
case
|
|
2166
|
-
releaseLock = _context24.
|
|
2198
|
+
case 3:
|
|
2199
|
+
releaseLock = _context24.sent;
|
|
2167
2200
|
restoreOutlineVisibility = (_canvas$getMaskHandle2 = canvas.getMaskHandler()) === null || _canvas$getMaskHandle2 === void 0 ? void 0 : _canvas$getMaskHandle2.toggleOutline(false);
|
|
2168
2201
|
restoreColorOverlayVisibility = (_canvas$getColorOverl2 = canvas.getColorOverlay()) === null || _canvas$getColorOverl2 === void 0 ? void 0 : _canvas$getColorOverl2.toggle(false);
|
|
2169
|
-
|
|
2170
|
-
_context24.
|
|
2202
|
+
_context24.t0 = id;
|
|
2203
|
+
_context24.next = 9;
|
|
2171
2204
|
return canvas[screenshotFn](fontMapping);
|
|
2172
|
-
case
|
|
2173
|
-
|
|
2174
|
-
result = [
|
|
2205
|
+
case 9:
|
|
2206
|
+
_context24.t1 = _context24.sent;
|
|
2207
|
+
result = [_context24.t0, _context24.t1];
|
|
2175
2208
|
restoreOutlineVisibility === null || restoreOutlineVisibility === void 0 || restoreOutlineVisibility();
|
|
2176
2209
|
restoreColorOverlayVisibility === null || restoreColorOverlayVisibility === void 0 || restoreColorOverlayVisibility();
|
|
2177
2210
|
releaseLock();
|
|
2178
|
-
return _context24.
|
|
2211
|
+
return _context24.abrupt("return", result);
|
|
2212
|
+
case 15:
|
|
2213
|
+
case "end":
|
|
2214
|
+
return _context24.stop();
|
|
2179
2215
|
}
|
|
2180
2216
|
}, _callee23);
|
|
2181
2217
|
}));
|
|
@@ -2183,13 +2219,16 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
2183
2219
|
return _ref22.apply(this, arguments);
|
|
2184
2220
|
};
|
|
2185
2221
|
}()));
|
|
2186
|
-
case
|
|
2187
|
-
return _context25.
|
|
2222
|
+
case 4:
|
|
2223
|
+
return _context25.abrupt("return", _context25.sent.reduce(function (screenShots, _ref23) {
|
|
2188
2224
|
var _ref24 = _slicedToArray(_ref23, 2),
|
|
2189
2225
|
id = _ref24[0],
|
|
2190
2226
|
screenshot = _ref24[1];
|
|
2191
2227
|
return _objectSpread(_objectSpread({}, screenShots), {}, _defineProperty({}, id, screenshot));
|
|
2192
2228
|
}, {}));
|
|
2229
|
+
case 5:
|
|
2230
|
+
case "end":
|
|
2231
|
+
return _context25.stop();
|
|
2193
2232
|
}
|
|
2194
2233
|
}, _callee24, this);
|
|
2195
2234
|
}));
|
|
@@ -2201,16 +2240,19 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
2201
2240
|
}, {
|
|
2202
2241
|
key: "getScreenshotsOfElements",
|
|
2203
2242
|
value: function () {
|
|
2204
|
-
var _getScreenshotsOfElements = _asyncToGenerator(/*#__PURE__*/
|
|
2205
|
-
return
|
|
2206
|
-
while (1) switch (_context26.
|
|
2243
|
+
var _getScreenshotsOfElements = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(fontMapping) {
|
|
2244
|
+
return _regeneratorRuntime().wrap(function _callee25$(_context26) {
|
|
2245
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
2207
2246
|
case 0:
|
|
2208
|
-
_context26.
|
|
2247
|
+
_context26.next = 2;
|
|
2209
2248
|
return this.getScreenshots(fontMapping, {
|
|
2210
2249
|
screenshotFn: 'getScreenshotsOfElements'
|
|
2211
2250
|
});
|
|
2212
|
-
case
|
|
2213
|
-
return _context26.
|
|
2251
|
+
case 2:
|
|
2252
|
+
return _context26.abrupt("return", _context26.sent);
|
|
2253
|
+
case 3:
|
|
2254
|
+
case "end":
|
|
2255
|
+
return _context26.stop();
|
|
2214
2256
|
}
|
|
2215
2257
|
}, _callee25, this);
|
|
2216
2258
|
}));
|
|
@@ -2287,24 +2329,24 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
2287
2329
|
}, {
|
|
2288
2330
|
key: "addSampleImageForDesignAreas",
|
|
2289
2331
|
value: function () {
|
|
2290
|
-
var _addSampleImageForDesignAreas = _asyncToGenerator(/*#__PURE__*/
|
|
2332
|
+
var _addSampleImageForDesignAreas = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(designAreaIdentifiers, active) {
|
|
2291
2333
|
var _this10 = this;
|
|
2292
|
-
return
|
|
2293
|
-
while (1) switch (_context28.
|
|
2334
|
+
return _regeneratorRuntime().wrap(function _callee27$(_context28) {
|
|
2335
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
2294
2336
|
case 0:
|
|
2295
|
-
_context28.
|
|
2296
|
-
return Promise.all(designAreaIdentifiers.map(/*#__PURE__*/function () {
|
|
2297
|
-
var _ref25 = _asyncToGenerator(/*#__PURE__*/
|
|
2337
|
+
_context28.next = 2;
|
|
2338
|
+
return Promise.all(designAreaIdentifiers.map( /*#__PURE__*/function () {
|
|
2339
|
+
var _ref25 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(designAreaIdentifier) {
|
|
2298
2340
|
var designArea, canvas, state, imageSrc, imageData, canvasDataJSON, designData, canvasData, objects;
|
|
2299
|
-
return
|
|
2300
|
-
while (1) switch (_context27.
|
|
2341
|
+
return _regeneratorRuntime().wrap(function _callee26$(_context27) {
|
|
2342
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
2301
2343
|
case 0:
|
|
2302
2344
|
designArea = _this10.getDesignAreaByIdentifier(designAreaIdentifier);
|
|
2303
2345
|
canvas = _this10._getCanvas(designArea);
|
|
2304
2346
|
state = _ServiceLocator.Services.store.state;
|
|
2305
2347
|
imageSrc = _designer_placeholder_logo["default"];
|
|
2306
2348
|
if (!active) {
|
|
2307
|
-
_context27.
|
|
2349
|
+
_context27.next = 13;
|
|
2308
2350
|
break;
|
|
2309
2351
|
}
|
|
2310
2352
|
imageData = (0, _Modifiers2.createSVGImageData)({
|
|
@@ -2314,38 +2356,41 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
2314
2356
|
isPlaceHolderImage: true,
|
|
2315
2357
|
galleryImage: false
|
|
2316
2358
|
});
|
|
2317
|
-
_context27.
|
|
2359
|
+
_context27.next = 8;
|
|
2318
2360
|
return _ServiceLocator.Services.designer.addImageFromUrl(canvas, (0, _Selectors2.getPreviewUrlFromImageData)(imageData.preview), imageData, {
|
|
2319
2361
|
enlargeImage: true
|
|
2320
2362
|
});
|
|
2321
|
-
case
|
|
2363
|
+
case 8:
|
|
2322
2364
|
canvasDataJSON = _this10.calculateObjectPosition(canvas); // eslint-disable-next-line no-console
|
|
2323
2365
|
console.log("Sample image added to canvas: ".concat(designAreaIdentifier));
|
|
2324
2366
|
_this10.setCanvasData(canvasDataJSON, designAreaIdentifier);
|
|
2325
|
-
_context27.
|
|
2367
|
+
_context27.next = 21;
|
|
2326
2368
|
break;
|
|
2327
|
-
case
|
|
2369
|
+
case 13:
|
|
2328
2370
|
designData = (0, _Selectors.getDesignDataByDesignAreaIdentifier)(state, designAreaIdentifier);
|
|
2329
2371
|
canvasData = designData.canvasData;
|
|
2330
2372
|
if (canvasData) {
|
|
2331
|
-
_context27.
|
|
2373
|
+
_context27.next = 17;
|
|
2332
2374
|
break;
|
|
2333
2375
|
}
|
|
2334
|
-
return _context27.
|
|
2335
|
-
case
|
|
2376
|
+
return _context27.abrupt("return");
|
|
2377
|
+
case 17:
|
|
2336
2378
|
objects = canvasData ? canvasData.objects.filter(function (obj) {
|
|
2337
2379
|
return obj.type === 'Text';
|
|
2338
2380
|
}) : [];
|
|
2339
2381
|
_this10.setCanvasData(_objectSpread(_objectSpread({}, canvasData), {}, {
|
|
2340
2382
|
objects: objects
|
|
2341
2383
|
}), designAreaIdentifier);
|
|
2342
|
-
_context27.
|
|
2384
|
+
_context27.next = 21;
|
|
2343
2385
|
return _this10.loadCanvasDataFromState([designArea]);
|
|
2344
|
-
case
|
|
2345
|
-
return _context27.
|
|
2386
|
+
case 21:
|
|
2387
|
+
return _context27.abrupt("return", {
|
|
2346
2388
|
canvas: canvas,
|
|
2347
2389
|
designAreaIdentifier: designAreaIdentifier
|
|
2348
2390
|
});
|
|
2391
|
+
case 22:
|
|
2392
|
+
case "end":
|
|
2393
|
+
return _context27.stop();
|
|
2349
2394
|
}
|
|
2350
2395
|
}, _callee26);
|
|
2351
2396
|
}));
|
|
@@ -2353,8 +2398,9 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
2353
2398
|
return _ref25.apply(this, arguments);
|
|
2354
2399
|
};
|
|
2355
2400
|
}()));
|
|
2356
|
-
case
|
|
2357
|
-
|
|
2401
|
+
case 2:
|
|
2402
|
+
case "end":
|
|
2403
|
+
return _context28.stop();
|
|
2358
2404
|
}
|
|
2359
2405
|
}, _callee27);
|
|
2360
2406
|
}));
|
|
@@ -2366,26 +2412,29 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
2366
2412
|
}, {
|
|
2367
2413
|
key: "addImageToDesignArea",
|
|
2368
2414
|
value: function () {
|
|
2369
|
-
var _addImageToDesignArea = _asyncToGenerator(/*#__PURE__*/
|
|
2415
|
+
var _addImageToDesignArea = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(designArea, imageData) {
|
|
2370
2416
|
var canvas;
|
|
2371
|
-
return
|
|
2372
|
-
while (1) switch (_context29.
|
|
2417
|
+
return _regeneratorRuntime().wrap(function _callee28$(_context29) {
|
|
2418
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
2373
2419
|
case 0:
|
|
2374
2420
|
canvas = this._getCanvas(designArea);
|
|
2375
2421
|
if (canvas) {
|
|
2376
|
-
_context29.
|
|
2422
|
+
_context29.next = 3;
|
|
2377
2423
|
break;
|
|
2378
2424
|
}
|
|
2379
|
-
return _context29.
|
|
2380
|
-
case
|
|
2381
|
-
_context29.
|
|
2425
|
+
return _context29.abrupt("return", false);
|
|
2426
|
+
case 3:
|
|
2427
|
+
_context29.next = 5;
|
|
2382
2428
|
return _ServiceLocator.Services.designer.addImageFromUrl(canvas, (0, _Selectors2.getPreviewUrlFromImageData)(imageData.preview), imageData, {
|
|
2383
2429
|
enlargeImage: true,
|
|
2384
2430
|
scaleToHalf: false,
|
|
2385
2431
|
autoSelect: false
|
|
2386
2432
|
});
|
|
2387
|
-
case
|
|
2388
|
-
return _context29.
|
|
2433
|
+
case 5:
|
|
2434
|
+
return _context29.abrupt("return", _context29.sent);
|
|
2435
|
+
case 6:
|
|
2436
|
+
case "end":
|
|
2437
|
+
return _context29.stop();
|
|
2389
2438
|
}
|
|
2390
2439
|
}, _callee28, this);
|
|
2391
2440
|
}));
|
|
@@ -2460,69 +2509,70 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
2460
2509
|
}, {
|
|
2461
2510
|
key: "setImageAndTextColor",
|
|
2462
2511
|
value: function () {
|
|
2463
|
-
var _setImageAndTextColor = _asyncToGenerator(/*#__PURE__*/
|
|
2464
|
-
var designArea, designData, objects, hasmultipleObjects, canvas, isImageSelected, selectedImageIdentifier, _iterator10, _step10, object, image, operations
|
|
2465
|
-
return
|
|
2466
|
-
while (1) switch (_context30.
|
|
2512
|
+
var _setImageAndTextColor = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(color) {
|
|
2513
|
+
var designArea, designData, objects, hasmultipleObjects, canvas, isImageSelected, selectedImageIdentifier, _iterator10, _step10, object, image, operations;
|
|
2514
|
+
return _regeneratorRuntime().wrap(function _callee29$(_context30) {
|
|
2515
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
2467
2516
|
case 0:
|
|
2468
2517
|
if (this.changeAllColorsNeeded()) {
|
|
2469
|
-
_context30.
|
|
2518
|
+
_context30.next = 2;
|
|
2470
2519
|
break;
|
|
2471
2520
|
}
|
|
2472
|
-
return _context30.
|
|
2473
|
-
case
|
|
2521
|
+
return _context30.abrupt("return");
|
|
2522
|
+
case 2:
|
|
2474
2523
|
designArea = (0, _Selectors.getSelectedDesignArea)(_ServiceLocator.Services.store.state);
|
|
2475
2524
|
designData = (0, _Selectors.getDesignDataByDesignAreaIdentifier)(_ServiceLocator.Services.store.state, designArea.identifier);
|
|
2476
2525
|
objects = (0, _get2["default"])(designData, 'canvasData.objects', []);
|
|
2477
2526
|
hasmultipleObjects = objects.length > 1;
|
|
2478
2527
|
if (hasmultipleObjects) {
|
|
2479
|
-
_context30.
|
|
2528
|
+
_context30.next = 8;
|
|
2480
2529
|
break;
|
|
2481
2530
|
}
|
|
2482
|
-
return _context30.
|
|
2483
|
-
case
|
|
2531
|
+
return _context30.abrupt("return");
|
|
2532
|
+
case 8:
|
|
2484
2533
|
canvas = this._getCanvas(designArea);
|
|
2485
2534
|
isImageSelected = canvas.selectedObject && canvas.selectedObject.type === 'Image';
|
|
2486
2535
|
selectedImageIdentifier = isImageSelected ? (0, _get2["default"])(_ServiceLocator.Services.store.state, 'imageGallery.selectedImage.identifier', null) : null;
|
|
2487
2536
|
_ServiceLocator.Services.store.dispatch((0, _Actions.setDesignAreaTextsColor)(designArea.identifier, color));
|
|
2488
2537
|
_iterator10 = _createForOfIteratorHelper(objects);
|
|
2489
|
-
_context30.
|
|
2538
|
+
_context30.prev = 13;
|
|
2490
2539
|
_iterator10.s();
|
|
2491
|
-
case
|
|
2540
|
+
case 15:
|
|
2492
2541
|
if ((_step10 = _iterator10.n()).done) {
|
|
2493
|
-
_context30.
|
|
2542
|
+
_context30.next = 24;
|
|
2494
2543
|
break;
|
|
2495
2544
|
}
|
|
2496
2545
|
object = _step10.value;
|
|
2497
2546
|
if (!(object.type === 'Image' && object.imageData.identifier !== selectedImageIdentifier)) {
|
|
2498
|
-
_context30.
|
|
2547
|
+
_context30.next = 22;
|
|
2499
2548
|
break;
|
|
2500
2549
|
}
|
|
2501
2550
|
image = (0, _Selectors2.getUserImage)(_ServiceLocator.Services.store.state, object.imageData.identifier);
|
|
2502
2551
|
operations = (0, _Modifiers.setColorOnOperations)(image.operations, color);
|
|
2503
|
-
_context30.
|
|
2552
|
+
_context30.next = 22;
|
|
2504
2553
|
return _ServiceLocator.Services.designData.editFile(operations, image);
|
|
2505
|
-
case
|
|
2506
|
-
_context30.
|
|
2554
|
+
case 22:
|
|
2555
|
+
_context30.next = 15;
|
|
2507
2556
|
break;
|
|
2508
|
-
case
|
|
2509
|
-
_context30.
|
|
2557
|
+
case 24:
|
|
2558
|
+
_context30.next = 29;
|
|
2510
2559
|
break;
|
|
2511
|
-
case
|
|
2512
|
-
_context30.
|
|
2513
|
-
|
|
2514
|
-
_iterator10.e(
|
|
2515
|
-
case
|
|
2516
|
-
_context30.
|
|
2560
|
+
case 26:
|
|
2561
|
+
_context30.prev = 26;
|
|
2562
|
+
_context30.t0 = _context30["catch"](13);
|
|
2563
|
+
_iterator10.e(_context30.t0);
|
|
2564
|
+
case 29:
|
|
2565
|
+
_context30.prev = 29;
|
|
2517
2566
|
_iterator10.f();
|
|
2518
|
-
return _context30.
|
|
2519
|
-
case
|
|
2520
|
-
_context30.
|
|
2567
|
+
return _context30.finish(29);
|
|
2568
|
+
case 32:
|
|
2569
|
+
_context30.next = 34;
|
|
2521
2570
|
return this.updateCanvasDataFromState([designArea]);
|
|
2522
|
-
case
|
|
2523
|
-
|
|
2571
|
+
case 34:
|
|
2572
|
+
case "end":
|
|
2573
|
+
return _context30.stop();
|
|
2524
2574
|
}
|
|
2525
|
-
}, _callee29, this, [[
|
|
2575
|
+
}, _callee29, this, [[13, 26, 29, 32]]);
|
|
2526
2576
|
}));
|
|
2527
2577
|
function setImageAndTextColor(_x32) {
|
|
2528
2578
|
return _setImageAndTextColor.apply(this, arguments);
|
|
@@ -2532,17 +2582,20 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
2532
2582
|
}, {
|
|
2533
2583
|
key: "getGalleryImageColors",
|
|
2534
2584
|
value: function () {
|
|
2535
|
-
var _getGalleryImageColors = _asyncToGenerator(/*#__PURE__*/
|
|
2585
|
+
var _getGalleryImageColors = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(url) {
|
|
2536
2586
|
var svgContent, designProductionMethod;
|
|
2537
|
-
return
|
|
2538
|
-
while (1) switch (_context31.
|
|
2587
|
+
return _regeneratorRuntime().wrap(function _callee30$(_context31) {
|
|
2588
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
2539
2589
|
case 0:
|
|
2540
|
-
_context31.
|
|
2590
|
+
_context31.next = 2;
|
|
2541
2591
|
return getSvgContent(url, url.startsWith('http'));
|
|
2542
|
-
case
|
|
2543
|
-
svgContent = _context31.
|
|
2592
|
+
case 2:
|
|
2593
|
+
svgContent = _context31.sent;
|
|
2544
2594
|
designProductionMethod = (0, _Selectors.getSelectedDesignProductionMethod)(_ServiceLocator.Services.store.state);
|
|
2545
|
-
return _context31.
|
|
2595
|
+
return _context31.abrupt("return", (0, _Modifiers.createVectorizeColorsMap)({}, getSvgColors(svgContent, designProductionMethod)));
|
|
2596
|
+
case 5:
|
|
2597
|
+
case "end":
|
|
2598
|
+
return _context31.stop();
|
|
2546
2599
|
}
|
|
2547
2600
|
}, _callee30);
|
|
2548
2601
|
}));
|
|
@@ -2554,42 +2607,45 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
2554
2607
|
}, {
|
|
2555
2608
|
key: "getSVGImageSize",
|
|
2556
2609
|
value: function () {
|
|
2557
|
-
var _getSVGImageSize = _asyncToGenerator(/*#__PURE__*/
|
|
2610
|
+
var _getSVGImageSize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(url) {
|
|
2558
2611
|
var _svgContent$match, _svgContent$match2, _svgContent$match3, _svgTag$match;
|
|
2559
2612
|
var svgContent, svgTag, width, height, viewBoxValues;
|
|
2560
|
-
return
|
|
2561
|
-
while (1) switch (_context32.
|
|
2613
|
+
return _regeneratorRuntime().wrap(function _callee31$(_context32) {
|
|
2614
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
2562
2615
|
case 0:
|
|
2563
|
-
_context32.
|
|
2616
|
+
_context32.next = 2;
|
|
2564
2617
|
return getSvgContent(url, url.startsWith('http'));
|
|
2565
|
-
case
|
|
2566
|
-
svgContent = _context32.
|
|
2618
|
+
case 2:
|
|
2619
|
+
svgContent = _context32.sent;
|
|
2567
2620
|
svgTag = (_svgContent$match = svgContent.match(/<svg[^>]+>/)) === null || _svgContent$match === void 0 ? void 0 : _svgContent$match[0];
|
|
2568
2621
|
width = (_svgContent$match2 = svgContent.match(/width="([^"]+)"/)) === null || _svgContent$match2 === void 0 ? void 0 : _svgContent$match2[1];
|
|
2569
2622
|
height = (_svgContent$match3 = svgContent.match(/height="([^"]+)"/)) === null || _svgContent$match3 === void 0 ? void 0 : _svgContent$match3[1];
|
|
2570
2623
|
if (!(width && height)) {
|
|
2571
|
-
_context32.
|
|
2624
|
+
_context32.next = 8;
|
|
2572
2625
|
break;
|
|
2573
2626
|
}
|
|
2574
|
-
return _context32.
|
|
2627
|
+
return _context32.abrupt("return", {
|
|
2575
2628
|
width: parseFloat(width),
|
|
2576
2629
|
height: parseFloat(height)
|
|
2577
2630
|
});
|
|
2578
|
-
case
|
|
2631
|
+
case 8:
|
|
2579
2632
|
viewBoxValues = (_svgTag$match = svgTag.match(/viewBox="([^"]+)"/)) === null || _svgTag$match === void 0 || (_svgTag$match = _svgTag$match[1]) === null || _svgTag$match === void 0 ? void 0 : _svgTag$match.split(' ');
|
|
2580
2633
|
if (!(viewBoxValues.length === 4)) {
|
|
2581
|
-
_context32.
|
|
2634
|
+
_context32.next = 11;
|
|
2582
2635
|
break;
|
|
2583
2636
|
}
|
|
2584
|
-
return _context32.
|
|
2637
|
+
return _context32.abrupt("return", {
|
|
2585
2638
|
width: parseFloat(viewBoxValues[2]),
|
|
2586
2639
|
height: parseFloat(viewBoxValues[3])
|
|
2587
2640
|
});
|
|
2588
|
-
case
|
|
2589
|
-
return _context32.
|
|
2641
|
+
case 11:
|
|
2642
|
+
return _context32.abrupt("return", {
|
|
2590
2643
|
width: 300,
|
|
2591
2644
|
height: 300
|
|
2592
2645
|
});
|
|
2646
|
+
case 12:
|
|
2647
|
+
case "end":
|
|
2648
|
+
return _context32.stop();
|
|
2593
2649
|
}
|
|
2594
2650
|
}, _callee31);
|
|
2595
2651
|
}));
|
|
@@ -2617,42 +2673,43 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
2617
2673
|
*/
|
|
2618
2674
|
}, {
|
|
2619
2675
|
key: "editFileQueued",
|
|
2620
|
-
value:
|
|
2621
|
-
var _editFileQueued = _asyncToGenerator(/*#__PURE__*/
|
|
2676
|
+
value: function () {
|
|
2677
|
+
var _editFileQueued = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(operations, image) {
|
|
2622
2678
|
var options,
|
|
2623
2679
|
releaseLock,
|
|
2624
2680
|
_args33 = arguments;
|
|
2625
|
-
return
|
|
2626
|
-
while (1) switch (_context33.
|
|
2681
|
+
return _regeneratorRuntime().wrap(function _callee32$(_context33) {
|
|
2682
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
2627
2683
|
case 0:
|
|
2628
2684
|
options = _args33.length > 2 && _args33[2] !== undefined ? _args33[2] : {};
|
|
2629
|
-
_context33.
|
|
2685
|
+
_context33.next = 3;
|
|
2630
2686
|
return (0, _ObjectLock.requestLock)(this);
|
|
2631
|
-
case 1:
|
|
2632
|
-
releaseLock = _context33.v;
|
|
2633
|
-
_context33.p = 2;
|
|
2634
|
-
_context33.n = 3;
|
|
2635
|
-
return this.editFile(operations, image, options);
|
|
2636
2687
|
case 3:
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
_context33.
|
|
2688
|
+
releaseLock = _context33.sent;
|
|
2689
|
+
_context33.prev = 4;
|
|
2690
|
+
_context33.next = 7;
|
|
2691
|
+
return this.editFile(operations, image, options);
|
|
2692
|
+
case 7:
|
|
2693
|
+
return _context33.abrupt("return", _context33.sent);
|
|
2694
|
+
case 8:
|
|
2695
|
+
_context33.prev = 8;
|
|
2640
2696
|
releaseLock();
|
|
2641
|
-
return _context33.
|
|
2642
|
-
case
|
|
2643
|
-
|
|
2697
|
+
return _context33.finish(8);
|
|
2698
|
+
case 11:
|
|
2699
|
+
case "end":
|
|
2700
|
+
return _context33.stop();
|
|
2644
2701
|
}
|
|
2645
|
-
}, _callee32, this, [[
|
|
2702
|
+
}, _callee32, this, [[4,, 8, 11]]);
|
|
2646
2703
|
}));
|
|
2647
2704
|
function editFileQueued(_x35, _x36) {
|
|
2648
2705
|
return _editFileQueued.apply(this, arguments);
|
|
2649
2706
|
}
|
|
2650
2707
|
return editFileQueued;
|
|
2651
|
-
}()
|
|
2708
|
+
}()
|
|
2652
2709
|
}, {
|
|
2653
2710
|
key: "editFile",
|
|
2654
2711
|
value: function () {
|
|
2655
|
-
var _editFile = _asyncToGenerator(/*#__PURE__*/
|
|
2712
|
+
var _editFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(operations, image) {
|
|
2656
2713
|
var options,
|
|
2657
2714
|
_options$immediateCom,
|
|
2658
2715
|
immediateCommit,
|
|
@@ -2687,8 +2744,8 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
2687
2744
|
numberOfAggregatedColors,
|
|
2688
2745
|
numberOfColorsToRemove,
|
|
2689
2746
|
_args34 = arguments;
|
|
2690
|
-
return
|
|
2691
|
-
while (1) switch (_context34.
|
|
2747
|
+
return _regeneratorRuntime().wrap(function _callee33$(_context34) {
|
|
2748
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
2692
2749
|
case 0:
|
|
2693
2750
|
options = _args34.length > 2 && _args34[2] !== undefined ? _args34[2] : {};
|
|
2694
2751
|
// patch operations to keep other unchanged values
|
|
@@ -2709,7 +2766,7 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
2709
2766
|
displayColorPreview: displayColorPreview
|
|
2710
2767
|
});
|
|
2711
2768
|
if (!(!operationsMatching || !imageIsCompatible)) {
|
|
2712
|
-
_context34.
|
|
2769
|
+
_context34.next = 29;
|
|
2713
2770
|
break;
|
|
2714
2771
|
}
|
|
2715
2772
|
if (!image.operations) {
|
|
@@ -2717,25 +2774,25 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
2717
2774
|
}
|
|
2718
2775
|
operations = makeOperationsCompatible(operations, compatibilityInfoHash, designProductionMethod.colorPalettes);
|
|
2719
2776
|
if (!image.gallery) {
|
|
2720
|
-
_context34.
|
|
2777
|
+
_context34.next = 18;
|
|
2721
2778
|
break;
|
|
2722
2779
|
}
|
|
2723
2780
|
operations = _objectSpread(_objectSpread({}, operations || {}), {}, {
|
|
2724
2781
|
vectorizeColorsMap: operations.vectorizeColorsMap
|
|
2725
2782
|
});
|
|
2726
|
-
_context34.
|
|
2783
|
+
_context34.next = 29;
|
|
2727
2784
|
break;
|
|
2728
|
-
case
|
|
2785
|
+
case 18:
|
|
2729
2786
|
_getImageUsageInfo = (0, _Selectors2.getImageUsageInfo)(_ServiceLocator.Services.store.state, image.identifier), designAreas = _getImageUsageInfo.designAreas, count = _getImageUsageInfo.count;
|
|
2730
2787
|
createCopy = !!(designAreas > 1 && image.compatibilityInfoHash && !imageIsCompatible) || !operationsMatching && count > (addMode ? 0 : 1);
|
|
2731
2788
|
editData = (0, _Modifiers.getEditDataFromOperations)(image.fileName, operations, designProductionMethod);
|
|
2732
2789
|
currentEditData = (0, _Modifiers.getEditDataFromOperations)(image.fileName, image.operations || {}, designProductionMethod);
|
|
2733
2790
|
isBackendNeeded = createCopy || !(0, _isEqual["default"])(editData, currentEditData);
|
|
2734
2791
|
if (!isBackendNeeded) {
|
|
2735
|
-
_context34.
|
|
2792
|
+
_context34.next = 29;
|
|
2736
2793
|
break;
|
|
2737
2794
|
}
|
|
2738
|
-
_context34.
|
|
2795
|
+
_context34.next = 26;
|
|
2739
2796
|
return _ServiceLocator.Services.store.dispatch((0, _Actions2.editImage)(_objectSpread(_objectSpread({}, editData), {}, {
|
|
2740
2797
|
createCopy: createCopy
|
|
2741
2798
|
}), _objectSpread(_objectSpread({}, imageDataPatch), {}, {
|
|
@@ -2745,26 +2802,26 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
2745
2802
|
}), {
|
|
2746
2803
|
immediateCommit: immediateCommit
|
|
2747
2804
|
}));
|
|
2748
|
-
case
|
|
2805
|
+
case 26:
|
|
2749
2806
|
selectedImage = _ServiceLocator.Services.store.state.imageGallery.selectedImage;
|
|
2750
2807
|
preview = (0, _get2["default"])(selectedImage, 'preview');
|
|
2751
2808
|
imageIdentifier = (0, _get2["default"])(selectedImage, 'identifier');
|
|
2752
|
-
case
|
|
2809
|
+
case 29:
|
|
2753
2810
|
if (!(!preview || !preview.url)) {
|
|
2754
|
-
_context34.
|
|
2811
|
+
_context34.next = 31;
|
|
2755
2812
|
break;
|
|
2756
2813
|
}
|
|
2757
2814
|
throw new Error('Preview image url is not specified!');
|
|
2758
|
-
case
|
|
2815
|
+
case 31:
|
|
2759
2816
|
if (!(0, _Selectors2.isEditableVectorImage)(preview)) {
|
|
2760
|
-
_context34.
|
|
2817
|
+
_context34.next = 40;
|
|
2761
2818
|
break;
|
|
2762
2819
|
}
|
|
2763
2820
|
_designProductionMethod = (0, _Selectors.getSelectedDesignProductionMethod)(_ServiceLocator.Services.store.state);
|
|
2764
|
-
_context34.
|
|
2821
|
+
_context34.next = 35;
|
|
2765
2822
|
return getSvgContent(preview.url, preview.url.startsWith('http'), !operationsMatching);
|
|
2766
|
-
case
|
|
2767
|
-
svgContent = _context34.
|
|
2823
|
+
case 35:
|
|
2824
|
+
svgContent = _context34.sent;
|
|
2768
2825
|
svgColors = getSvgColors(svgContent, _designProductionMethod);
|
|
2769
2826
|
vectorizeColorsMap = (0, _Modifiers.createVectorizeColorsMap)(operations.vectorizeColorsMap, svgColors);
|
|
2770
2827
|
thresholdChanged = operations.vectorizeThreshold !== (0, _get2["default"])(image, 'operations.vectorizeThreshold', 0); // prepare initial values for the vectorize feature
|
|
@@ -2793,7 +2850,7 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
2793
2850
|
} else {
|
|
2794
2851
|
operations.vectorizeColorsMap = vectorizeColorsMap;
|
|
2795
2852
|
}
|
|
2796
|
-
case
|
|
2853
|
+
case 40:
|
|
2797
2854
|
_ServiceLocator.Services.store.dispatch((0, _Actions2.updateImage)(imageIdentifier, _objectSpread(_objectSpread({
|
|
2798
2855
|
operations: operations
|
|
2799
2856
|
}, imageDataPatch), {}, {
|
|
@@ -2802,12 +2859,15 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
2802
2859
|
if (immediateCommit) {
|
|
2803
2860
|
this.updateDesignAreaImagesWithSelectedImageData(image.identifier);
|
|
2804
2861
|
}
|
|
2805
|
-
return _context34.
|
|
2862
|
+
return _context34.abrupt("return", {
|
|
2806
2863
|
vectorizeColorsMap: operations.vectorizeColorsMap,
|
|
2807
2864
|
vectorizeThreshold: operations.vectorizeThreshold,
|
|
2808
2865
|
vectorizeMaxColorAmount: operations.vectorizeMaxColorAmount,
|
|
2809
2866
|
vectorizeOriginalColorsMap: operations.vectorizeOriginalColorsMap
|
|
2810
2867
|
});
|
|
2868
|
+
case 43:
|
|
2869
|
+
case "end":
|
|
2870
|
+
return _context34.stop();
|
|
2811
2871
|
}
|
|
2812
2872
|
}, _callee33, this);
|
|
2813
2873
|
}));
|
|
@@ -2819,10 +2879,10 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
2819
2879
|
}, {
|
|
2820
2880
|
key: "resetEditedFile",
|
|
2821
2881
|
value: function () {
|
|
2822
|
-
var _resetEditedFile = _asyncToGenerator(/*#__PURE__*/
|
|
2882
|
+
var _resetEditedFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34(image) {
|
|
2823
2883
|
var state, _image, operations, vectorizeColorsMap, resetOperations, designProductionMethod;
|
|
2824
|
-
return
|
|
2825
|
-
while (1) switch (_context35.
|
|
2884
|
+
return _regeneratorRuntime().wrap(function _callee34$(_context35) {
|
|
2885
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
2826
2886
|
case 0:
|
|
2827
2887
|
state = _ServiceLocator.Services.store.state;
|
|
2828
2888
|
if (!image) {
|
|
@@ -2841,10 +2901,13 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
2841
2901
|
vectorizeThreshold: null
|
|
2842
2902
|
});
|
|
2843
2903
|
}
|
|
2844
|
-
_context35.
|
|
2904
|
+
_context35.next = 7;
|
|
2845
2905
|
return this.editFileQueued(resetOperations, image);
|
|
2846
|
-
case
|
|
2847
|
-
return _context35.
|
|
2906
|
+
case 7:
|
|
2907
|
+
return _context35.abrupt("return", _context35.sent);
|
|
2908
|
+
case 8:
|
|
2909
|
+
case "end":
|
|
2910
|
+
return _context35.stop();
|
|
2848
2911
|
}
|
|
2849
2912
|
}, _callee34, this);
|
|
2850
2913
|
}));
|
|
@@ -2868,5 +2931,6 @@ var DesignDataService = exports["default"] = /*#__PURE__*/function () {
|
|
|
2868
2931
|
}
|
|
2869
2932
|
}
|
|
2870
2933
|
}]);
|
|
2934
|
+
return DesignDataService;
|
|
2871
2935
|
}();
|
|
2872
2936
|
_defineProperty(DesignDataService, "serviceName", 'DesignDataService');
|