@configuratorware/configurator-frontendgui 1.38.2 → 1.38.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.
@@ -104,7 +104,7 @@ var styles = function styles(theme) {
104
104
  }), _horizontal),
105
105
  '&.vertical': {
106
106
  "float": 'left',
107
- height: 'calc(100% - 310px)',
107
+ height: 'calc(100% - 68px)',
108
108
  minHeight: 120,
109
109
  width: 140,
110
110
  left: theme.spacing(1),
@@ -141,7 +141,7 @@ var styles = function styles(theme) {
141
141
  }, _defineProperty(_visualization, theme.breakpoints.down('xs'), {
142
142
  height: '75%'
143
143
  }), _defineProperty(_visualization, theme.breakpoints.down(theme.creator.viewSelectBreakpoint), {
144
- height: 'calc(100% - 152px)'
144
+ height: 'calc(100% - 18px)'
145
145
  }), _defineProperty(_visualization, '&.withBottomList', (_withBottomList2 = {}, _defineProperty(_withBottomList2, theme.breakpoints.between('xs', 'sm'), {
146
146
  height: 'calc(100% - 198px)'
147
147
  }), _defineProperty(_withBottomList2, theme.breakpoints.up('sm'), {
@@ -13,6 +13,8 @@ var _withStyles = _interopRequireDefault(require("@material-ui/core/styles/withS
13
13
 
14
14
  var _AlignTargetProvider = require("redhotmagma-visualization/AlignTargetProvider");
15
15
 
16
+ var _clsx = _interopRequireDefault(require("clsx"));
17
+
16
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17
19
 
18
20
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -36,7 +38,8 @@ var AlignTargetContainer = (0, _withStyles["default"])(style, {
36
38
  })((0, _AlignTargetProvider.withAlignTarget)(function (_ref) {
37
39
  var alignTarget = _ref.alignTarget,
38
40
  children = _ref.children,
39
- classes = _ref.classes;
41
+ classes = _ref.classes,
42
+ className = _ref.className;
40
43
  var ref = (0, _react.useRef)();
41
44
  (0, _react.useEffect)(function () {
42
45
  if (ref.current) {
@@ -49,7 +52,7 @@ var AlignTargetContainer = (0, _withStyles["default"])(style, {
49
52
  }, [alignTarget]);
50
53
  return /*#__PURE__*/_react["default"].createElement("div", {
51
54
  ref: ref,
52
- className: classes.root
55
+ className: (0, _clsx["default"])(classes.root, className)
53
56
  }, children);
54
57
  }));
55
58
  exports.AlignTargetContainer = AlignTargetContainer;
@@ -5,37 +5,65 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.CreatorAlignTarget = void 0;
7
7
 
8
+ var _react = _interopRequireDefault(require("react"));
9
+
8
10
  var _Containers = require("../Creator/Containers");
9
11
 
10
12
  var _withStyles = _interopRequireDefault(require("@material-ui/core/styles/withStyles"));
11
13
 
14
+ var _reactRedux = require("react-redux");
15
+
12
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
17
 
18
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
19
+
14
20
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15
21
 
16
22
  var styles = function styles(theme) {
17
- var _root;
23
+ var _withDesignViews, _root;
18
24
 
19
25
  return {
20
26
  root: (_root = {
21
27
  marginTop: 36
22
28
  }, _defineProperty(_root, theme.breakpoints.down('xs'), {
23
29
  maxHeight: 'calc(100% - 270px)'
24
- }), _defineProperty(_root, theme.breakpoints.up('sm'), {
30
+ }), _defineProperty(_root, theme.breakpoints.up('sm'), _defineProperty({
31
+ maxHeight: 'calc(100% - 58px)'
32
+ }, theme.orientation.portrait, {
25
33
  maxHeight: 'calc(100% - 260px)'
26
- }), _defineProperty(_root, theme.breakpoints.up(theme.creator.viewSelectBreakpoint), {
34
+ })), _defineProperty(_root, theme.breakpoints.up(theme.creator.viewSelectBreakpoint), {
27
35
  marginTop: 0
28
36
  }), _defineProperty(_root, theme.breakpoints.between(theme.creator.viewSelectBreakpoint, 'lg'), {
29
- maxHeight: 'calc(100% - 286px)'
37
+ maxHeight: 'calc(100% - 152px)'
30
38
  }), _defineProperty(_root, theme.breakpoints.up('lg'), {
31
- maxHeight: 'calc(100% - 196px)'
39
+ maxHeight: 'calc(100% - 154px)'
32
40
  }), _defineProperty(_root, '@media (min-aspect-ratio: 13/9) and (min-height: 280px) and (max-width: 950px)', {
33
41
  maxHeight: '100%'
34
- }), _root)
42
+ }), _defineProperty(_root, '&.withDesignViews', (_withDesignViews = {}, _defineProperty(_withDesignViews, theme.breakpoints.up('sm'), _defineProperty({
43
+ maxHeight: 'calc(100% - 136px)'
44
+ }, theme.orientation.portrait, {
45
+ maxHeight: 'calc(100% - 260px)'
46
+ })), _defineProperty(_withDesignViews, theme.breakpoints.between(theme.creator.viewSelectBreakpoint, 'lg'), {
47
+ maxHeight: 'calc(100% - 156px)'
48
+ }), _defineProperty(_withDesignViews, theme.breakpoints.up('lg'), {
49
+ maxHeight: 'calc(100% - 196px)'
50
+ }), _withDesignViews)), _root)
35
51
  };
36
52
  };
37
53
 
38
- var CreatorAlignTarget = (0, _withStyles["default"])(styles, {
54
+ var StyledAlignTargetContainer = (0, _withStyles["default"])(styles, {
39
55
  name: 'CreatorAlignTarget'
40
56
  })(_Containers.AlignTargetContainer);
57
+
58
+ var CreatorAlignTarget = function CreatorAlignTarget(props) {
59
+ var className = (0, _reactRedux.useSelector)(function (state) {
60
+ var _state$designView;
61
+
62
+ return ((_state$designView = state.designView) === null || _state$designView === void 0 ? void 0 : _state$designView.designViews.length) > 1;
63
+ }) && 'withDesignViews';
64
+ return /*#__PURE__*/_react["default"].createElement(StyledAlignTargetContainer, _extends({
65
+ className: className
66
+ }, props));
67
+ };
68
+
41
69
  exports.CreatorAlignTarget = CreatorAlignTarget;
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@configuratorware/configurator-frontendgui",
3
- "version": "1.38.2",
3
+ "version": "1.38.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.38.2",
9
+ "@configuratorware/scripts": "1.38.3",
10
10
  "@hot-loader/react-dom": "^17.0.1",
11
11
  "@material-ui/core": "^4.12.2",
12
12
  "@material-ui/icons": "^4.11.2",
@@ -39,8 +39,8 @@
39
39
  "react-router-dom": "^5.2.0",
40
40
  "react-swipeable": "^5.5.1",
41
41
  "react-zoom-pan-pinch": "^2.1.3",
42
- "redhotmagma-graphics-editor": "1.38.2",
43
- "redhotmagma-visualization": "1.38.2",
42
+ "redhotmagma-graphics-editor": "1.38.3",
43
+ "redhotmagma-visualization": "1.38.3",
44
44
  "redux": "^4.1.0",
45
45
  "redux-logger": "^3.0.6",
46
46
  "redux-persist": "^5.10.0",
@@ -102,7 +102,7 @@ const styles = theme => ({
102
102
  },
103
103
  '&.vertical': {
104
104
  float: 'left',
105
- height: 'calc(100% - 310px)',
105
+ height: 'calc(100% - 68px)',
106
106
  minHeight: 120,
107
107
  width: 140,
108
108
  left: theme.spacing(1),
@@ -148,7 +148,7 @@ const styles = theme => ({
148
148
  height: '75%',
149
149
  },
150
150
  [theme.breakpoints.down(theme.creator.viewSelectBreakpoint)]: {
151
- height: 'calc(100% - 152px)',
151
+ height: 'calc(100% - 18px)',
152
152
  },
153
153
  '&.withBottomList': {
154
154
  [theme.breakpoints.between('xs', 'sm')]: {
@@ -1,6 +1,7 @@
1
1
  import React, { useRef, useEffect } from 'react';
2
2
  import withStyles from '@material-ui/core/styles/withStyles';
3
3
  import { withAlignTarget } from 'redhotmagma-visualization/AlignTargetProvider';
4
+ import clsx from 'clsx';
4
5
 
5
6
  const style = {
6
7
  root: {
@@ -15,7 +16,7 @@ const style = {
15
16
  };
16
17
 
17
18
  export const AlignTargetContainer = withStyles(style, { name: 'AlignTargetContainer' })(
18
- withAlignTarget(({ alignTarget, children, classes }) => {
19
+ withAlignTarget(({ alignTarget, children, classes, className }) => {
19
20
  const ref = useRef();
20
21
  useEffect(() => {
21
22
  if (ref.current) {
@@ -24,7 +25,7 @@ export const AlignTargetContainer = withStyles(style, { name: 'AlignTargetContai
24
25
  return () => alignTarget.remove(ref.current);
25
26
  }, [alignTarget]);
26
27
  return (
27
- <div ref={ref} className={classes.root}>
28
+ <div ref={ref} className={clsx(classes.root, className)}>
28
29
  {children}
29
30
  </div>
30
31
  );
@@ -1,5 +1,7 @@
1
+ import React from 'react';
1
2
  import { AlignTargetContainer } from '../Creator/Containers';
2
3
  import withStyles from '@material-ui/core/styles/withStyles';
4
+ import { useSelector } from 'react-redux';
3
5
 
4
6
  const styles = theme => ({
5
7
  root: {
@@ -9,20 +11,43 @@ const styles = theme => ({
9
11
  maxHeight: 'calc(100% - 270px)',
10
12
  },
11
13
  [theme.breakpoints.up('sm')]: {
12
- maxHeight: 'calc(100% - 260px)',
14
+ maxHeight: 'calc(100% - 58px)',
15
+ [theme.orientation.portrait]: {
16
+ maxHeight: 'calc(100% - 260px)',
17
+ },
13
18
  },
14
19
  [theme.breakpoints.up(theme.creator.viewSelectBreakpoint)]: {
15
20
  marginTop: 0,
16
21
  },
17
22
  [theme.breakpoints.between(theme.creator.viewSelectBreakpoint, 'lg')]: {
18
- maxHeight: 'calc(100% - 286px)',
23
+ maxHeight: 'calc(100% - 152px)',
19
24
  },
20
25
  [theme.breakpoints.up('lg')]: {
21
- maxHeight: 'calc(100% - 196px)',
26
+ maxHeight: 'calc(100% - 154px)',
22
27
  },
23
28
  '@media (min-aspect-ratio: 13/9) and (min-height: 280px) and (max-width: 950px)': {
24
29
  maxHeight: '100%',
25
30
  },
31
+ '&.withDesignViews': {
32
+ [theme.breakpoints.up('sm')]: {
33
+ maxHeight: 'calc(100% - 136px)',
34
+ [theme.orientation.portrait]: {
35
+ maxHeight: 'calc(100% - 260px)',
36
+ },
37
+ },
38
+ [theme.breakpoints.between(theme.creator.viewSelectBreakpoint, 'lg')]: {
39
+ maxHeight: 'calc(100% - 156px)',
40
+ },
41
+ [theme.breakpoints.up('lg')]: {
42
+ maxHeight: 'calc(100% - 196px)',
43
+ },
44
+ },
26
45
  },
27
46
  });
28
- export const CreatorAlignTarget = withStyles(styles, { name: 'CreatorAlignTarget' })(AlignTargetContainer);
47
+
48
+ const StyledAlignTargetContainer = withStyles(styles, { name: 'CreatorAlignTarget' })(AlignTargetContainer);
49
+
50
+ export const CreatorAlignTarget = props => {
51
+ const className = useSelector(state => state.designView?.designViews.length > 1) && 'withDesignViews';
52
+ return <StyledAlignTargetContainer className={className} {...props} />;
53
+ };