@configuratorware/configurator-frontendgui 1.56.2 → 1.56.4
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/Error/ErrorBoundary.js +8 -6
- package/App/Frame.js +8 -6
- package/App/Modules/Creator/Components/ConfigurationvariantItem/index.js +10 -8
- package/App/Modules/Creator/Components/ConfigurationvariantSelection/index.js +10 -8
- package/App/Modules/Creator/Components/CustomTitleEditor/index.js +10 -8
- package/App/Modules/Creator/Components/ExternalVisualization/index.js +9 -7
- package/App/Modules/Creator/Components/FastConfigurationRow/index.js +8 -6
- package/App/Modules/Creator/Components/FastConfigurationSelect/index.js +8 -6
- package/App/Modules/Creator/Components/FullScreenView/FullScreenView.js +11 -10
- package/App/Modules/Creator/Components/Incompatibility/OptionExclusionRule/index.js +8 -6
- package/App/Modules/Creator/Components/Incompatibility/OptionRule/index.js +8 -6
- package/App/Modules/Creator/Components/Incompatibility/RuleComponent.js +9 -7
- package/App/Modules/Creator/Components/Incompatibility/index.js +9 -8
- package/App/Modules/Creator/Components/Option/index.js +1 -0
- package/App/Modules/Creator/Components/OptionAmount/index.js +14 -6
- package/App/Modules/Creator/Components/Optiondetail/ZoomImage/index.js +7 -6
- package/App/Modules/Creator/Components/Optiondetail/index.js +17 -15
- package/App/Modules/Creator/Components/OptionsList/index.js +12 -11
- package/App/Modules/Creator/Components/Price/index.js +8 -6
- package/App/Modules/Creator/Components/ProductPart/index.js +8 -7
- package/App/Modules/Creator/Components/Tools/index.js +8 -6
- package/App/Modules/Creator/Layouts/DefaultLayout.js +30 -28
- package/App/Modules/Designer/Components/AddGalleryImage/index.js +11 -9
- package/App/Modules/Designer/Components/AddGalleryImage/index.story.js +4 -4
- package/App/Modules/Designer/Components/AddGalleryImage/index.test.js +6 -6
- package/App/Modules/Designer/Components/AddVisualElement/index.js +8 -6
- package/App/Modules/Designer/Components/AddVisualElement/index.test.js +3 -3
- package/App/Modules/Designer/Components/CloseDesignEditor/index.js +8 -6
- package/App/Modules/Designer/Components/CloseGraphicsEditorButton/index.js +5 -4
- package/App/Modules/Designer/Components/ColorPalettes/index.js +26 -21
- package/App/Modules/Designer/Components/ColorPalettes/index.test.js +3 -3
- package/App/Modules/Designer/Components/DesignAreaControlbox/index.js +23 -20
- package/App/Modules/Designer/Components/DesignAreaControlbox/index.test.js +7 -7
- package/App/Modules/Designer/Components/Dialog/index.js +13 -10
- package/App/Modules/Designer/Components/FeedbackNotice/index.js +9 -7
- package/App/Modules/Designer/Components/FeedbackNotice/index.test.js +1 -1
- package/App/Modules/Designer/Components/FullScreenView/FullScreenView.js +7 -6
- package/App/Modules/Designer/Components/ImageColorPicker/ImageColorPicker.js +12 -10
- package/App/Modules/Designer/Components/ImageColorize/index.js +39 -29
- package/App/Modules/Designer/Components/ImageControlbox/index.js +16 -13
- package/App/Modules/Designer/Components/ImageEditDialog/ImageThumbnail.js +24 -14
- package/App/Modules/Designer/Components/ImageEditDialog/ImageUpload.js +85 -69
- package/App/Modules/Designer/Components/ImageEditDialog/index.js +45 -42
- package/App/Modules/Designer/Components/ImageLibraryThumbnail/index.js +9 -7
- package/App/Modules/Designer/Components/ObjectTools/index.js +8 -6
- package/App/Modules/Designer/Components/Select/index.js +8 -6
- package/App/Modules/Designer/Components/TextControlbox/index.js +26 -21
- package/App/Modules/Designer/Components/TextControlbox/index.test.js +10 -10
- package/App/Modules/Designer/Containers/AddVisualElement.js +21 -11
- package/App/Modules/Designer/Containers/ImageEditDialog.js +173 -157
- package/App/Modules/Designer/Designer.js +7 -6
- package/App/Modules/Designer/Layouts/DefaultLayout.js +20 -17
- package/App/Modules/Designer/Layouts/PopupAreaProvider.js +18 -15
- package/App/Modules/Designer/Utils/Transformers.js +23 -13
- package/App/Modules/Designer/setupDesigner.js +27 -16
- package/App/Modules/Designer/withActiveCanvas.js +10 -8
- package/App/Modules/Visualization/AlignTargetContainer.js +1 -0
- package/App/Modules/Visualization/CreatorAlignTarget.js +12 -11
- package/App/Modules/Visualization/DefaultVisualizationProvider.js +10 -8
- package/App/Modules/Visualization/DesignerAlignTarget.js +10 -9
- package/App/Reducers/Actions.js +44 -36
- package/App/Reducers/Configurator/Actions.js +92 -78
- package/App/Reducers/Configurator/Selectors.js +5 -5
- package/App/Reducers/Confirm/Actions.js +16 -6
- package/App/Reducers/DesignArea/Selectors.js +2 -1
- package/App/Reducers/ImageGallery/Actions.js +31 -18
- package/App/Reducers/ImageGallery/Reducer.js +1 -0
- package/App/Reducers/ImageGallery/Selectors.js +1 -0
- package/App/Reducers/UI/Actions.js +40 -26
- package/App/Routing.js +8 -6
- package/App/Screens/Configurator/Components/AmountSelection/index.js +11 -9
- package/App/Screens/Configurator/Components/CalculationWidget/index.js +19 -17
- package/App/Screens/Configurator/Components/CalculationWidget/index.test.js +8 -8
- package/App/Screens/Configurator/Components/Confirm/index.js +8 -6
- package/App/Screens/Configurator/Components/Error/index.js +9 -7
- package/App/Screens/Configurator/Components/FullScreenView/index.js +24 -21
- package/App/Screens/Configurator/Components/FullScreenView/index.test.js +2 -2
- package/App/Screens/Configurator/Components/ItemTile/ItemTile.js +13 -5
- package/App/Screens/Configurator/Components/PreviewPortal/index.js +10 -8
- package/App/Screens/Configurator/Components/Thumbnail/index.js +27 -24
- package/App/Screens/Configurator/Components/Thumbnail/index.test.js +2 -2
- package/App/Screens/Configurator/Containers/AmountPrice.js +6 -5
- package/App/Screens/Configurator/Containers/ConfigurationModeSwitch.js +19 -10
- package/App/Screens/DesignerProductPreview/DesignerProductPreviewManager.js +88 -73
- package/App/Screens/DesignerProductPreview/Screen.js +21 -14
- package/App/Screens/ItemOverview/Components/ItemOverview.js +47 -32
- package/App/ServiceLocator.js +4 -2
- package/App/Services/AdminareaCommunicationService.js +24 -14
- package/App/Services/AnalyticsService.js +48 -47
- package/App/Services/ConfiguratorService.js +142 -121
- package/App/Services/DesignDataService.js +619 -555
- package/App/Services/DesignerService.js +100 -79
- package/App/Services/InteractionService.js +236 -210
- package/App/Services/UIService.js +10 -7
- package/App/Services/VisualizationService.js +104 -86
- package/App/Shared/Components/AcceptDesign/index.js +19 -16
- package/App/Shared/Components/AcceptPrivacy/index.js +8 -6
- package/App/Shared/Components/AddToBasket/index.js +8 -6
- package/App/Shared/Components/AlertDialog/index.js +9 -7
- package/App/Shared/Components/AmountInput/index.js +24 -21
- package/App/Shared/Components/AmountPrice/index.js +128 -115
- package/App/Shared/Components/AmountPrice/index.test.js +5 -5
- package/App/Shared/Components/BulkNames/index.js +8 -6
- package/App/Shared/Components/ConfigurationOverview/index.js +8 -6
- package/App/Shared/Components/InformationTag/InformationTag.js +11 -9
- package/App/Shared/Components/LicenseNotice/LicenseNotice.js +8 -6
- package/App/Shared/Components/LoadConfiguration/index.js +9 -7
- package/App/Shared/Components/Notification/index.js +8 -6
- package/App/Shared/Components/PdfDownload/index.js +25 -15
- package/App/Shared/Components/PriceList/index.js +16 -13
- package/App/Shared/Components/PriceOverview/index.js +13 -10
- package/App/Shared/Components/ProductVariant/index.js +25 -22
- package/App/Shared/Components/ProductVariant/index.story.js +1 -0
- package/App/Shared/Components/ReceiveOfferForm/index.js +12 -10
- package/App/Shared/Components/ReceiveOfferForm/index.test.js +2 -2
- package/App/Shared/Components/SaveConfiguration/index.js +32 -22
- package/App/Shared/Components/Stepper/index.js +10 -8
- package/App/Shared/Components/ToolbarList/index.js +11 -9
- package/App/Shared/Components/VariantChooser/index.js +13 -10
- package/App/Shared/Containers/BulkNames.js +15 -13
- package/App/Shared/Containers/Header/index.js +15 -7
- package/App/Shared/Containers/LoadConfiguration/LoadConfiguration.js +22 -15
- package/App/Shared/Containers/ProductVariant/ProductVariant.js +23 -15
- package/App/Translations.js +56 -40
- package/App/Utils/Request/lazyFetch.js +27 -19
- package/App/configuration.js +4 -0
- package/App/index.js +24 -14
- package/Framework/Api.js +2 -1
- package/Framework/ComponentContainer.js +14 -11
- package/Framework/Components/Carousel/index.js +13 -11
- package/Framework/Components/Dialog/index.js +35 -33
- package/Framework/Components/DialogSelect/index.js +19 -16
- package/Framework/Components/Input/index.js +12 -10
- package/Framework/CustomError.js +6 -5
- package/Framework/Helpers/TransitionDetect.js +2 -1
- package/Framework/Services/AbstractAdminareaCommunicationService.js +2 -1
- package/Framework/Services/AbstractAsyncService.js +2 -1
- package/Framework/Services/AbstractConfiguratorService.js +2 -1
- package/Framework/Services/AbstractInteractionService.js +2 -1
- package/Framework/Services/AbstractStoreService.js +2 -1
- package/Framework/Services/AbstractUIService.js +2 -1
- package/Framework/Services/AbstractVisualizationService.js +2 -1
- package/Framework/Services/AsyncService.js +8 -6
- package/Framework/Services/StoreService.js +27 -17
- package/Framework/bindDecorator.js +7 -6
- package/Framework/i18n.js +10 -8
- package/Shared/ErrorTypes/DeferredError.js +6 -5
- package/Shared/HOCs/ResizeDetect/ResizeDetect.js +11 -9
- package/Utils/Async/AsyncManager.js +30 -20
- package/Utils/Async/Deferred.js +4 -2
- package/Utils/Decorators/Observable.js +2 -1
- package/Utils/Dev/HOCs/withFilePicker.js +10 -8
- package/Utils/Immutable/set.js +6 -6
- package/Utils/Test/mountWithState.js +1 -1
- package/package.json +4 -4
|
@@ -25,13 +25,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
25
25
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
26
26
|
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
27
27
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
28
|
-
function
|
|
28
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
29
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
30
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
29
31
|
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
30
32
|
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
31
33
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
32
34
|
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
33
|
-
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
34
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
35
35
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
36
36
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
37
37
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
@@ -69,22 +69,24 @@ var styles = function styles(theme) {
|
|
|
69
69
|
};
|
|
70
70
|
};
|
|
71
71
|
var AddImagePanel = /*#__PURE__*/function (_React$Component) {
|
|
72
|
+
_inherits(AddImagePanel, _React$Component);
|
|
73
|
+
var _super = _createSuper(AddImagePanel);
|
|
72
74
|
function AddImagePanel() {
|
|
73
75
|
var _this;
|
|
74
76
|
_classCallCheck(this, AddImagePanel);
|
|
75
77
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
76
78
|
args[_key] = arguments[_key];
|
|
77
79
|
}
|
|
78
|
-
_this =
|
|
79
|
-
_defineProperty(_this, "state", {
|
|
80
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
81
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
80
82
|
selectedImage: {}
|
|
81
83
|
});
|
|
82
|
-
_defineProperty(_this, "onSelectImage", function (selectedImage) {
|
|
84
|
+
_defineProperty(_assertThisInitialized(_this), "onSelectImage", function (selectedImage) {
|
|
83
85
|
_this.setState({
|
|
84
86
|
selectedImage: selectedImage
|
|
85
87
|
});
|
|
86
88
|
});
|
|
87
|
-
_defineProperty(_this, "selectGalleryImage", function () {
|
|
89
|
+
_defineProperty(_assertThisInitialized(_this), "selectGalleryImage", function () {
|
|
88
90
|
var selectedImage = _this.state.selectedImage;
|
|
89
91
|
var _this$props = _this.props,
|
|
90
92
|
onSelectImage = _this$props.onSelectImage,
|
|
@@ -94,8 +96,7 @@ var AddImagePanel = /*#__PURE__*/function (_React$Component) {
|
|
|
94
96
|
});
|
|
95
97
|
return _this;
|
|
96
98
|
}
|
|
97
|
-
|
|
98
|
-
return _createClass(AddImagePanel, [{
|
|
99
|
+
_createClass(AddImagePanel, [{
|
|
99
100
|
key: "componentDidUpdate",
|
|
100
101
|
value: function componentDidUpdate(prevProps) {
|
|
101
102
|
var open = this.props.open;
|
|
@@ -170,6 +171,7 @@ var AddImagePanel = /*#__PURE__*/function (_React$Component) {
|
|
|
170
171
|
}, (0, _i18n.t)('fileUpload.apply'))));
|
|
171
172
|
}
|
|
172
173
|
}]);
|
|
174
|
+
return AddImagePanel;
|
|
173
175
|
}(_react["default"].Component);
|
|
174
176
|
var _default = exports["default"] = (0, _withWidth["default"])()((0, _styles.withStyles)(styles, {
|
|
175
177
|
name: 'AddImagePanel'
|
|
@@ -11,7 +11,7 @@ var _Stern = _interopRequireDefault(require("./res/Stern.jpg"));
|
|
|
11
11
|
var _Dreieck = _interopRequireDefault(require("./res/Dreieck.jpg"));
|
|
12
12
|
var _Rechteck = _interopRequireDefault(require("./res/Rechteck.jpg"));
|
|
13
13
|
var _Kreis = _interopRequireDefault(require("./res/Kreis.jpg"));
|
|
14
|
-
var
|
|
14
|
+
var _class;
|
|
15
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
16
16
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
17
17
|
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
@@ -55,10 +55,10 @@ var images = [{
|
|
|
55
55
|
url: _Dreieck["default"],
|
|
56
56
|
title: 'Geometrisch'
|
|
57
57
|
}];
|
|
58
|
-
var analyticsSrvc = new (
|
|
59
|
-
_classCallCheck(this,
|
|
58
|
+
var analyticsSrvc = new (_class = /*#__PURE__*/_createClass(function _class() {
|
|
59
|
+
_classCallCheck(this, _class);
|
|
60
60
|
_defineProperty(this, "triggerEvent", function () {});
|
|
61
|
-
}), _defineProperty(
|
|
61
|
+
}), _defineProperty(_class, "serviceName", 'AnalyticsService'), _class)();
|
|
62
62
|
_ServiceLocator["default"].provide(analyticsSrvc);
|
|
63
63
|
(0, _react2.storiesOf)('AddGalleryImage', module).add('shows empty dialog if there are no images to show', function () {
|
|
64
64
|
return /*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
@@ -88,7 +88,7 @@ jest.mock('@material-ui/core/Dialog', function () {
|
|
|
88
88
|
};
|
|
89
89
|
});
|
|
90
90
|
it('renders correctly', function () {
|
|
91
|
-
var tree = (0, _enzyme.render)(/*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
91
|
+
var tree = (0, _enzyme.render)( /*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
92
92
|
tags: tags,
|
|
93
93
|
images: images,
|
|
94
94
|
onClose: function onClose() {},
|
|
@@ -100,14 +100,14 @@ it('renders correctly', function () {
|
|
|
100
100
|
expect(tree).toMatchSnapshot();
|
|
101
101
|
});
|
|
102
102
|
it('calls the onSelectImage callback when the user uploads an own image in the Component', function () {
|
|
103
|
-
var
|
|
104
|
-
var analyticsSrvc = new (
|
|
105
|
-
_classCallCheck(this,
|
|
103
|
+
var _class;
|
|
104
|
+
var analyticsSrvc = new (_class = /*#__PURE__*/_createClass(function _class() {
|
|
105
|
+
_classCallCheck(this, _class);
|
|
106
106
|
_defineProperty(this, "triggerEvent", jest.fn());
|
|
107
|
-
}), _defineProperty(
|
|
107
|
+
}), _defineProperty(_class, "serviceName", 'AnalyticsService'), _class)();
|
|
108
108
|
_ServiceLocator["default"].provide(analyticsSrvc);
|
|
109
109
|
var onChangeHandler = jest.fn();
|
|
110
|
-
var tree = (0, _enzyme.mount)(/*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
110
|
+
var tree = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
111
111
|
tags: tags,
|
|
112
112
|
images: images,
|
|
113
113
|
onClose: function onClose() {},
|
|
@@ -23,13 +23,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
23
23
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
24
24
|
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
25
25
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
26
|
-
function
|
|
26
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
27
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
28
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
27
29
|
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
28
30
|
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
29
31
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
30
32
|
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
31
|
-
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
32
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
33
33
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
34
34
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
35
35
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
@@ -97,12 +97,13 @@ var styles = function styles(theme) {
|
|
|
97
97
|
};
|
|
98
98
|
};
|
|
99
99
|
var AddVisualElement = /*#__PURE__*/function (_React$Component) {
|
|
100
|
+
_inherits(AddVisualElement, _React$Component);
|
|
101
|
+
var _super = _createSuper(AddVisualElement);
|
|
100
102
|
function AddVisualElement() {
|
|
101
103
|
_classCallCheck(this, AddVisualElement);
|
|
102
|
-
return
|
|
104
|
+
return _super.apply(this, arguments);
|
|
103
105
|
}
|
|
104
|
-
|
|
105
|
-
return _createClass(AddVisualElement, [{
|
|
106
|
+
_createClass(AddVisualElement, [{
|
|
106
107
|
key: "render",
|
|
107
108
|
value: function render() {
|
|
108
109
|
var _this = this;
|
|
@@ -180,6 +181,7 @@ var AddVisualElement = /*#__PURE__*/function (_React$Component) {
|
|
|
180
181
|
}, renderAddTextLabel(this.props)))))))));
|
|
181
182
|
}
|
|
182
183
|
}]);
|
|
184
|
+
return AddVisualElement;
|
|
183
185
|
}(_react["default"].Component);
|
|
184
186
|
_defineProperty(AddVisualElement, "defaultProps", {
|
|
185
187
|
boxed: false,
|
|
@@ -17,14 +17,14 @@ jest.mock("../../../../Shared/Components/CallToAction", function () {
|
|
|
17
17
|
};
|
|
18
18
|
});
|
|
19
19
|
it('renders correctly', function () {
|
|
20
|
-
var tree = (0, _render["default"])(/*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
20
|
+
var tree = (0, _render["default"])( /*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
21
21
|
onImageFileSelected: _noop["default"],
|
|
22
22
|
onAddTextClick: _noop["default"]
|
|
23
23
|
}));
|
|
24
24
|
expect(tree).toMatchSnapshot();
|
|
25
25
|
});
|
|
26
26
|
it('renders a boxed component with the boxed prop', function () {
|
|
27
|
-
var tree = (0, _render["default"])(/*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
27
|
+
var tree = (0, _render["default"])( /*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
28
28
|
onImageFileSelected: _noop["default"],
|
|
29
29
|
onAddTextClick: _noop["default"],
|
|
30
30
|
boxed: true
|
|
@@ -33,7 +33,7 @@ it('renders a boxed component with the boxed prop', function () {
|
|
|
33
33
|
});
|
|
34
34
|
it('calls the onImageFileSelected callback when the user clicks the onImageFileSelected button', function () {
|
|
35
35
|
var spy = jest.fn();
|
|
36
|
-
var tree = (0, _mount["default"])(/*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
36
|
+
var tree = (0, _mount["default"])( /*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
37
37
|
onImageFileSelected: spy,
|
|
38
38
|
onAddTextClick: _noop["default"]
|
|
39
39
|
}));
|
|
@@ -16,13 +16,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
16
16
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
17
17
|
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
18
18
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
19
|
-
function
|
|
19
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
20
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
21
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
20
22
|
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
21
23
|
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
22
24
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
23
25
|
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
24
|
-
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
25
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
26
26
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
27
27
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
28
28
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
@@ -57,12 +57,13 @@ var styles = function styles(theme) {
|
|
|
57
57
|
};
|
|
58
58
|
};
|
|
59
59
|
var CloseDesignEditor = /*#__PURE__*/function (_React$Component) {
|
|
60
|
+
_inherits(CloseDesignEditor, _React$Component);
|
|
61
|
+
var _super = _createSuper(CloseDesignEditor);
|
|
60
62
|
function CloseDesignEditor() {
|
|
61
63
|
_classCallCheck(this, CloseDesignEditor);
|
|
62
|
-
return
|
|
64
|
+
return _super.apply(this, arguments);
|
|
63
65
|
}
|
|
64
|
-
|
|
65
|
-
return _createClass(CloseDesignEditor, [{
|
|
66
|
+
_createClass(CloseDesignEditor, [{
|
|
66
67
|
key: "render",
|
|
67
68
|
value: function render() {
|
|
68
69
|
var _this$props = this.props,
|
|
@@ -89,6 +90,7 @@ var CloseDesignEditor = /*#__PURE__*/function (_React$Component) {
|
|
|
89
90
|
}, (0, _i18n.t)('addVisualElement.closeEdit'))));
|
|
90
91
|
}
|
|
91
92
|
}]);
|
|
93
|
+
return CloseDesignEditor;
|
|
92
94
|
}(_react["default"].Component);
|
|
93
95
|
var _default = exports["default"] = (0, _styles.withStyles)(styles, {
|
|
94
96
|
name: 'CloseDesignEditor'
|
|
@@ -16,15 +16,16 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
|
|
|
16
16
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
17
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
18
18
|
var styles = function styles(theme) {
|
|
19
|
+
var _button;
|
|
19
20
|
return {
|
|
20
|
-
button:
|
|
21
|
+
button: (_button = {
|
|
21
22
|
pointerEvents: 'all'
|
|
22
|
-
}, theme.breakpoints.up('sm'), {
|
|
23
|
+
}, _defineProperty(_button, theme.breakpoints.up('sm'), {
|
|
23
24
|
marginBottom: 16,
|
|
24
25
|
minHeight: 40
|
|
25
|
-
}), theme.breakpoints.down('xs'), {
|
|
26
|
+
}), _defineProperty(_button, theme.breakpoints.down('xs'), {
|
|
26
27
|
height: 56
|
|
27
|
-
})
|
|
28
|
+
}), _button)
|
|
28
29
|
};
|
|
29
30
|
};
|
|
30
31
|
var CloseGraphicsEditorButton = exports.CloseGraphicsEditorButton = (0, _styles.withStyles)(styles, {
|
|
@@ -47,21 +47,23 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
47
47
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
48
48
|
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
49
49
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
50
|
-
function
|
|
50
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
51
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
52
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
51
53
|
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
52
54
|
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
53
55
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
54
56
|
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
55
|
-
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
56
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
57
57
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
58
58
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
59
59
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
60
60
|
var styles = function styles(theme) {
|
|
61
|
+
var _colorPaletteButton;
|
|
61
62
|
return {
|
|
62
63
|
container: {
|
|
63
64
|
pointerEvents: 'all' // catch the pointer events again
|
|
64
65
|
},
|
|
66
|
+
|
|
65
67
|
containerInPortraitMode: {
|
|
66
68
|
width: '40%',
|
|
67
69
|
position: 'fixed',
|
|
@@ -173,14 +175,14 @@ var styles = function styles(theme) {
|
|
|
173
175
|
}
|
|
174
176
|
}
|
|
175
177
|
},
|
|
176
|
-
colorPaletteButton:
|
|
178
|
+
colorPaletteButton: (_colorPaletteButton = {
|
|
177
179
|
marginTop: 24,
|
|
178
180
|
padding: 8
|
|
179
|
-
}, theme.breakpoints.down('sm'), {
|
|
181
|
+
}, _defineProperty(_colorPaletteButton, theme.breakpoints.down('sm'), {
|
|
180
182
|
marginTop: '0'
|
|
181
|
-
}), theme.breakpoints.down('xs'), {
|
|
183
|
+
}), _defineProperty(_colorPaletteButton, theme.breakpoints.down('xs'), {
|
|
182
184
|
height: 56
|
|
183
|
-
}),
|
|
185
|
+
}), _colorPaletteButton),
|
|
184
186
|
selectedColorGrid: {
|
|
185
187
|
margin: '0 auto'
|
|
186
188
|
},
|
|
@@ -301,12 +303,14 @@ var ColorPaletteColorsWrapper = (0, _styles.withStyles)(styles, {
|
|
|
301
303
|
}, !isSearchActive && renderColors(palette));
|
|
302
304
|
});
|
|
303
305
|
var ColorPalettes = /*#__PURE__*/function (_React$Component) {
|
|
306
|
+
_inherits(ColorPalettes, _React$Component);
|
|
307
|
+
var _super = _createSuper(ColorPalettes);
|
|
304
308
|
function ColorPalettes(props) {
|
|
305
309
|
var _this;
|
|
306
310
|
_classCallCheck(this, ColorPalettes);
|
|
307
|
-
_this =
|
|
308
|
-
_defineProperty(_this, "textInputRef", /*#__PURE__*/_react["default"].createRef());
|
|
309
|
-
_defineProperty(_this, "colorSelectChange", function (evt, color, paletteIdentifier, isCustomColorChecked) {
|
|
311
|
+
_this = _super.call(this, props);
|
|
312
|
+
_defineProperty(_assertThisInitialized(_this), "textInputRef", /*#__PURE__*/_react["default"].createRef());
|
|
313
|
+
_defineProperty(_assertThisInitialized(_this), "colorSelectChange", function (evt, color, paletteIdentifier, isCustomColorChecked) {
|
|
310
314
|
if (isCustomColorChecked) {
|
|
311
315
|
return;
|
|
312
316
|
}
|
|
@@ -325,16 +329,16 @@ var ColorPalettes = /*#__PURE__*/function (_React$Component) {
|
|
|
325
329
|
window.getSelection().removeAllRanges();
|
|
326
330
|
}
|
|
327
331
|
});
|
|
328
|
-
_defineProperty(_this, "onColorPaletteChange", function (evt) {
|
|
332
|
+
_defineProperty(_assertThisInitialized(_this), "onColorPaletteChange", function (evt) {
|
|
329
333
|
_this.props.colorPaletteChange(evt.target.value);
|
|
330
334
|
});
|
|
331
|
-
_defineProperty(_this, "onCustomColorChange", function (evt) {
|
|
335
|
+
_defineProperty(_assertThisInitialized(_this), "onCustomColorChange", function (evt) {
|
|
332
336
|
_this.setState({
|
|
333
337
|
customColor: evt.target.value,
|
|
334
338
|
customColorError: null
|
|
335
339
|
});
|
|
336
340
|
});
|
|
337
|
-
_defineProperty(_this, "onApplyColor", function () {
|
|
341
|
+
_defineProperty(_assertThisInitialized(_this), "onApplyColor", function () {
|
|
338
342
|
var customColor = _this.state.customColor;
|
|
339
343
|
if (!customColor) {
|
|
340
344
|
_this.setState({
|
|
@@ -346,22 +350,22 @@ var ColorPalettes = /*#__PURE__*/function (_React$Component) {
|
|
|
346
350
|
selectionRangeMemo.restore();
|
|
347
351
|
_this.props.colorSelectClick(customColor, customColor, null, true);
|
|
348
352
|
});
|
|
349
|
-
_defineProperty(_this, "toggleCustomColor", function (event) {
|
|
353
|
+
_defineProperty(_assertThisInitialized(_this), "toggleCustomColor", function (event) {
|
|
350
354
|
_this.setState({
|
|
351
355
|
isCustomColorChecked: event.target.checked
|
|
352
356
|
});
|
|
353
357
|
});
|
|
354
|
-
_defineProperty(_this, "changeText", function (event) {
|
|
358
|
+
_defineProperty(_assertThisInitialized(_this), "changeText", function (event) {
|
|
355
359
|
_this.setState({
|
|
356
360
|
searchText: event.target.value
|
|
357
361
|
});
|
|
358
362
|
});
|
|
359
|
-
_defineProperty(_this, "activateSearch", function () {
|
|
363
|
+
_defineProperty(_assertThisInitialized(_this), "activateSearch", function () {
|
|
360
364
|
_this.setState({
|
|
361
365
|
isSearchActive: true
|
|
362
366
|
});
|
|
363
367
|
});
|
|
364
|
-
_defineProperty(_this, "closeSearch", function () {
|
|
368
|
+
_defineProperty(_assertThisInitialized(_this), "closeSearch", function () {
|
|
365
369
|
_this.setState({
|
|
366
370
|
isSearchActive: false
|
|
367
371
|
});
|
|
@@ -369,7 +373,7 @@ var ColorPalettes = /*#__PURE__*/function (_React$Component) {
|
|
|
369
373
|
searchText: ''
|
|
370
374
|
});
|
|
371
375
|
});
|
|
372
|
-
_defineProperty(_this, "searchPaletteColors", function (palettes) {
|
|
376
|
+
_defineProperty(_assertThisInitialized(_this), "searchPaletteColors", function (palettes) {
|
|
373
377
|
var _ref4;
|
|
374
378
|
var colorsArray = palettes.map(function (_ref3) {
|
|
375
379
|
var identifier = _ref3.identifier,
|
|
@@ -385,7 +389,7 @@ var ColorPalettes = /*#__PURE__*/function (_React$Component) {
|
|
|
385
389
|
colors: (0, _uniqBy["default"])(searchColors, 'identifier')
|
|
386
390
|
};
|
|
387
391
|
});
|
|
388
|
-
_defineProperty(_this, "renderColors", function (palette) {
|
|
392
|
+
_defineProperty(_assertThisInitialized(_this), "renderColors", function (palette) {
|
|
389
393
|
var _this$props = _this.props,
|
|
390
394
|
classes = _this$props.classes,
|
|
391
395
|
selectedColor = _this$props.selectedColor;
|
|
@@ -441,8 +445,7 @@ var ColorPalettes = /*#__PURE__*/function (_React$Component) {
|
|
|
441
445
|
selectionRangeMemo.save();
|
|
442
446
|
return _this;
|
|
443
447
|
}
|
|
444
|
-
|
|
445
|
-
return _createClass(ColorPalettes, [{
|
|
448
|
+
_createClass(ColorPalettes, [{
|
|
446
449
|
key: "componentDidUpdate",
|
|
447
450
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
448
451
|
var selectedColor = this.props.selectedColor;
|
|
@@ -602,6 +605,7 @@ var ColorPalettes = /*#__PURE__*/function (_React$Component) {
|
|
|
602
605
|
heightColorPaletteWrapper: isCustomColorChecked ? heightColorPaletteWrapper - 150 // 135 height of custom fields
|
|
603
606
|
: heightColorPaletteWrapper - 50 // 35 height of search clear button
|
|
604
607
|
,
|
|
608
|
+
|
|
605
609
|
onSearch: this.onSearch,
|
|
606
610
|
closeSearch: this.closeSearch,
|
|
607
611
|
isSearchActive: isSearchActive,
|
|
@@ -686,6 +690,7 @@ var ColorPalettes = /*#__PURE__*/function (_React$Component) {
|
|
|
686
690
|
}, (0, _i18n.t)('colorPalettes.apply'))))))));
|
|
687
691
|
}
|
|
688
692
|
}]);
|
|
693
|
+
return ColorPalettes;
|
|
689
694
|
}(_react["default"].Component);
|
|
690
695
|
var _default = exports["default"] = (0, _ResizeDetect.withResizeDetectWrapper)((0, _withWidth["default"])({
|
|
691
696
|
initialWidth: 'lg'
|
|
@@ -106,7 +106,7 @@ var usedColors = [{
|
|
|
106
106
|
value: 'rgb(0, 0, 0)'
|
|
107
107
|
}];
|
|
108
108
|
it('renders correctly', function () {
|
|
109
|
-
var tree = (0, _enzyme.render)(/*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
109
|
+
var tree = (0, _enzyme.render)( /*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
110
110
|
colorPalettes: colorPalettes.colorPalettes,
|
|
111
111
|
colorPalette: 'HKS',
|
|
112
112
|
selectedColor: color,
|
|
@@ -116,7 +116,7 @@ it('renders correctly', function () {
|
|
|
116
116
|
expect(tree).toMatchSnapshot();
|
|
117
117
|
});
|
|
118
118
|
it('renders a boxed component with the boxed prop', function () {
|
|
119
|
-
var tree = (0, _enzyme.render)(/*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
119
|
+
var tree = (0, _enzyme.render)( /*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
120
120
|
width: "xs",
|
|
121
121
|
colorPalettes: colorPalettes.colorPalettes,
|
|
122
122
|
colorPalette: 'HKS',
|
|
@@ -129,7 +129,7 @@ it('renders a boxed component with the boxed prop', function () {
|
|
|
129
129
|
});
|
|
130
130
|
it('calls the colorSelectClick callback when the user changes the color', function () {
|
|
131
131
|
var onChangeHandler = jest.fn();
|
|
132
|
-
var tree = (0, _enzyme.mount)(/*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
132
|
+
var tree = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
133
133
|
width: "xs",
|
|
134
134
|
colorPalettes: colorPalettes.colorPalettes,
|
|
135
135
|
colorPalette: 'HKS',
|
|
@@ -29,17 +29,18 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
29
29
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
30
30
|
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
31
31
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
32
|
-
function
|
|
32
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
33
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
34
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
33
35
|
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
34
36
|
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
35
37
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
36
38
|
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
37
|
-
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
38
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
39
39
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
40
40
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
41
41
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
42
42
|
var styles = function styles(theme) {
|
|
43
|
+
var _cardContentRoot, _underlineInputText;
|
|
43
44
|
return {
|
|
44
45
|
card: _defineProperty({}, theme.breakpoints.down('xs'), {
|
|
45
46
|
zIndex: 1
|
|
@@ -62,13 +63,13 @@ var styles = function styles(theme) {
|
|
|
62
63
|
paddingBottom: 8
|
|
63
64
|
}
|
|
64
65
|
}),
|
|
65
|
-
cardContentRoot:
|
|
66
|
+
cardContentRoot: (_cardContentRoot = {
|
|
66
67
|
padding: '0 16px'
|
|
67
|
-
}, theme.breakpoints.down('xs'), {
|
|
68
|
+
}, _defineProperty(_cardContentRoot, theme.breakpoints.down('xs'), {
|
|
68
69
|
padding: 0
|
|
69
|
-
}), '&:last-child', _defineProperty({}, theme.breakpoints.up('sm'), {
|
|
70
|
+
}), _defineProperty(_cardContentRoot, '&:last-child', _defineProperty({}, theme.breakpoints.up('sm'), {
|
|
70
71
|
paddingBottom: 16
|
|
71
|
-
})),
|
|
72
|
+
})), _cardContentRoot),
|
|
72
73
|
listItemText: _defineProperty({
|
|
73
74
|
fontSize: '12px',
|
|
74
75
|
lineHeight: '40px'
|
|
@@ -107,23 +108,23 @@ var styles = function styles(theme) {
|
|
|
107
108
|
iconedItem: _defineProperty({}, theme.breakpoints.down('xs'), {
|
|
108
109
|
paddingRight: '6px !important'
|
|
109
110
|
}),
|
|
110
|
-
underlineInputText:
|
|
111
|
+
underlineInputText: (_underlineInputText = {
|
|
111
112
|
marginBottom: 0
|
|
112
|
-
}, theme.breakpoints.up('sm'), {
|
|
113
|
+
}, _defineProperty(_underlineInputText, theme.breakpoints.up('sm'), {
|
|
113
114
|
marginBottom: 8
|
|
114
|
-
}), '&:before', _defineProperty({
|
|
115
|
+
}), _defineProperty(_underlineInputText, '&:before', _defineProperty({
|
|
115
116
|
borderBottom: 0
|
|
116
117
|
}, theme.breakpoints.up('sm'), {
|
|
117
118
|
borderBottom: '1px solid rgba(0, 0, 0, 0.42)'
|
|
118
|
-
})), '&&&&:hover:before', _defineProperty({
|
|
119
|
+
})), _defineProperty(_underlineInputText, '&&&&:hover:before', _defineProperty({
|
|
119
120
|
borderBottom: 0
|
|
120
121
|
}, theme.breakpoints.up('sm'), {
|
|
121
122
|
borderBottom: '1px solid rgba(0, 0, 0, 0.42)'
|
|
122
|
-
})), '&:after', _defineProperty({
|
|
123
|
+
})), _defineProperty(_underlineInputText, '&:after', _defineProperty({
|
|
123
124
|
borderBottom: 0
|
|
124
125
|
}, theme.breakpoints.up('sm'), {
|
|
125
126
|
borderBottom: '1px solid transparent'
|
|
126
|
-
})),
|
|
127
|
+
})), _underlineInputText),
|
|
127
128
|
iconRootCheck: _defineProperty({
|
|
128
129
|
position: 'absolute',
|
|
129
130
|
right: 30,
|
|
@@ -183,21 +184,23 @@ var styles = function styles(theme) {
|
|
|
183
184
|
};
|
|
184
185
|
};
|
|
185
186
|
var DesignAreaControlbox = /*#__PURE__*/function (_React$Component) {
|
|
187
|
+
_inherits(DesignAreaControlbox, _React$Component);
|
|
188
|
+
var _super = _createSuper(DesignAreaControlbox);
|
|
186
189
|
function DesignAreaControlbox(props) {
|
|
187
190
|
var _this;
|
|
188
191
|
_classCallCheck(this, DesignAreaControlbox);
|
|
189
|
-
_this =
|
|
190
|
-
_defineProperty(_this, "openAmountIndicatorModal", function () {
|
|
192
|
+
_this = _super.call(this, props);
|
|
193
|
+
_defineProperty(_assertThisInitialized(_this), "openAmountIndicatorModal", function () {
|
|
191
194
|
_this.setState({
|
|
192
195
|
amountIndicatorOpen: true
|
|
193
196
|
});
|
|
194
197
|
});
|
|
195
|
-
_defineProperty(_this, "closeAmountIndicatorModal", function () {
|
|
198
|
+
_defineProperty(_assertThisInitialized(_this), "closeAmountIndicatorModal", function () {
|
|
196
199
|
_this.setState({
|
|
197
200
|
amountIndicatorOpen: false
|
|
198
201
|
});
|
|
199
202
|
});
|
|
200
|
-
_defineProperty(_this, "getColorAmountMessageClass", function () {
|
|
203
|
+
_defineProperty(_assertThisInitialized(_this), "getColorAmountMessageClass", function () {
|
|
201
204
|
var _this$props = _this.props,
|
|
202
205
|
classes = _this$props.classes,
|
|
203
206
|
hasAmountIndicatorWarning = _this$props.hasAmountIndicatorWarning;
|
|
@@ -211,7 +214,7 @@ var DesignAreaControlbox = /*#__PURE__*/function (_React$Component) {
|
|
|
211
214
|
}
|
|
212
215
|
return className;
|
|
213
216
|
});
|
|
214
|
-
_defineProperty(_this, "getColorAmountMessage", function () {
|
|
217
|
+
_defineProperty(_assertThisInitialized(_this), "getColorAmountMessage", function () {
|
|
215
218
|
var _this$props2 = _this.props,
|
|
216
219
|
colorAmount = _this$props2.colorAmount,
|
|
217
220
|
maxColorAmount = _this$props2.maxColorAmount;
|
|
@@ -233,8 +236,7 @@ var DesignAreaControlbox = /*#__PURE__*/function (_React$Component) {
|
|
|
233
236
|
};
|
|
234
237
|
return _this;
|
|
235
238
|
}
|
|
236
|
-
|
|
237
|
-
return _createClass(DesignAreaControlbox, [{
|
|
239
|
+
_createClass(DesignAreaControlbox, [{
|
|
238
240
|
key: "render",
|
|
239
241
|
value: function render() {
|
|
240
242
|
var _this$props3 = this.props,
|
|
@@ -385,6 +387,7 @@ var DesignAreaControlbox = /*#__PURE__*/function (_React$Component) {
|
|
|
385
387
|
}, /*#__PURE__*/_react["default"].createElement("div", null)))));
|
|
386
388
|
}
|
|
387
389
|
}]);
|
|
390
|
+
return DesignAreaControlbox;
|
|
388
391
|
}(_react["default"].Component);
|
|
389
392
|
var _default = exports["default"] = (0, _withWidth["default"])({
|
|
390
393
|
initialWidth: 'lg'
|
|
@@ -92,7 +92,7 @@ var hierarchicalMockData = [{
|
|
|
92
92
|
}]
|
|
93
93
|
}];
|
|
94
94
|
it('renders correctly', function () {
|
|
95
|
-
var tree = (0, _enzyme.render)(/*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
95
|
+
var tree = (0, _enzyme.render)( /*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
96
96
|
designAreas: hierarchicalMockData,
|
|
97
97
|
designedAreas: {
|
|
98
98
|
a_1: true
|
|
@@ -107,7 +107,7 @@ it('renders correctly', function () {
|
|
|
107
107
|
expect(tree).toMatchSnapshot();
|
|
108
108
|
});
|
|
109
109
|
it('renders a boxed component with the boxed prop', function () {
|
|
110
|
-
var tree = (0, _enzyme.render)(/*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
110
|
+
var tree = (0, _enzyme.render)( /*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
111
111
|
designAreas: hierarchicalMockData,
|
|
112
112
|
designedAreas: {
|
|
113
113
|
a_1: true
|
|
@@ -123,14 +123,14 @@ it('renders a boxed component with the boxed prop', function () {
|
|
|
123
123
|
expect(tree).toMatchSnapshot();
|
|
124
124
|
});
|
|
125
125
|
it('calls the handleChangeColorAmount callback when the user clicks the DesignAreaControlbox button', function () {
|
|
126
|
-
var
|
|
126
|
+
var _class;
|
|
127
127
|
var onChangeHandler = jest.fn();
|
|
128
|
-
var analyticsSrvc = new (
|
|
129
|
-
_classCallCheck(this,
|
|
128
|
+
var analyticsSrvc = new (_class = /*#__PURE__*/_createClass(function _class() {
|
|
129
|
+
_classCallCheck(this, _class);
|
|
130
130
|
_defineProperty(this, "triggerEvent", jest.fn());
|
|
131
|
-
}), _defineProperty(
|
|
131
|
+
}), _defineProperty(_class, "serviceName", 'AnalyticsService'), _class)();
|
|
132
132
|
_ServiceLocator["default"].provide(analyticsSrvc);
|
|
133
|
-
var tree = (0, _enzyme.mount)(/*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
133
|
+
var tree = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_index["default"], {
|
|
134
134
|
width: "lg",
|
|
135
135
|
designAreas: hierarchicalMockData,
|
|
136
136
|
designedAreas: {
|