@configuratorware/configurator-frontendgui 1.36.0-beta.0 → 1.36.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/App/Modules/Creator/Components/Option/index.js +7 -1
- package/App/Modules/Creator/Components/Optiondetail/index.js +17 -14
- package/App/Modules/Creator/CreatorScreen.js +1 -4
- package/App/Modules/Designer/Components/DesignerSelectionToolbox/DesignerSelectionToolbox.js +20 -4
- package/App/Modules/Designer/Components/FullScreenView/FullScreenView.js +1 -1
- package/App/Modules/Designer/Containers/ImageEditDialog.js +1 -1
- package/App/Modules/Designer/DesignerScreen.js +1 -4
- package/App/Modules/Visualization/CreatorAlignTarget.js +1 -1
- package/App/Modules/Visualization/DesignerAlignTarget.js +1 -1
- package/App/Reducers/Configurator/Reducer.js +1 -1
- package/App/Reducers/DesignArea/Selectors.js +31 -13
- package/App/Screens/Configurator/Components/FullScreenView/index.js +2 -2
- package/App/Screens/Configurator/Components/LandscapeInformation/index.js +1 -1
- package/App/Screens/Configurator/Screen.js +1 -1
- package/App/Shared/Components/AmountPrice/index.js +18 -6
- package/Framework/Components/Carousel/index.js +17 -20
- package/package.json +23 -16
- package/src/App/Modules/Creator/Components/Option/index.js +8 -1
- package/src/App/Modules/Creator/Components/Optiondetail/__snapshots__/index.test.js.snap +75 -69
- package/src/App/Modules/Creator/Components/Optiondetail/index.js +50 -45
- package/src/App/Modules/Creator/CreatorScreen.js +0 -2
- package/src/App/Modules/Designer/Components/DesignerSelectionToolbox/DesignerSelectionToolbox.js +20 -5
- package/src/App/Modules/Designer/Components/FullScreenView/FullScreenView.js +1 -1
- package/src/App/Modules/Designer/Containers/ImageEditDialog.js +1 -1
- package/src/App/Modules/Designer/DesignerScreen.js +0 -2
- package/src/App/Modules/Visualization/CreatorAlignTarget.js +1 -1
- package/src/App/Modules/Visualization/DesignerAlignTarget.js +1 -1
- package/src/App/Reducers/Configurator/Reducer.js +4 -1
- package/src/App/Reducers/DesignArea/Selectors.js +15 -0
- package/src/App/Reducers/DesignArea/__tests__/Selectors.test.js +5 -0
- package/src/App/Screens/Configurator/Components/FullScreenView/index.js +2 -2
- package/src/App/Screens/Configurator/Components/LandscapeInformation/index.js +1 -1
- package/src/App/Screens/Configurator/Screen.js +1 -1
- package/src/App/Services/__tests__/DesignDataService.test.js +81 -0
- package/src/App/Shared/Components/AmountPrice/index.js +32 -21
- package/src/Framework/Components/Carousel/index.js +16 -17
- package/Shared/Components/Swipeable.js +0 -57
- package/src/Shared/Components/Swipeable.js +0 -10
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@configuratorware/configurator-frontendgui",
|
|
3
|
-
"version": "1.36.
|
|
3
|
+
"version": "1.36.1",
|
|
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.36.
|
|
10
|
-
"@hot-loader/react-dom": "^17.0.
|
|
9
|
+
"@configuratorware/scripts": "1.36.1",
|
|
10
|
+
"@hot-loader/react-dom": "^17.0.1",
|
|
11
11
|
"@material-ui/core": "^4.12.2",
|
|
12
12
|
"@material-ui/icons": "^4.11.2",
|
|
13
13
|
"@material-ui/lab": "^4.0.0-alpha.60",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"path-browserify": "^1.0.1",
|
|
27
27
|
"prop-types": "^15.7.2",
|
|
28
28
|
"qs": "^6.10.1",
|
|
29
|
-
"react": "^
|
|
29
|
+
"react": "^16.14.0",
|
|
30
30
|
"react-custom-scrollbars": "^4.2.1",
|
|
31
|
-
"react-dom": "^
|
|
31
|
+
"react-dom": "^16.14.0",
|
|
32
32
|
"react-file-drop": "^0.2.8",
|
|
33
33
|
"react-hot-loader": "^4.13.0",
|
|
34
34
|
"react-hyphen": "^1.4.0",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"react-redux-i18n": "^1.9.3",
|
|
38
38
|
"react-router": "^5.2.0",
|
|
39
39
|
"react-router-dom": "^5.2.0",
|
|
40
|
-
"react-swipeable": "^
|
|
40
|
+
"react-swipeable": "^5.5.1",
|
|
41
41
|
"react-zoom-pan-pinch": "^2.1.3",
|
|
42
|
-
"redhotmagma-graphics-editor": "1.36.
|
|
43
|
-
"redhotmagma-visualization": "1.36.
|
|
42
|
+
"redhotmagma-graphics-editor": "1.36.1",
|
|
43
|
+
"redhotmagma-visualization": "1.36.1",
|
|
44
44
|
"redux": "^4.1.0",
|
|
45
45
|
"redux-logger": "^3.0.6",
|
|
46
46
|
"redux-persist": "^5.10.0",
|
|
@@ -52,18 +52,25 @@
|
|
|
52
52
|
"uuid": "^3.4.0"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
+
"@babel/plugin-proposal-class-properties": "^7.13.0",
|
|
56
|
+
"@babel/plugin-proposal-decorators": "^7.13.5",
|
|
57
|
+
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
58
|
+
"@babel/preset-env": "^7.13.12",
|
|
59
|
+
"@babel/preset-react": "^7.13.13",
|
|
60
|
+
"@babel/preset-typescript": "^7.13.0",
|
|
55
61
|
"babel-loader": "^8.2.2",
|
|
56
|
-
"
|
|
62
|
+
"babel-plugin-module-resolver": "^4.1.0",
|
|
63
|
+
"css-loader": "^5.2.0",
|
|
57
64
|
"file-loader": "^6.2.0",
|
|
58
|
-
"mini-css-extract-plugin": "^
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
65
|
+
"mini-css-extract-plugin": "^1.4.0",
|
|
66
|
+
"node-sass": "^5.0.0",
|
|
67
|
+
"optimize-css-assets-webpack-plugin": "^5.0.4",
|
|
68
|
+
"resolve-url-loader": "^3.1.2",
|
|
69
|
+
"sass-loader": "^11.0.1",
|
|
62
70
|
"style-loader": "^2.0.0",
|
|
63
|
-
"terser-webpack-plugin": "^5.1.4",
|
|
64
71
|
"url-loader": "^4.1.1",
|
|
65
|
-
"webpack": "^5.
|
|
66
|
-
"webpack-cli": "^4.
|
|
72
|
+
"webpack": "^5.28.0",
|
|
73
|
+
"webpack-cli": "^4.6.0",
|
|
67
74
|
"webpack-dev-server": "^3.11.2"
|
|
68
75
|
},
|
|
69
76
|
"scripts": {
|
|
@@ -253,6 +253,10 @@ const Option = ({ children, render, ...props }) => {
|
|
|
253
253
|
});
|
|
254
254
|
};
|
|
255
255
|
|
|
256
|
+
const onAbstractClicked = event => {
|
|
257
|
+
event.stopPropagation();
|
|
258
|
+
};
|
|
259
|
+
|
|
256
260
|
const onDetailsClicked = event => {
|
|
257
261
|
event.stopPropagation();
|
|
258
262
|
event.preventDefault();
|
|
@@ -409,7 +413,9 @@ const Option = ({ children, render, ...props }) => {
|
|
|
409
413
|
{!hidePrices && <div className={classes.price}>{option.priceFormatted}</div>}
|
|
410
414
|
{smallerScreen && renderControls('horizontal')}
|
|
411
415
|
{option.abstract && (
|
|
412
|
-
<Markdown className={classes.description}
|
|
416
|
+
<Markdown className={classes.description} onClick={onAbstractClicked}>
|
|
417
|
+
{option.abstract}
|
|
418
|
+
</Markdown>
|
|
413
419
|
)}
|
|
414
420
|
|
|
415
421
|
{renderActions()}
|
|
@@ -481,6 +487,7 @@ const Option = ({ children, render, ...props }) => {
|
|
|
481
487
|
onOptionSelected,
|
|
482
488
|
onOptionClicked,
|
|
483
489
|
onAmountChanged,
|
|
490
|
+
onAbstractClicked,
|
|
484
491
|
onDetailsClicked,
|
|
485
492
|
onIncompatibilityClicked,
|
|
486
493
|
onOptionGroupClicked,
|
|
@@ -5,28 +5,30 @@ exports[`Screens/Components/ImageEditDialog/MessageBox renders as a modal screen
|
|
|
5
5
|
<div
|
|
6
6
|
class="MuiDialogContent-root Optiondetail-detailDialogContentRoot-14"
|
|
7
7
|
>
|
|
8
|
-
<div
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<div
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
8
|
+
<div>
|
|
9
|
+
<div
|
|
10
|
+
class="Optiondetail-detailContainer-4"
|
|
11
|
+
>
|
|
12
|
+
<div>
|
|
13
|
+
<div
|
|
14
|
+
class="MuiTypography-root Optiondetail-detailsTypography-8 MuiTypography-body2"
|
|
15
|
+
>
|
|
16
|
+
<p>
|
|
17
|
+
Das sind schwarze Reissverschlüsse
|
|
18
|
+
</p>
|
|
19
|
+
</div>
|
|
20
|
+
<div
|
|
21
|
+
class="MuiTypography-root Optiondetail-priceFormatted-6 MuiTypography-body2"
|
|
22
|
+
>
|
|
23
|
+
0,00 €
|
|
24
|
+
</div>
|
|
25
|
+
<div
|
|
26
|
+
class="MuiTypography-root Optiondetail-detailsTypography-8 MuiTypography-body2"
|
|
27
|
+
>
|
|
28
|
+
<p>
|
|
29
|
+
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
|
|
30
|
+
</p>
|
|
31
|
+
</div>
|
|
30
32
|
</div>
|
|
31
33
|
</div>
|
|
32
34
|
</div>
|
|
@@ -60,28 +62,30 @@ exports[`Screens/Components/ImageEditDialog/MessageBox renders as full screen on
|
|
|
60
62
|
<div
|
|
61
63
|
class="MuiDialogContent-root Optiondetail-detailDialogContentRoot-14"
|
|
62
64
|
>
|
|
63
|
-
<div
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
<div
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
65
|
+
<div>
|
|
66
|
+
<div
|
|
67
|
+
class="Optiondetail-detailContainer-4"
|
|
68
|
+
>
|
|
69
|
+
<div>
|
|
70
|
+
<div
|
|
71
|
+
class="MuiTypography-root Optiondetail-detailsTypography-8 MuiTypography-body2"
|
|
72
|
+
>
|
|
73
|
+
<p>
|
|
74
|
+
Das sind schwarze Reissverschlüsse
|
|
75
|
+
</p>
|
|
76
|
+
</div>
|
|
77
|
+
<div
|
|
78
|
+
class="MuiTypography-root Optiondetail-priceFormatted-6 MuiTypography-body2"
|
|
79
|
+
>
|
|
80
|
+
0,00 €
|
|
81
|
+
</div>
|
|
82
|
+
<div
|
|
83
|
+
class="MuiTypography-root Optiondetail-detailsTypography-8 MuiTypography-body2"
|
|
84
|
+
>
|
|
85
|
+
<p>
|
|
86
|
+
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
|
|
87
|
+
</p>
|
|
88
|
+
</div>
|
|
85
89
|
</div>
|
|
86
90
|
</div>
|
|
87
91
|
</div>
|
|
@@ -115,36 +119,38 @@ exports[`Screens/Components/ImageEditDialog/MessageBox renders with previous and
|
|
|
115
119
|
<div
|
|
116
120
|
class="MuiDialogContent-root Optiondetail-detailDialogContentRoot-14"
|
|
117
121
|
>
|
|
118
|
-
<div
|
|
119
|
-
class="Optiondetail-detailContainerWithNav-3"
|
|
120
|
-
>
|
|
122
|
+
<div>
|
|
121
123
|
<div
|
|
122
|
-
class="Optiondetail-
|
|
123
|
-
|
|
124
|
-
<div>
|
|
125
|
-
<div
|
|
126
|
-
class="MuiTypography-root Optiondetail-detailsTypography-8 MuiTypography-body2"
|
|
127
|
-
>
|
|
128
|
-
<p>
|
|
129
|
-
Das sind schwarze Reissverschlüsse
|
|
130
|
-
</p>
|
|
131
|
-
</div>
|
|
124
|
+
class="Optiondetail-detailContainerWithNav-3"
|
|
125
|
+
>
|
|
132
126
|
<div
|
|
133
|
-
class="
|
|
134
|
-
|
|
135
|
-
|
|
127
|
+
class="Optiondetail-detailNav-1 prev"
|
|
128
|
+
/>
|
|
129
|
+
<div>
|
|
130
|
+
<div
|
|
131
|
+
class="MuiTypography-root Optiondetail-detailsTypography-8 MuiTypography-body2"
|
|
132
|
+
>
|
|
133
|
+
<p>
|
|
134
|
+
Das sind schwarze Reissverschlüsse
|
|
135
|
+
</p>
|
|
136
|
+
</div>
|
|
137
|
+
<div
|
|
138
|
+
class="MuiTypography-root Optiondetail-priceFormatted-6 MuiTypography-body2"
|
|
139
|
+
>
|
|
140
|
+
0,00 €
|
|
141
|
+
</div>
|
|
142
|
+
<div
|
|
143
|
+
class="MuiTypography-root Optiondetail-detailsTypography-8 MuiTypography-body2"
|
|
144
|
+
>
|
|
145
|
+
<p>
|
|
146
|
+
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
|
|
147
|
+
</p>
|
|
148
|
+
</div>
|
|
136
149
|
</div>
|
|
137
150
|
<div
|
|
138
|
-
class="
|
|
139
|
-
|
|
140
|
-
<p>
|
|
141
|
-
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
|
|
142
|
-
</p>
|
|
143
|
-
</div>
|
|
151
|
+
class="Optiondetail-detailNav-1 next"
|
|
152
|
+
/>
|
|
144
153
|
</div>
|
|
145
|
-
<div
|
|
146
|
-
class="Optiondetail-detailNav-1 next"
|
|
147
|
-
/>
|
|
148
154
|
</div>
|
|
149
155
|
</div>
|
|
150
156
|
<div
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import _ from 'lodash';
|
|
3
|
+
import { Swipeable } from 'react-swipeable';
|
|
3
4
|
import clsx from 'clsx';
|
|
4
5
|
import Button from '@material-ui/core/Button';
|
|
5
6
|
import DialogContent from '@material-ui/core/DialogContent';
|
|
@@ -16,7 +17,6 @@ import OptionlistitemAmount from '../OptionAmount';
|
|
|
16
17
|
import getImageUrl from '../../../../Utils/getImageUrl';
|
|
17
18
|
import Markdown from '../../../../../Framework/Components/Markdown';
|
|
18
19
|
import ZoomImage from './ZoomImage';
|
|
19
|
-
import { LEFT, RIGHT, Swipeable } from '../../../../../Shared/Components/Swipeable';
|
|
20
20
|
|
|
21
21
|
const styles = theme => ({
|
|
22
22
|
detailNav: {
|
|
@@ -189,11 +189,14 @@ class Optiondetail extends React.Component {
|
|
|
189
189
|
}
|
|
190
190
|
};
|
|
191
191
|
|
|
192
|
-
swiped = e => {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
192
|
+
swiped = (e, deltaX, deltaY) => {
|
|
193
|
+
// use only horizontal swiping
|
|
194
|
+
if (Math.abs(deltaX) >= Math.abs(deltaY)) {
|
|
195
|
+
if (deltaX > 0) {
|
|
196
|
+
this.next();
|
|
197
|
+
} else {
|
|
198
|
+
this.prev();
|
|
199
|
+
}
|
|
197
200
|
}
|
|
198
201
|
};
|
|
199
202
|
|
|
@@ -348,53 +351,55 @@ class Optiondetail extends React.Component {
|
|
|
348
351
|
</div>
|
|
349
352
|
) : (
|
|
350
353
|
<Swipeable
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
}}
|
|
356
|
-
ref={this.setDetailsContainerRef}
|
|
357
|
-
className={showNav ? classes.detailContainerWithNav : classes.detailContainer}
|
|
354
|
+
disabled={!showNav}
|
|
355
|
+
trackMouse={true}
|
|
356
|
+
onSwiped={this.swiped}
|
|
357
|
+
delta={Optiondetail.swipeDelta}
|
|
358
358
|
>
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
359
|
+
<div
|
|
360
|
+
ref={this.setDetailsContainerRef}
|
|
361
|
+
className={showNav ? classes.detailContainerWithNav : classes.detailContainer}
|
|
362
|
+
>
|
|
363
|
+
{showNav && (
|
|
364
|
+
<div className={clsx(classes.detailNav, 'prev')} onClick={this.prev} />
|
|
365
|
+
)}
|
|
362
366
|
|
|
363
|
-
|
|
364
|
-
<div
|
|
365
|
-
className={clsx({
|
|
366
|
-
[classes.detailsWithImageContainer]: !showFullScreenModal,
|
|
367
|
-
})}
|
|
368
|
-
>
|
|
367
|
+
{detailImage ? (
|
|
369
368
|
<div
|
|
370
|
-
className={
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
: classes.imageContainer
|
|
374
|
-
}
|
|
375
|
-
onClick={this.state.hasZoom ? this.toggleZoomImage : null}
|
|
369
|
+
className={clsx({
|
|
370
|
+
[classes.detailsWithImageContainer]: !showFullScreenModal,
|
|
371
|
+
})}
|
|
376
372
|
>
|
|
377
|
-
<
|
|
378
|
-
ref={this.setDetailsImageRef}
|
|
379
|
-
onLoad={this.handleImageLoaded}
|
|
373
|
+
<div
|
|
380
374
|
className={
|
|
381
|
-
this.state.
|
|
382
|
-
? classes.
|
|
383
|
-
: classes.
|
|
375
|
+
this.state.hasZoom
|
|
376
|
+
? classes.imageContainerWithZoom
|
|
377
|
+
: classes.imageContainer
|
|
384
378
|
}
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
379
|
+
onClick={this.state.hasZoom ? this.toggleZoomImage : null}
|
|
380
|
+
>
|
|
381
|
+
<img
|
|
382
|
+
ref={this.setDetailsImageRef}
|
|
383
|
+
onLoad={this.handleImageLoaded}
|
|
384
|
+
className={
|
|
385
|
+
this.state.zoomImage && ['xs', 'sm'].includes(width)
|
|
386
|
+
? classes.imageHidden
|
|
387
|
+
: classes.image
|
|
388
|
+
}
|
|
389
|
+
src={getImageUrl(detailImage)}
|
|
390
|
+
alt={details.title}
|
|
391
|
+
/>
|
|
392
|
+
</div>
|
|
393
|
+
{detailsContent}
|
|
388
394
|
</div>
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
detailsContent
|
|
393
|
-
)}
|
|
395
|
+
) : (
|
|
396
|
+
detailsContent
|
|
397
|
+
)}
|
|
394
398
|
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
399
|
+
{showNav && (
|
|
400
|
+
<div className={clsx(classes.detailNav, 'next')} onClick={this.next} />
|
|
401
|
+
)}
|
|
402
|
+
</div>
|
|
398
403
|
</Swipeable>
|
|
399
404
|
)}
|
|
400
405
|
</DialogContent>
|
package/src/App/Modules/Designer/Components/DesignerSelectionToolbox/DesignerSelectionToolbox.js
CHANGED
|
@@ -10,11 +10,12 @@ import TextControlbox from '../TextControlbox';
|
|
|
10
10
|
import ImageControlbox from '../ImageControlbox';
|
|
11
11
|
import { CustomFontOverlay } from './CustomFontOverlay';
|
|
12
12
|
import { createFontItemProps, findCurrentFontItem } from './fontItemUtils';
|
|
13
|
-
import { isPlaceholderContent } from 'App/Reducers/DesignArea/Selectors';
|
|
13
|
+
import { isPlaceholderContent, isOneLineText } from 'App/Reducers/DesignArea/Selectors';
|
|
14
14
|
import isMobileDevice from 'Framework/Helpers/isMobileDevice';
|
|
15
15
|
import { hasBackgroundColor } from 'App/Reducers/DesignData/Selectors';
|
|
16
16
|
import { t } from 'Framework/i18n';
|
|
17
17
|
import { isOriginalVector } from '../../Utils/Transformers';
|
|
18
|
+
import { useSelector } from 'react-redux';
|
|
18
19
|
|
|
19
20
|
const styles = theme => ({
|
|
20
21
|
root: {
|
|
@@ -132,11 +133,13 @@ const DesignerSelectionToolbox = props => {
|
|
|
132
133
|
defaultFont,
|
|
133
134
|
loadFonts,
|
|
134
135
|
initialColor,
|
|
136
|
+
autoFocusEditor,
|
|
135
137
|
} = props;
|
|
136
138
|
|
|
137
139
|
const rteRef = useRef(null);
|
|
138
140
|
const editorRef = useRef(null);
|
|
139
141
|
const [showCustomFontOverlay, toggleCustomFontOverlay] = useState(false);
|
|
142
|
+
const disableLinebreaks = useSelector(state => isOneLineText(state));
|
|
140
143
|
|
|
141
144
|
return (
|
|
142
145
|
<div className={classes.root}>
|
|
@@ -271,6 +274,12 @@ const DesignerSelectionToolbox = props => {
|
|
|
271
274
|
canvas.selectedObject.content = '';
|
|
272
275
|
}
|
|
273
276
|
},
|
|
277
|
+
onBlur: () => {
|
|
278
|
+
const regex = /<\/span>/;
|
|
279
|
+
if (selectedObject.content.search(regex) === -1) {
|
|
280
|
+
canvas.selectedObject.remove();
|
|
281
|
+
}
|
|
282
|
+
},
|
|
274
283
|
};
|
|
275
284
|
|
|
276
285
|
if (selectedObject.isBulkName) {
|
|
@@ -285,10 +294,14 @@ const DesignerSelectionToolbox = props => {
|
|
|
285
294
|
|
|
286
295
|
return renderTextEditor({
|
|
287
296
|
...textToolsRenderObj,
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
297
|
+
disableLinebreaks,
|
|
298
|
+
autoFocusWhenMounted:
|
|
299
|
+
autoFocusEditor ||
|
|
300
|
+
!(
|
|
301
|
+
isPlaceholderContent(
|
|
302
|
+
selectedObject.content
|
|
303
|
+
) || isMobileDevice()
|
|
304
|
+
),
|
|
292
305
|
textEditorElementProps,
|
|
293
306
|
onChangeHTML: (...args) => {
|
|
294
307
|
// call the original function first with all the args
|
|
@@ -390,6 +403,7 @@ DesignerSelectionToolbox.propTypes = {
|
|
|
390
403
|
addCustomFont: PropTypes.func,
|
|
391
404
|
defaultFont: PropTypes.object,
|
|
392
405
|
initialColor: PropTypes.object,
|
|
406
|
+
autoFocusEditor: PropTypes.bool,
|
|
393
407
|
};
|
|
394
408
|
|
|
395
409
|
DesignerSelectionToolbox.defaultProps = {
|
|
@@ -402,6 +416,7 @@ DesignerSelectionToolbox.defaultProps = {
|
|
|
402
416
|
width: '',
|
|
403
417
|
isActiveBulkName: false,
|
|
404
418
|
isPortraitMode: false,
|
|
419
|
+
autoFocusEditor: false,
|
|
405
420
|
};
|
|
406
421
|
|
|
407
422
|
export default withWidth()(
|
|
@@ -22,7 +22,7 @@ const styles = theme => ({
|
|
|
22
22
|
[theme.orientation.landscape]: {
|
|
23
23
|
height: 136,
|
|
24
24
|
},
|
|
25
|
-
'@media (min-aspect-ratio: 13/9) and (min-height: 280px) and (max-width:
|
|
25
|
+
'@media (min-aspect-ratio: 13/9) and (min-height: 280px) and (max-width: 950px)': {
|
|
26
26
|
width: '100%',
|
|
27
27
|
maxWidth: '100%',
|
|
28
28
|
position: 'absolute',
|
|
@@ -567,7 +567,7 @@ export class ImageEditDialogContainer extends React.Component {
|
|
|
567
567
|
return;
|
|
568
568
|
}
|
|
569
569
|
|
|
570
|
-
if (activeTabIndex === 0) {
|
|
570
|
+
if (activeTabIndex === 0 && !(image.gallery && colorDisabled)) {
|
|
571
571
|
this.setState({ activeTabIndex: image.gallery ? 2 : 1 });
|
|
572
572
|
return;
|
|
573
573
|
}
|
|
@@ -20,7 +20,7 @@ const styles = theme => ({
|
|
|
20
20
|
[theme.breakpoints.up('lg')]: {
|
|
21
21
|
maxHeight: 'calc(100% - 196px)',
|
|
22
22
|
},
|
|
23
|
-
'@media (min-aspect-ratio: 13/9) and (min-height: 280px) and (max-width:
|
|
23
|
+
'@media (min-aspect-ratio: 13/9) and (min-height: 280px) and (max-width: 950px)': {
|
|
24
24
|
maxHeight: '100%',
|
|
25
25
|
},
|
|
26
26
|
},
|
|
@@ -26,7 +26,7 @@ const styles = theme => ({
|
|
|
26
26
|
marginTop: 0,
|
|
27
27
|
},
|
|
28
28
|
},
|
|
29
|
-
'@media (min-aspect-ratio: 13/9) and (min-height: 280px) and (max-width:
|
|
29
|
+
'@media (min-aspect-ratio: 13/9) and (min-height: 280px) and (max-width: 950px)': {
|
|
30
30
|
maxHeight: '100%',
|
|
31
31
|
},
|
|
32
32
|
},
|
|
@@ -628,5 +628,8 @@ export default function configuratorReducer(prevState = initialState, action = {
|
|
|
628
628
|
}
|
|
629
629
|
|
|
630
630
|
function filterOptionsWithDetails(options) {
|
|
631
|
-
return _.filter(
|
|
631
|
+
return _.filter(
|
|
632
|
+
options,
|
|
633
|
+
option => !!(option.abstract || option.description || option.detailImageExists === true)
|
|
634
|
+
);
|
|
632
635
|
}
|
|
@@ -125,11 +125,14 @@ export const getDesignAreaIdentifierToOpen = state => {
|
|
|
125
125
|
} = state;
|
|
126
126
|
const previousEditedDesignAreaIdentifier = getPreviousEditedDesignAreaIdentifier(state);
|
|
127
127
|
const firstEditedDesignAreafromDesignData = getFirstEditedDesignAreafromDesignData(state);
|
|
128
|
+
const designAreaFromSelectedDesignView = getDesignAreaFromSelectedDesignView(state);
|
|
128
129
|
const defaultDesignAreaFromProductionMethod = getDefaultDesignAreaIdentifierFromProductionMethod(state);
|
|
130
|
+
|
|
129
131
|
return (
|
|
130
132
|
identifier ||
|
|
131
133
|
previousEditedDesignAreaIdentifier ||
|
|
132
134
|
firstEditedDesignAreafromDesignData ||
|
|
135
|
+
designAreaFromSelectedDesignView ||
|
|
133
136
|
defaultDesignAreaFromProductionMethod ||
|
|
134
137
|
null
|
|
135
138
|
);
|
|
@@ -672,6 +675,14 @@ export const getDesignViewListForDesignAreas = (state, designAreas) => {
|
|
|
672
675
|
return designViewList;
|
|
673
676
|
};
|
|
674
677
|
|
|
678
|
+
export const getDesignAreaFromSelectedDesignView = state => {
|
|
679
|
+
const {
|
|
680
|
+
designArea: { filteredDesignAreas },
|
|
681
|
+
designView: { selectedDesignView },
|
|
682
|
+
} = state;
|
|
683
|
+
return find(filteredDesignAreas, ['designView.identifier', selectedDesignView.identifier])?.identifier;
|
|
684
|
+
};
|
|
685
|
+
|
|
675
686
|
export const getDefaultDesignAreaIdentifierFromProductionMethod = state => {
|
|
676
687
|
//return the first designArea with isDefault: true due to api call accepts multiple productionmethods to be default
|
|
677
688
|
const {
|
|
@@ -905,3 +916,7 @@ export const getImagesByDesignArea = (state, designAreaIdentifier) => {
|
|
|
905
916
|
const designData = getDesignDataByDesignAreaIdentifier(state, designAreaIdentifier);
|
|
906
917
|
return get(designData, 'canvasData.objects', []).filter(({ type }) => type === 'Image');
|
|
907
918
|
};
|
|
919
|
+
|
|
920
|
+
export function isOneLineText(state) {
|
|
921
|
+
return get(getSelectedDesignProductionMethod(state), 'oneLineText', false);
|
|
922
|
+
}
|
|
@@ -262,6 +262,11 @@ describe('Reducers/DesignArea/Selectors', () => {
|
|
|
262
262
|
selectedDesignArea: { identifier: 'a_2' },
|
|
263
263
|
previousEditedDesignArea: {},
|
|
264
264
|
},
|
|
265
|
+
designView: {
|
|
266
|
+
selectedDesignView: {
|
|
267
|
+
identifier: '01_side',
|
|
268
|
+
},
|
|
269
|
+
},
|
|
265
270
|
configurator: {
|
|
266
271
|
configuration: {
|
|
267
272
|
designdata: {
|
|
@@ -31,7 +31,7 @@ const styles = theme => ({
|
|
|
31
31
|
[theme.breakpoints.down('sm')]: {
|
|
32
32
|
zIndex: 5,
|
|
33
33
|
},
|
|
34
|
-
'@media (min-aspect-ratio: 13/9) and (min-height: 280px) and (max-width:
|
|
34
|
+
'@media (min-aspect-ratio: 13/9) and (min-height: 280px) and (max-width: 950px)': {
|
|
35
35
|
display: 'none',
|
|
36
36
|
},
|
|
37
37
|
},
|
|
@@ -71,7 +71,7 @@ const styles = theme => ({
|
|
|
71
71
|
bottom: 0,
|
|
72
72
|
height: 56,
|
|
73
73
|
},
|
|
74
|
-
'@media (min-aspect-ratio: 13/9) and (min-height: 280px) and (max-width:
|
|
74
|
+
'@media (min-aspect-ratio: 13/9) and (min-height: 280px) and (max-width: 950px)': {
|
|
75
75
|
display: 'none',
|
|
76
76
|
},
|
|
77
77
|
},
|
|
@@ -9,7 +9,7 @@ const styles = () => ({
|
|
|
9
9
|
LandscapeFullscreen: {
|
|
10
10
|
display: 'none',
|
|
11
11
|
},
|
|
12
|
-
'@media (min-aspect-ratio: 13/9) and (min-height: 280px) and (max-width:
|
|
12
|
+
'@media (min-aspect-ratio: 13/9) and (min-height: 280px) and (max-width: 950px)': {
|
|
13
13
|
LandscapeFullscreen: {
|
|
14
14
|
display: 'flex',
|
|
15
15
|
position: 'absolute',
|
|
@@ -46,7 +46,7 @@ import { Services } from '../../ServiceLocator';
|
|
|
46
46
|
*/
|
|
47
47
|
export const Configurator = props => {
|
|
48
48
|
const imageOnly = useMediaQuery(
|
|
49
|
-
'(min-aspect-ratio: 13/9) and (min-height: 280px) and (max-width:
|
|
49
|
+
'(min-aspect-ratio: 13/9) and (min-height: 280px) and (max-width: 950px)'
|
|
50
50
|
);
|
|
51
51
|
useEffect(() => {
|
|
52
52
|
if (imageOnly) {
|