use-react-screenshot-fix
Advanced tools
Comparing version 4.0.2 to 4.0.3
@@ -12,2 +12,10 @@ import { useState } from 'react'; | ||
} | ||
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; | ||
} | ||
function _iterableToArrayLimit(r, l) { | ||
@@ -43,5 +51,40 @@ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; | ||
} | ||
function ownKeys(e, r) { | ||
var t = Object.keys(e); | ||
if (Object.getOwnPropertySymbols) { | ||
var o = Object.getOwnPropertySymbols(e); | ||
r && (o = o.filter(function (r) { | ||
return Object.getOwnPropertyDescriptor(e, r).enumerable; | ||
})), t.push.apply(t, o); | ||
} | ||
return t; | ||
} | ||
function _objectSpread2(e) { | ||
for (var r = 1; r < arguments.length; r++) { | ||
var t = null != arguments[r] ? arguments[r] : {}; | ||
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { | ||
_defineProperty(e, r, t[r]); | ||
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { | ||
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); | ||
}); | ||
} | ||
return e; | ||
} | ||
function _slicedToArray(r, e) { | ||
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); | ||
} | ||
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); | ||
} | ||
function _toPropertyKey(t) { | ||
var i = _toPrimitive(t, "string"); | ||
return "symbol" == typeof i ? i : i + ""; | ||
} | ||
function _unsupportedIterableToArray(r, a) { | ||
@@ -90,3 +133,6 @@ if (r) { | ||
window.scrollTo(0, 0); | ||
return html2canvas(node, options).then(function (canvas) { | ||
var opts = _objectSpread2(_objectSpread2({}, options), {}, { | ||
useCORS: true | ||
}); | ||
return html2canvas(node, opts).then(function (canvas) { | ||
var croppedCanvas = document.createElement('canvas'); | ||
@@ -93,0 +139,0 @@ var croppedCanvasContext = croppedCanvas.getContext('2d'); |
@@ -18,2 +18,10 @@ 'use strict'; | ||
} | ||
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; | ||
} | ||
function _iterableToArrayLimit(r, l) { | ||
@@ -49,5 +57,40 @@ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; | ||
} | ||
function ownKeys(e, r) { | ||
var t = Object.keys(e); | ||
if (Object.getOwnPropertySymbols) { | ||
var o = Object.getOwnPropertySymbols(e); | ||
r && (o = o.filter(function (r) { | ||
return Object.getOwnPropertyDescriptor(e, r).enumerable; | ||
})), t.push.apply(t, o); | ||
} | ||
return t; | ||
} | ||
function _objectSpread2(e) { | ||
for (var r = 1; r < arguments.length; r++) { | ||
var t = null != arguments[r] ? arguments[r] : {}; | ||
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { | ||
_defineProperty(e, r, t[r]); | ||
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { | ||
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); | ||
}); | ||
} | ||
return e; | ||
} | ||
function _slicedToArray(r, e) { | ||
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); | ||
} | ||
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); | ||
} | ||
function _toPropertyKey(t) { | ||
var i = _toPrimitive(t, "string"); | ||
return "symbol" == typeof i ? i : i + ""; | ||
} | ||
function _unsupportedIterableToArray(r, a) { | ||
@@ -96,3 +139,6 @@ if (r) { | ||
window.scrollTo(0, 0); | ||
return html2canvas(node, options).then(function (canvas) { | ||
var opts = _objectSpread2(_objectSpread2({}, options), {}, { | ||
useCORS: true | ||
}); | ||
return html2canvas(node, opts).then(function (canvas) { | ||
var croppedCanvas = document.createElement('canvas'); | ||
@@ -99,0 +145,0 @@ var croppedCanvasContext = croppedCanvas.getContext('2d'); |
{ | ||
"name": "use-react-screenshot-fix", | ||
"version": "4.0.2", | ||
"version": "4.0.3", | ||
"description": "hook which allows to create screenshots", | ||
@@ -5,0 +5,0 @@ "author": "vre2h", |
@@ -30,3 +30,4 @@ import { useState } from 'react' | ||
window.scrollTo(0, 0); | ||
return html2canvas(node, options) | ||
const opts = { ...options, useCORS: true } | ||
return html2canvas(node, opts) | ||
.then((canvas) => { | ||
@@ -33,0 +34,0 @@ const croppedCanvas = document.createElement('canvas') |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2344548
36573