three-render-objects 1.26.8 → 1.27.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.
@@ -502,8 +502,10 @@ var threeRenderObjects = Kapsule__default["default"]({
502
502
  state.pointerPos.y = ev.pageY - offset.top; // Move tooltip
503
503
 
504
504
  state.toolTipElem.style.top = "".concat(state.pointerPos.y, "px");
505
- state.toolTipElem.style.left = "".concat(state.pointerPos.x, "px");
506
- state.toolTipElem.style.transform = "translate(-".concat(state.pointerPos.x / state.width * 100, "%, 21px)"); // adjust horizontal position to not exceed canvas boundaries
505
+ state.toolTipElem.style.left = "".concat(state.pointerPos.x, "px"); // adjust horizontal position to not exceed canvas boundaries
506
+
507
+ state.toolTipElem.style.transform = "translate(-".concat(state.pointerPos.x / state.width * 100, "%, ").concat( // flip to above if near bottom
508
+ state.height - state.pointerPos.y < 100 ? 'calc(-100% - 8px)' : '21px', ")");
507
509
  }
508
510
 
509
511
  function getOffset(el) {
@@ -1,4 +1,4 @@
1
- // Version 1.26.8 three-render-objects - https://github.com/vasturiano/three-render-objects
1
+ // Version 1.27.2 three-render-objects - https://github.com/vasturiano/three-render-objects
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('three')) :
4
4
  typeof define === 'function' && define.amd ? define(['three'], factory) :
@@ -1873,8 +1873,6 @@
1873
1873
 
1874
1874
  function onMouseMove( event ) {
1875
1875
 
1876
- if ( scope.enabled === false ) return;
1877
-
1878
1876
  switch ( state ) {
1879
1877
 
1880
1878
  case STATE.ROTATE:
@@ -3001,7 +2999,7 @@
3001
2999
  }
3002
3000
 
3003
3001
  function _extends() {
3004
- _extends = Object.assign || function (target) {
3002
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
3005
3003
  for (var i = 1; i < arguments.length; i++) {
3006
3004
  var source = arguments[i];
3007
3005
 
@@ -3014,7 +3012,6 @@
3014
3012
 
3015
3013
  return target;
3016
3014
  };
3017
-
3018
3015
  return _extends.apply(this, arguments);
3019
3016
  }
3020
3017
 
@@ -3027,11 +3024,10 @@
3027
3024
  }
3028
3025
 
3029
3026
  function _setPrototypeOf(o, p) {
3030
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
3027
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
3031
3028
  o.__proto__ = p;
3032
3029
  return o;
3033
3030
  };
3034
-
3035
3031
  return _setPrototypeOf(o, p);
3036
3032
  }
3037
3033
 
@@ -3042,7 +3038,7 @@
3042
3038
  }
3043
3039
 
3044
3040
  function _getPrototypeOf(o) {
3045
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
3041
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
3046
3042
  return o.__proto__ || Object.getPrototypeOf(o);
3047
3043
  };
3048
3044
  return _getPrototypeOf(o);
@@ -3067,7 +3063,7 @@
3067
3063
 
3068
3064
  function _construct(Parent, args, Class) {
3069
3065
  if (_isNativeReflectConstruct()) {
3070
- _construct = Reflect.construct;
3066
+ _construct = Reflect.construct.bind();
3071
3067
  } else {
3072
3068
  _construct = function _construct(Parent, args, Class) {
3073
3069
  var a = [null];
@@ -3472,10 +3468,10 @@
3472
3468
  var hexRgbaRegex = /^#[a-fA-F0-9]{8}$/;
3473
3469
  var reducedHexRegex = /^#[a-fA-F0-9]{3}$/;
3474
3470
  var reducedRgbaHexRegex = /^#[a-fA-F0-9]{4}$/;
3475
- var rgbRegex = /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i;
3476
- var rgbaRegex = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i;
3477
- var hslRegex = /^hsl\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i;
3478
- var hslaRegex = /^hsla\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i;
3471
+ var rgbRegex = /^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i;
3472
+ var rgbaRegex = /^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;
3473
+ var hslRegex = /^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i;
3474
+ var hslaRegex = /^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;
3479
3475
  /**
3480
3476
  * Returns an RgbColor or RgbaColor object. This utility function is only useful
3481
3477
  * if want to extract a color component. With the color util `toColorString` you
@@ -3549,7 +3545,7 @@
3549
3545
  red: parseInt("" + rgbaMatched[1], 10),
3550
3546
  green: parseInt("" + rgbaMatched[2], 10),
3551
3547
  blue: parseInt("" + rgbaMatched[3], 10),
3552
- alpha: parseFloat("" + rgbaMatched[4])
3548
+ alpha: parseFloat("" + rgbaMatched[4]) > 1 ? parseFloat("" + rgbaMatched[4]) / 100 : parseFloat("" + rgbaMatched[4])
3553
3549
  };
3554
3550
  }
3555
3551
 
@@ -3594,7 +3590,7 @@
3594
3590
  red: parseInt("" + _hslRgbMatched[1], 10),
3595
3591
  green: parseInt("" + _hslRgbMatched[2], 10),
3596
3592
  blue: parseInt("" + _hslRgbMatched[3], 10),
3597
- alpha: parseFloat("" + hslaMatched[4])
3593
+ alpha: parseFloat("" + hslaMatched[4]) > 1 ? parseFloat("" + hslaMatched[4]) / 100 : parseFloat("" + hslaMatched[4])
3598
3594
  };
3599
3595
  }
3600
3596
 
@@ -5232,8 +5228,10 @@
5232
5228
  state.pointerPos.y = ev.pageY - offset.top; // Move tooltip
5233
5229
 
5234
5230
  state.toolTipElem.style.top = "".concat(state.pointerPos.y, "px");
5235
- state.toolTipElem.style.left = "".concat(state.pointerPos.x, "px");
5236
- state.toolTipElem.style.transform = "translate(-".concat(state.pointerPos.x / state.width * 100, "%, 21px)"); // adjust horizontal position to not exceed canvas boundaries
5231
+ state.toolTipElem.style.left = "".concat(state.pointerPos.x, "px"); // adjust horizontal position to not exceed canvas boundaries
5232
+
5233
+ state.toolTipElem.style.transform = "translate(-".concat(state.pointerPos.x / state.width * 100, "%, ").concat( // flip to above if near bottom
5234
+ state.height - state.pointerPos.y < 100 ? 'calc(-100% - 8px)' : '21px', ")");
5237
5235
  }
5238
5236
 
5239
5237
  function getOffset(el) {