@react-pdf-viewer/drop
Advanced tools
Comparing version
@@ -111,3 +111,3 @@ 'use strict'; | ||
}).isDragging; | ||
var l10n = React__namespace.useContext(core.LocalizationContext); | ||
var l10n = React__namespace.useContext(core.LocalizationContext).l10n; | ||
return (React__namespace.createElement(React__namespace.Fragment, null, isDragging && (React__namespace.createElement("div", { className: "rpv-drop__area" }, | ||
@@ -114,0 +114,0 @@ React__namespace.createElement("div", { className: "rpv-drop__area-body" }, l10n && l10n.drop ? l10n.drop.dragDropFile : 'Drag and drop a PDF document here'))))); |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("@react-pdf-viewer/core");function t(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}})),r.default=e,Object.freeze(r)}var n=t(e),a=function(){return(a=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e}).apply(this,arguments)},i=function(e){var t=e.containerRef,a=e.openFile,i=function(e,r){var t=n.useRef(0),a=n.useState(!1),i=a[0],o=a[1],u=function(e){e.preventDefault(),o(!1),t.current=0,e.dataTransfer&&r(e.dataTransfer.files)},c=function(e){e.preventDefault()},l=function(e){e.preventDefault(),t.current+=1,t.current<=1&&o(!0)},s=function(e){e.preventDefault(),t.current-=1,t.current<=0&&o(!1)};return n.useEffect((function(){var r=e.current;if(r)return r.addEventListener("drop",u),r.addEventListener("dragover",c),r.addEventListener("dragenter",l),r.addEventListener("dragleave",s),function(){r.removeEventListener("drop",u),r.removeEventListener("dragover",c),r.removeEventListener("dragenter",l),r.removeEventListener("dragleave",s)}}),[e.current]),{isDragging:i}}(t,(function(e){0!==e.length&&a(e[0])})).isDragging,o=n.useContext(r.LocalizationContext);return n.createElement(n.Fragment,null,i&&n.createElement("div",{className:"rpv-drop__area"},n.createElement("div",{className:"rpv-drop__area-body"},o&&o.drop?o.drop.dragDropFile:"Drag and drop a PDF document here")))}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("@react-pdf-viewer/core");function t(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}})),r.default=e,Object.freeze(r)}var n=t(e),a=function(){return(a=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e}).apply(this,arguments)},i=function(e){var t=e.containerRef,a=e.openFile,i=function(e,r){var t=n.useRef(0),a=n.useState(!1),i=a[0],o=a[1],u=function(e){e.preventDefault(),o(!1),t.current=0,e.dataTransfer&&r(e.dataTransfer.files)},c=function(e){e.preventDefault()},l=function(e){e.preventDefault(),t.current+=1,t.current<=1&&o(!0)},s=function(e){e.preventDefault(),t.current-=1,t.current<=0&&o(!1)};return n.useEffect((function(){var r=e.current;if(r)return r.addEventListener("drop",u),r.addEventListener("dragover",c),r.addEventListener("dragenter",l),r.addEventListener("dragleave",s),function(){r.removeEventListener("drop",u),r.removeEventListener("dragover",c),r.removeEventListener("dragenter",l),r.removeEventListener("dragleave",s)}}),[e.current]),{isDragging:i}}(t,(function(e){0!==e.length&&a(e[0])})).isDragging,o=n.useContext(r.LocalizationContext).l10n;return n.createElement(n.Fragment,null,i&&n.createElement("div",{className:"rpv-drop__area"},n.createElement("div",{className:"rpv-drop__area-body"},o&&o.drop?o.drop.dragDropFile:"Drag and drop a PDF document here")))}; | ||
/*! ***************************************************************************** | ||
@@ -3,0 +3,0 @@ Copyright (c) Microsoft Corporation. |
{ | ||
"name": "@react-pdf-viewer/drop", | ||
"version": "2.7.1", | ||
"version": "2.7.2", | ||
"description": "A React component to view a PDF document", | ||
@@ -36,3 +36,3 @@ "license": "https://react-pdf-viewer.dev/license", | ||
"dependencies": { | ||
"@react-pdf-viewer/core": "2.7.1" | ||
"@react-pdf-viewer/core": "2.7.2" | ||
}, | ||
@@ -52,3 +52,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "e7e1a5a6c3c2706198c71b57fff3cff285c5fe54" | ||
"gitHead": "d5084b21f1e89e11ee45764849b8c61e4e6f4216" | ||
} |
10891
0.09%+ Added
- Removed
Updated