@configuratorware/configurator-frontendgui 1.29.4 → 1.30.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/App/Modules/Creator/Components/Option/index.js +2 -2
  2. package/App/Modules/Creator/Components/OptionsList/index.js +54 -28
  3. package/App/Modules/Designer/Components/DesignerSelectionToolbox/DesignerSelectionToolbox.js +3 -3
  4. package/App/Modules/Designer/Components/ImageColorPicker/ImageColorPicker.js +5 -6
  5. package/App/Modules/Designer/Components/ImageEditDialog/ImageThumbnail.js +1 -1
  6. package/App/Modules/Designer/Components/ImageEditDialog/index.js +3 -1
  7. package/App/Modules/Designer/Containers/ImageEditDialog.js +169 -116
  8. package/App/Modules/Designer/Utils/SvgFixers.js +59 -0
  9. package/App/Modules/Designer/Utils/Transformers.js +17 -10
  10. package/App/Reducers/ImageGallery/Selectors.js +7 -10
  11. package/App/Services/AnalyticsService.js +13 -64
  12. package/App/Services/ConfiguratorService.js +4 -2
  13. package/App/Services/DesignDataService.js +125 -138
  14. package/App/configuration.js +1 -1
  15. package/package.json +4 -4
  16. package/src/App/Modules/Creator/Components/Option/__snapshots__/index.test.js.snap +2 -2
  17. package/src/App/Modules/Creator/Components/Option/index.js +12 -2
  18. package/src/App/Modules/Creator/Components/OptionsList/index.js +46 -32
  19. package/src/App/Modules/Designer/Components/DesignerSelectionToolbox/DesignerSelectionToolbox.js +2 -5
  20. package/src/App/Modules/Designer/Components/DesignerSelectionToolbox/DesignerSelectionToolbox.test.js +1 -0
  21. package/src/App/Modules/Designer/Components/ImageColorPicker/ImageColorPicker.js +5 -6
  22. package/src/App/Modules/Designer/Components/ImageEditDialog/ImageThumbnail.js +1 -1
  23. package/src/App/Modules/Designer/Components/ImageEditDialog/index.js +3 -1
  24. package/src/App/Modules/Designer/Containers/ImageEditDialog.js +39 -12
  25. package/src/App/Modules/Designer/Utils/SvgFixers.js +36 -0
  26. package/src/App/Modules/Designer/Utils/Transformers.js +7 -3
  27. package/src/App/Modules/Designer/Utils/__tests__/Transformers.test.js +2 -2
  28. package/src/App/Reducers/ImageGallery/Selectors.js +5 -5
  29. package/src/App/Reducers/ImageGallery/__tests__/Selectors.test.js +0 -13
  30. package/src/App/Services/AnalyticsService.js +7 -20
  31. package/src/App/Services/ConfiguratorService.js +3 -2
  32. package/src/App/Services/DesignDataService.js +39 -24
  33. package/src/App/Services/__tests__/AnalyticsService.test.js +24 -37
  34. package/src/App/configuration.js +1 -1
@@ -403,59 +403,43 @@ exports.makeOperationsCompatible = makeOperationsCompatible;
403
403
 
404
404
  var getSvgContent = function () {
405
405
  var svgContentMap = new Map();
406
- return /*#__PURE__*/function () {
407
- var _getSvgContent = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(url) {
408
- var absolute,
409
- forceFetch,
410
- absUrl,
411
- result,
412
- svgContent,
413
- _args = arguments;
414
- return regeneratorRuntime.wrap(function _callee$(_context) {
415
- while (1) {
416
- switch (_context.prev = _context.next) {
417
- case 0:
418
- absolute = _args.length > 1 && _args[1] !== undefined ? _args[1] : false;
419
- forceFetch = _args.length > 2 && _args[2] !== undefined ? _args[2] : false;
420
- absUrl = absolute ? url : "".concat((0, _configuration.getConf)('network.host')).concat(url);
421
-
422
- if (!(!forceFetch && svgContentMap.has(absUrl))) {
423
- _context.next = 5;
424
- break;
425
- }
426
-
427
- return _context.abrupt("return", svgContentMap.get(absUrl));
406
+ return function getSvgContent(url) {
407
+ var absolute = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
408
+ var forceFetch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
409
+ var absUrl = absolute ? url : "".concat((0, _configuration.getConf)('network.host')).concat(url);
428
410
 
429
- case 5:
430
- _context.prev = 5;
431
- _context.next = 8;
432
- return _axios["default"].get(absUrl);
411
+ if (!forceFetch && svgContentMap.has(absUrl)) {
412
+ return svgContentMap.get(absUrl);
413
+ }
433
414
 
434
- case 8:
435
- result = _context.sent;
436
- svgContent = (0, _Transformers.initDefaultColor)(result.data);
437
- svgContentMap.set(absUrl, svgContent);
438
- return _context.abrupt("return", svgContent);
415
+ try {
416
+ var promise = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
417
+ var result;
418
+ return regeneratorRuntime.wrap(function _callee$(_context) {
419
+ while (1) {
420
+ switch (_context.prev = _context.next) {
421
+ case 0:
422
+ _context.next = 2;
423
+ return _axios["default"].get(absUrl);
439
424
 
440
- case 14:
441
- _context.prev = 14;
442
- _context.t0 = _context["catch"](5);
443
- return _context.abrupt("return", '');
425
+ case 2:
426
+ result = _context.sent;
427
+ return _context.abrupt("return", (0, _Transformers.initDefaultColor)(result.data));
444
428
 
445
- case 17:
446
- case "end":
447
- return _context.stop();
429
+ case 4:
430
+ case "end":
431
+ return _context.stop();
432
+ }
448
433
  }
449
- }
450
- }, _callee, null, [[5, 14]]);
451
- }));
434
+ }, _callee);
435
+ }))();
452
436
 
453
- function getSvgContent(_x) {
454
- return _getSvgContent.apply(this, arguments);
437
+ svgContentMap.set(absUrl, promise);
438
+ return promise;
439
+ } catch (e) {
440
+ return '';
455
441
  }
456
-
457
- return getSvgContent;
458
- }();
442
+ };
459
443
  }();
460
444
 
461
445
  exports.getSvgContent = getSvgContent;
@@ -610,7 +594,7 @@ var DesignDataService = /*#__PURE__*/function () {
610
594
  _defineProperty(this, "_isCanvasDataUpdateEnabled", true);
611
595
 
612
596
  _defineProperty(this, "handleDesignProductionMethodChangeFromVectorizationToNonVectorization", /*#__PURE__*/function () {
613
- var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(designProductionMethodIdentifier) {
597
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(designProductionMethodIdentifier) {
614
598
  var state, _getVectorizeForDesig, currentVectorsRequired, newVectorsRequired, designArea, images;
615
599
 
616
600
  return regeneratorRuntime.wrap(function _callee2$(_context2) {
@@ -641,14 +625,14 @@ var DesignDataService = /*#__PURE__*/function () {
641
625
  }, _callee2);
642
626
  }));
643
627
 
644
- return function (_x2) {
645
- return _ref3.apply(this, arguments);
628
+ return function (_x) {
629
+ return _ref4.apply(this, arguments);
646
630
  };
647
631
  }());
648
632
 
649
633
  _defineProperty(this, "handleDesignProductionMethodChangeFromNonVectorizationToVectorization", /*#__PURE__*/function () {
650
- var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(designProductionMethodIdentifier) {
651
- var state, _getVectorizeForDesig2, currentVectorsRequired, newVectorsRequired, designArea, images;
634
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(designProductionMethodIdentifier) {
635
+ var state, _getVectorizeForDesig2, currentVectorsRequired, newVectorsRequired, designArea, nonVectorizedImages;
652
636
 
653
637
  return regeneratorRuntime.wrap(function _callee3$(_context3) {
654
638
  while (1) {
@@ -657,9 +641,11 @@ var DesignDataService = /*#__PURE__*/function () {
657
641
  state = _ServiceLocator.Services.store.state;
658
642
  _getVectorizeForDesig2 = (0, _Selectors.getVectorizeForDesignProductionMethods)(state, designProductionMethodIdentifier), currentVectorsRequired = _getVectorizeForDesig2.currentVectorsRequired, newVectorsRequired = _getVectorizeForDesig2.newVectorsRequired;
659
643
  designArea = (0, _Selectors.getSelectedDesignArea)(state);
660
- images = (0, _Selectors.getImagesByDesignArea)(state, designArea.identifier);
644
+ nonVectorizedImages = (0, _Selectors.getImagesByDesignArea)(state, designArea.identifier).filter(function (obj) {
645
+ return !(0, _get2["default"])(obj, 'imageData.operations.vectorize');
646
+ });
661
647
 
662
- if (!(images.length === 1 && (!currentVectorsRequired && newVectorsRequired || !(0, _Selectors2.isColorPreviewCompatible)(state, images[0].imageData, designProductionMethodIdentifier)))) {
648
+ if (!(nonVectorizedImages.length === 1 && (!currentVectorsRequired && newVectorsRequired || !(0, _Selectors2.isColorPreviewCompatible)(state, nonVectorizedImages[0].imageData, designProductionMethodIdentifier)))) {
663
649
  _context3.next = 8;
664
650
  break;
665
651
  }
@@ -678,13 +664,13 @@ var DesignDataService = /*#__PURE__*/function () {
678
664
  }, _callee3);
679
665
  }));
680
666
 
681
- return function (_x3) {
682
- return _ref4.apply(this, arguments);
667
+ return function (_x2) {
668
+ return _ref5.apply(this, arguments);
683
669
  };
684
670
  }());
685
671
 
686
672
  _defineProperty(this, "checkColorUsageForDesignProductionMethod", /*#__PURE__*/function () {
687
- var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(designProductionMethodIdentifier) {
673
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(designProductionMethodIdentifier) {
688
674
  var state, _getSelectedDesignAre2, maxColorAmount, designProductionMethod, newProductionMethod, newMaxColorAmount, currentVectorsRequired, newVectorsRequired, designArea, colorPreviewRequired, canvas, images, missingColorPalettesColors;
689
675
 
690
676
  return regeneratorRuntime.wrap(function _callee4$(_context4) {
@@ -711,7 +697,7 @@ var DesignDataService = /*#__PURE__*/function () {
711
697
  return false;
712
698
  }
713
699
 
714
- return !(0, _Selectors2.isEditableVectorImage)(obj.imageData.preview) || !(0, _Selectors2.isColorPreviewCompatible)(state, obj.imageData, designProductionMethodIdentifier);
700
+ return !(0, _get2["default"])(obj, 'imageData.operations.vectorize') || !(0, _Selectors2.isColorPreviewCompatible)(state, obj.imageData, designProductionMethodIdentifier);
715
701
  }) : [];
716
702
 
717
703
  if (!(images.length > 1)) {
@@ -755,13 +741,13 @@ var DesignDataService = /*#__PURE__*/function () {
755
741
  }, _callee4);
756
742
  }));
757
743
 
758
- return function (_x4) {
759
- return _ref5.apply(this, arguments);
744
+ return function (_x3) {
745
+ return _ref6.apply(this, arguments);
760
746
  };
761
747
  }());
762
748
 
763
749
  _defineProperty(this, "replaceSelectedDesignAreaElementsColor", /*#__PURE__*/function () {
764
- var _ref6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(missingColorPalettesColors, designProductionMethod) {
750
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(missingColorPalettesColors, designProductionMethod) {
765
751
  var state, designArea, designData, objects, _iterator7, _step7, missingColor;
766
752
 
767
753
  return regeneratorRuntime.wrap(function _callee5$(_context5) {
@@ -773,11 +759,11 @@ var DesignDataService = /*#__PURE__*/function () {
773
759
  designData = (0, _Selectors.getDesignDataByDesignAreaIdentifier)(state, designArea.identifier);
774
760
  objects = (0, _get2["default"])(designData, 'canvasData.objects', []);
775
761
  _context5.next = 6;
776
- return Promise.all(objects.filter(function (_ref7) {
777
- var type = _ref7.type;
762
+ return Promise.all(objects.filter(function (_ref8) {
763
+ var type = _ref8.type;
778
764
  return type === 'Image';
779
- }).map(function (_ref8) {
780
- var imageData = _ref8.imageData;
765
+ }).map(function (_ref9) {
766
+ var imageData = _ref9.imageData;
781
767
  return (0, _Selectors2.getUserImage)(state, imageData.identifier);
782
768
  }).filter(function (image, idx, arr) {
783
769
  return arr.indexOf(image) === idx && // uniq
@@ -822,8 +808,8 @@ var DesignDataService = /*#__PURE__*/function () {
822
808
  }, _callee5);
823
809
  }));
824
810
 
825
- return function (_x5, _x6) {
826
- return _ref6.apply(this, arguments);
811
+ return function (_x4, _x5) {
812
+ return _ref7.apply(this, arguments);
827
813
  };
828
814
  }());
829
815
  }
@@ -836,7 +822,7 @@ var DesignDataService = /*#__PURE__*/function () {
836
822
  _ServiceLocator.Services.store.observeStore(function (state) {
837
823
  return state.designArea.filteredDesignAreas;
838
824
  }, /*#__PURE__*/function () {
839
- var _ref9 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(filteredDesignAreas, prevDesignAreas) {
825
+ var _ref10 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(filteredDesignAreas, prevDesignAreas) {
840
826
  var initList, areasToLoad;
841
827
  return regeneratorRuntime.wrap(function _callee6$(_context6) {
842
828
  while (1) {
@@ -849,11 +835,11 @@ var DesignDataService = /*#__PURE__*/function () {
849
835
  case 3:
850
836
  initList = _context6.sent;
851
837
  // only the newly initialized canvases has to be loaded
852
- areasToLoad = initList.filter(function (_ref10) {
853
- var isNew = _ref10.isNew;
838
+ areasToLoad = initList.filter(function (_ref11) {
839
+ var isNew = _ref11.isNew;
854
840
  return isNew;
855
- }).map(function (_ref11) {
856
- var designArea = _ref11.designArea;
841
+ }).map(function (_ref12) {
842
+ var designArea = _ref12.designArea;
857
843
  return designArea;
858
844
  }); // the canvas data is there first with the configuration, but since the canvas instances are
859
845
  // associated with the design areas the data can be loaded only when the design areas are available
@@ -890,8 +876,8 @@ var DesignDataService = /*#__PURE__*/function () {
890
876
  }, _callee6, null, [[0, 13]]);
891
877
  }));
892
878
 
893
- return function (_x7, _x8) {
894
- return _ref9.apply(this, arguments);
879
+ return function (_x6, _x7) {
880
+ return _ref10.apply(this, arguments);
895
881
  };
896
882
  }());
897
883
 
@@ -911,8 +897,8 @@ var DesignDataService = /*#__PURE__*/function () {
911
897
  });
912
898
  }
913
899
 
914
- _ServiceLocator.Services.store.observeStore(function (_ref12) {
915
- var selectedoptionclassification = _ref12.configurator.selectedoptionclassification;
900
+ _ServiceLocator.Services.store.observeStore(function (_ref13) {
901
+ var selectedoptionclassification = _ref13.configurator.selectedoptionclassification;
916
902
  return selectedoptionclassification;
917
903
  }, this.componentChangeHandler.bind(this));
918
904
 
@@ -1055,7 +1041,7 @@ var DesignDataService = /*#__PURE__*/function () {
1055
1041
  }, _callee7, this);
1056
1042
  }));
1057
1043
 
1058
- function initCanvases(_x9, _x10) {
1044
+ function initCanvases(_x8, _x9) {
1059
1045
  return _initCanvases.apply(this, arguments);
1060
1046
  }
1061
1047
 
@@ -1155,7 +1141,7 @@ var DesignDataService = /*#__PURE__*/function () {
1155
1141
  state = _ServiceLocator.Services.store.state;
1156
1142
  _context11.next = 3;
1157
1143
  return Promise.all(designAreas.map( /*#__PURE__*/function () {
1158
- var _ref13 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10(designArea) {
1144
+ var _ref14 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10(designArea) {
1159
1145
  var designData, canvasData, canvasSize;
1160
1146
  return regeneratorRuntime.wrap(function _callee10$(_context10) {
1161
1147
  while (1) {
@@ -1184,8 +1170,8 @@ var DesignDataService = /*#__PURE__*/function () {
1184
1170
  }, _callee10);
1185
1171
  }));
1186
1172
 
1187
- return function (_x13) {
1188
- return _ref13.apply(this, arguments);
1173
+ return function (_x12) {
1174
+ return _ref14.apply(this, arguments);
1189
1175
  };
1190
1176
  }()));
1191
1177
 
@@ -1202,7 +1188,7 @@ var DesignDataService = /*#__PURE__*/function () {
1202
1188
  }, _callee11);
1203
1189
  }));
1204
1190
 
1205
- function syncCanvases(_x11, _x12) {
1191
+ function syncCanvases(_x10, _x11) {
1206
1192
  return _syncCanvases.apply(this, arguments);
1207
1193
  }
1208
1194
 
@@ -1218,8 +1204,8 @@ var DesignDataService = /*#__PURE__*/function () {
1218
1204
  }, {
1219
1205
  key: "getDesignAreaByIdentifier",
1220
1206
  value: function getDesignAreaByIdentifier(designAreaIdentifier) {
1221
- return this.getDesignAreas().find(function (_ref14) {
1222
- var identifier = _ref14.identifier;
1207
+ return this.getDesignAreas().find(function (_ref15) {
1208
+ var identifier = _ref15.identifier;
1223
1209
  return identifier === designAreaIdentifier;
1224
1210
  });
1225
1211
  }
@@ -1304,7 +1290,7 @@ var DesignDataService = /*#__PURE__*/function () {
1304
1290
  }, _callee12, this);
1305
1291
  }));
1306
1292
 
1307
- function updateCanvasData(_x14, _x15) {
1293
+ function updateCanvasData(_x13, _x14) {
1308
1294
  return _updateCanvasData.apply(this, arguments);
1309
1295
  }
1310
1296
 
@@ -1312,10 +1298,10 @@ var DesignDataService = /*#__PURE__*/function () {
1312
1298
  }()
1313
1299
  }, {
1314
1300
  key: "createCanvasChangeListener",
1315
- value: function createCanvasChangeListener(_ref15) {
1301
+ value: function createCanvasChangeListener(_ref16) {
1316
1302
  var _this6 = this;
1317
1303
 
1318
- var syncCanvasChange = _ref15.syncCanvasChange;
1304
+ var syncCanvasChange = _ref16.syncCanvasChange;
1319
1305
  this._syncCanvasChange = syncCanvasChange;
1320
1306
  return /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee13() {
1321
1307
  var _args13 = arguments;
@@ -1589,7 +1575,7 @@ var DesignDataService = /*#__PURE__*/function () {
1589
1575
  key: "vectorizeSingleImageAndShowEditDialog",
1590
1576
  value: function () {
1591
1577
  var _vectorizeSingleImageAndShowEditDialog = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee14(identifier) {
1592
- var showImageEditDialog, state, designArea, canvas, images, operations, imageData, imageToSelect;
1578
+ var showImageEditDialog, state, designArea, canvas, firstNonVectorizedImage, operations, imageData, imageToSelect;
1593
1579
  return regeneratorRuntime.wrap(function _callee14$(_context14) {
1594
1580
  while (1) {
1595
1581
  switch (_context14.prev = _context14.next) {
@@ -1610,11 +1596,13 @@ var DesignDataService = /*#__PURE__*/function () {
1610
1596
  state = _ServiceLocator.Services.store.state;
1611
1597
  designArea = (0, _Selectors.getSelectedDesignArea)(state);
1612
1598
  canvas = this._getCanvas(designArea);
1613
- images = (0, _Selectors.getImagesByDesignArea)(state, designArea.identifier);
1614
- operations = _objectSpread(_objectSpread({}, images[0].imageData.operations), {}, {
1599
+ firstNonVectorizedImage = (0, _Selectors.getImagesByDesignArea)(state, designArea.identifier).find(function (obj) {
1600
+ return !(0, _get2["default"])(obj, 'imageData.operations.vectorize');
1601
+ });
1602
+ operations = _objectSpread(_objectSpread({}, firstNonVectorizedImage.imageData.operations), {}, {
1615
1603
  vectorize: true
1616
1604
  });
1617
- imageData = images[0].imageData;
1605
+ imageData = firstNonVectorizedImage.imageData;
1618
1606
  _context14.prev = 11;
1619
1607
 
1620
1608
  if (!imageData.isPlaceHolderImage) {
@@ -1638,7 +1626,7 @@ var DesignDataService = /*#__PURE__*/function () {
1638
1626
  });
1639
1627
  imageToSelect.selected = true;
1640
1628
  _context14.next = 20;
1641
- return _ServiceLocator.Services.designer.openImageEditDialog(images[0].imageData.identifier, canvas, {
1629
+ return _ServiceLocator.Services.designer.openImageEditDialog(firstNonVectorizedImage.imageData.identifier, canvas, {
1642
1630
  placeholderImageUpdate: false,
1643
1631
  submitOnExitClick: true
1644
1632
  });
@@ -1658,7 +1646,7 @@ var DesignDataService = /*#__PURE__*/function () {
1658
1646
  }, _callee14, this, [[11,, 20, 23]]);
1659
1647
  }));
1660
1648
 
1661
- function vectorizeSingleImageAndShowEditDialog(_x16) {
1649
+ function vectorizeSingleImageAndShowEditDialog(_x15) {
1662
1650
  return _vectorizeSingleImageAndShowEditDialog.apply(this, arguments);
1663
1651
  }
1664
1652
 
@@ -1744,7 +1732,7 @@ var DesignDataService = /*#__PURE__*/function () {
1744
1732
  }, _callee15, this, [[9, 20, 23, 26]]);
1745
1733
  }));
1746
1734
 
1747
- function restoreVectorizedImages(_x17) {
1735
+ function restoreVectorizedImages(_x16) {
1748
1736
  return _restoreVectorizedImages.apply(this, arguments);
1749
1737
  }
1750
1738
 
@@ -1796,7 +1784,7 @@ var DesignDataService = /*#__PURE__*/function () {
1796
1784
  }, _callee16, this);
1797
1785
  }));
1798
1786
 
1799
- function updateObjectsAfterProductionMethodChange(_x18, _x19) {
1787
+ function updateObjectsAfterProductionMethodChange(_x17, _x18) {
1800
1788
  return _updateObjectsAfterProductionMethodChange.apply(this, arguments);
1801
1789
  }
1802
1790
 
@@ -1949,7 +1937,7 @@ var DesignDataService = /*#__PURE__*/function () {
1949
1937
  }, _callee17, this, [[10, 17], [20, 29], [34, 41]]);
1950
1938
  }));
1951
1939
 
1952
- function setDesignProductionMethod(_x20) {
1940
+ function setDesignProductionMethod(_x19) {
1953
1941
  return _setDesignProductionMethod2.apply(this, arguments);
1954
1942
  }
1955
1943
 
@@ -2023,7 +2011,7 @@ var DesignDataService = /*#__PURE__*/function () {
2023
2011
  }, _callee18, null, [[3, 8]]);
2024
2012
  }));
2025
2013
 
2026
- function setColorAmount(_x21) {
2014
+ function setColorAmount(_x20) {
2027
2015
  return _setColorAmount2.apply(this, arguments);
2028
2016
  }
2029
2017
 
@@ -2128,7 +2116,7 @@ var DesignDataService = /*#__PURE__*/function () {
2128
2116
  effectEnabled = !(0, _Selectors3.isDesignerProductPreviewMode)();
2129
2117
 
2130
2118
  drawingFn = /*#__PURE__*/function () {
2131
- var _ref17 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee20(textureCtx, getTextureBuilder) {
2119
+ var _ref18 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee20(textureCtx, getTextureBuilder) {
2132
2120
  var designAreas,
2133
2121
  _getTextureBuilder,
2134
2122
  getTextureImage,
@@ -2197,8 +2185,8 @@ var DesignDataService = /*#__PURE__*/function () {
2197
2185
 
2198
2186
  if (maskHandler) {
2199
2187
  restoreOutlineVisibility = maskHandler.toggleOutline(showHighlight, {
2200
- getZoomFactor: function getZoomFactor(_ref18) {
2201
- var zoom = _ref18.zoom;
2188
+ getZoomFactor: function getZoomFactor(_ref19) {
2189
+ var zoom = _ref19.zoom;
2202
2190
  // currentZoom is only available for 2D, for 3D it is always 1
2203
2191
  var threeFactor = Math.min(getParams().currentZoom, 1) || 1;
2204
2192
  return zoom * threeFactor;
@@ -2276,8 +2264,8 @@ var DesignDataService = /*#__PURE__*/function () {
2276
2264
  }, _callee20, null, [[7, 16, 19, 22]]);
2277
2265
  }));
2278
2266
 
2279
- return function drawingFn(_x24, _x25) {
2280
- return _ref17.apply(this, arguments);
2267
+ return function drawingFn(_x23, _x24) {
2268
+ return _ref18.apply(this, arguments);
2281
2269
  };
2282
2270
  }();
2283
2271
 
@@ -2307,7 +2295,7 @@ var DesignDataService = /*#__PURE__*/function () {
2307
2295
  }, _callee21, null, [[6, 11]]);
2308
2296
  }));
2309
2297
 
2310
- function redrawAllDesignAreas(_x22, _x23) {
2298
+ function redrawAllDesignAreas(_x21, _x22) {
2311
2299
  return _redrawAllDesignAreas.apply(this, arguments);
2312
2300
  }
2313
2301
 
@@ -2392,17 +2380,17 @@ var DesignDataService = /*#__PURE__*/function () {
2392
2380
  id: area.identifier,
2393
2381
  canvas: _this10._getCanvas(area)
2394
2382
  };
2395
- }).filter(function (_ref20) {
2396
- var canvas = _ref20.canvas;
2383
+ }).filter(function (_ref21) {
2384
+ var canvas = _ref21.canvas;
2397
2385
  return canvas && canvas[screenshotFn] && canvas.objects && canvas.objects.length > 0;
2398
2386
  }).map( /*#__PURE__*/function () {
2399
- var _ref22 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee23(_ref21) {
2387
+ var _ref23 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee23(_ref22) {
2400
2388
  var id, canvas, releaseLock, maskHandler, restoreOutlineVisibility, result;
2401
2389
  return regeneratorRuntime.wrap(function _callee23$(_context24) {
2402
2390
  while (1) {
2403
2391
  switch (_context24.prev = _context24.next) {
2404
2392
  case 0:
2405
- id = _ref21.id, canvas = _ref21.canvas;
2393
+ id = _ref22.id, canvas = _ref22.canvas;
2406
2394
  _context24.next = 3;
2407
2395
  return (0, _ObjectLock.requestLock)(canvas);
2408
2396
 
@@ -2429,16 +2417,16 @@ var DesignDataService = /*#__PURE__*/function () {
2429
2417
  }, _callee23);
2430
2418
  }));
2431
2419
 
2432
- return function (_x27) {
2433
- return _ref22.apply(this, arguments);
2420
+ return function (_x26) {
2421
+ return _ref23.apply(this, arguments);
2434
2422
  };
2435
2423
  }()));
2436
2424
 
2437
2425
  case 4:
2438
- return _context25.abrupt("return", _context25.sent.reduce(function (screenShots, _ref23) {
2439
- var _ref24 = _slicedToArray(_ref23, 2),
2440
- id = _ref24[0],
2441
- screenshot = _ref24[1];
2426
+ return _context25.abrupt("return", _context25.sent.reduce(function (screenShots, _ref24) {
2427
+ var _ref25 = _slicedToArray(_ref24, 2),
2428
+ id = _ref25[0],
2429
+ screenshot = _ref25[1];
2442
2430
 
2443
2431
  return _objectSpread(_objectSpread({}, screenShots), {}, _defineProperty({}, id, screenshot));
2444
2432
  }, {}));
@@ -2451,7 +2439,7 @@ var DesignDataService = /*#__PURE__*/function () {
2451
2439
  }, _callee24, this);
2452
2440
  }));
2453
2441
 
2454
- function getScreenshots(_x26) {
2442
+ function getScreenshots(_x25) {
2455
2443
  return _getScreenshots.apply(this, arguments);
2456
2444
  }
2457
2445
 
@@ -2481,7 +2469,7 @@ var DesignDataService = /*#__PURE__*/function () {
2481
2469
  }, _callee25, this);
2482
2470
  }));
2483
2471
 
2484
- function getScreenshotsOfElements(_x28) {
2472
+ function getScreenshotsOfElements(_x27) {
2485
2473
  return _getScreenshotsOfElements.apply(this, arguments);
2486
2474
  }
2487
2475
 
@@ -2579,7 +2567,7 @@ var DesignDataService = /*#__PURE__*/function () {
2579
2567
  case 0:
2580
2568
  _context28.next = 2;
2581
2569
  return Promise.all(designAreaIdentifiers.map( /*#__PURE__*/function () {
2582
- var _ref25 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee26(designAreaIdentifier) {
2570
+ var _ref26 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee26(designAreaIdentifier) {
2583
2571
  var designArea, canvas, state, imageSrc, imageData, canvasDataJSON, designData, canvasData, objects;
2584
2572
  return regeneratorRuntime.wrap(function _callee26$(_context27) {
2585
2573
  while (1) {
@@ -2655,8 +2643,8 @@ var DesignDataService = /*#__PURE__*/function () {
2655
2643
  }, _callee26);
2656
2644
  }));
2657
2645
 
2658
- return function (_x31) {
2659
- return _ref25.apply(this, arguments);
2646
+ return function (_x30) {
2647
+ return _ref26.apply(this, arguments);
2660
2648
  };
2661
2649
  }()));
2662
2650
 
@@ -2668,7 +2656,7 @@ var DesignDataService = /*#__PURE__*/function () {
2668
2656
  }, _callee27);
2669
2657
  }));
2670
2658
 
2671
- function addSampleImageForDesignAreas(_x29, _x30) {
2659
+ function addSampleImageForDesignAreas(_x28, _x29) {
2672
2660
  return _addSampleImageForDesignAreas.apply(this, arguments);
2673
2661
  }
2674
2662
 
@@ -2711,7 +2699,7 @@ var DesignDataService = /*#__PURE__*/function () {
2711
2699
  }, _callee28, this);
2712
2700
  }));
2713
2701
 
2714
- function addImageToDesignArea(_x32, _x33) {
2702
+ function addImageToDesignArea(_x31, _x32) {
2715
2703
  return _addImageToDesignArea.apply(this, arguments);
2716
2704
  }
2717
2705
 
@@ -2883,7 +2871,7 @@ var DesignDataService = /*#__PURE__*/function () {
2883
2871
  }, _callee29, this, [[13, 26, 29, 32]]);
2884
2872
  }));
2885
2873
 
2886
- function setImageAndTextColor(_x34) {
2874
+ function setImageAndTextColor(_x33) {
2887
2875
  return _setImageAndTextColor.apply(this, arguments);
2888
2876
  }
2889
2877
 
@@ -2914,7 +2902,7 @@ var DesignDataService = /*#__PURE__*/function () {
2914
2902
  }, _callee30);
2915
2903
  }));
2916
2904
 
2917
- function getGalleryImageColors(_x35) {
2905
+ function getGalleryImageColors(_x34) {
2918
2906
  return _getGalleryImageColors.apply(this, arguments);
2919
2907
  }
2920
2908
 
@@ -2974,7 +2962,7 @@ var DesignDataService = /*#__PURE__*/function () {
2974
2962
  }, _callee31, this, [[4,, 8, 11]]);
2975
2963
  }));
2976
2964
 
2977
- function editFileQueued(_x36, _x37) {
2965
+ function editFileQueued(_x35, _x36) {
2978
2966
  return _editFileQueued.apply(this, arguments);
2979
2967
  }
2980
2968
 
@@ -3040,7 +3028,7 @@ var DesignDataService = /*#__PURE__*/function () {
3040
3028
  });
3041
3029
 
3042
3030
  if (!(!operationsMatching || !imageIsCompatible)) {
3043
- _context33.next = 29;
3031
+ _context33.next = 28;
3044
3032
  break;
3045
3033
  }
3046
3034
 
@@ -3058,7 +3046,7 @@ var DesignDataService = /*#__PURE__*/function () {
3058
3046
  operations = _objectSpread(_objectSpread({}, operations || {}), {}, {
3059
3047
  vectorizeColorsMap: operations.vectorizeColorsMap
3060
3048
  });
3061
- _context33.next = 29;
3049
+ _context33.next = 28;
3062
3050
  break;
3063
3051
 
3064
3052
  case 17:
@@ -3067,14 +3055,13 @@ var DesignDataService = /*#__PURE__*/function () {
3067
3055
  editData = (0, _Modifiers.getEditDataFromOperations)(image.fileName, operations, designProductionMethod);
3068
3056
  currentEditData = (0, _Modifiers.getEditDataFromOperations)(image.fileName, image.operations || {}, designProductionMethod);
3069
3057
  isBackendNeeded = createCopy || !(0, _isEqual["default"])(editData, currentEditData);
3070
- _context33.t0 = isBackendNeeded;
3071
3058
 
3072
- if (!_context33.t0) {
3073
- _context33.next = 26;
3059
+ if (!isBackendNeeded) {
3060
+ _context33.next = 28;
3074
3061
  break;
3075
3062
  }
3076
3063
 
3077
- _context33.next = 26;
3064
+ _context33.next = 25;
3078
3065
  return _ServiceLocator.Services.store.dispatch((0, _Actions2.editImage)(_objectSpread(_objectSpread({}, editData), {}, {
3079
3066
  createCopy: createCopy
3080
3067
  }), _objectSpread(_objectSpread({}, imageDataPatch), {}, {
@@ -3085,30 +3072,30 @@ var DesignDataService = /*#__PURE__*/function () {
3085
3072
  immediateCommit: immediateCommit
3086
3073
  }));
3087
3074
 
3088
- case 26:
3075
+ case 25:
3089
3076
  selectedImage = _ServiceLocator.Services.store.state.imageGallery.selectedImage;
3090
3077
  preview = (0, _get2["default"])(selectedImage, 'preview');
3091
3078
  imageIdentifier = (0, _get2["default"])(selectedImage, 'identifier');
3092
3079
 
3093
- case 29:
3080
+ case 28:
3094
3081
  if (!(!preview || !preview.url)) {
3095
- _context33.next = 31;
3082
+ _context33.next = 30;
3096
3083
  break;
3097
3084
  }
3098
3085
 
3099
3086
  throw new Error('Preview image url is not specified!');
3100
3087
 
3101
- case 31:
3088
+ case 30:
3102
3089
  if (!(0, _Selectors2.isEditableVectorImage)(preview)) {
3103
- _context33.next = 40;
3090
+ _context33.next = 39;
3104
3091
  break;
3105
3092
  }
3106
3093
 
3107
3094
  _designProductionMethod = (0, _Selectors.getSelectedDesignProductionMethod)(_ServiceLocator.Services.store.state);
3108
- _context33.next = 35;
3095
+ _context33.next = 34;
3109
3096
  return getSvgContent(preview.url, false, !operationsMatching);
3110
3097
 
3111
- case 35:
3098
+ case 34:
3112
3099
  svgContent = _context33.sent;
3113
3100
  svgColors = getSvgColors(svgContent, _designProductionMethod);
3114
3101
  vectorizeColorsMap = (0, _Modifiers.createVectorizeColorsMap)(operations.vectorizeColorsMap, svgColors);
@@ -3140,7 +3127,7 @@ var DesignDataService = /*#__PURE__*/function () {
3140
3127
  operations.vectorizeColorsMap = vectorizeColorsMap;
3141
3128
  }
3142
3129
 
3143
- case 40:
3130
+ case 39:
3144
3131
  _ServiceLocator.Services.store.dispatch((0, _Actions2.updateImage)(imageIdentifier, _objectSpread(_objectSpread({
3145
3132
  operations: operations
3146
3133
  }, imageDataPatch), {}, {
@@ -3158,7 +3145,7 @@ var DesignDataService = /*#__PURE__*/function () {
3158
3145
  vectorizeOriginalColorsMap: operations.vectorizeOriginalColorsMap
3159
3146
  });
3160
3147
 
3161
- case 43:
3148
+ case 42:
3162
3149
  case "end":
3163
3150
  return _context33.stop();
3164
3151
  }
@@ -3166,7 +3153,7 @@ var DesignDataService = /*#__PURE__*/function () {
3166
3153
  }, _callee32, this);
3167
3154
  }));
3168
3155
 
3169
- function editFile(_x38, _x39) {
3156
+ function editFile(_x37, _x38) {
3170
3157
  return _editFile.apply(this, arguments);
3171
3158
  }
3172
3159
 
@@ -3217,7 +3204,7 @@ var DesignDataService = /*#__PURE__*/function () {
3217
3204
  }, _callee33, this);
3218
3205
  }));
3219
3206
 
3220
- function resetEditedFile(_x40) {
3207
+ function resetEditedFile(_x39) {
3221
3208
  return _resetEditedFile.apply(this, arguments);
3222
3209
  }
3223
3210