@configuratorware/configurator-frontendgui 1.47.1 → 1.47.3
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/Components/ImageControlbox/index.js +2 -2
- package/App/Modules/Designer/setupDesigner.js +15 -4
- package/App/Reducers/DesignArea/MaskSelectors.js +3 -2
- package/package.json +9 -5
- package/scripts/versionCheck.js +8 -0
- package/src/App/Modules/Designer/Components/ImageControlbox/index.js +2 -2
- package/src/App/Modules/Designer/setupDesigner.js +8 -1
- package/src/App/Reducers/DesignArea/MaskSelectors.js +16 -9
|
@@ -161,7 +161,7 @@ var ImageControlbox = /*#__PURE__*/function (_React$Component) {
|
|
|
161
161
|
flipToFrontDisabled = _this$props2.flipToFrontDisabled,
|
|
162
162
|
flipToBackDisabled = _this$props2.flipToBackDisabled;
|
|
163
163
|
var printQualityInfoDialogOpen = this.state.printQualityInfoDialogOpen;
|
|
164
|
-
var printQualityInfoExists = (0, _i18n.translationExists)('imageControlbox.
|
|
164
|
+
var printQualityInfoExists = (0, _i18n.translationExists)('imageControlbox.printQuality.' + this.props.printQuality);
|
|
165
165
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_Card["default"], {
|
|
166
166
|
className: (0, _clsx["default"])(boxed ? classes.card : classes.cardUnboxed, (0, _customClassName["default"])('image-tools-box'))
|
|
167
167
|
}, /*#__PURE__*/_react["default"].createElement(_CardContent["default"], {
|
|
@@ -224,7 +224,7 @@ var ImageControlbox = /*#__PURE__*/function (_React$Component) {
|
|
|
224
224
|
"aria-describedby": "alert-dialog-description"
|
|
225
225
|
}, /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], null, /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], {
|
|
226
226
|
id: "alert-dialog-description"
|
|
227
|
-
}, (0, _i18n.t)('imageControlbox.
|
|
227
|
+
}, (0, _i18n.t)('imageControlbox.printQuality.' + printQuality))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
228
228
|
onClick: this.handlePrintQualityInfoDialogClose,
|
|
229
229
|
color: "primary"
|
|
230
230
|
}, "OK"))));
|
|
@@ -131,20 +131,31 @@ var setupDesigner = exports.setupDesigner = function setupDesigner(designDataSer
|
|
|
131
131
|
canvas = canvasRepository.requestCanvas(designArea, canvasSize);
|
|
132
132
|
isNew = true;
|
|
133
133
|
}
|
|
134
|
-
_context.
|
|
134
|
+
_context.prev = 2;
|
|
135
|
+
_context.next = 5;
|
|
135
136
|
return canvas.useMask(maskData);
|
|
136
|
-
case
|
|
137
|
+
case 5:
|
|
138
|
+
_context.next = 11;
|
|
139
|
+
break;
|
|
140
|
+
case 7:
|
|
141
|
+
_context.prev = 7;
|
|
142
|
+
_context.t0 = _context["catch"](2);
|
|
143
|
+
// eslint-disable-next-line no-console
|
|
144
|
+
console.error('Error while applying mask:', _context.t0);
|
|
145
|
+
// eslint-disable-next-line no-console
|
|
146
|
+
console.error('Mask data:', maskData);
|
|
147
|
+
case 11:
|
|
137
148
|
canvas.useColorOverlay(colorOverlayData);
|
|
138
149
|
return _context.abrupt("return", {
|
|
139
150
|
canvas: canvas,
|
|
140
151
|
designArea: designArea,
|
|
141
152
|
isNew: isNew
|
|
142
153
|
});
|
|
143
|
-
case
|
|
154
|
+
case 13:
|
|
144
155
|
case "end":
|
|
145
156
|
return _context.stop();
|
|
146
157
|
}
|
|
147
|
-
}, _callee);
|
|
158
|
+
}, _callee, null, [[2, 7]]);
|
|
148
159
|
}));
|
|
149
160
|
return function (_x) {
|
|
150
161
|
return _ref3.apply(this, arguments);
|
|
@@ -23,6 +23,7 @@ var maskTypes = {
|
|
|
23
23
|
var getMaskIfComplete = function getMaskIfComplete(obj) {
|
|
24
24
|
return maskTypes[(0, _get["default"])(obj, 'mask.maskType')] && _objectSpread(_objectSpread({}, obj.mask.maskData), {}, {
|
|
25
25
|
type: obj.mask.maskType,
|
|
26
|
+
dataUrl: obj.mask.maskDataUrl,
|
|
26
27
|
source: obj
|
|
27
28
|
});
|
|
28
29
|
};
|
|
@@ -33,7 +34,7 @@ var designAreaAppliesMask = exports.designAreaAppliesMask = function designAreaA
|
|
|
33
34
|
var designProductionMethod = (0, _Selectors2.getSelectedDesignProductionMethodForDesignArea)(state, designArea);
|
|
34
35
|
return !!(getMaskIfComplete(designProductionMethod) || getMaskIfComplete(designArea));
|
|
35
36
|
};
|
|
36
|
-
var
|
|
37
|
+
var createMaskSrc = function createMaskSrc(_ref) {
|
|
37
38
|
var itemIdentifier = _ref.itemIdentifier,
|
|
38
39
|
designAreaIdentifier = _ref.designAreaIdentifier,
|
|
39
40
|
designProductionMethodIdentifier = _ref.designProductionMethodIdentifier,
|
|
@@ -63,7 +64,7 @@ var getMaskDataForDesignArea = exports.getMaskDataForDesignArea = function getMa
|
|
|
63
64
|
var item = (0, _Selectors.getItem)((0, _Selectors.getConfigurator)(state));
|
|
64
65
|
var maskData = getMaskIfComplete(designProductionMethod) || getMaskIfComplete(designArea);
|
|
65
66
|
if (maskData) {
|
|
66
|
-
var src =
|
|
67
|
+
var src = maskData.dataUrl || createMaskSrc({
|
|
67
68
|
itemIdentifier: item.identifier,
|
|
68
69
|
designAreaIdentifier: designArea.identifier,
|
|
69
70
|
designProductionMethodIdentifier: maskData.source === designProductionMethod ? designProductionMethod.identifier : false,
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@configuratorware/configurator-frontendgui",
|
|
3
|
-
"version": "1.47.
|
|
3
|
+
"version": "1.47.3",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "./index.js",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@babel/polyfill": "^7.12.1",
|
|
9
|
-
"@configuratorware/scripts": "1.47.
|
|
9
|
+
"@configuratorware/scripts": "1.47.3",
|
|
10
10
|
"@material-ui/core": "^4.12.4",
|
|
11
11
|
"@material-ui/icons": "^4.11.3",
|
|
12
12
|
"@material-ui/lab": "^4.0.0-alpha.61",
|
|
@@ -36,12 +36,13 @@
|
|
|
36
36
|
"react-router-dom": "^5.3.4",
|
|
37
37
|
"react-swipeable": "^5.5.1",
|
|
38
38
|
"react-zoom-pan-pinch": "^2.1.3",
|
|
39
|
-
"redhotmagma-graphics-editor": "1.47.
|
|
40
|
-
"redhotmagma-visualization": "1.47.
|
|
39
|
+
"redhotmagma-graphics-editor": "1.47.3",
|
|
40
|
+
"redhotmagma-visualization": "1.47.3",
|
|
41
41
|
"redux": "^4.1.0",
|
|
42
42
|
"redux-logger": "^3.0.6",
|
|
43
43
|
"redux-persist": "^5.10.0",
|
|
44
44
|
"redux-thunk": "^2.3.0",
|
|
45
|
+
"semver": "^7.6.3",
|
|
45
46
|
"showdown": "^1.9.1",
|
|
46
47
|
"storage-factory": "^0.2.0",
|
|
47
48
|
"typeface-roboto": "^1.1.13",
|
|
@@ -64,10 +65,10 @@
|
|
|
64
65
|
"file-loader": "^6.2.0",
|
|
65
66
|
"mini-css-extract-plugin": "^2.7.6",
|
|
66
67
|
"node-sass": "^9.0.0",
|
|
67
|
-
"resolve-url-loader": "^5.0.0",
|
|
68
68
|
"react": "^18.2.0",
|
|
69
69
|
"react-dom": "^18.2.0",
|
|
70
70
|
"react-refresh": "^0.14.0",
|
|
71
|
+
"resolve-url-loader": "^5.0.0",
|
|
71
72
|
"sass-loader": "^13.3.2",
|
|
72
73
|
"style-loader": "^3.3.3",
|
|
73
74
|
"terser-webpack-plugin": "^5.3.9",
|
|
@@ -76,6 +77,9 @@
|
|
|
76
77
|
"webpack-cli": "^5.1.4",
|
|
77
78
|
"webpack-dev-server": "^4.15.1"
|
|
78
79
|
},
|
|
80
|
+
"engines": {
|
|
81
|
+
"node": ">=16.0.0"
|
|
82
|
+
},
|
|
79
83
|
"scripts": {
|
|
80
84
|
"copy-public": "node ./scripts/cpPublic.js",
|
|
81
85
|
"install": "npm run copy-public"
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
const package = require('../package.json');
|
|
3
|
+
const semver = require('semver');
|
|
4
|
+
const version = package.engines.node;
|
|
5
|
+
if (!semver.satisfies(process.version, version)) {
|
|
6
|
+
console.log(`Required node version ${version} not satisfied with current version ${process.version}.`);
|
|
7
|
+
process.exit(1);
|
|
8
|
+
}
|
|
@@ -153,7 +153,7 @@ class ImageControlbox extends React.Component {
|
|
|
153
153
|
const { printQualityInfoDialogOpen } = this.state;
|
|
154
154
|
|
|
155
155
|
const printQualityInfoExists = translationExists(
|
|
156
|
-
'imageControlbox.
|
|
156
|
+
'imageControlbox.printQuality.' + this.props.printQuality
|
|
157
157
|
);
|
|
158
158
|
|
|
159
159
|
return (
|
|
@@ -230,7 +230,7 @@ class ImageControlbox extends React.Component {
|
|
|
230
230
|
>
|
|
231
231
|
<DialogContent>
|
|
232
232
|
<DialogContentText id="alert-dialog-description">
|
|
233
|
-
{t('imageControlbox.
|
|
233
|
+
{t('imageControlbox.printQuality.' + printQuality)}
|
|
234
234
|
</DialogContentText>
|
|
235
235
|
</DialogContent>
|
|
236
236
|
<DialogActions>
|
|
@@ -124,7 +124,14 @@ export const setupDesigner = designDataService => {
|
|
|
124
124
|
canvas = canvasRepository.requestCanvas(designArea, canvasSize);
|
|
125
125
|
isNew = true;
|
|
126
126
|
}
|
|
127
|
-
|
|
127
|
+
try {
|
|
128
|
+
await canvas.useMask(maskData);
|
|
129
|
+
} catch (e) {
|
|
130
|
+
// eslint-disable-next-line no-console
|
|
131
|
+
console.error('Error while applying mask:', e);
|
|
132
|
+
// eslint-disable-next-line no-console
|
|
133
|
+
console.error('Mask data:', maskData);
|
|
134
|
+
}
|
|
128
135
|
canvas.useColorOverlay(colorOverlayData);
|
|
129
136
|
return {
|
|
130
137
|
canvas,
|
|
@@ -10,7 +10,12 @@ const maskTypes = {
|
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
const getMaskIfComplete = obj =>
|
|
13
|
-
maskTypes[get(obj, 'mask.maskType')] && {
|
|
13
|
+
maskTypes[get(obj, 'mask.maskType')] && {
|
|
14
|
+
...obj.mask.maskData,
|
|
15
|
+
type: obj.mask.maskType,
|
|
16
|
+
dataUrl: obj.mask.maskDataUrl,
|
|
17
|
+
source: obj,
|
|
18
|
+
};
|
|
14
19
|
|
|
15
20
|
export const designAreaAppliesMask = (state, designArea) => {
|
|
16
21
|
if (!designArea) {
|
|
@@ -20,7 +25,7 @@ export const designAreaAppliesMask = (state, designArea) => {
|
|
|
20
25
|
return !!(getMaskIfComplete(designProductionMethod) || getMaskIfComplete(designArea));
|
|
21
26
|
};
|
|
22
27
|
|
|
23
|
-
const
|
|
28
|
+
const createMaskSrc = ({ itemIdentifier, designAreaIdentifier, designProductionMethodIdentifier, type }) => {
|
|
24
29
|
switch (type) {
|
|
25
30
|
case maskTypes.circle: {
|
|
26
31
|
return circleMaskSVG;
|
|
@@ -45,13 +50,15 @@ export const getMaskDataForDesignArea = (state, designArea = null) => {
|
|
|
45
50
|
const item = getItem(getConfigurator(state));
|
|
46
51
|
const maskData = getMaskIfComplete(designProductionMethod) || getMaskIfComplete(designArea);
|
|
47
52
|
if (maskData) {
|
|
48
|
-
const src =
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
const src =
|
|
54
|
+
maskData.dataUrl ||
|
|
55
|
+
createMaskSrc({
|
|
56
|
+
itemIdentifier: item.identifier,
|
|
57
|
+
designAreaIdentifier: designArea.identifier,
|
|
58
|
+
designProductionMethodIdentifier:
|
|
59
|
+
maskData.source === designProductionMethod ? designProductionMethod.identifier : false,
|
|
60
|
+
type: maskData.type,
|
|
61
|
+
});
|
|
55
62
|
return { ...maskData, src, outlineColor: getClientHighlightColor(state) };
|
|
56
63
|
}
|
|
57
64
|
return false;
|