@configuratorware/configurator-frontendgui 1.40.4 → 1.40.6
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/Modules/Designer/Containers/ImageEditDialog.js +10 -28
- package/App/Reducers/DesignArea/Selectors.js +11 -44
- package/App/Reducers/DesignData/Modifiers.js +1 -3
- package/App/Reducers/ImageGallery/Actions.js +18 -25
- package/App/Reducers/ImageGallery/Reducer.js +0 -5
- package/App/Reducers/ImageGallery/Selectors.js +1 -1
- package/App/Screens/DesignerProductPreview/DesignerProductPreviewManager.js +9 -10
- package/App/Services/DesignDataService.js +435 -494
- package/App/configuration.js +1 -1
- package/package.json +4 -4
- package/src/App/Modules/Designer/Containers/ImageEditDialog.js +6 -33
- package/src/App/Reducers/DesignArea/Selectors.js +9 -39
- package/src/App/Reducers/DesignArea/__tests__/Selectors.test.js +0 -19
- package/src/App/Reducers/DesignData/Modifiers.js +0 -3
- package/src/App/Reducers/ImageGallery/Actions.js +5 -20
- package/src/App/Reducers/ImageGallery/Reducer.js +0 -5
- package/src/App/Reducers/ImageGallery/Selectors.js +3 -4
- package/src/App/Reducers/ImageGallery/__tests__/Actions.test.js +7 -81
- package/src/App/Screens/DesignerProductPreview/DesignerProductPreviewManager.js +1 -4
- package/src/App/Services/DesignDataService.js +16 -56
- package/src/App/configuration.js +1 -1
|
@@ -682,52 +682,13 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
682
682
|
};
|
|
683
683
|
}());
|
|
684
684
|
|
|
685
|
-
_defineProperty(this, "
|
|
685
|
+
_defineProperty(this, "checkColorUsageForDesignProductionMethod", /*#__PURE__*/function () {
|
|
686
686
|
var _ref6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(designProductionMethodIdentifier) {
|
|
687
|
-
var state,
|
|
687
|
+
var state, _getSelectedDesignAre2, maxColorAmount, designProductionMethod, newProductionMethod, newMaxColorAmount, currentVectorsRequired, newVectorsRequired, designArea, colorPreviewRequired, canvas, images, missingColorPalettesColors;
|
|
688
688
|
|
|
689
689
|
return regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
690
690
|
while (1) {
|
|
691
691
|
switch (_context4.prev = _context4.next) {
|
|
692
|
-
case 0:
|
|
693
|
-
state = _ServiceLocator.Services.store.state;
|
|
694
|
-
_getMandatoryVectoriz = (0, _Selectors.getMandatoryVectorizationForDesignProductionMethods)(state, designProductionMethodIdentifier), currentVectorsMandatory = _getMandatoryVectoriz.currentVectorsMandatory, newVectorsMandatory = _getMandatoryVectoriz.newVectorsMandatory;
|
|
695
|
-
designArea = (0, _Selectors.getSelectedDesignArea)(state);
|
|
696
|
-
nonColorizedImages = (0, _Selectors.getImagesByDesignArea)(state, designArea.identifier).filter(function (obj) {
|
|
697
|
-
return !(0, _get2["default"])(obj, 'imageData.gallery') && !(0, _get2["default"])(obj, 'imageData.displayColorPreview');
|
|
698
|
-
});
|
|
699
|
-
|
|
700
|
-
if (!(nonColorizedImages.length === 1 && (!currentVectorsMandatory && newVectorsMandatory || !(0, _Selectors2.isColorPreviewCompatible)(state, nonColorizedImages[0].imageData, designProductionMethodIdentifier)))) {
|
|
701
|
-
_context4.next = 8;
|
|
702
|
-
break;
|
|
703
|
-
}
|
|
704
|
-
|
|
705
|
-
_context4.next = 7;
|
|
706
|
-
return _ServiceLocator.Services.store.dispatch((0, _Actions.showSwitchToProductionMethodWithVectorization)());
|
|
707
|
-
|
|
708
|
-
case 7:
|
|
709
|
-
return _context4.abrupt("return", true);
|
|
710
|
-
|
|
711
|
-
case 8:
|
|
712
|
-
case "end":
|
|
713
|
-
return _context4.stop();
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
}, _callee4);
|
|
717
|
-
}));
|
|
718
|
-
|
|
719
|
-
return function (_x3) {
|
|
720
|
-
return _ref6.apply(this, arguments);
|
|
721
|
-
};
|
|
722
|
-
}());
|
|
723
|
-
|
|
724
|
-
_defineProperty(this, "checkColorUsageForDesignProductionMethod", /*#__PURE__*/function () {
|
|
725
|
-
var _ref7 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(designProductionMethodIdentifier) {
|
|
726
|
-
var state, _getSelectedDesignAre2, maxColorAmount, designProductionMethod, newProductionMethod, newMaxColorAmount, currentVectorsRequired, newVectorsRequired, designArea, colorPreviewRequired, canvas, images, missingColorPalettesColors;
|
|
727
|
-
|
|
728
|
-
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
729
|
-
while (1) {
|
|
730
|
-
switch (_context5.prev = _context5.next) {
|
|
731
692
|
case 0:
|
|
732
693
|
state = _ServiceLocator.Services.store.state;
|
|
733
694
|
_getSelectedDesignAre2 = (0, _Selectors.getSelectedDesignAreaProperties)(state), maxColorAmount = _getSelectedDesignAre2.maxColorAmount, designProductionMethod = _getSelectedDesignAre2.designProductionMethod;
|
|
@@ -736,10 +697,10 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
736
697
|
currentVectorsRequired = !!(0, _get2["default"])(designProductionMethod, 'options.vectorsRequired');
|
|
737
698
|
newVectorsRequired = !!(0, _get2["default"])(newProductionMethod, 'options.vectorsRequired');
|
|
738
699
|
designArea = (0, _Selectors.getSelectedDesignArea)(state);
|
|
739
|
-
colorPreviewRequired = (0, _Selectors.designProductionMethodHasEmbroideryVisualizationEffect)(newProductionMethod)
|
|
700
|
+
colorPreviewRequired = (0, _Selectors.designProductionMethodHasEmbroideryVisualizationEffect)(newProductionMethod);
|
|
740
701
|
|
|
741
702
|
if (!(newMaxColorAmount !== 0 && newMaxColorAmount < maxColorAmount || !currentVectorsRequired && newVectorsRequired || colorPreviewRequired)) {
|
|
742
|
-
|
|
703
|
+
_context4.next = 15;
|
|
743
704
|
break;
|
|
744
705
|
}
|
|
745
706
|
|
|
@@ -753,71 +714,69 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
753
714
|
}) : [];
|
|
754
715
|
|
|
755
716
|
if (!(images.length > 1)) {
|
|
756
|
-
|
|
717
|
+
_context4.next = 15;
|
|
757
718
|
break;
|
|
758
719
|
}
|
|
759
720
|
|
|
760
|
-
|
|
721
|
+
_context4.next = 14;
|
|
761
722
|
return _ServiceLocator.Services.store.dispatch((0, _Actions.showProductionMethodRemoveImagesConfirm)());
|
|
762
723
|
|
|
763
724
|
case 14:
|
|
764
725
|
images.forEach(function (object) {
|
|
765
726
|
object.remove();
|
|
766
727
|
});
|
|
767
|
-
_context5.next = 17;
|
|
768
|
-
return _this2.updateCanvasData(canvas);
|
|
769
728
|
|
|
770
|
-
case
|
|
729
|
+
case 15:
|
|
771
730
|
missingColorPalettesColors = getMissingColorPalettesColors((0, _Selectors.getColorsWithPalette)(state), newProductionMethod.colorPalettes, !currentVectorsRequired && newVectorsRequired);
|
|
772
731
|
|
|
773
732
|
if (!missingColorPalettesColors.length) {
|
|
774
|
-
|
|
733
|
+
_context4.next = 22;
|
|
775
734
|
break;
|
|
776
735
|
}
|
|
777
736
|
|
|
778
737
|
if ((0, _Selectors.isColoringDisabled)(state, newProductionMethod.identifier)) {
|
|
779
|
-
|
|
738
|
+
_context4.next = 22;
|
|
780
739
|
break;
|
|
781
740
|
}
|
|
782
741
|
|
|
783
|
-
|
|
742
|
+
_context4.next = 20;
|
|
784
743
|
return _ServiceLocator.Services.store.dispatch((0, _Actions.showProductionMethodChangeColorsConfirm)());
|
|
785
744
|
|
|
786
|
-
case
|
|
787
|
-
|
|
745
|
+
case 20:
|
|
746
|
+
_context4.next = 22;
|
|
788
747
|
return _this2.replaceSelectedDesignAreaElementsColor(missingColorPalettesColors, newProductionMethod);
|
|
789
748
|
|
|
790
|
-
case
|
|
749
|
+
case 22:
|
|
791
750
|
case "end":
|
|
792
|
-
return
|
|
751
|
+
return _context4.stop();
|
|
793
752
|
}
|
|
794
753
|
}
|
|
795
|
-
},
|
|
754
|
+
}, _callee4);
|
|
796
755
|
}));
|
|
797
756
|
|
|
798
|
-
return function (
|
|
799
|
-
return
|
|
757
|
+
return function (_x3) {
|
|
758
|
+
return _ref6.apply(this, arguments);
|
|
800
759
|
};
|
|
801
760
|
}());
|
|
802
761
|
|
|
803
762
|
_defineProperty(this, "replaceSelectedDesignAreaElementsColor", /*#__PURE__*/function () {
|
|
804
|
-
var
|
|
763
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(missingColorPalettesColors, designProductionMethod) {
|
|
805
764
|
var state, designArea, designData, objects, _iterator7, _step7, missingColor;
|
|
806
765
|
|
|
807
|
-
return regeneratorRuntime.wrap(function
|
|
766
|
+
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
808
767
|
while (1) {
|
|
809
|
-
switch (
|
|
768
|
+
switch (_context5.prev = _context5.next) {
|
|
810
769
|
case 0:
|
|
811
770
|
state = _ServiceLocator.Services.store.state;
|
|
812
771
|
designArea = (0, _Selectors.getSelectedDesignArea)(state);
|
|
813
772
|
designData = (0, _Selectors.getDesignDataByDesignAreaIdentifier)(state, designArea.identifier);
|
|
814
773
|
objects = (0, _get2["default"])(designData, 'canvasData.objects', []);
|
|
815
|
-
|
|
816
|
-
return Promise.all(objects.filter(function (
|
|
817
|
-
var type =
|
|
774
|
+
_context5.next = 6;
|
|
775
|
+
return Promise.all(objects.filter(function (_ref8) {
|
|
776
|
+
var type = _ref8.type;
|
|
818
777
|
return type === 'Image';
|
|
819
|
-
}).map(function (
|
|
820
|
-
var imageData =
|
|
778
|
+
}).map(function (_ref9) {
|
|
779
|
+
var imageData = _ref9.imageData;
|
|
821
780
|
return (0, _Selectors2.getUserImage)(state, imageData.identifier);
|
|
822
781
|
}).filter(function (image, idx, arr) {
|
|
823
782
|
return arr.indexOf(image) === idx && // uniq
|
|
@@ -851,19 +810,19 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
851
810
|
_iterator7.f();
|
|
852
811
|
}
|
|
853
812
|
|
|
854
|
-
|
|
813
|
+
_context5.next = 10;
|
|
855
814
|
return _this2.loadCanvasDataFromState([designArea]);
|
|
856
815
|
|
|
857
816
|
case 10:
|
|
858
817
|
case "end":
|
|
859
|
-
return
|
|
818
|
+
return _context5.stop();
|
|
860
819
|
}
|
|
861
820
|
}
|
|
862
|
-
},
|
|
821
|
+
}, _callee5);
|
|
863
822
|
}));
|
|
864
823
|
|
|
865
|
-
return function (
|
|
866
|
-
return
|
|
824
|
+
return function (_x4, _x5) {
|
|
825
|
+
return _ref7.apply(this, arguments);
|
|
867
826
|
};
|
|
868
827
|
}());
|
|
869
828
|
}
|
|
@@ -876,36 +835,36 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
876
835
|
_ServiceLocator.Services.store.observeStore(function (state) {
|
|
877
836
|
return state.designArea.filteredDesignAreas;
|
|
878
837
|
}, /*#__PURE__*/function () {
|
|
879
|
-
var
|
|
838
|
+
var _ref10 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(filteredDesignAreas, prevDesignAreas) {
|
|
880
839
|
var initList, areasToLoad;
|
|
881
|
-
return regeneratorRuntime.wrap(function
|
|
840
|
+
return regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
882
841
|
while (1) {
|
|
883
|
-
switch (
|
|
842
|
+
switch (_context6.prev = _context6.next) {
|
|
884
843
|
case 0:
|
|
885
|
-
|
|
886
|
-
|
|
844
|
+
_context6.prev = 0;
|
|
845
|
+
_context6.next = 3;
|
|
887
846
|
return _this3.initCanvases(filteredDesignAreas, prevDesignAreas);
|
|
888
847
|
|
|
889
848
|
case 3:
|
|
890
|
-
initList =
|
|
849
|
+
initList = _context6.sent;
|
|
891
850
|
// only the newly initialized canvases has to be loaded
|
|
892
|
-
areasToLoad = initList.filter(function (
|
|
893
|
-
var isNew =
|
|
851
|
+
areasToLoad = initList.filter(function (_ref11) {
|
|
852
|
+
var isNew = _ref11.isNew;
|
|
894
853
|
return isNew;
|
|
895
|
-
}).map(function (
|
|
896
|
-
var designArea =
|
|
854
|
+
}).map(function (_ref12) {
|
|
855
|
+
var designArea = _ref12.designArea;
|
|
897
856
|
return designArea;
|
|
898
857
|
}); // the canvas data is there first with the configuration, but since the canvas instances are
|
|
899
858
|
// associated with the design areas the data can be loaded only when the design areas are available
|
|
900
859
|
|
|
901
|
-
|
|
860
|
+
_context6.t0 = !(0, _Selectors3.isDesignerProductPreviewMode)() && areasToLoad.length;
|
|
902
861
|
|
|
903
|
-
if (!
|
|
904
|
-
|
|
862
|
+
if (!_context6.t0) {
|
|
863
|
+
_context6.next = 9;
|
|
905
864
|
break;
|
|
906
865
|
}
|
|
907
866
|
|
|
908
|
-
|
|
867
|
+
_context6.next = 9;
|
|
909
868
|
return _this3.loadCanvasDataFromState(areasToLoad);
|
|
910
869
|
|
|
911
870
|
case 9:
|
|
@@ -913,25 +872,25 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
913
872
|
|
|
914
873
|
_this3.designAreaListChangeListener(filteredDesignAreas, prevDesignAreas);
|
|
915
874
|
|
|
916
|
-
|
|
875
|
+
_context6.next = 16;
|
|
917
876
|
break;
|
|
918
877
|
|
|
919
878
|
case 13:
|
|
920
|
-
|
|
921
|
-
|
|
879
|
+
_context6.prev = 13;
|
|
880
|
+
_context6.t1 = _context6["catch"](0);
|
|
922
881
|
// eslint-disable-next-line no-console
|
|
923
|
-
console.error('Error occurred in processing design area list change:',
|
|
882
|
+
console.error('Error occurred in processing design area list change:', _context6.t1);
|
|
924
883
|
|
|
925
884
|
case 16:
|
|
926
885
|
case "end":
|
|
927
|
-
return
|
|
886
|
+
return _context6.stop();
|
|
928
887
|
}
|
|
929
888
|
}
|
|
930
|
-
},
|
|
889
|
+
}, _callee6, null, [[0, 13]]);
|
|
931
890
|
}));
|
|
932
891
|
|
|
933
|
-
return function (
|
|
934
|
-
return
|
|
892
|
+
return function (_x6, _x7) {
|
|
893
|
+
return _ref10.apply(this, arguments);
|
|
935
894
|
};
|
|
936
895
|
}());
|
|
937
896
|
|
|
@@ -951,8 +910,8 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
951
910
|
});
|
|
952
911
|
}
|
|
953
912
|
|
|
954
|
-
_ServiceLocator.Services.store.observeStore(function (
|
|
955
|
-
var selectedoptionclassification =
|
|
913
|
+
_ServiceLocator.Services.store.observeStore(function (_ref13) {
|
|
914
|
+
var selectedoptionclassification = _ref13.configurator.selectedoptionclassification;
|
|
956
915
|
return selectedoptionclassification;
|
|
957
916
|
}, this.componentChangeHandler.bind(this));
|
|
958
917
|
|
|
@@ -1052,13 +1011,13 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
1052
1011
|
}, {
|
|
1053
1012
|
key: "initCanvases",
|
|
1054
1013
|
value: function () {
|
|
1055
|
-
var _initCanvases = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
1014
|
+
var _initCanvases = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(designAreas, prevDesignAreas) {
|
|
1056
1015
|
var _this4 = this;
|
|
1057
1016
|
|
|
1058
1017
|
var state;
|
|
1059
|
-
return regeneratorRuntime.wrap(function
|
|
1018
|
+
return regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
1060
1019
|
while (1) {
|
|
1061
|
-
switch (
|
|
1020
|
+
switch (_context7.prev = _context7.next) {
|
|
1062
1021
|
case 0:
|
|
1063
1022
|
// clean up first: remove canvases that are not mapped to any design areas
|
|
1064
1023
|
this._removeCanvas && prevDesignAreas.filter(function (prevArea) {
|
|
@@ -1069,7 +1028,7 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
1069
1028
|
return _this4._removeCanvas(prevArea);
|
|
1070
1029
|
});
|
|
1071
1030
|
state = _ServiceLocator.Services.store.state;
|
|
1072
|
-
|
|
1031
|
+
_context7.next = 4;
|
|
1073
1032
|
return Promise.all(designAreas.map(function (designArea) {
|
|
1074
1033
|
var maskData = (0, _Selectors.getMaskDataForDesignArea)(state, designArea);
|
|
1075
1034
|
var canvasSize = (0, _Selectors.getCanvasSizeFromDesignArea)(state, designArea);
|
|
@@ -1085,17 +1044,17 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
1085
1044
|
}));
|
|
1086
1045
|
|
|
1087
1046
|
case 4:
|
|
1088
|
-
return
|
|
1047
|
+
return _context7.abrupt("return", _context7.sent);
|
|
1089
1048
|
|
|
1090
1049
|
case 5:
|
|
1091
1050
|
case "end":
|
|
1092
|
-
return
|
|
1051
|
+
return _context7.stop();
|
|
1093
1052
|
}
|
|
1094
1053
|
}
|
|
1095
|
-
},
|
|
1054
|
+
}, _callee7, this);
|
|
1096
1055
|
}));
|
|
1097
1056
|
|
|
1098
|
-
function initCanvases(
|
|
1057
|
+
function initCanvases(_x8, _x9) {
|
|
1099
1058
|
return _initCanvases.apply(this, arguments);
|
|
1100
1059
|
}
|
|
1101
1060
|
|
|
@@ -1109,26 +1068,26 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
1109
1068
|
}, {
|
|
1110
1069
|
key: "updateCanvasDataFromState",
|
|
1111
1070
|
value: function () {
|
|
1112
|
-
var _updateCanvasDataFromState = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
1071
|
+
var _updateCanvasDataFromState = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8() {
|
|
1113
1072
|
var designAreas,
|
|
1114
|
-
|
|
1115
|
-
return regeneratorRuntime.wrap(function
|
|
1073
|
+
_args8 = arguments;
|
|
1074
|
+
return regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
1116
1075
|
while (1) {
|
|
1117
|
-
switch (
|
|
1076
|
+
switch (_context8.prev = _context8.next) {
|
|
1118
1077
|
case 0:
|
|
1119
|
-
designAreas =
|
|
1120
|
-
|
|
1078
|
+
designAreas = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : this.getDesignAreas();
|
|
1079
|
+
_context8.next = 3;
|
|
1121
1080
|
return this.syncCanvases(this._updateCanvasData, designAreas);
|
|
1122
1081
|
|
|
1123
1082
|
case 3:
|
|
1124
|
-
return
|
|
1083
|
+
return _context8.abrupt("return", _context8.sent);
|
|
1125
1084
|
|
|
1126
1085
|
case 4:
|
|
1127
1086
|
case "end":
|
|
1128
|
-
return
|
|
1087
|
+
return _context8.stop();
|
|
1129
1088
|
}
|
|
1130
1089
|
}
|
|
1131
|
-
},
|
|
1090
|
+
}, _callee8, this);
|
|
1132
1091
|
}));
|
|
1133
1092
|
|
|
1134
1093
|
function updateCanvasDataFromState() {
|
|
@@ -1145,26 +1104,26 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
1145
1104
|
}, {
|
|
1146
1105
|
key: "loadCanvasDataFromState",
|
|
1147
1106
|
value: function () {
|
|
1148
|
-
var _loadCanvasDataFromState = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
1107
|
+
var _loadCanvasDataFromState = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9() {
|
|
1149
1108
|
var designAreas,
|
|
1150
|
-
|
|
1151
|
-
return regeneratorRuntime.wrap(function
|
|
1109
|
+
_args9 = arguments;
|
|
1110
|
+
return regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
1152
1111
|
while (1) {
|
|
1153
|
-
switch (
|
|
1112
|
+
switch (_context9.prev = _context9.next) {
|
|
1154
1113
|
case 0:
|
|
1155
|
-
designAreas =
|
|
1156
|
-
|
|
1114
|
+
designAreas = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : this.getDesignAreas();
|
|
1115
|
+
_context9.next = 3;
|
|
1157
1116
|
return this.syncCanvases(this._loadCanvasData, designAreas);
|
|
1158
1117
|
|
|
1159
1118
|
case 3:
|
|
1160
|
-
return
|
|
1119
|
+
return _context9.abrupt("return", _context9.sent);
|
|
1161
1120
|
|
|
1162
1121
|
case 4:
|
|
1163
1122
|
case "end":
|
|
1164
|
-
return
|
|
1123
|
+
return _context9.stop();
|
|
1165
1124
|
}
|
|
1166
1125
|
}
|
|
1167
|
-
},
|
|
1126
|
+
}, _callee9, this);
|
|
1168
1127
|
}));
|
|
1169
1128
|
|
|
1170
1129
|
function loadCanvasDataFromState() {
|
|
@@ -1184,48 +1143,48 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
1184
1143
|
}, {
|
|
1185
1144
|
key: "syncCanvases",
|
|
1186
1145
|
value: function () {
|
|
1187
|
-
var _syncCanvases = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
1146
|
+
var _syncCanvases = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee11(updateFn, designAreas) {
|
|
1188
1147
|
var _this5 = this;
|
|
1189
1148
|
|
|
1190
1149
|
var state;
|
|
1191
|
-
return regeneratorRuntime.wrap(function
|
|
1150
|
+
return regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
1192
1151
|
while (1) {
|
|
1193
|
-
switch (
|
|
1152
|
+
switch (_context11.prev = _context11.next) {
|
|
1194
1153
|
case 0:
|
|
1195
1154
|
state = _ServiceLocator.Services.store.state;
|
|
1196
|
-
|
|
1155
|
+
_context11.next = 3;
|
|
1197
1156
|
return Promise.all(designAreas.map( /*#__PURE__*/function () {
|
|
1198
|
-
var
|
|
1157
|
+
var _ref14 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10(designArea) {
|
|
1199
1158
|
var designData, canvasData, canvasSize;
|
|
1200
|
-
return regeneratorRuntime.wrap(function
|
|
1159
|
+
return regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
1201
1160
|
while (1) {
|
|
1202
|
-
switch (
|
|
1161
|
+
switch (_context10.prev = _context10.next) {
|
|
1203
1162
|
case 0:
|
|
1204
1163
|
designData = (0, _Selectors.getDesignDataByDesignAreaIdentifier)(state, designArea.identifier);
|
|
1205
1164
|
canvasData = (0, _get2["default"])(designData, 'canvasData');
|
|
1206
1165
|
|
|
1207
1166
|
if (!canvasData) {
|
|
1208
|
-
|
|
1167
|
+
_context10.next = 7;
|
|
1209
1168
|
break;
|
|
1210
1169
|
}
|
|
1211
1170
|
|
|
1212
|
-
|
|
1171
|
+
_context10.next = 5;
|
|
1213
1172
|
return preloadFonts(canvasData);
|
|
1214
1173
|
|
|
1215
1174
|
case 5:
|
|
1216
1175
|
canvasSize = (0, _Selectors.getCanvasSizeFromDesignArea)(state, designArea);
|
|
1217
|
-
return
|
|
1176
|
+
return _context10.abrupt("return", updateFn && updateFn(canvasData, designArea, canvasSize));
|
|
1218
1177
|
|
|
1219
1178
|
case 7:
|
|
1220
1179
|
case "end":
|
|
1221
|
-
return
|
|
1180
|
+
return _context10.stop();
|
|
1222
1181
|
}
|
|
1223
1182
|
}
|
|
1224
|
-
},
|
|
1183
|
+
}, _callee10);
|
|
1225
1184
|
}));
|
|
1226
1185
|
|
|
1227
|
-
return function (
|
|
1228
|
-
return
|
|
1186
|
+
return function (_x12) {
|
|
1187
|
+
return _ref14.apply(this, arguments);
|
|
1229
1188
|
};
|
|
1230
1189
|
}()));
|
|
1231
1190
|
|
|
@@ -1236,13 +1195,13 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
1236
1195
|
|
|
1237
1196
|
case 4:
|
|
1238
1197
|
case "end":
|
|
1239
|
-
return
|
|
1198
|
+
return _context11.stop();
|
|
1240
1199
|
}
|
|
1241
1200
|
}
|
|
1242
|
-
},
|
|
1201
|
+
}, _callee11);
|
|
1243
1202
|
}));
|
|
1244
1203
|
|
|
1245
|
-
function syncCanvases(
|
|
1204
|
+
function syncCanvases(_x10, _x11) {
|
|
1246
1205
|
return _syncCanvases.apply(this, arguments);
|
|
1247
1206
|
}
|
|
1248
1207
|
|
|
@@ -1258,8 +1217,8 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
1258
1217
|
}, {
|
|
1259
1218
|
key: "getDesignAreaByIdentifier",
|
|
1260
1219
|
value: function getDesignAreaByIdentifier(designAreaIdentifier) {
|
|
1261
|
-
return this.getDesignAreas().find(function (
|
|
1262
|
-
var identifier =
|
|
1220
|
+
return this.getDesignAreas().find(function (_ref15) {
|
|
1221
|
+
var identifier = _ref15.identifier;
|
|
1263
1222
|
return identifier === designAreaIdentifier;
|
|
1264
1223
|
});
|
|
1265
1224
|
}
|
|
@@ -1299,15 +1258,15 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
1299
1258
|
}, {
|
|
1300
1259
|
key: "updateCanvasData",
|
|
1301
1260
|
value: function () {
|
|
1302
|
-
var _updateCanvasData = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
1261
|
+
var _updateCanvasData = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee12(canvas, eventData) {
|
|
1303
1262
|
var canvasDataJSON, showAlert, _getDesignDataForSele, canvasData;
|
|
1304
1263
|
|
|
1305
|
-
return regeneratorRuntime.wrap(function
|
|
1264
|
+
return regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
1306
1265
|
while (1) {
|
|
1307
|
-
switch (
|
|
1266
|
+
switch (_context12.prev = _context12.next) {
|
|
1308
1267
|
case 0:
|
|
1309
1268
|
if (this._serializeCanvas) {
|
|
1310
|
-
|
|
1269
|
+
_context12.next = 2;
|
|
1311
1270
|
break;
|
|
1312
1271
|
}
|
|
1313
1272
|
|
|
@@ -1322,7 +1281,7 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
1322
1281
|
showAlert = eventData ? checkColorUsage(canvasDataJSON, eventData.changeEvent) : false;
|
|
1323
1282
|
|
|
1324
1283
|
if (!(showAlert && (0, _configuration.getConf)('displayColorAmountWarnings', true))) {
|
|
1325
|
-
|
|
1284
|
+
_context12.next = 9;
|
|
1326
1285
|
break;
|
|
1327
1286
|
}
|
|
1328
1287
|
|
|
@@ -1331,20 +1290,20 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
1331
1290
|
_getDesignDataForSele = (0, _Selectors.getDesignDataForSelectedDesignArea)(_ServiceLocator.Services.store.state), canvasData = _getDesignDataForSele.canvasData; // Restore Graphics Editor state
|
|
1332
1291
|
|
|
1333
1292
|
this._loadCanvasData && this._loadCanvasData(canvasData);
|
|
1334
|
-
return
|
|
1293
|
+
return _context12.abrupt("return");
|
|
1335
1294
|
|
|
1336
1295
|
case 9:
|
|
1337
1296
|
this.setCanvasData(canvasDataJSON);
|
|
1338
1297
|
|
|
1339
1298
|
case 10:
|
|
1340
1299
|
case "end":
|
|
1341
|
-
return
|
|
1300
|
+
return _context12.stop();
|
|
1342
1301
|
}
|
|
1343
1302
|
}
|
|
1344
|
-
},
|
|
1303
|
+
}, _callee12, this);
|
|
1345
1304
|
}));
|
|
1346
1305
|
|
|
1347
|
-
function updateCanvasData(
|
|
1306
|
+
function updateCanvasData(_x13, _x14) {
|
|
1348
1307
|
return _updateCanvasData.apply(this, arguments);
|
|
1349
1308
|
}
|
|
1350
1309
|
|
|
@@ -1352,31 +1311,31 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
1352
1311
|
}()
|
|
1353
1312
|
}, {
|
|
1354
1313
|
key: "createCanvasChangeListener",
|
|
1355
|
-
value: function createCanvasChangeListener(
|
|
1314
|
+
value: function createCanvasChangeListener(_ref16) {
|
|
1356
1315
|
var _this6 = this;
|
|
1357
1316
|
|
|
1358
|
-
var syncCanvasChange =
|
|
1317
|
+
var syncCanvasChange = _ref16.syncCanvasChange;
|
|
1359
1318
|
this._syncCanvasChange = syncCanvasChange;
|
|
1360
|
-
return /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
1361
|
-
var
|
|
1362
|
-
return regeneratorRuntime.wrap(function
|
|
1319
|
+
return /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee13() {
|
|
1320
|
+
var _args13 = arguments;
|
|
1321
|
+
return regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
1363
1322
|
while (1) {
|
|
1364
|
-
switch (
|
|
1323
|
+
switch (_context13.prev = _context13.next) {
|
|
1365
1324
|
case 0:
|
|
1366
1325
|
if (!_this6._isCanvasDataUpdateEnabled) {
|
|
1367
|
-
|
|
1326
|
+
_context13.next = 3;
|
|
1368
1327
|
break;
|
|
1369
1328
|
}
|
|
1370
1329
|
|
|
1371
|
-
|
|
1372
|
-
return _this6.updateCanvasData.apply(_this6,
|
|
1330
|
+
_context13.next = 3;
|
|
1331
|
+
return _this6.updateCanvasData.apply(_this6, _args13);
|
|
1373
1332
|
|
|
1374
1333
|
case 3:
|
|
1375
1334
|
case "end":
|
|
1376
|
-
return
|
|
1335
|
+
return _context13.stop();
|
|
1377
1336
|
}
|
|
1378
1337
|
}
|
|
1379
|
-
},
|
|
1338
|
+
}, _callee13);
|
|
1380
1339
|
}));
|
|
1381
1340
|
}
|
|
1382
1341
|
}, {
|
|
@@ -1628,34 +1587,20 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
1628
1587
|
}, {
|
|
1629
1588
|
key: "vectorizeSingleImageAndShowEditDialog",
|
|
1630
1589
|
value: function () {
|
|
1631
|
-
var _vectorizeSingleImageAndShowEditDialog = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
1632
|
-
var showImageEditDialog, state, designArea, canvas,
|
|
1633
|
-
return regeneratorRuntime.wrap(function
|
|
1590
|
+
var _vectorizeSingleImageAndShowEditDialog = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee14(identifier) {
|
|
1591
|
+
var showImageEditDialog, state, designArea, canvas, firstNonVectorizedImage, operations, imageData, imageToSelect;
|
|
1592
|
+
return regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
1634
1593
|
while (1) {
|
|
1635
|
-
switch (
|
|
1594
|
+
switch (_context14.prev = _context14.next) {
|
|
1636
1595
|
case 0:
|
|
1637
|
-
|
|
1596
|
+
_context14.next = 2;
|
|
1638
1597
|
return this.handleDesignProductionMethodChangeFromNonVectorizationToVectorization(identifier);
|
|
1639
1598
|
|
|
1640
1599
|
case 2:
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
if (_context15.t0) {
|
|
1644
|
-
_context15.next = 7;
|
|
1645
|
-
break;
|
|
1646
|
-
}
|
|
1647
|
-
|
|
1648
|
-
_context15.next = 6;
|
|
1649
|
-
return this.handleDesignProductionMethodChangeToMandatoryVectorization(identifier);
|
|
1650
|
-
|
|
1651
|
-
case 6:
|
|
1652
|
-
_context15.t0 = _context15.sent;
|
|
1653
|
-
|
|
1654
|
-
case 7:
|
|
1655
|
-
showImageEditDialog = _context15.t0;
|
|
1600
|
+
showImageEditDialog = _context14.sent;
|
|
1656
1601
|
|
|
1657
1602
|
if (!showImageEditDialog) {
|
|
1658
|
-
|
|
1603
|
+
_context14.next = 23;
|
|
1659
1604
|
break;
|
|
1660
1605
|
}
|
|
1661
1606
|
|
|
@@ -1664,58 +1609,57 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
1664
1609
|
state = _ServiceLocator.Services.store.state;
|
|
1665
1610
|
designArea = (0, _Selectors.getSelectedDesignArea)(state);
|
|
1666
1611
|
canvas = this._getCanvas(designArea);
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
return !(0, _get2["default"])(obj, 'imageData.gallery') && (!(0, _get2["default"])(obj, 'imageData.operations.vectorize') || !(0, _get2["default"])(obj, 'imageData.displayColorPreview'));
|
|
1612
|
+
firstNonVectorizedImage = (0, _Selectors.getImagesByDesignArea)(state, designArea.identifier).find(function (obj) {
|
|
1613
|
+
return !(0, _get2["default"])(obj, 'imageData.operations.vectorize');
|
|
1670
1614
|
});
|
|
1671
|
-
_context15.prev = 15;
|
|
1672
1615
|
operations = _objectSpread(_objectSpread({}, firstNonVectorizedImage.imageData.operations), {}, {
|
|
1673
1616
|
vectorize: true
|
|
1674
1617
|
});
|
|
1675
|
-
imageData = firstNonVectorizedImage.imageData;
|
|
1618
|
+
imageData = firstNonVectorizedImage.imageData;
|
|
1619
|
+
_context14.prev = 11;
|
|
1676
1620
|
|
|
1677
1621
|
if (!imageData.isPlaceHolderImage) {
|
|
1678
|
-
|
|
1622
|
+
_context14.next = 14;
|
|
1679
1623
|
break;
|
|
1680
1624
|
}
|
|
1681
1625
|
|
|
1682
|
-
return
|
|
1626
|
+
return _context14.abrupt("return");
|
|
1683
1627
|
|
|
1684
|
-
case
|
|
1685
|
-
|
|
1628
|
+
case 14:
|
|
1629
|
+
_context14.next = 16;
|
|
1686
1630
|
return _ServiceLocator.Services.designData.editFile(operations, imageData, {
|
|
1687
1631
|
immediateCommit: true
|
|
1688
1632
|
});
|
|
1689
1633
|
|
|
1690
|
-
case
|
|
1634
|
+
case 16:
|
|
1691
1635
|
imageToSelect = canvas.objects.filter(function (object) {
|
|
1692
1636
|
return object.type === 'Image';
|
|
1693
1637
|
}).find(function (obj) {
|
|
1694
1638
|
return obj._imageData.identifier === imageData.identifier;
|
|
1695
1639
|
});
|
|
1696
1640
|
imageToSelect.selected = true;
|
|
1697
|
-
|
|
1641
|
+
_context14.next = 20;
|
|
1698
1642
|
return _ServiceLocator.Services.designer.openImageEditDialog(firstNonVectorizedImage.imageData.identifier, canvas, {
|
|
1699
1643
|
placeholderImageUpdate: false,
|
|
1700
1644
|
submitOnExitClick: true
|
|
1701
1645
|
});
|
|
1702
1646
|
|
|
1703
|
-
case
|
|
1704
|
-
|
|
1647
|
+
case 20:
|
|
1648
|
+
_context14.prev = 20;
|
|
1705
1649
|
|
|
1706
1650
|
_ServiceLocator.Services.ui.hide('globalLoader');
|
|
1707
1651
|
|
|
1708
|
-
return
|
|
1652
|
+
return _context14.finish(20);
|
|
1709
1653
|
|
|
1710
|
-
case
|
|
1654
|
+
case 23:
|
|
1711
1655
|
case "end":
|
|
1712
|
-
return
|
|
1656
|
+
return _context14.stop();
|
|
1713
1657
|
}
|
|
1714
1658
|
}
|
|
1715
|
-
},
|
|
1659
|
+
}, _callee14, this, [[11,, 20, 23]]);
|
|
1716
1660
|
}));
|
|
1717
1661
|
|
|
1718
|
-
function vectorizeSingleImageAndShowEditDialog(
|
|
1662
|
+
function vectorizeSingleImageAndShowEditDialog(_x15) {
|
|
1719
1663
|
return _vectorizeSingleImageAndShowEditDialog.apply(this, arguments);
|
|
1720
1664
|
}
|
|
1721
1665
|
|
|
@@ -1724,21 +1668,21 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
1724
1668
|
}, {
|
|
1725
1669
|
key: "restoreVectorizedImages",
|
|
1726
1670
|
value: function () {
|
|
1727
|
-
var _restoreVectorizedImages = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
1671
|
+
var _restoreVectorizedImages = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee15(identifier) {
|
|
1728
1672
|
var displayImagesAsUnVectorized, state, designArea, images, _iterator8, _step8, image, operations;
|
|
1729
1673
|
|
|
1730
|
-
return regeneratorRuntime.wrap(function
|
|
1674
|
+
return regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
1731
1675
|
while (1) {
|
|
1732
|
-
switch (
|
|
1676
|
+
switch (_context15.prev = _context15.next) {
|
|
1733
1677
|
case 0:
|
|
1734
|
-
|
|
1678
|
+
_context15.next = 2;
|
|
1735
1679
|
return this.handleDesignProductionMethodChangeFromVectorizationToNonVectorization(identifier);
|
|
1736
1680
|
|
|
1737
1681
|
case 2:
|
|
1738
|
-
displayImagesAsUnVectorized =
|
|
1682
|
+
displayImagesAsUnVectorized = _context15.sent;
|
|
1739
1683
|
|
|
1740
1684
|
if (!displayImagesAsUnVectorized) {
|
|
1741
|
-
|
|
1685
|
+
_context15.next = 28;
|
|
1742
1686
|
break;
|
|
1743
1687
|
}
|
|
1744
1688
|
|
|
@@ -1750,58 +1694,58 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
1750
1694
|
}); //excluding placeHolderImage from executing edit operations
|
|
1751
1695
|
|
|
1752
1696
|
_iterator8 = _createForOfIteratorHelper(images);
|
|
1753
|
-
|
|
1697
|
+
_context15.prev = 9;
|
|
1754
1698
|
|
|
1755
1699
|
_iterator8.s();
|
|
1756
1700
|
|
|
1757
1701
|
case 11:
|
|
1758
1702
|
if ((_step8 = _iterator8.n()).done) {
|
|
1759
|
-
|
|
1703
|
+
_context15.next = 18;
|
|
1760
1704
|
break;
|
|
1761
1705
|
}
|
|
1762
1706
|
|
|
1763
1707
|
image = _step8.value;
|
|
1764
1708
|
operations = (0, _Modifiers.removeVectorizeFromOperations)(image.imageData.operations);
|
|
1765
|
-
|
|
1709
|
+
_context15.next = 16;
|
|
1766
1710
|
return _ServiceLocator.Services.designData.editFile(operations, image.imageData, {
|
|
1767
1711
|
immediateCommit: true,
|
|
1768
1712
|
displayColorPreview: (0, _configuration.getConf)('autoPreviewVectorization', true)
|
|
1769
1713
|
});
|
|
1770
1714
|
|
|
1771
1715
|
case 16:
|
|
1772
|
-
|
|
1716
|
+
_context15.next = 11;
|
|
1773
1717
|
break;
|
|
1774
1718
|
|
|
1775
1719
|
case 18:
|
|
1776
|
-
|
|
1720
|
+
_context15.next = 23;
|
|
1777
1721
|
break;
|
|
1778
1722
|
|
|
1779
1723
|
case 20:
|
|
1780
|
-
|
|
1781
|
-
|
|
1724
|
+
_context15.prev = 20;
|
|
1725
|
+
_context15.t0 = _context15["catch"](9);
|
|
1782
1726
|
|
|
1783
|
-
_iterator8.e(
|
|
1727
|
+
_iterator8.e(_context15.t0);
|
|
1784
1728
|
|
|
1785
1729
|
case 23:
|
|
1786
|
-
|
|
1730
|
+
_context15.prev = 23;
|
|
1787
1731
|
|
|
1788
1732
|
_iterator8.f();
|
|
1789
1733
|
|
|
1790
|
-
return
|
|
1734
|
+
return _context15.finish(23);
|
|
1791
1735
|
|
|
1792
1736
|
case 26:
|
|
1793
|
-
|
|
1737
|
+
_context15.next = 28;
|
|
1794
1738
|
return this.loadCanvasDataFromState([designArea]);
|
|
1795
1739
|
|
|
1796
1740
|
case 28:
|
|
1797
1741
|
case "end":
|
|
1798
|
-
return
|
|
1742
|
+
return _context15.stop();
|
|
1799
1743
|
}
|
|
1800
1744
|
}
|
|
1801
|
-
},
|
|
1745
|
+
}, _callee15, this, [[9, 20, 23, 26]]);
|
|
1802
1746
|
}));
|
|
1803
1747
|
|
|
1804
|
-
function restoreVectorizedImages(
|
|
1748
|
+
function restoreVectorizedImages(_x16) {
|
|
1805
1749
|
return _restoreVectorizedImages.apply(this, arguments);
|
|
1806
1750
|
}
|
|
1807
1751
|
|
|
@@ -1810,50 +1754,50 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
1810
1754
|
}, {
|
|
1811
1755
|
key: "updateObjectsAfterProductionMethodChange",
|
|
1812
1756
|
value: function () {
|
|
1813
|
-
var _updateObjectsAfterProductionMethodChange = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
1757
|
+
var _updateObjectsAfterProductionMethodChange = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee16(oldProductionMethod, newProductionMethod) {
|
|
1814
1758
|
var _getDesignDataForSele2, canvasData, objects, newObjects, designArea;
|
|
1815
1759
|
|
|
1816
|
-
return regeneratorRuntime.wrap(function
|
|
1760
|
+
return regeneratorRuntime.wrap(function _callee16$(_context16) {
|
|
1817
1761
|
while (1) {
|
|
1818
|
-
switch (
|
|
1762
|
+
switch (_context16.prev = _context16.next) {
|
|
1819
1763
|
case 0:
|
|
1820
1764
|
_getDesignDataForSele2 = (0, _Selectors.getDesignDataForSelectedDesignArea)(_ServiceLocator.Services.store.state), canvasData = _getDesignDataForSele2.canvasData;
|
|
1821
1765
|
|
|
1822
1766
|
if (canvasData) {
|
|
1823
|
-
|
|
1767
|
+
_context16.next = 3;
|
|
1824
1768
|
break;
|
|
1825
1769
|
}
|
|
1826
1770
|
|
|
1827
|
-
return
|
|
1771
|
+
return _context16.abrupt("return");
|
|
1828
1772
|
|
|
1829
1773
|
case 3:
|
|
1830
1774
|
objects = canvasData.objects;
|
|
1831
1775
|
newObjects = (0, _Modifiers.applyProductionMethodChangeToCanvasObjects)(newProductionMethod, oldProductionMethod, objects);
|
|
1832
1776
|
|
|
1833
1777
|
if (!(newObjects === objects)) {
|
|
1834
|
-
|
|
1778
|
+
_context16.next = 7;
|
|
1835
1779
|
break;
|
|
1836
1780
|
}
|
|
1837
1781
|
|
|
1838
|
-
return
|
|
1782
|
+
return _context16.abrupt("return");
|
|
1839
1783
|
|
|
1840
1784
|
case 7:
|
|
1841
1785
|
this.setCanvasData(_objectSpread(_objectSpread({}, canvasData), {}, {
|
|
1842
1786
|
objects: newObjects
|
|
1843
1787
|
}));
|
|
1844
1788
|
designArea = (0, _Selectors.getSelectedDesignArea)(_ServiceLocator.Services.store.state);
|
|
1845
|
-
|
|
1789
|
+
_context16.next = 11;
|
|
1846
1790
|
return this.updateCanvasDataFromState([designArea]);
|
|
1847
1791
|
|
|
1848
1792
|
case 11:
|
|
1849
1793
|
case "end":
|
|
1850
|
-
return
|
|
1794
|
+
return _context16.stop();
|
|
1851
1795
|
}
|
|
1852
1796
|
}
|
|
1853
|
-
},
|
|
1797
|
+
}, _callee16, this);
|
|
1854
1798
|
}));
|
|
1855
1799
|
|
|
1856
|
-
function updateObjectsAfterProductionMethodChange(
|
|
1800
|
+
function updateObjectsAfterProductionMethodChange(_x17, _x18) {
|
|
1857
1801
|
return _updateObjectsAfterProductionMethodChange.apply(this, arguments);
|
|
1858
1802
|
}
|
|
1859
1803
|
|
|
@@ -1878,18 +1822,18 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
1878
1822
|
}, {
|
|
1879
1823
|
key: "setDesignProductionMethod",
|
|
1880
1824
|
value: function () {
|
|
1881
|
-
var _setDesignProductionMethod2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
1825
|
+
var _setDesignProductionMethod2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee17(identifier) {
|
|
1882
1826
|
var state, designData, selectedDesignProduction, bulkNameSelected, fontSizeMin, smallestFontSize, oldDesignProductionMethod;
|
|
1883
|
-
return regeneratorRuntime.wrap(function
|
|
1827
|
+
return regeneratorRuntime.wrap(function _callee17$(_context17) {
|
|
1884
1828
|
while (1) {
|
|
1885
|
-
switch (
|
|
1829
|
+
switch (_context17.prev = _context17.next) {
|
|
1886
1830
|
case 0:
|
|
1887
1831
|
if (this.checkDesignElementRestrictions(identifier)) {
|
|
1888
|
-
|
|
1832
|
+
_context17.next = 2;
|
|
1889
1833
|
break;
|
|
1890
1834
|
}
|
|
1891
1835
|
|
|
1892
|
-
return
|
|
1836
|
+
return _context17.abrupt("return");
|
|
1893
1837
|
|
|
1894
1838
|
case 2:
|
|
1895
1839
|
this.clearSelectionOnCurrentDesignArea(); // check if the selected design production method has a higher minimum font size
|
|
@@ -1901,83 +1845,83 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
1901
1845
|
bulkNameSelected = (0, _Selectors.hasSelectedBulkName)(designData);
|
|
1902
1846
|
|
|
1903
1847
|
if (isWidget(location.pathname)) {
|
|
1904
|
-
|
|
1848
|
+
_context17.next = 44;
|
|
1905
1849
|
break;
|
|
1906
1850
|
}
|
|
1907
1851
|
|
|
1908
1852
|
fontSizeMin = (0, _Selectors.getFontSizeMin)(state, identifier);
|
|
1909
1853
|
smallestFontSize = (0, _Selectors.findSmallestFontSizeInCanvasData)(designData.canvasData);
|
|
1910
|
-
|
|
1911
|
-
|
|
1854
|
+
_context17.prev = 10;
|
|
1855
|
+
_context17.t0 = smallestFontSize < fontSizeMin;
|
|
1912
1856
|
|
|
1913
|
-
if (!
|
|
1914
|
-
|
|
1857
|
+
if (!_context17.t0) {
|
|
1858
|
+
_context17.next = 15;
|
|
1915
1859
|
break;
|
|
1916
1860
|
}
|
|
1917
1861
|
|
|
1918
|
-
|
|
1862
|
+
_context17.next = 15;
|
|
1919
1863
|
return _ServiceLocator.Services.store.dispatch((0, _Actions.showMinFontSizeConfirm)(fontSizeMin));
|
|
1920
1864
|
|
|
1921
1865
|
case 15:
|
|
1922
|
-
|
|
1866
|
+
_context17.next = 20;
|
|
1923
1867
|
break;
|
|
1924
1868
|
|
|
1925
1869
|
case 17:
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
return
|
|
1870
|
+
_context17.prev = 17;
|
|
1871
|
+
_context17.t1 = _context17["catch"](10);
|
|
1872
|
+
return _context17.abrupt("return");
|
|
1929
1873
|
|
|
1930
1874
|
case 20:
|
|
1931
|
-
|
|
1932
|
-
|
|
1875
|
+
_context17.prev = 20;
|
|
1876
|
+
_context17.next = 23;
|
|
1933
1877
|
return this.checkColorUsageForDesignProductionMethod(identifier);
|
|
1934
1878
|
|
|
1935
1879
|
case 23:
|
|
1936
|
-
|
|
1880
|
+
_context17.next = 25;
|
|
1937
1881
|
return this.vectorizeSingleImageAndShowEditDialog(identifier);
|
|
1938
1882
|
|
|
1939
1883
|
case 25:
|
|
1940
|
-
|
|
1884
|
+
_context17.next = 27;
|
|
1941
1885
|
return this.restoreVectorizedImages(identifier);
|
|
1942
1886
|
|
|
1943
1887
|
case 27:
|
|
1944
|
-
|
|
1888
|
+
_context17.next = 34;
|
|
1945
1889
|
break;
|
|
1946
1890
|
|
|
1947
1891
|
case 29:
|
|
1948
|
-
|
|
1949
|
-
|
|
1892
|
+
_context17.prev = 29;
|
|
1893
|
+
_context17.t2 = _context17["catch"](20);
|
|
1950
1894
|
|
|
1951
|
-
if (!(0, _Actions5.isConfirmResult)(
|
|
1952
|
-
|
|
1895
|
+
if (!(0, _Actions5.isConfirmResult)(_context17.t2)) {
|
|
1896
|
+
_context17.next = 33;
|
|
1953
1897
|
break;
|
|
1954
1898
|
}
|
|
1955
1899
|
|
|
1956
|
-
return
|
|
1900
|
+
return _context17.abrupt("return");
|
|
1957
1901
|
|
|
1958
1902
|
case 33:
|
|
1959
|
-
throw
|
|
1903
|
+
throw _context17.t2;
|
|
1960
1904
|
|
|
1961
1905
|
case 34:
|
|
1962
|
-
|
|
1963
|
-
|
|
1906
|
+
_context17.prev = 34;
|
|
1907
|
+
_context17.t3 = bulkNameSelected && !selectedDesignProduction.allowBulkNames;
|
|
1964
1908
|
|
|
1965
|
-
if (!
|
|
1966
|
-
|
|
1909
|
+
if (!_context17.t3) {
|
|
1910
|
+
_context17.next = 39;
|
|
1967
1911
|
break;
|
|
1968
1912
|
}
|
|
1969
1913
|
|
|
1970
|
-
|
|
1914
|
+
_context17.next = 39;
|
|
1971
1915
|
return _ServiceLocator.Services.store.dispatch((0, _Actions.showProductionMethodChangeConfirm)());
|
|
1972
1916
|
|
|
1973
1917
|
case 39:
|
|
1974
|
-
|
|
1918
|
+
_context17.next = 44;
|
|
1975
1919
|
break;
|
|
1976
1920
|
|
|
1977
1921
|
case 41:
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
return
|
|
1922
|
+
_context17.prev = 41;
|
|
1923
|
+
_context17.t4 = _context17["catch"](34);
|
|
1924
|
+
return _context17.abrupt("return");
|
|
1981
1925
|
|
|
1982
1926
|
case 44:
|
|
1983
1927
|
oldDesignProductionMethod = (0, _Selectors.getSelectedDesignProductionMethod)(state);
|
|
@@ -1995,18 +1939,18 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
1995
1939
|
!(0, _Selectors.isBulkNamesSelected)(_ServiceLocator.Services.store.state.configurator) && _ServiceLocator.Services.configurator.clearBulkNames();
|
|
1996
1940
|
}
|
|
1997
1941
|
|
|
1998
|
-
|
|
1942
|
+
_context17.next = 51;
|
|
1999
1943
|
return this.updateObjectsAfterProductionMethodChange(oldDesignProductionMethod, selectedDesignProduction);
|
|
2000
1944
|
|
|
2001
1945
|
case 51:
|
|
2002
1946
|
case "end":
|
|
2003
|
-
return
|
|
1947
|
+
return _context17.stop();
|
|
2004
1948
|
}
|
|
2005
1949
|
}
|
|
2006
|
-
},
|
|
1950
|
+
}, _callee17, this, [[10, 17], [20, 29], [34, 41]]);
|
|
2007
1951
|
}));
|
|
2008
1952
|
|
|
2009
|
-
function setDesignProductionMethod(
|
|
1953
|
+
function setDesignProductionMethod(_x19) {
|
|
2010
1954
|
return _setDesignProductionMethod2.apply(this, arguments);
|
|
2011
1955
|
}
|
|
2012
1956
|
|
|
@@ -2038,11 +1982,11 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
2038
1982
|
}, {
|
|
2039
1983
|
key: "setColorAmount",
|
|
2040
1984
|
value: function () {
|
|
2041
|
-
var _setColorAmount2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
1985
|
+
var _setColorAmount2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee18(maxColorCount) {
|
|
2042
1986
|
var currentColorCount, colorCount;
|
|
2043
|
-
return regeneratorRuntime.wrap(function
|
|
1987
|
+
return regeneratorRuntime.wrap(function _callee18$(_context18) {
|
|
2044
1988
|
while (1) {
|
|
2045
|
-
switch (
|
|
1989
|
+
switch (_context18.prev = _context18.next) {
|
|
2046
1990
|
case 0:
|
|
2047
1991
|
// check the current color usage before applying the selected color count
|
|
2048
1992
|
// so if the color count is more than the selected maxColorCount the user can decide to
|
|
@@ -2052,35 +1996,35 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
2052
1996
|
colorCount = (0, _Selectors.getColors)(_ServiceLocator.Services.store.state).length;
|
|
2053
1997
|
|
|
2054
1998
|
if (!(maxColorCount && colorCount > maxColorCount && !isWidget(location.pathname) && (0, _configuration.getConf)('displayColorAmountWarnings', true))) {
|
|
2055
|
-
|
|
1999
|
+
_context18.next = 11;
|
|
2056
2000
|
break;
|
|
2057
2001
|
}
|
|
2058
2002
|
|
|
2059
|
-
|
|
2060
|
-
|
|
2003
|
+
_context18.prev = 3;
|
|
2004
|
+
_context18.next = 6;
|
|
2061
2005
|
return _ServiceLocator.Services.store.dispatch((0, _Actions.showMaxColorChangeConfirm)(colorCount, maxColorCount, currentColorCount));
|
|
2062
2006
|
|
|
2063
2007
|
case 6:
|
|
2064
|
-
|
|
2008
|
+
_context18.next = 11;
|
|
2065
2009
|
break;
|
|
2066
2010
|
|
|
2067
2011
|
case 8:
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
return
|
|
2012
|
+
_context18.prev = 8;
|
|
2013
|
+
_context18.t0 = _context18["catch"](3);
|
|
2014
|
+
return _context18.abrupt("return");
|
|
2071
2015
|
|
|
2072
2016
|
case 11:
|
|
2073
2017
|
_ServiceLocator.Services.store.dispatch((0, _Actions.setColorAmount)(maxColorCount));
|
|
2074
2018
|
|
|
2075
2019
|
case 12:
|
|
2076
2020
|
case "end":
|
|
2077
|
-
return
|
|
2021
|
+
return _context18.stop();
|
|
2078
2022
|
}
|
|
2079
2023
|
}
|
|
2080
|
-
},
|
|
2024
|
+
}, _callee18, null, [[3, 8]]);
|
|
2081
2025
|
}));
|
|
2082
2026
|
|
|
2083
|
-
function setColorAmount(
|
|
2027
|
+
function setColorAmount(_x20) {
|
|
2084
2028
|
return _setColorAmount2.apply(this, arguments);
|
|
2085
2029
|
}
|
|
2086
2030
|
|
|
@@ -2095,42 +2039,42 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
2095
2039
|
}, {
|
|
2096
2040
|
key: "updateVisualization",
|
|
2097
2041
|
value: function () {
|
|
2098
|
-
var _updateVisualization = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
2042
|
+
var _updateVisualization = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee19() {
|
|
2099
2043
|
var updateEventObject,
|
|
2100
2044
|
isDesignAreaSelected,
|
|
2101
2045
|
isDesignerOpen,
|
|
2102
2046
|
isScreenshotEvent,
|
|
2103
2047
|
drawingFunction,
|
|
2104
|
-
|
|
2105
|
-
return regeneratorRuntime.wrap(function
|
|
2048
|
+
_args19 = arguments;
|
|
2049
|
+
return regeneratorRuntime.wrap(function _callee19$(_context19) {
|
|
2106
2050
|
while (1) {
|
|
2107
|
-
switch (
|
|
2051
|
+
switch (_context19.prev = _context19.next) {
|
|
2108
2052
|
case 0:
|
|
2109
|
-
updateEventObject =
|
|
2053
|
+
updateEventObject = _args19.length > 0 && _args19[0] !== undefined ? _args19[0] : {};
|
|
2110
2054
|
|
|
2111
2055
|
if (_ServiceLocator.Services.visualization.isReadyToRender()) {
|
|
2112
|
-
|
|
2056
|
+
_context19.next = 3;
|
|
2113
2057
|
break;
|
|
2114
2058
|
}
|
|
2115
2059
|
|
|
2116
|
-
return
|
|
2060
|
+
return _context19.abrupt("return");
|
|
2117
2061
|
|
|
2118
2062
|
case 3:
|
|
2119
2063
|
if (_ServiceLocator.Services.visualization.isReadyToRenderCustomDesign()) {
|
|
2120
|
-
|
|
2064
|
+
_context19.next = 6;
|
|
2121
2065
|
break;
|
|
2122
2066
|
}
|
|
2123
2067
|
|
|
2124
2068
|
_ServiceLocator.Services.visualization.render();
|
|
2125
2069
|
|
|
2126
|
-
return
|
|
2070
|
+
return _context19.abrupt("return");
|
|
2127
2071
|
|
|
2128
2072
|
case 6:
|
|
2129
2073
|
isDesignAreaSelected = !!(0, _Selectors.getSelectedDesignArea)(_ServiceLocator.Services.store.state).identifier;
|
|
2130
2074
|
isDesignerOpen = isDesignAreaSelected && _ServiceLocator.Services.ui.isVisible('designer');
|
|
2131
2075
|
isScreenshotEvent = (0, _get2["default"])(updateEventObject, 'data.screenshot');
|
|
2132
2076
|
drawingFunction = isDesignerOpen && !isScreenshotEvent && !this.isInPreviewMode ? this.redrawEmptyAreas : this.redrawAllDesignAreas;
|
|
2133
|
-
|
|
2077
|
+
_context19.next = 12;
|
|
2134
2078
|
return _ServiceLocator.Services.visualization.updateTexture({
|
|
2135
2079
|
updateEventObject: updateEventObject,
|
|
2136
2080
|
drawingFunction: drawingFunction.bind(this)
|
|
@@ -2138,10 +2082,10 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
2138
2082
|
|
|
2139
2083
|
case 12:
|
|
2140
2084
|
case "end":
|
|
2141
|
-
return
|
|
2085
|
+
return _context19.stop();
|
|
2142
2086
|
}
|
|
2143
2087
|
}
|
|
2144
|
-
},
|
|
2088
|
+
}, _callee19, this);
|
|
2145
2089
|
}));
|
|
2146
2090
|
|
|
2147
2091
|
function updateVisualization() {
|
|
@@ -2165,13 +2109,13 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
2165
2109
|
}, {
|
|
2166
2110
|
key: "redrawAllDesignAreas",
|
|
2167
2111
|
value: function () {
|
|
2168
|
-
var _redrawAllDesignAreas = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
2112
|
+
var _redrawAllDesignAreas = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee21(getDrawingContext, updateEventObject) {
|
|
2169
2113
|
var _this8 = this;
|
|
2170
2114
|
|
|
2171
2115
|
var state, showHighlight, textureBuilderConfig, variantIdentifier, effectEnabled, drawingFn;
|
|
2172
|
-
return regeneratorRuntime.wrap(function
|
|
2116
|
+
return regeneratorRuntime.wrap(function _callee21$(_context22) {
|
|
2173
2117
|
while (1) {
|
|
2174
|
-
switch (
|
|
2118
|
+
switch (_context22.prev = _context22.next) {
|
|
2175
2119
|
case 0:
|
|
2176
2120
|
state = _ServiceLocator.Services.store.state;
|
|
2177
2121
|
showHighlight = (0, _get2["default"])(state, 'designArea.showHighlight');
|
|
@@ -2185,7 +2129,7 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
2185
2129
|
effectEnabled = !(0, _Selectors3.isDesignerProductPreviewMode)();
|
|
2186
2130
|
|
|
2187
2131
|
drawingFn = /*#__PURE__*/function () {
|
|
2188
|
-
var
|
|
2132
|
+
var _ref18 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee20(textureCtx, getTextureBuilder) {
|
|
2189
2133
|
var designAreas,
|
|
2190
2134
|
_getTextureBuilder,
|
|
2191
2135
|
getTextureImage,
|
|
@@ -2196,23 +2140,23 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
2196
2140
|
_iterator9,
|
|
2197
2141
|
_step9,
|
|
2198
2142
|
_loop,
|
|
2199
|
-
|
|
2143
|
+
_args21 = arguments;
|
|
2200
2144
|
|
|
2201
|
-
return regeneratorRuntime.wrap(function
|
|
2145
|
+
return regeneratorRuntime.wrap(function _callee20$(_context21) {
|
|
2202
2146
|
while (1) {
|
|
2203
|
-
switch (
|
|
2147
|
+
switch (_context21.prev = _context21.next) {
|
|
2204
2148
|
case 0:
|
|
2205
|
-
designAreas =
|
|
2149
|
+
designAreas = _args21.length > 2 && _args21[2] !== undefined ? _args21[2] : _this8.getDesignAreas();
|
|
2206
2150
|
_getTextureBuilder = getTextureBuilder(textureBuilderConfig), getTextureImage = _getTextureBuilder.getTextureImage, drawCanvasToArea = _getTextureBuilder.drawCanvasToArea, highlightDesignAreas = _getTextureBuilder.highlightDesignAreas, drawOn = _getTextureBuilder.drawOn, getParams = _getTextureBuilder.getParams;
|
|
2207
2151
|
|
|
2208
2152
|
if (getTextureImage()) {
|
|
2209
|
-
|
|
2153
|
+
_context21.next = 5;
|
|
2210
2154
|
break;
|
|
2211
2155
|
}
|
|
2212
2156
|
|
|
2213
2157
|
// eslint-disable-next-line no-console
|
|
2214
2158
|
console.warn('Texture image is missing!', designAreas);
|
|
2215
|
-
return
|
|
2159
|
+
return _context21.abrupt("return");
|
|
2216
2160
|
|
|
2217
2161
|
case 5:
|
|
2218
2162
|
if (showHighlight) {
|
|
@@ -2224,26 +2168,26 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
2224
2168
|
}
|
|
2225
2169
|
|
|
2226
2170
|
_iterator9 = _createForOfIteratorHelper(designAreas);
|
|
2227
|
-
|
|
2171
|
+
_context21.prev = 7;
|
|
2228
2172
|
_loop = /*#__PURE__*/regeneratorRuntime.mark(function _loop() {
|
|
2229
2173
|
var designArea, canvas, releaseLock, selectedObject, maskHandler, restoreOutlineVisibility, drawToContext, getSvg;
|
|
2230
|
-
return regeneratorRuntime.wrap(function _loop$(
|
|
2174
|
+
return regeneratorRuntime.wrap(function _loop$(_context20) {
|
|
2231
2175
|
while (1) {
|
|
2232
|
-
switch (
|
|
2176
|
+
switch (_context20.prev = _context20.next) {
|
|
2233
2177
|
case 0:
|
|
2234
2178
|
designArea = _step9.value;
|
|
2235
2179
|
canvas = _this8._getCanvas(_this8.getDesignAreaByIdentifier(designArea.identifier));
|
|
2236
2180
|
|
|
2237
2181
|
if (!canvas) {
|
|
2238
|
-
|
|
2182
|
+
_context20.next = 16;
|
|
2239
2183
|
break;
|
|
2240
2184
|
}
|
|
2241
2185
|
|
|
2242
|
-
|
|
2186
|
+
_context20.next = 5;
|
|
2243
2187
|
return (0, _ObjectLock.requestLock)(canvas);
|
|
2244
2188
|
|
|
2245
2189
|
case 5:
|
|
2246
|
-
releaseLock =
|
|
2190
|
+
releaseLock = _context20.sent;
|
|
2247
2191
|
selectedObject = (0, _get2["default"])(canvas, 'selectedObject');
|
|
2248
2192
|
|
|
2249
2193
|
if (selectedObject) {
|
|
@@ -2254,8 +2198,8 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
2254
2198
|
|
|
2255
2199
|
if (maskHandler) {
|
|
2256
2200
|
restoreOutlineVisibility = maskHandler.toggleOutline(showHighlight, {
|
|
2257
|
-
getZoomFactor: function getZoomFactor(
|
|
2258
|
-
var zoom =
|
|
2201
|
+
getZoomFactor: function getZoomFactor(_ref19) {
|
|
2202
|
+
var zoom = _ref19.zoom;
|
|
2259
2203
|
// currentZoom is only available for 2D, for 3D it is always 1
|
|
2260
2204
|
var threeFactor = Math.min(getParams().currentZoom, 1) || 1;
|
|
2261
2205
|
return zoom * threeFactor;
|
|
@@ -2269,7 +2213,7 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
2269
2213
|
return canvas.getScreenshot((0, _Selectors4.getFontMapping)(state));
|
|
2270
2214
|
};
|
|
2271
2215
|
|
|
2272
|
-
|
|
2216
|
+
_context20.next = 14;
|
|
2273
2217
|
return drawCanvasToArea(_objectSpread({
|
|
2274
2218
|
drawToContext: drawToContext,
|
|
2275
2219
|
designArea: designArea,
|
|
@@ -2285,7 +2229,7 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
2285
2229
|
|
|
2286
2230
|
case 16:
|
|
2287
2231
|
case "end":
|
|
2288
|
-
return
|
|
2232
|
+
return _context20.stop();
|
|
2289
2233
|
}
|
|
2290
2234
|
}
|
|
2291
2235
|
}, _loop);
|
|
@@ -2295,51 +2239,51 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
2295
2239
|
|
|
2296
2240
|
case 10:
|
|
2297
2241
|
if ((_step9 = _iterator9.n()).done) {
|
|
2298
|
-
|
|
2242
|
+
_context21.next = 14;
|
|
2299
2243
|
break;
|
|
2300
2244
|
}
|
|
2301
2245
|
|
|
2302
|
-
return
|
|
2246
|
+
return _context21.delegateYield(_loop(), "t0", 12);
|
|
2303
2247
|
|
|
2304
2248
|
case 12:
|
|
2305
|
-
|
|
2249
|
+
_context21.next = 10;
|
|
2306
2250
|
break;
|
|
2307
2251
|
|
|
2308
2252
|
case 14:
|
|
2309
|
-
|
|
2253
|
+
_context21.next = 19;
|
|
2310
2254
|
break;
|
|
2311
2255
|
|
|
2312
2256
|
case 16:
|
|
2313
|
-
|
|
2314
|
-
|
|
2257
|
+
_context21.prev = 16;
|
|
2258
|
+
_context21.t1 = _context21["catch"](7);
|
|
2315
2259
|
|
|
2316
|
-
_iterator9.e(
|
|
2260
|
+
_iterator9.e(_context21.t1);
|
|
2317
2261
|
|
|
2318
2262
|
case 19:
|
|
2319
|
-
|
|
2263
|
+
_context21.prev = 19;
|
|
2320
2264
|
|
|
2321
2265
|
_iterator9.f();
|
|
2322
2266
|
|
|
2323
|
-
return
|
|
2267
|
+
return _context21.finish(19);
|
|
2324
2268
|
|
|
2325
2269
|
case 22:
|
|
2326
2270
|
drawOn(textureCtx);
|
|
2327
2271
|
|
|
2328
2272
|
case 23:
|
|
2329
2273
|
case "end":
|
|
2330
|
-
return
|
|
2274
|
+
return _context21.stop();
|
|
2331
2275
|
}
|
|
2332
2276
|
}
|
|
2333
|
-
},
|
|
2277
|
+
}, _callee20, null, [[7, 16, 19, 22]]);
|
|
2334
2278
|
}));
|
|
2335
2279
|
|
|
2336
|
-
return function drawingFn(
|
|
2337
|
-
return
|
|
2280
|
+
return function drawingFn(_x23, _x24) {
|
|
2281
|
+
return _ref18.apply(this, arguments);
|
|
2338
2282
|
};
|
|
2339
2283
|
}();
|
|
2340
2284
|
|
|
2341
|
-
|
|
2342
|
-
|
|
2285
|
+
_context22.prev = 6;
|
|
2286
|
+
_context22.next = 9;
|
|
2343
2287
|
return getDrawingContext(drawingFn, true
|
|
2344
2288
|
/* update alpha */
|
|
2345
2289
|
, true
|
|
@@ -2347,24 +2291,24 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
2347
2291
|
);
|
|
2348
2292
|
|
|
2349
2293
|
case 9:
|
|
2350
|
-
|
|
2294
|
+
_context22.next = 14;
|
|
2351
2295
|
break;
|
|
2352
2296
|
|
|
2353
2297
|
case 11:
|
|
2354
|
-
|
|
2355
|
-
|
|
2298
|
+
_context22.prev = 11;
|
|
2299
|
+
_context22.t0 = _context22["catch"](6);
|
|
2356
2300
|
// eslint-disable-next-line no-console
|
|
2357
|
-
console.warn('Could not get drawing context, texture update is skipped!',
|
|
2301
|
+
console.warn('Could not get drawing context, texture update is skipped!', _context22.t0.message);
|
|
2358
2302
|
|
|
2359
2303
|
case 14:
|
|
2360
2304
|
case "end":
|
|
2361
|
-
return
|
|
2305
|
+
return _context22.stop();
|
|
2362
2306
|
}
|
|
2363
2307
|
}
|
|
2364
|
-
},
|
|
2308
|
+
}, _callee21, null, [[6, 11]]);
|
|
2365
2309
|
}));
|
|
2366
2310
|
|
|
2367
|
-
function redrawAllDesignAreas(
|
|
2311
|
+
function redrawAllDesignAreas(_x21, _x22) {
|
|
2368
2312
|
return _redrawAllDesignAreas.apply(this, arguments);
|
|
2369
2313
|
}
|
|
2370
2314
|
|
|
@@ -2373,16 +2317,16 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
2373
2317
|
}, {
|
|
2374
2318
|
key: "redrawEmptyAreas",
|
|
2375
2319
|
value: function redrawEmptyAreas(getDrawingContext) {
|
|
2376
|
-
getDrawingContext( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
2377
|
-
return regeneratorRuntime.wrap(function
|
|
2320
|
+
getDrawingContext( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee22() {
|
|
2321
|
+
return regeneratorRuntime.wrap(function _callee22$(_context23) {
|
|
2378
2322
|
while (1) {
|
|
2379
|
-
switch (
|
|
2323
|
+
switch (_context23.prev = _context23.next) {
|
|
2380
2324
|
case 0:
|
|
2381
2325
|
case "end":
|
|
2382
|
-
return
|
|
2326
|
+
return _context23.stop();
|
|
2383
2327
|
}
|
|
2384
2328
|
}
|
|
2385
|
-
},
|
|
2329
|
+
}, _callee22);
|
|
2386
2330
|
})), true
|
|
2387
2331
|
/* update alpha */
|
|
2388
2332
|
, true
|
|
@@ -2429,86 +2373,86 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
2429
2373
|
}, {
|
|
2430
2374
|
key: "getScreenshots",
|
|
2431
2375
|
value: function () {
|
|
2432
|
-
var _getScreenshots = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
2376
|
+
var _getScreenshots = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee24(fontMapping) {
|
|
2433
2377
|
var _this10 = this;
|
|
2434
2378
|
|
|
2435
2379
|
var options,
|
|
2436
2380
|
_options$screenshotFn,
|
|
2437
2381
|
screenshotFn,
|
|
2438
|
-
|
|
2382
|
+
_args25 = arguments;
|
|
2439
2383
|
|
|
2440
|
-
return regeneratorRuntime.wrap(function
|
|
2384
|
+
return regeneratorRuntime.wrap(function _callee24$(_context25) {
|
|
2441
2385
|
while (1) {
|
|
2442
|
-
switch (
|
|
2386
|
+
switch (_context25.prev = _context25.next) {
|
|
2443
2387
|
case 0:
|
|
2444
|
-
options =
|
|
2388
|
+
options = _args25.length > 1 && _args25[1] !== undefined ? _args25[1] : {};
|
|
2445
2389
|
_options$screenshotFn = options.screenshotFn, screenshotFn = _options$screenshotFn === void 0 ? 'getScreenshot' : _options$screenshotFn;
|
|
2446
|
-
|
|
2390
|
+
_context25.next = 4;
|
|
2447
2391
|
return Promise.all(this.getDesignAreas().map(function (area) {
|
|
2448
2392
|
return {
|
|
2449
2393
|
id: area.identifier,
|
|
2450
2394
|
canvas: _this10._getCanvas(area)
|
|
2451
2395
|
};
|
|
2452
|
-
}).filter(function (
|
|
2453
|
-
var canvas =
|
|
2396
|
+
}).filter(function (_ref21) {
|
|
2397
|
+
var canvas = _ref21.canvas;
|
|
2454
2398
|
return canvas && canvas[screenshotFn] && canvas.objects && canvas.objects.length > 0;
|
|
2455
2399
|
}).map( /*#__PURE__*/function () {
|
|
2456
|
-
var
|
|
2400
|
+
var _ref23 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee23(_ref22) {
|
|
2457
2401
|
var id, canvas, releaseLock, maskHandler, restoreOutlineVisibility, result;
|
|
2458
|
-
return regeneratorRuntime.wrap(function
|
|
2402
|
+
return regeneratorRuntime.wrap(function _callee23$(_context24) {
|
|
2459
2403
|
while (1) {
|
|
2460
|
-
switch (
|
|
2404
|
+
switch (_context24.prev = _context24.next) {
|
|
2461
2405
|
case 0:
|
|
2462
|
-
id =
|
|
2463
|
-
|
|
2406
|
+
id = _ref22.id, canvas = _ref22.canvas;
|
|
2407
|
+
_context24.next = 3;
|
|
2464
2408
|
return (0, _ObjectLock.requestLock)(canvas);
|
|
2465
2409
|
|
|
2466
2410
|
case 3:
|
|
2467
|
-
releaseLock =
|
|
2411
|
+
releaseLock = _context24.sent;
|
|
2468
2412
|
maskHandler = canvas.getMaskHandler();
|
|
2469
2413
|
restoreOutlineVisibility = maskHandler && maskHandler.toggleOutline(false);
|
|
2470
|
-
|
|
2471
|
-
|
|
2414
|
+
_context24.t0 = id;
|
|
2415
|
+
_context24.next = 9;
|
|
2472
2416
|
return canvas[screenshotFn](fontMapping);
|
|
2473
2417
|
|
|
2474
2418
|
case 9:
|
|
2475
|
-
|
|
2476
|
-
result = [
|
|
2419
|
+
_context24.t1 = _context24.sent;
|
|
2420
|
+
result = [_context24.t0, _context24.t1];
|
|
2477
2421
|
restoreOutlineVisibility && restoreOutlineVisibility();
|
|
2478
2422
|
releaseLock();
|
|
2479
|
-
return
|
|
2423
|
+
return _context24.abrupt("return", result);
|
|
2480
2424
|
|
|
2481
2425
|
case 14:
|
|
2482
2426
|
case "end":
|
|
2483
|
-
return
|
|
2427
|
+
return _context24.stop();
|
|
2484
2428
|
}
|
|
2485
2429
|
}
|
|
2486
|
-
},
|
|
2430
|
+
}, _callee23);
|
|
2487
2431
|
}));
|
|
2488
2432
|
|
|
2489
|
-
return function (
|
|
2490
|
-
return
|
|
2433
|
+
return function (_x26) {
|
|
2434
|
+
return _ref23.apply(this, arguments);
|
|
2491
2435
|
};
|
|
2492
2436
|
}()));
|
|
2493
2437
|
|
|
2494
2438
|
case 4:
|
|
2495
|
-
return
|
|
2496
|
-
var
|
|
2497
|
-
id =
|
|
2498
|
-
screenshot =
|
|
2439
|
+
return _context25.abrupt("return", _context25.sent.reduce(function (screenShots, _ref24) {
|
|
2440
|
+
var _ref25 = _slicedToArray(_ref24, 2),
|
|
2441
|
+
id = _ref25[0],
|
|
2442
|
+
screenshot = _ref25[1];
|
|
2499
2443
|
|
|
2500
2444
|
return _objectSpread(_objectSpread({}, screenShots), {}, _defineProperty({}, id, screenshot));
|
|
2501
2445
|
}, {}));
|
|
2502
2446
|
|
|
2503
2447
|
case 5:
|
|
2504
2448
|
case "end":
|
|
2505
|
-
return
|
|
2449
|
+
return _context25.stop();
|
|
2506
2450
|
}
|
|
2507
2451
|
}
|
|
2508
|
-
},
|
|
2452
|
+
}, _callee24, this);
|
|
2509
2453
|
}));
|
|
2510
2454
|
|
|
2511
|
-
function getScreenshots(
|
|
2455
|
+
function getScreenshots(_x25) {
|
|
2512
2456
|
return _getScreenshots.apply(this, arguments);
|
|
2513
2457
|
}
|
|
2514
2458
|
|
|
@@ -2517,28 +2461,28 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
2517
2461
|
}, {
|
|
2518
2462
|
key: "getScreenshotsOfElements",
|
|
2519
2463
|
value: function () {
|
|
2520
|
-
var _getScreenshotsOfElements = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
2521
|
-
return regeneratorRuntime.wrap(function
|
|
2464
|
+
var _getScreenshotsOfElements = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee25(fontMapping) {
|
|
2465
|
+
return regeneratorRuntime.wrap(function _callee25$(_context26) {
|
|
2522
2466
|
while (1) {
|
|
2523
|
-
switch (
|
|
2467
|
+
switch (_context26.prev = _context26.next) {
|
|
2524
2468
|
case 0:
|
|
2525
|
-
|
|
2469
|
+
_context26.next = 2;
|
|
2526
2470
|
return this.getScreenshots(fontMapping, {
|
|
2527
2471
|
screenshotFn: 'getScreenshotsOfElements'
|
|
2528
2472
|
});
|
|
2529
2473
|
|
|
2530
2474
|
case 2:
|
|
2531
|
-
return
|
|
2475
|
+
return _context26.abrupt("return", _context26.sent);
|
|
2532
2476
|
|
|
2533
2477
|
case 3:
|
|
2534
2478
|
case "end":
|
|
2535
|
-
return
|
|
2479
|
+
return _context26.stop();
|
|
2536
2480
|
}
|
|
2537
2481
|
}
|
|
2538
|
-
},
|
|
2482
|
+
}, _callee25, this);
|
|
2539
2483
|
}));
|
|
2540
2484
|
|
|
2541
|
-
function getScreenshotsOfElements(
|
|
2485
|
+
function getScreenshotsOfElements(_x27) {
|
|
2542
2486
|
return _getScreenshotsOfElements.apply(this, arguments);
|
|
2543
2487
|
}
|
|
2544
2488
|
|
|
@@ -2627,20 +2571,20 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
2627
2571
|
}, {
|
|
2628
2572
|
key: "addSampleImageForDesignAreas",
|
|
2629
2573
|
value: function () {
|
|
2630
|
-
var _addSampleImageForDesignAreas = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
2574
|
+
var _addSampleImageForDesignAreas = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee27(designAreaIdentifiers, active) {
|
|
2631
2575
|
var _this12 = this;
|
|
2632
2576
|
|
|
2633
|
-
return regeneratorRuntime.wrap(function
|
|
2577
|
+
return regeneratorRuntime.wrap(function _callee27$(_context28) {
|
|
2634
2578
|
while (1) {
|
|
2635
|
-
switch (
|
|
2579
|
+
switch (_context28.prev = _context28.next) {
|
|
2636
2580
|
case 0:
|
|
2637
|
-
|
|
2581
|
+
_context28.next = 2;
|
|
2638
2582
|
return Promise.all(designAreaIdentifiers.map( /*#__PURE__*/function () {
|
|
2639
|
-
var
|
|
2583
|
+
var _ref26 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee26(designAreaIdentifier) {
|
|
2640
2584
|
var designArea, canvas, state, imageSrc, imageData, canvasDataJSON, designData, canvasData, objects;
|
|
2641
|
-
return regeneratorRuntime.wrap(function
|
|
2585
|
+
return regeneratorRuntime.wrap(function _callee26$(_context27) {
|
|
2642
2586
|
while (1) {
|
|
2643
|
-
switch (
|
|
2587
|
+
switch (_context27.prev = _context27.next) {
|
|
2644
2588
|
case 0:
|
|
2645
2589
|
designArea = _this12.getDesignAreaByIdentifier(designAreaIdentifier);
|
|
2646
2590
|
canvas = _this12._getCanvas(designArea);
|
|
@@ -2648,7 +2592,7 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
2648
2592
|
imageSrc = _designer_placeholder_logo["default"];
|
|
2649
2593
|
|
|
2650
2594
|
if (!active) {
|
|
2651
|
-
|
|
2595
|
+
_context27.next = 13;
|
|
2652
2596
|
break;
|
|
2653
2597
|
}
|
|
2654
2598
|
|
|
@@ -2659,7 +2603,7 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
2659
2603
|
isPlaceHolderImage: true,
|
|
2660
2604
|
galleryImage: false
|
|
2661
2605
|
});
|
|
2662
|
-
|
|
2606
|
+
_context27.next = 8;
|
|
2663
2607
|
return _ServiceLocator.Services.designer.addImageFromUrl(canvas, (0, _Selectors2.getPreviewUrlFromImageData)(imageData.preview), imageData, {
|
|
2664
2608
|
enlargeImage: true
|
|
2665
2609
|
});
|
|
@@ -2672,7 +2616,7 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
2672
2616
|
|
|
2673
2617
|
_this12.setCanvasData(canvasDataJSON, designAreaIdentifier);
|
|
2674
2618
|
|
|
2675
|
-
|
|
2619
|
+
_context27.next = 21;
|
|
2676
2620
|
break;
|
|
2677
2621
|
|
|
2678
2622
|
case 13:
|
|
@@ -2680,11 +2624,11 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
2680
2624
|
canvasData = designData.canvasData;
|
|
2681
2625
|
|
|
2682
2626
|
if (canvasData) {
|
|
2683
|
-
|
|
2627
|
+
_context27.next = 17;
|
|
2684
2628
|
break;
|
|
2685
2629
|
}
|
|
2686
2630
|
|
|
2687
|
-
return
|
|
2631
|
+
return _context27.abrupt("return");
|
|
2688
2632
|
|
|
2689
2633
|
case 17:
|
|
2690
2634
|
objects = canvasData ? canvasData.objects.filter(function (obj) {
|
|
@@ -2695,37 +2639,37 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
2695
2639
|
objects: objects
|
|
2696
2640
|
}), designAreaIdentifier);
|
|
2697
2641
|
|
|
2698
|
-
|
|
2642
|
+
_context27.next = 21;
|
|
2699
2643
|
return _this12.loadCanvasDataFromState([designArea]);
|
|
2700
2644
|
|
|
2701
2645
|
case 21:
|
|
2702
|
-
return
|
|
2646
|
+
return _context27.abrupt("return", {
|
|
2703
2647
|
canvas: canvas,
|
|
2704
2648
|
designAreaIdentifier: designAreaIdentifier
|
|
2705
2649
|
});
|
|
2706
2650
|
|
|
2707
2651
|
case 22:
|
|
2708
2652
|
case "end":
|
|
2709
|
-
return
|
|
2653
|
+
return _context27.stop();
|
|
2710
2654
|
}
|
|
2711
2655
|
}
|
|
2712
|
-
},
|
|
2656
|
+
}, _callee26);
|
|
2713
2657
|
}));
|
|
2714
2658
|
|
|
2715
|
-
return function (
|
|
2716
|
-
return
|
|
2659
|
+
return function (_x30) {
|
|
2660
|
+
return _ref26.apply(this, arguments);
|
|
2717
2661
|
};
|
|
2718
2662
|
}()));
|
|
2719
2663
|
|
|
2720
2664
|
case 2:
|
|
2721
2665
|
case "end":
|
|
2722
|
-
return
|
|
2666
|
+
return _context28.stop();
|
|
2723
2667
|
}
|
|
2724
2668
|
}
|
|
2725
|
-
},
|
|
2669
|
+
}, _callee27);
|
|
2726
2670
|
}));
|
|
2727
2671
|
|
|
2728
|
-
function addSampleImageForDesignAreas(
|
|
2672
|
+
function addSampleImageForDesignAreas(_x28, _x29) {
|
|
2729
2673
|
return _addSampleImageForDesignAreas.apply(this, arguments);
|
|
2730
2674
|
}
|
|
2731
2675
|
|
|
@@ -2734,23 +2678,23 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
2734
2678
|
}, {
|
|
2735
2679
|
key: "addImageToDesignArea",
|
|
2736
2680
|
value: function () {
|
|
2737
|
-
var _addImageToDesignArea = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
2681
|
+
var _addImageToDesignArea = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee28(designArea, imageData) {
|
|
2738
2682
|
var canvas;
|
|
2739
|
-
return regeneratorRuntime.wrap(function
|
|
2683
|
+
return regeneratorRuntime.wrap(function _callee28$(_context29) {
|
|
2740
2684
|
while (1) {
|
|
2741
|
-
switch (
|
|
2685
|
+
switch (_context29.prev = _context29.next) {
|
|
2742
2686
|
case 0:
|
|
2743
2687
|
canvas = this._getCanvas(designArea);
|
|
2744
2688
|
|
|
2745
2689
|
if (canvas) {
|
|
2746
|
-
|
|
2690
|
+
_context29.next = 3;
|
|
2747
2691
|
break;
|
|
2748
2692
|
}
|
|
2749
2693
|
|
|
2750
|
-
return
|
|
2694
|
+
return _context29.abrupt("return", false);
|
|
2751
2695
|
|
|
2752
2696
|
case 3:
|
|
2753
|
-
|
|
2697
|
+
_context29.next = 5;
|
|
2754
2698
|
return _ServiceLocator.Services.designer.addImageFromUrl(canvas, (0, _Selectors2.getPreviewUrlFromImageData)(imageData.preview), imageData, {
|
|
2755
2699
|
enlargeImage: true,
|
|
2756
2700
|
scaleToHalf: false,
|
|
@@ -2758,17 +2702,17 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
2758
2702
|
});
|
|
2759
2703
|
|
|
2760
2704
|
case 5:
|
|
2761
|
-
return
|
|
2705
|
+
return _context29.abrupt("return", _context29.sent);
|
|
2762
2706
|
|
|
2763
2707
|
case 6:
|
|
2764
2708
|
case "end":
|
|
2765
|
-
return
|
|
2709
|
+
return _context29.stop();
|
|
2766
2710
|
}
|
|
2767
2711
|
}
|
|
2768
|
-
},
|
|
2712
|
+
}, _callee28, this);
|
|
2769
2713
|
}));
|
|
2770
2714
|
|
|
2771
|
-
function addImageToDesignArea(
|
|
2715
|
+
function addImageToDesignArea(_x31, _x32) {
|
|
2772
2716
|
return _addImageToDesignArea.apply(this, arguments);
|
|
2773
2717
|
}
|
|
2774
2718
|
|
|
@@ -2850,19 +2794,19 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
2850
2794
|
}, {
|
|
2851
2795
|
key: "setImageAndTextColor",
|
|
2852
2796
|
value: function () {
|
|
2853
|
-
var _setImageAndTextColor = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
2797
|
+
var _setImageAndTextColor = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee29(color) {
|
|
2854
2798
|
var designArea, designData, objects, hasmultipleObjects, canvas, isImageSelected, selectedImageIdentifier, _iterator11, _step11, object, image, operations;
|
|
2855
2799
|
|
|
2856
|
-
return regeneratorRuntime.wrap(function
|
|
2800
|
+
return regeneratorRuntime.wrap(function _callee29$(_context30) {
|
|
2857
2801
|
while (1) {
|
|
2858
|
-
switch (
|
|
2802
|
+
switch (_context30.prev = _context30.next) {
|
|
2859
2803
|
case 0:
|
|
2860
2804
|
if (this.changeAllColorsNeeded()) {
|
|
2861
|
-
|
|
2805
|
+
_context30.next = 2;
|
|
2862
2806
|
break;
|
|
2863
2807
|
}
|
|
2864
2808
|
|
|
2865
|
-
return
|
|
2809
|
+
return _context30.abrupt("return");
|
|
2866
2810
|
|
|
2867
2811
|
case 2:
|
|
2868
2812
|
designArea = (0, _Selectors.getSelectedDesignArea)(_ServiceLocator.Services.store.state);
|
|
@@ -2871,11 +2815,11 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
2871
2815
|
hasmultipleObjects = objects.length > 1;
|
|
2872
2816
|
|
|
2873
2817
|
if (hasmultipleObjects) {
|
|
2874
|
-
|
|
2818
|
+
_context30.next = 8;
|
|
2875
2819
|
break;
|
|
2876
2820
|
}
|
|
2877
2821
|
|
|
2878
|
-
return
|
|
2822
|
+
return _context30.abrupt("return");
|
|
2879
2823
|
|
|
2880
2824
|
case 8:
|
|
2881
2825
|
canvas = this._getCanvas(designArea);
|
|
@@ -2885,62 +2829,62 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
2885
2829
|
_ServiceLocator.Services.store.dispatch((0, _Actions.setDesignAreaTextsColor)(designArea.identifier, color));
|
|
2886
2830
|
|
|
2887
2831
|
_iterator11 = _createForOfIteratorHelper(objects);
|
|
2888
|
-
|
|
2832
|
+
_context30.prev = 13;
|
|
2889
2833
|
|
|
2890
2834
|
_iterator11.s();
|
|
2891
2835
|
|
|
2892
2836
|
case 15:
|
|
2893
2837
|
if ((_step11 = _iterator11.n()).done) {
|
|
2894
|
-
|
|
2838
|
+
_context30.next = 24;
|
|
2895
2839
|
break;
|
|
2896
2840
|
}
|
|
2897
2841
|
|
|
2898
2842
|
object = _step11.value;
|
|
2899
2843
|
|
|
2900
2844
|
if (!(object.type === 'Image' && object.imageData.identifier !== selectedImageIdentifier)) {
|
|
2901
|
-
|
|
2845
|
+
_context30.next = 22;
|
|
2902
2846
|
break;
|
|
2903
2847
|
}
|
|
2904
2848
|
|
|
2905
2849
|
image = (0, _Selectors2.getUserImage)(_ServiceLocator.Services.store.state, object.imageData.identifier);
|
|
2906
2850
|
operations = (0, _Modifiers.setColorOnOperations)(image.operations, color);
|
|
2907
|
-
|
|
2851
|
+
_context30.next = 22;
|
|
2908
2852
|
return _ServiceLocator.Services.designData.editFile(operations, image);
|
|
2909
2853
|
|
|
2910
2854
|
case 22:
|
|
2911
|
-
|
|
2855
|
+
_context30.next = 15;
|
|
2912
2856
|
break;
|
|
2913
2857
|
|
|
2914
2858
|
case 24:
|
|
2915
|
-
|
|
2859
|
+
_context30.next = 29;
|
|
2916
2860
|
break;
|
|
2917
2861
|
|
|
2918
2862
|
case 26:
|
|
2919
|
-
|
|
2920
|
-
|
|
2863
|
+
_context30.prev = 26;
|
|
2864
|
+
_context30.t0 = _context30["catch"](13);
|
|
2921
2865
|
|
|
2922
|
-
_iterator11.e(
|
|
2866
|
+
_iterator11.e(_context30.t0);
|
|
2923
2867
|
|
|
2924
2868
|
case 29:
|
|
2925
|
-
|
|
2869
|
+
_context30.prev = 29;
|
|
2926
2870
|
|
|
2927
2871
|
_iterator11.f();
|
|
2928
2872
|
|
|
2929
|
-
return
|
|
2873
|
+
return _context30.finish(29);
|
|
2930
2874
|
|
|
2931
2875
|
case 32:
|
|
2932
|
-
|
|
2876
|
+
_context30.next = 34;
|
|
2933
2877
|
return this.updateCanvasDataFromState([designArea]);
|
|
2934
2878
|
|
|
2935
2879
|
case 34:
|
|
2936
2880
|
case "end":
|
|
2937
|
-
return
|
|
2881
|
+
return _context30.stop();
|
|
2938
2882
|
}
|
|
2939
2883
|
}
|
|
2940
|
-
},
|
|
2884
|
+
}, _callee29, this, [[13, 26, 29, 32]]);
|
|
2941
2885
|
}));
|
|
2942
2886
|
|
|
2943
|
-
function setImageAndTextColor(
|
|
2887
|
+
function setImageAndTextColor(_x33) {
|
|
2944
2888
|
return _setImageAndTextColor.apply(this, arguments);
|
|
2945
2889
|
}
|
|
2946
2890
|
|
|
@@ -2949,29 +2893,29 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
2949
2893
|
}, {
|
|
2950
2894
|
key: "getGalleryImageColors",
|
|
2951
2895
|
value: function () {
|
|
2952
|
-
var _getGalleryImageColors = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
2896
|
+
var _getGalleryImageColors = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee30(url) {
|
|
2953
2897
|
var svgContent, designProductionMethod;
|
|
2954
|
-
return regeneratorRuntime.wrap(function
|
|
2898
|
+
return regeneratorRuntime.wrap(function _callee30$(_context31) {
|
|
2955
2899
|
while (1) {
|
|
2956
|
-
switch (
|
|
2900
|
+
switch (_context31.prev = _context31.next) {
|
|
2957
2901
|
case 0:
|
|
2958
|
-
|
|
2902
|
+
_context31.next = 2;
|
|
2959
2903
|
return getSvgContent(url);
|
|
2960
2904
|
|
|
2961
2905
|
case 2:
|
|
2962
|
-
svgContent =
|
|
2906
|
+
svgContent = _context31.sent;
|
|
2963
2907
|
designProductionMethod = (0, _Selectors.getSelectedDesignProductionMethod)(_ServiceLocator.Services.store.state);
|
|
2964
|
-
return
|
|
2908
|
+
return _context31.abrupt("return", (0, _Modifiers.createVectorizeColorsMap)({}, getSvgColors(svgContent, designProductionMethod)));
|
|
2965
2909
|
|
|
2966
2910
|
case 5:
|
|
2967
2911
|
case "end":
|
|
2968
|
-
return
|
|
2912
|
+
return _context31.stop();
|
|
2969
2913
|
}
|
|
2970
2914
|
}
|
|
2971
|
-
},
|
|
2915
|
+
}, _callee30);
|
|
2972
2916
|
}));
|
|
2973
2917
|
|
|
2974
|
-
function getGalleryImageColors(
|
|
2918
|
+
function getGalleryImageColors(_x34) {
|
|
2975
2919
|
return _getGalleryImageColors.apply(this, arguments);
|
|
2976
2920
|
}
|
|
2977
2921
|
|
|
@@ -2997,41 +2941,41 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
2997
2941
|
}, {
|
|
2998
2942
|
key: "editFileQueued",
|
|
2999
2943
|
value: function () {
|
|
3000
|
-
var _editFileQueued = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
2944
|
+
var _editFileQueued = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee31(operations, image) {
|
|
3001
2945
|
var options,
|
|
3002
2946
|
releaseLock,
|
|
3003
|
-
|
|
3004
|
-
return regeneratorRuntime.wrap(function
|
|
2947
|
+
_args32 = arguments;
|
|
2948
|
+
return regeneratorRuntime.wrap(function _callee31$(_context32) {
|
|
3005
2949
|
while (1) {
|
|
3006
|
-
switch (
|
|
2950
|
+
switch (_context32.prev = _context32.next) {
|
|
3007
2951
|
case 0:
|
|
3008
|
-
options =
|
|
3009
|
-
|
|
2952
|
+
options = _args32.length > 2 && _args32[2] !== undefined ? _args32[2] : {};
|
|
2953
|
+
_context32.next = 3;
|
|
3010
2954
|
return (0, _ObjectLock.requestLock)(this);
|
|
3011
2955
|
|
|
3012
2956
|
case 3:
|
|
3013
|
-
releaseLock =
|
|
3014
|
-
|
|
3015
|
-
|
|
2957
|
+
releaseLock = _context32.sent;
|
|
2958
|
+
_context32.prev = 4;
|
|
2959
|
+
_context32.next = 7;
|
|
3016
2960
|
return this.editFile(operations, image, options);
|
|
3017
2961
|
|
|
3018
2962
|
case 7:
|
|
3019
|
-
return
|
|
2963
|
+
return _context32.abrupt("return", _context32.sent);
|
|
3020
2964
|
|
|
3021
2965
|
case 8:
|
|
3022
|
-
|
|
2966
|
+
_context32.prev = 8;
|
|
3023
2967
|
releaseLock();
|
|
3024
|
-
return
|
|
2968
|
+
return _context32.finish(8);
|
|
3025
2969
|
|
|
3026
2970
|
case 11:
|
|
3027
2971
|
case "end":
|
|
3028
|
-
return
|
|
2972
|
+
return _context32.stop();
|
|
3029
2973
|
}
|
|
3030
2974
|
}
|
|
3031
|
-
},
|
|
2975
|
+
}, _callee31, this, [[4,, 8, 11]]);
|
|
3032
2976
|
}));
|
|
3033
2977
|
|
|
3034
|
-
function editFileQueued(
|
|
2978
|
+
function editFileQueued(_x35, _x36) {
|
|
3035
2979
|
return _editFileQueued.apply(this, arguments);
|
|
3036
2980
|
}
|
|
3037
2981
|
|
|
@@ -3040,7 +2984,7 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
3040
2984
|
}, {
|
|
3041
2985
|
key: "editFile",
|
|
3042
2986
|
value: function () {
|
|
3043
|
-
var _editFile = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
2987
|
+
var _editFile = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee32(operations, image) {
|
|
3044
2988
|
var options,
|
|
3045
2989
|
_options$immediateCom,
|
|
3046
2990
|
immediateCommit,
|
|
@@ -3054,7 +2998,6 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
3054
2998
|
compatibilityInfoHash,
|
|
3055
2999
|
imageIsCompatible,
|
|
3056
3000
|
operationsMatching,
|
|
3057
|
-
vectorizedLogoMandatory,
|
|
3058
3001
|
colorPreviewRequired,
|
|
3059
3002
|
imageDataPatch,
|
|
3060
3003
|
_getImageUsageInfo,
|
|
@@ -3074,13 +3017,13 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
3074
3017
|
vectorizeOriginalColorsMap,
|
|
3075
3018
|
numberOfAggregatedColors,
|
|
3076
3019
|
numberOfColorsToRemove,
|
|
3077
|
-
|
|
3020
|
+
_args33 = arguments;
|
|
3078
3021
|
|
|
3079
|
-
return regeneratorRuntime.wrap(function
|
|
3022
|
+
return regeneratorRuntime.wrap(function _callee32$(_context33) {
|
|
3080
3023
|
while (1) {
|
|
3081
|
-
switch (
|
|
3024
|
+
switch (_context33.prev = _context33.next) {
|
|
3082
3025
|
case 0:
|
|
3083
|
-
options =
|
|
3026
|
+
options = _args33.length > 2 && _args33[2] !== undefined ? _args33[2] : {};
|
|
3084
3027
|
// patch operations to keep other unchanged values
|
|
3085
3028
|
operations = _objectSpread(_objectSpread({}, image.operations), operations);
|
|
3086
3029
|
_options$immediateCom = options.immediateCommit, immediateCommit = _options$immediateCom === void 0 ? false : _options$immediateCom, _options$designProduc = options.designProductionMethod, designProductionMethod = _options$designProduc === void 0 ? (0, _Selectors.getSelectedDesignProductionMethod)(_ServiceLocator.Services.store.state) : _options$designProduc, _options$addMode = options.addMode, addMode = _options$addMode === void 0 ? false : _options$addMode, displayColorPreview = options.displayColorPreview;
|
|
@@ -3089,18 +3032,16 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
3089
3032
|
compatibilityInfoHash = (0, _Selectors.getDesignAreaImageCompatibilityInfo)(designProductionMethod);
|
|
3090
3033
|
imageIsCompatible = (0, _Selectors.areHashesCompatible)(image.compatibilityInfoHash, compatibilityInfoHash);
|
|
3091
3034
|
operationsMatching = (0, _Modifiers.compareOperations)(image.operations, operations);
|
|
3092
|
-
|
|
3093
|
-
colorPreviewRequired = (0, _Selectors.designProductionMethodHasEmbroideryVisualizationEffect)(designProductionMethod) || vectorizedLogoMandatory;
|
|
3035
|
+
colorPreviewRequired = (0, _Selectors.designProductionMethodHasEmbroideryVisualizationEffect)(designProductionMethod);
|
|
3094
3036
|
imageDataPatch = _objectSpread({
|
|
3095
3037
|
compatibilityInfoHash: compatibilityInfoHash,
|
|
3096
|
-
colorPreviewRequired: colorPreviewRequired
|
|
3097
|
-
vectorizedLogoMandatory: vectorizedLogoMandatory
|
|
3038
|
+
colorPreviewRequired: colorPreviewRequired
|
|
3098
3039
|
}, displayColorPreview !== undefined && {
|
|
3099
3040
|
displayColorPreview: displayColorPreview
|
|
3100
3041
|
});
|
|
3101
3042
|
|
|
3102
3043
|
if (!(!operationsMatching || !imageIsCompatible)) {
|
|
3103
|
-
|
|
3044
|
+
_context33.next = 28;
|
|
3104
3045
|
break;
|
|
3105
3046
|
}
|
|
3106
3047
|
|
|
@@ -3111,17 +3052,17 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
3111
3052
|
operations = makeOperationsCompatible(operations, compatibilityInfoHash, designProductionMethod.colorPalettes);
|
|
3112
3053
|
|
|
3113
3054
|
if (!image.gallery) {
|
|
3114
|
-
|
|
3055
|
+
_context33.next = 17;
|
|
3115
3056
|
break;
|
|
3116
3057
|
}
|
|
3117
3058
|
|
|
3118
3059
|
operations = _objectSpread(_objectSpread({}, operations || {}), {}, {
|
|
3119
3060
|
vectorizeColorsMap: operations.vectorizeColorsMap
|
|
3120
3061
|
});
|
|
3121
|
-
|
|
3062
|
+
_context33.next = 28;
|
|
3122
3063
|
break;
|
|
3123
3064
|
|
|
3124
|
-
case
|
|
3065
|
+
case 17:
|
|
3125
3066
|
_getImageUsageInfo = (0, _Selectors2.getImageUsageInfo)(_ServiceLocator.Services.store.state, image.identifier), designAreas = _getImageUsageInfo.designAreas, count = _getImageUsageInfo.count;
|
|
3126
3067
|
createCopy = !!(designAreas > 1 && image.compatibilityInfoHash && !imageIsCompatible) || !operationsMatching && count > (addMode ? 0 : 1);
|
|
3127
3068
|
editData = (0, _Modifiers.getEditDataFromOperations)(image.fileName, operations, designProductionMethod);
|
|
@@ -3129,11 +3070,11 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
3129
3070
|
isBackendNeeded = createCopy || !(0, _isEqual["default"])(editData, currentEditData);
|
|
3130
3071
|
|
|
3131
3072
|
if (!isBackendNeeded) {
|
|
3132
|
-
|
|
3073
|
+
_context33.next = 28;
|
|
3133
3074
|
break;
|
|
3134
3075
|
}
|
|
3135
3076
|
|
|
3136
|
-
|
|
3077
|
+
_context33.next = 25;
|
|
3137
3078
|
return _ServiceLocator.Services.store.dispatch((0, _Actions2.editImage)(_objectSpread(_objectSpread({}, editData), {}, {
|
|
3138
3079
|
createCopy: createCopy
|
|
3139
3080
|
}), _objectSpread(_objectSpread({}, imageDataPatch), {}, {
|
|
@@ -3144,31 +3085,31 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
3144
3085
|
immediateCommit: immediateCommit
|
|
3145
3086
|
}));
|
|
3146
3087
|
|
|
3147
|
-
case
|
|
3088
|
+
case 25:
|
|
3148
3089
|
selectedImage = _ServiceLocator.Services.store.state.imageGallery.selectedImage;
|
|
3149
3090
|
preview = (0, _get2["default"])(selectedImage, 'preview');
|
|
3150
3091
|
imageIdentifier = (0, _get2["default"])(selectedImage, 'identifier');
|
|
3151
3092
|
|
|
3152
|
-
case
|
|
3093
|
+
case 28:
|
|
3153
3094
|
if (!(!preview || !preview.url)) {
|
|
3154
|
-
|
|
3095
|
+
_context33.next = 30;
|
|
3155
3096
|
break;
|
|
3156
3097
|
}
|
|
3157
3098
|
|
|
3158
3099
|
throw new Error('Preview image url is not specified!');
|
|
3159
3100
|
|
|
3160
|
-
case
|
|
3101
|
+
case 30:
|
|
3161
3102
|
if (!(0, _Selectors2.isEditableVectorImage)(preview)) {
|
|
3162
|
-
|
|
3103
|
+
_context33.next = 39;
|
|
3163
3104
|
break;
|
|
3164
3105
|
}
|
|
3165
3106
|
|
|
3166
3107
|
_designProductionMethod = (0, _Selectors.getSelectedDesignProductionMethod)(_ServiceLocator.Services.store.state);
|
|
3167
|
-
|
|
3108
|
+
_context33.next = 34;
|
|
3168
3109
|
return getSvgContent(preview.url, false, !operationsMatching);
|
|
3169
3110
|
|
|
3170
|
-
case
|
|
3171
|
-
svgContent =
|
|
3111
|
+
case 34:
|
|
3112
|
+
svgContent = _context33.sent;
|
|
3172
3113
|
svgColors = getSvgColors(svgContent, _designProductionMethod);
|
|
3173
3114
|
vectorizeColorsMap = (0, _Modifiers.createVectorizeColorsMap)(operations.vectorizeColorsMap, svgColors);
|
|
3174
3115
|
thresholdChanged = operations.vectorizeThreshold !== (0, _get2["default"])(image, 'operations.vectorizeThreshold', 0); // prepare initial values for the vectorize feature
|
|
@@ -3199,7 +3140,7 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
3199
3140
|
operations.vectorizeColorsMap = vectorizeColorsMap;
|
|
3200
3141
|
}
|
|
3201
3142
|
|
|
3202
|
-
case
|
|
3143
|
+
case 39:
|
|
3203
3144
|
_ServiceLocator.Services.store.dispatch((0, _Actions2.updateImage)(imageIdentifier, _objectSpread(_objectSpread({
|
|
3204
3145
|
operations: operations
|
|
3205
3146
|
}, imageDataPatch), {}, {
|
|
@@ -3210,22 +3151,22 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
3210
3151
|
this.updateDesignAreaImagesWithSelectedImageData(image.identifier);
|
|
3211
3152
|
}
|
|
3212
3153
|
|
|
3213
|
-
return
|
|
3154
|
+
return _context33.abrupt("return", {
|
|
3214
3155
|
vectorizeColorsMap: operations.vectorizeColorsMap,
|
|
3215
3156
|
vectorizeThreshold: operations.vectorizeThreshold,
|
|
3216
3157
|
vectorizeMaxColorAmount: operations.vectorizeMaxColorAmount,
|
|
3217
3158
|
vectorizeOriginalColorsMap: operations.vectorizeOriginalColorsMap
|
|
3218
3159
|
});
|
|
3219
3160
|
|
|
3220
|
-
case
|
|
3161
|
+
case 42:
|
|
3221
3162
|
case "end":
|
|
3222
|
-
return
|
|
3163
|
+
return _context33.stop();
|
|
3223
3164
|
}
|
|
3224
3165
|
}
|
|
3225
|
-
},
|
|
3166
|
+
}, _callee32, this);
|
|
3226
3167
|
}));
|
|
3227
3168
|
|
|
3228
|
-
function editFile(
|
|
3169
|
+
function editFile(_x37, _x38) {
|
|
3229
3170
|
return _editFile.apply(this, arguments);
|
|
3230
3171
|
}
|
|
3231
3172
|
|
|
@@ -3234,12 +3175,12 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
3234
3175
|
}, {
|
|
3235
3176
|
key: "resetEditedFile",
|
|
3236
3177
|
value: function () {
|
|
3237
|
-
var _resetEditedFile = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function
|
|
3178
|
+
var _resetEditedFile = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee33(image) {
|
|
3238
3179
|
var state, _image, operations, vectorizeColorsMap, resetOperations, designProductionMethod;
|
|
3239
3180
|
|
|
3240
|
-
return regeneratorRuntime.wrap(function
|
|
3181
|
+
return regeneratorRuntime.wrap(function _callee33$(_context34) {
|
|
3241
3182
|
while (1) {
|
|
3242
|
-
switch (
|
|
3183
|
+
switch (_context34.prev = _context34.next) {
|
|
3243
3184
|
case 0:
|
|
3244
3185
|
state = _ServiceLocator.Services.store.state;
|
|
3245
3186
|
|
|
@@ -3262,21 +3203,21 @@ var DesignDataService = /*#__PURE__*/function () {
|
|
|
3262
3203
|
});
|
|
3263
3204
|
}
|
|
3264
3205
|
|
|
3265
|
-
|
|
3206
|
+
_context34.next = 7;
|
|
3266
3207
|
return this.editFileQueued(resetOperations, image);
|
|
3267
3208
|
|
|
3268
3209
|
case 7:
|
|
3269
|
-
return
|
|
3210
|
+
return _context34.abrupt("return", _context34.sent);
|
|
3270
3211
|
|
|
3271
3212
|
case 8:
|
|
3272
3213
|
case "end":
|
|
3273
|
-
return
|
|
3214
|
+
return _context34.stop();
|
|
3274
3215
|
}
|
|
3275
3216
|
}
|
|
3276
|
-
},
|
|
3217
|
+
}, _callee33, this);
|
|
3277
3218
|
}));
|
|
3278
3219
|
|
|
3279
|
-
function resetEditedFile(
|
|
3220
|
+
function resetEditedFile(_x39) {
|
|
3280
3221
|
return _resetEditedFile.apply(this, arguments);
|
|
3281
3222
|
}
|
|
3282
3223
|
|