redhotmagma-graphics-editor 1.51.0 → 1.51.2

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.
Files changed (50) hide show
  1. package/App.js +76 -81
  2. package/CanvasAdapters/Mock/Canvas.js +54 -62
  3. package/CanvasAdapters/Mock/Objects/CanvasObject.js +15 -17
  4. package/CanvasAdapters/Mock/Objects/Group.js +21 -23
  5. package/CanvasAdapters/Mock/Objects/Image.js +21 -23
  6. package/CanvasAdapters/Mock/Objects/Text.js +22 -24
  7. package/CanvasAdapters/PaperJs/Canvas.js +144 -164
  8. package/CanvasAdapters/PaperJs/Objects/CanvasObject.js +24 -25
  9. package/CanvasAdapters/PaperJs/Objects/Group.js +22 -24
  10. package/CanvasAdapters/PaperJs/Objects/Image.js +56 -62
  11. package/CanvasAdapters/PaperJs/Objects/Text.js +35 -36
  12. package/CanvasAdapters/PaperJs/Utils/HTML2Paper.js +11 -12
  13. package/CanvasAdapters/PaperJs/Utils/SVGfix.js +5 -5
  14. package/CanvasAdapters/PaperJs/Utils/StyleParams.js +3 -3
  15. package/CanvasAdapters/PaperJs/Utils/TextToSVGRepository.js +26 -27
  16. package/CanvasAdapters/PaperJs/Utils/UseColorLayer.js +1 -1
  17. package/CanvasAdapters/PaperJs/Utils/UseMask.js +49 -55
  18. package/CanvasInterface/Canvas.js +56 -61
  19. package/CanvasInterface/CanvasProvider.js +22 -24
  20. package/CanvasInterface/Objects/CanvasObject.js +16 -19
  21. package/CanvasInterface/Observable.js +10 -11
  22. package/CanvasInterface/canvasConnect.js +21 -23
  23. package/CanvasInterface/index.js +1 -2
  24. package/Components/Canvas/Canvas.js +20 -22
  25. package/Components/Canvas/CanvasContainer.js +1 -1
  26. package/Components/DelayedContainer.js +19 -21
  27. package/Components/Editor/Editor.js +19 -20
  28. package/Components/Editor/EditorContainer.js +30 -32
  29. package/Components/InlineToolbox/InlineToolbox.js +40 -42
  30. package/Components/InlineToolbox/InlineToolboxButton.js +7 -7
  31. package/Components/ManipulableContainer.js +20 -22
  32. package/Components/ResizeDetect/ResizeDetect.js +20 -22
  33. package/Components/Rulers/Ruler.js +22 -25
  34. package/Components/Rulers/Rulers.js +17 -19
  35. package/Components/SelectionToolbox/ColorPalette.js +20 -23
  36. package/Components/SelectionToolbox/SelectionToolbox.js +25 -26
  37. package/Components/SelectionToolbox/TextTools.js +29 -31
  38. package/Components/StandardToolbox/StandardToolbox.js +63 -65
  39. package/Components/TextEditor/TextEditor.js +39 -41
  40. package/Components/TextEditor/TextEditorStateProvider.js +19 -21
  41. package/Components/Toolbox/ToolboxContainer.js +4 -4
  42. package/Components/Toolbox/ToolboxRow.js +4 -4
  43. package/Utils/DOM.js +7 -7
  44. package/Utils/Device.js +1 -1
  45. package/Utils/Logger.js +7 -8
  46. package/Utils/Range.js +1 -1
  47. package/_demos/UsingExternalControls/App.js +18 -20
  48. package/_demos/UsingRenderProps/App.js +21 -23
  49. package/index.js +4 -2
  50. package/package.json +1 -1
@@ -5,43 +5,42 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
9
  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); }
10
- function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
11
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
12
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
13
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
14
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
15
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
16
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
17
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
18
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
19
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
20
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
21
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
22
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
23
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
10
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
11
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
12
+ 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); } }
13
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
14
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
15
+ 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); }
16
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
17
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
18
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
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 _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; }
22
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
23
+ 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); }
24
24
  var ManipulableContainer = exports["default"] = /*#__PURE__*/function (_React$Component) {
25
- _inherits(ManipulableContainer, _React$Component);
26
- var _super = _createSuper(ManipulableContainer);
27
25
  function ManipulableContainer() {
28
26
  var _this;
29
27
  _classCallCheck(this, ManipulableContainer);
30
28
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
31
29
  args[_key] = arguments[_key];
32
30
  }
33
- _this = _super.call.apply(_super, [this].concat(args));
34
- _defineProperty(_assertThisInitialized(_this), "transform", {
31
+ _this = _callSuper(this, ManipulableContainer, [].concat(args));
32
+ _defineProperty(_this, "transform", {
35
33
  translate: {
36
34
  x: 0,
37
35
  y: 0
38
36
  },
39
37
  rotate: 0
40
38
  });
41
- _defineProperty(_assertThisInitialized(_this), "containerRef", /*#__PURE__*/_react["default"].createRef());
39
+ _defineProperty(_this, "containerRef", /*#__PURE__*/_react["default"].createRef());
42
40
  return _this;
43
41
  }
44
- _createClass(ManipulableContainer, [{
42
+ _inherits(ManipulableContainer, _React$Component);
43
+ return _createClass(ManipulableContainer, [{
45
44
  key: "translate",
46
45
  value: function translate(_ref) {
47
46
  var x = _ref.x,
@@ -75,5 +74,4 @@ var ManipulableContainer = exports["default"] = /*#__PURE__*/function (_React$Co
75
74
  }, this.props));
76
75
  }
77
76
  }]);
78
- return ManipulableContainer;
79
77
  }(_react["default"].Component);
@@ -8,33 +8,31 @@ var _react = _interopRequireDefault(require("react"));
8
8
  var _cssElementQueries = require("css-element-queries");
9
9
  var _propTypes = _interopRequireDefault(require("prop-types"));
10
10
  var _omit = _interopRequireDefault(require("lodash/omit"));
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
12
- function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
12
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
13
13
  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); }
14
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
15
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
16
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
17
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
18
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
19
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
20
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
21
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
22
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
23
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
24
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
25
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
26
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
14
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
15
+ 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); } }
16
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
17
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
18
+ 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); }
19
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
20
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
21
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
22
+ 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); }
23
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
24
+ 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; }
25
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
26
+ 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); }
27
27
  var ResizeDetect = exports["default"] = /*#__PURE__*/function (_React$Component) {
28
- _inherits(ResizeDetect, _React$Component);
29
- var _super = _createSuper(ResizeDetect);
30
28
  function ResizeDetect() {
31
29
  var _this;
32
30
  _classCallCheck(this, ResizeDetect);
33
31
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
34
32
  args[_key] = arguments[_key];
35
33
  }
36
- _this = _super.call.apply(_super, [this].concat(args));
37
- _defineProperty(_assertThisInitialized(_this), "onSizeChange", function () {
34
+ _this = _callSuper(this, ResizeDetect, [].concat(args));
35
+ _defineProperty(_this, "onSizeChange", function () {
38
36
  if (_this.props.onSizeChange) {
39
37
  var container = _this.containerRef.current;
40
38
  var _container$getBoundin = container.getBoundingClientRect(),
@@ -46,10 +44,11 @@ var ResizeDetect = exports["default"] = /*#__PURE__*/function (_React$Component)
46
44
  });
47
45
  }
48
46
  });
49
- _defineProperty(_assertThisInitialized(_this), "containerRef", /*#__PURE__*/_react["default"].createRef());
47
+ _defineProperty(_this, "containerRef", /*#__PURE__*/_react["default"].createRef());
50
48
  return _this;
51
49
  }
52
- _createClass(ResizeDetect, [{
50
+ _inherits(ResizeDetect, _React$Component);
51
+ return _createClass(ResizeDetect, [{
53
52
  key: "componentDidMount",
54
53
  value: function componentDidMount() {
55
54
  var container = this.containerRef.current;
@@ -76,7 +75,6 @@ var ResizeDetect = exports["default"] = /*#__PURE__*/function (_React$Component)
76
75
  }));
77
76
  }
78
77
  }]);
79
- return ResizeDetect;
80
78
  }(_react["default"].Component);
81
79
  _defineProperty(ResizeDetect, "propTypes", {
82
80
  onSizeChange: _propTypes["default"].func,
@@ -9,21 +9,21 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _withStyles = _interopRequireDefault(require("@material-ui/core/styles/withStyles"));
10
10
  var _styles = _interopRequireDefault(require("./styles"));
11
11
  var _EditorContainer = require("../Editor/EditorContainer");
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
13
13
  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); }
14
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
15
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
16
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
17
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
18
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
19
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
20
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
21
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
22
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
23
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
24
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
25
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
26
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
14
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
15
+ 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); } }
16
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
17
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
18
+ 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); }
19
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
20
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
21
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
22
+ 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); }
23
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
24
+ 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; }
25
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
26
+ 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); }
27
27
  var TYPE_TOP = 'top';
28
28
  var TYPE_RIGHT = 'right';
29
29
  var TYPE_BOTTOM = 'bottom';
@@ -32,17 +32,15 @@ var LINE_TYPE_1 = 'LINE_TYPE_1';
32
32
  var LINE_TYPE_2 = 'LINE_TYPE_2';
33
33
  var LINE_TYPE_3 = 'LINE_TYPE_3';
34
34
  var Ruler = /*#__PURE__*/function (_React$Component) {
35
- _inherits(Ruler, _React$Component);
36
- var _super = _createSuper(Ruler);
37
35
  function Ruler(props) {
38
36
  var _this;
39
37
  _classCallCheck(this, Ruler);
40
- _this = _super.call(this, props);
41
- _defineProperty(_assertThisInitialized(_this), "getMmInPixel", function (totalWidthMm, totalWidthPx, alignRight, mm) {
38
+ _this = _callSuper(this, Ruler, [props]);
39
+ _defineProperty(_this, "getMmInPixel", function (totalWidthMm, totalWidthPx, alignRight, mm) {
42
40
  var result = Math.round(mm / totalWidthMm * totalWidthPx);
43
41
  return alignRight ? totalWidthPx - result : result;
44
42
  });
45
- _defineProperty(_assertThisInitialized(_this), "drawUnitLine", function (ctx, widthMm, widthPx, heightPx, alignRight, mm, lineType) {
43
+ _defineProperty(_this, "drawUnitLine", function (ctx, widthMm, widthPx, heightPx, alignRight, mm, lineType) {
46
44
  var lineHeight = heightPx;
47
45
  if (lineType === LINE_TYPE_1) {
48
46
  lineHeight = Math.round(heightPx / 3);
@@ -55,7 +53,7 @@ var Ruler = /*#__PURE__*/function (_React$Component) {
55
53
  ctx.lineTo(x, heightPx - lineHeight);
56
54
  ctx.stroke();
57
55
  });
58
- _defineProperty(_assertThisInitialized(_this), "drawUnitText", function (ctx, widthMm, widthPx, heightPx, alignRight, rotate, mm) {
56
+ _defineProperty(_this, "drawUnitText", function (ctx, widthMm, widthPx, heightPx, alignRight, rotate, mm) {
59
57
  var fontSize = 10;
60
58
  var paddingTop = 2;
61
59
  var paddingSide = 2;
@@ -76,7 +74,7 @@ var Ruler = /*#__PURE__*/function (_React$Component) {
76
74
  ctx.fillText("".concat(mm, " mm"), x + paddingSide * (alignRight ? 1 : -1), paddingTop);
77
75
  }
78
76
  });
79
- _defineProperty(_assertThisInitialized(_this), "updateCanvas", function () {
77
+ _defineProperty(_this, "updateCanvas", function () {
80
78
  var prevProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
81
79
  var _this$props = _this.props,
82
80
  type = _this$props.type,
@@ -125,7 +123,8 @@ var Ruler = /*#__PURE__*/function (_React$Component) {
125
123
  _this.canvas = /*#__PURE__*/_react["default"].createRef();
126
124
  return _this;
127
125
  }
128
- _createClass(Ruler, [{
126
+ _inherits(Ruler, _React$Component);
127
+ return _createClass(Ruler, [{
129
128
  key: "componentDidMount",
130
129
  value: function componentDidMount() {
131
130
  this.updateCanvas();
@@ -138,18 +137,16 @@ var Ruler = /*#__PURE__*/function (_React$Component) {
138
137
  }, {
139
138
  key: "render",
140
139
  value: function render() {
141
- var _classMap;
142
140
  var _this$props2 = this.props,
143
141
  classes = _this$props2.classes,
144
142
  type = _this$props2.type;
145
- var classMap = (_classMap = {}, _defineProperty(_classMap, TYPE_TOP, "".concat(classes.ruler, " ").concat(classes.rulerTop)), _defineProperty(_classMap, TYPE_RIGHT, "".concat(classes.ruler, " ").concat(classes.rulerRight)), _defineProperty(_classMap, TYPE_BOTTOM, "".concat(classes.ruler, " ").concat(classes.rulerBottom)), _defineProperty(_classMap, TYPE_LEFT, "".concat(classes.ruler, " ").concat(classes.rulerLeft)), _classMap);
143
+ var classMap = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, TYPE_TOP, "".concat(classes.ruler, " ").concat(classes.rulerTop)), TYPE_RIGHT, "".concat(classes.ruler, " ").concat(classes.rulerRight)), TYPE_BOTTOM, "".concat(classes.ruler, " ").concat(classes.rulerBottom)), TYPE_LEFT, "".concat(classes.ruler, " ").concat(classes.rulerLeft));
146
144
  return /*#__PURE__*/_react["default"].createElement("canvas", {
147
145
  ref: this.canvas,
148
146
  className: classMap[type]
149
147
  });
150
148
  }
151
149
  }]);
152
- return Ruler;
153
150
  }(_react["default"].Component);
154
151
  _defineProperty(Ruler, "propTypes", {
155
152
  classes: _propTypes["default"].object.isRequired,
@@ -12,30 +12,29 @@ var _Canvas = require("../../CanvasInterface/Canvas");
12
12
  var _Logger = _interopRequireDefault(require("../../Utils/Logger"));
13
13
  var _Ruler = _interopRequireDefault(require("./Ruler"));
14
14
  var _styles = _interopRequireDefault(require("./styles"));
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
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
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
18
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
19
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
20
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
21
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
22
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
23
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
24
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
25
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
26
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
27
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
28
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
29
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
17
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
18
+ 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); } }
19
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
20
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
21
+ 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); }
22
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
23
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
24
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
25
+ 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); }
26
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
27
+ 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; }
28
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
29
+ 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); }
30
30
  var logger = new _Logger["default"]('Rulers');
31
31
  var Rulers = /*#__PURE__*/function (_React$Component) {
32
- _inherits(Rulers, _React$Component);
33
- var _super = _createSuper(Rulers);
34
32
  function Rulers() {
35
33
  _classCallCheck(this, Rulers);
36
- return _super.apply(this, arguments);
34
+ return _callSuper(this, Rulers, arguments);
37
35
  }
38
- _createClass(Rulers, [{
36
+ _inherits(Rulers, _React$Component);
37
+ return _createClass(Rulers, [{
39
38
  key: "render",
40
39
  value: function render() {
41
40
  logger.log('render Rulers');
@@ -53,7 +52,6 @@ var Rulers = /*#__PURE__*/function (_React$Component) {
53
52
  }));
54
53
  }
55
54
  }]);
56
- return Rulers;
57
55
  }(_react["default"].Component);
58
56
  _defineProperty(Rulers, "propTypes", {
59
57
  canvas: _propTypes["default"].instanceOf(_Canvas.AbstractCanvas).isRequired,
@@ -8,21 +8,21 @@ var _react = _interopRequireDefault(require("react"));
8
8
  var _withStyles = _interopRequireDefault(require("@material-ui/core/styles/withStyles"));
9
9
  var _isObject = _interopRequireDefault(require("lodash/isObject"));
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
12
12
  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); }
13
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
14
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
15
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
16
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
17
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
18
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
19
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
20
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
21
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
22
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
23
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
24
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
25
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
13
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
14
+ 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); }
15
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
16
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
17
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
18
+ 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); }
19
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
20
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
21
+ 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); } }
22
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
23
+ 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; }
24
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
25
+ 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); }
26
26
  var Color = /*#__PURE__*/function () {
27
27
  function Color(r, g, b) {
28
28
  _classCallCheck(this, Color);
@@ -39,7 +39,7 @@ var Color = /*#__PURE__*/function () {
39
39
  };
40
40
  this.identifier = this.hex;
41
41
  }
42
- _createClass(Color, [{
42
+ return _createClass(Color, [{
43
43
  key: "hex",
44
44
  get: function get() {
45
45
  return Color.rgb2hex(this.rgb);
@@ -97,7 +97,6 @@ var Color = /*#__PURE__*/function () {
97
97
  } : null;
98
98
  }
99
99
  }]);
100
- return Color;
101
100
  }();
102
101
  function generatePalette() {
103
102
  var numColors = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
@@ -148,19 +147,17 @@ var styles = {
148
147
  }
149
148
  };
150
149
  var ColorPalette = /*#__PURE__*/function (_React$Component) {
151
- _inherits(ColorPalette, _React$Component);
152
- var _super = _createSuper(ColorPalette);
153
150
  function ColorPalette() {
154
151
  var _this;
155
152
  _classCallCheck(this, ColorPalette);
156
153
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
157
154
  args[_key] = arguments[_key];
158
155
  }
159
- _this = _super.call.apply(_super, [this].concat(args));
160
- _defineProperty(_assertThisInitialized(_this), "state", {
156
+ _this = _callSuper(this, ColorPalette, [].concat(args));
157
+ _defineProperty(_this, "state", {
161
158
  show: false
162
159
  });
163
- _defineProperty(_assertThisInitialized(_this), "toggle", function () {
160
+ _defineProperty(_this, "toggle", function () {
164
161
  return _this.setState(function (_ref3) {
165
162
  var show = _ref3.show;
166
163
  return {
@@ -170,7 +167,8 @@ var ColorPalette = /*#__PURE__*/function (_React$Component) {
170
167
  });
171
168
  return _this;
172
169
  }
173
- _createClass(ColorPalette, [{
170
+ _inherits(ColorPalette, _React$Component);
171
+ return _createClass(ColorPalette, [{
174
172
  key: "render",
175
173
  value: function render() {
176
174
  var _this$props = this.props,
@@ -217,7 +215,6 @@ var ColorPalette = /*#__PURE__*/function (_React$Component) {
217
215
  })));
218
216
  }
219
217
  }]);
220
- return ColorPalette;
221
218
  }(_react["default"].Component);
222
219
  _defineProperty(ColorPalette, "propTypes", {
223
220
  palette: _propTypes["default"].object,