Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@react-pdf-viewer/get-file

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-pdf-viewer/get-file - npm Package Compare versions

Comparing version 2.7.1 to 2.7.2

4

lib/cjs/get-file.js

@@ -65,3 +65,3 @@ 'use strict';

var onClick = _a.onClick;
var l10n = React__namespace.useContext(core.LocalizationContext);
var l10n = React__namespace.useContext(core.LocalizationContext).l10n;
var label = l10n && l10n.download ? l10n.download.download : 'Download';

@@ -112,3 +112,3 @@ return (React__namespace.createElement(core.Tooltip, { ariaControlsSuffix: "get-file", position: core.Position.BottomCenter, target: React__namespace.createElement(core.MinimalButton, { ariaLabel: label, onClick: onClick },

var onClick = _a.onClick;
var l10n = React__namespace.useContext(core.LocalizationContext);
var l10n = React__namespace.useContext(core.LocalizationContext).l10n;
var label = l10n && l10n.download ? l10n.download.download : 'Download';

@@ -115,0 +115,0 @@ return (React__namespace.createElement(core.MenuItem, { icon: React__namespace.createElement(DownloadIcon, null), onClick: onClick }, label));

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@react-pdf-viewer/core");function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var o=n(e),r=function(){return(r=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},a=function(){return o.createElement(t.Icon,{size:16},o.createElement("path",{d:"M11.5 19.5L11.5 5"}),o.createElement("path",{d:"M17 14L11.5 19.5 6 14"}),o.createElement("path",{d:"M17.5.5h5a1,1,0,0,1,1,1v21a1,1,0,0,1-1,1h-5"}),o.createElement("path",{d:"M6.5.5h-5a1,1,0,0,0-1,1v21a1,1,0,0,0,1,1h5"}))},c={left:0,top:8},i=function(e){var n=e.onClick,r=o.useContext(t.LocalizationContext),i=r&&r.download?r.download.download:"Download";return o.createElement(t.Tooltip,{ariaControlsSuffix:"get-file",position:t.Position.BottomCenter,target:o.createElement(t.MinimalButton,{ariaLabel:i,onClick:n},o.createElement(a,null)),content:function(){return i},offset:c})},l=function(e){var t=e.children,n=e.fileNameGenerator,r=e.store,a=o.useState(r.get("file")),c=a[0],l=a[1],u=function(e){l(e)};o.useEffect((function(){return r.subscribe("file",u),function(){r.unsubscribe("file",u)}}),[]);return(t||function(e){return o.createElement(i,{onClick:e.onClick})})({onClick:function(){var e,t,o,r;c&&(e=c,t=n(c),o="string"==typeof e.data?"":URL.createObjectURL(new Blob([e.data],{type:"application/pdf"})),(r=document.createElement("a")).style.display="none",r.href=o||e.name,r.setAttribute("download",t),document.body.appendChild(r),r.click(),document.body.removeChild(r),o&&URL.revokeObjectURL(o))}})},u=function(e){var n=e.onClick,r=o.useContext(t.LocalizationContext),c=r&&r.download?r.download.download:"Download";return o.createElement(t.MenuItem,{icon:o.createElement(a,null),onClick:n},c)};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@react-pdf-viewer/core");function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var o=n(e),r=function(){return(r=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},a=function(){return o.createElement(t.Icon,{size:16},o.createElement("path",{d:"M11.5 19.5L11.5 5"}),o.createElement("path",{d:"M17 14L11.5 19.5 6 14"}),o.createElement("path",{d:"M17.5.5h5a1,1,0,0,1,1,1v21a1,1,0,0,1-1,1h-5"}),o.createElement("path",{d:"M6.5.5h-5a1,1,0,0,0-1,1v21a1,1,0,0,0,1,1h5"}))},l={left:0,top:8},c=function(e){var n=e.onClick,r=o.useContext(t.LocalizationContext).l10n,c=r&&r.download?r.download.download:"Download";return o.createElement(t.Tooltip,{ariaControlsSuffix:"get-file",position:t.Position.BottomCenter,target:o.createElement(t.MinimalButton,{ariaLabel:c,onClick:n},o.createElement(a,null)),content:function(){return c},offset:l})},i=function(e){var t=e.children,n=e.fileNameGenerator,r=e.store,a=o.useState(r.get("file")),l=a[0],i=a[1],u=function(e){i(e)};o.useEffect((function(){return r.subscribe("file",u),function(){r.unsubscribe("file",u)}}),[]);return(t||function(e){return o.createElement(c,{onClick:e.onClick})})({onClick:function(){var e,t,o,r;l&&(e=l,t=n(l),o="string"==typeof e.data?"":URL.createObjectURL(new Blob([e.data],{type:"application/pdf"})),(r=document.createElement("a")).style.display="none",r.href=o||e.name,r.setAttribute("download",t),document.body.appendChild(r),r.click(),document.body.removeChild(r),o&&URL.revokeObjectURL(o))}})},u=function(e){var n=e.onClick,r=o.useContext(t.LocalizationContext).l10n,l=r&&r.download?r.download.download:"Download";return o.createElement(t.MenuItem,{icon:o.createElement(a,null),onClick:n},l)};
/*! *****************************************************************************

@@ -15,2 +15,2 @@ Copyright (c) Microsoft Corporation.

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */exports.DownloadIcon=a,exports.getFilePlugin=function(e){var n=o.useMemo((function(){return t.createStore({})}),[]),a=function(e){return"object"==typeof e.data?"document.pdf":(t=e.name,(n=t.split("/").pop())?n.split("#")[0].split("?")[0]:t);var t,n},c=function(t){return o.createElement(l,r({},t,{fileNameGenerator:e&&e.fileNameGenerator||a,store:n}))};return{onViewerStateChange:function(e){return n.update("file",e.file),e},Download:c,DownloadButton:function(){return o.createElement(c,null,(function(e){return o.createElement(i,r({},e))}))},DownloadMenuItem:function(e){return o.createElement(c,null,(function(t){return o.createElement(u,{onClick:function(){t.onClick(),e.onClick()}})}))}}};
***************************************************************************** */exports.DownloadIcon=a,exports.getFilePlugin=function(e){var n=o.useMemo((function(){return t.createStore({})}),[]),a=function(e){return"object"==typeof e.data?"document.pdf":(t=e.name,(n=t.split("/").pop())?n.split("#")[0].split("?")[0]:t);var t,n},l=function(t){return o.createElement(i,r({},t,{fileNameGenerator:e&&e.fileNameGenerator||a,store:n}))};return{onViewerStateChange:function(e){return n.update("file",e.file),e},Download:l,DownloadButton:function(){return o.createElement(l,null,(function(e){return o.createElement(c,r({},e))}))},DownloadMenuItem:function(e){return o.createElement(l,null,(function(t){return o.createElement(u,{onClick:function(){t.onClick(),e.onClick()}})}))}}};
{
"name": "@react-pdf-viewer/get-file",
"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"
},

@@ -50,3 +50,3 @@ "peerDependencies": {

},
"gitHead": "e7e1a5a6c3c2706198c71b57fff3cff285c5fe54"
"gitHead": "156fdaa17d841cc90ce4e9bf6ec9e5a9e23bb014"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc