@pedidopago/ui 1.13.49 → 1.13.50

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.
@@ -1 +1 @@
1
- {"version":3,"file":"useWindowSize.d.ts","sourceRoot":"","sources":["../../../src/shared/hooks/useWindowSize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAgB,aAAa,CAAC,WAAW,CAAC,EAAE,iBAAiB,cA4C5D"}
1
+ {"version":3,"file":"useWindowSize.d.ts","sourceRoot":"","sources":["../../../src/shared/hooks/useWindowSize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAgB,aAAa,CAAC,WAAW,CAAC,EAAE,iBAAiB,cA8C5D"}
@@ -1 +1 @@
1
- "use strict";var _react=require("react");Object.defineProperty(exports,"__esModule",{value:!0}),exports.useWindowSize=useWindowSize;function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(o,minLen):void 0}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _s,_e,_x,_r,_arr=[],_n=!0,_d=!1;try{if(_x=(_i=_i.call(arr)).next,0===i){if(Object(_i)!==_i)return;_n=!1}else for(;!(_n=(_s=_x.call(_i)).done)&&(_arr.push(_s.value),_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{if(!_n&&null!=_i.return&&(_r=_i.return(),Object(_r)!==_r))return}finally{if(_d)throw _e}}return _arr}}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}function useWindowSize(breakpoints){var _useState=(0,_react.useState)({width:window.innerWidth,height:window.innerHeight}),_useState2=_slicedToArray(_useState,2),currentSize=_useState2[0],setCurrentSize=_useState2[1];return(0,_react.useEffect)(function(){var findClosestBreakpoint=function(width){return breakpoints?Object.values(breakpoints).reduce(function(prev,curr){return Math.abs(curr-width)<Math.abs(prev-width)?curr:prev}):void 0},handleResize=function(){var newWidth=window.innerWidth,newHeight=window.innerHeight;if(!breakpoints)return void setCurrentSize({width:newWidth,height:newHeight});var closestBreakpoint=findClosestBreakpoint(newWidth);closestBreakpoint!==findClosestBreakpoint(currentSize.width)&&setCurrentSize({width:newWidth,height:newHeight})};return window.addEventListener("resize",handleResize),function(){return window.removeEventListener("resize",handleResize)}},[currentSize,breakpoints]),currentSize}
1
+ "use strict";var _react=require("react");Object.defineProperty(exports,"__esModule",{value:!0}),exports.useWindowSize=useWindowSize;function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(o,minLen):void 0}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _s,_e,_x,_r,_arr=[],_n=!0,_d=!1;try{if(_x=(_i=_i.call(arr)).next,0===i){if(Object(_i)!==_i)return;_n=!1}else for(;!(_n=(_s=_x.call(_i)).done)&&(_arr.push(_s.value),_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{if(!_n&&null!=_i.return&&(_r=_i.return(),Object(_r)!==_r))return}finally{if(_d)throw _e}}return _arr}}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}function useWindowSize(breakpoints){var isClient="object"===("undefined"==typeof window?"undefined":_typeof(window)),_useState=(0,_react.useState)({width:isClient?window.innerWidth:0,height:isClient?window.innerHeight:0}),_useState2=_slicedToArray(_useState,2),currentSize=_useState2[0],setCurrentSize=_useState2[1];return(0,_react.useEffect)(function(){var findClosestBreakpoint=function(width){return breakpoints?Object.values(breakpoints).reduce(function(prev,curr){return Math.abs(curr-width)<Math.abs(prev-width)?curr:prev}):void 0},handleResize=function(){var newWidth=window.innerWidth,newHeight=window.innerHeight;if(!breakpoints)return void setCurrentSize({width:newWidth,height:newHeight});var closestBreakpoint=findClosestBreakpoint(newWidth);closestBreakpoint!==findClosestBreakpoint(currentSize.width)&&setCurrentSize({width:newWidth,height:newHeight})};return window.addEventListener("resize",handleResize),function(){return window.removeEventListener("resize",handleResize)}},[currentSize,breakpoints]),currentSize}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pedidopago/ui",
3
- "version": "1.13.49",
3
+ "version": "1.13.50",
4
4
  "description": "Quick build beatiful Pedido Pago apps",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",