three-render-objects 1.26.8 → 1.27.0

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.0 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) :
@@ -3001,7 +3001,7 @@
3001
3001
  }
3002
3002
 
3003
3003
  function _extends() {
3004
- _extends = Object.assign || function (target) {
3004
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
3005
3005
  for (var i = 1; i < arguments.length; i++) {
3006
3006
  var source = arguments[i];
3007
3007
 
@@ -3014,7 +3014,6 @@
3014
3014
 
3015
3015
  return target;
3016
3016
  };
3017
-
3018
3017
  return _extends.apply(this, arguments);
3019
3018
  }
3020
3019
 
@@ -3027,11 +3026,10 @@
3027
3026
  }
3028
3027
 
3029
3028
  function _setPrototypeOf(o, p) {
3030
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
3029
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
3031
3030
  o.__proto__ = p;
3032
3031
  return o;
3033
3032
  };
3034
-
3035
3033
  return _setPrototypeOf(o, p);
3036
3034
  }
3037
3035
 
@@ -3042,7 +3040,7 @@
3042
3040
  }
3043
3041
 
3044
3042
  function _getPrototypeOf(o) {
3045
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
3043
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
3046
3044
  return o.__proto__ || Object.getPrototypeOf(o);
3047
3045
  };
3048
3046
  return _getPrototypeOf(o);
@@ -3067,7 +3065,7 @@
3067
3065
 
3068
3066
  function _construct(Parent, args, Class) {
3069
3067
  if (_isNativeReflectConstruct()) {
3070
- _construct = Reflect.construct;
3068
+ _construct = Reflect.construct.bind();
3071
3069
  } else {
3072
3070
  _construct = function _construct(Parent, args, Class) {
3073
3071
  var a = [null];
@@ -3472,10 +3470,10 @@
3472
3470
  var hexRgbaRegex = /^#[a-fA-F0-9]{8}$/;
3473
3471
  var reducedHexRegex = /^#[a-fA-F0-9]{3}$/;
3474
3472
  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;
3473
+ var rgbRegex = /^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i;
3474
+ var rgbaRegex = /^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;
3475
+ 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;
3476
+ 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
3477
  /**
3480
3478
  * Returns an RgbColor or RgbaColor object. This utility function is only useful
3481
3479
  * if want to extract a color component. With the color util `toColorString` you
@@ -3549,7 +3547,7 @@
3549
3547
  red: parseInt("" + rgbaMatched[1], 10),
3550
3548
  green: parseInt("" + rgbaMatched[2], 10),
3551
3549
  blue: parseInt("" + rgbaMatched[3], 10),
3552
- alpha: parseFloat("" + rgbaMatched[4])
3550
+ alpha: parseFloat("" + rgbaMatched[4]) > 1 ? parseFloat("" + rgbaMatched[4]) / 100 : parseFloat("" + rgbaMatched[4])
3553
3551
  };
3554
3552
  }
3555
3553
 
@@ -3594,7 +3592,7 @@
3594
3592
  red: parseInt("" + _hslRgbMatched[1], 10),
3595
3593
  green: parseInt("" + _hslRgbMatched[2], 10),
3596
3594
  blue: parseInt("" + _hslRgbMatched[3], 10),
3597
- alpha: parseFloat("" + hslaMatched[4])
3595
+ alpha: parseFloat("" + hslaMatched[4]) > 1 ? parseFloat("" + hslaMatched[4]) / 100 : parseFloat("" + hslaMatched[4])
3598
3596
  };
3599
3597
  }
3600
3598
 
@@ -5232,8 +5230,10 @@
5232
5230
  state.pointerPos.y = ev.pageY - offset.top; // Move tooltip
5233
5231
 
5234
5232
  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
5233
+ state.toolTipElem.style.left = "".concat(state.pointerPos.x, "px"); // adjust horizontal position to not exceed canvas boundaries
5234
+
5235
+ state.toolTipElem.style.transform = "translate(-".concat(state.pointerPos.x / state.width * 100, "%, ").concat( // flip to above if near bottom
5236
+ state.height - state.pointerPos.y < 100 ? 'calc(-100% - 8px)' : '21px', ")");
5237
5237
  }
5238
5238
 
5239
5239
  function getOffset(el) {