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.4.0 to 2.4.1

2

lib/cjs/get-file.js

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

var children = _a.children, fileNameGenerator = _a.fileNameGenerator, store = _a.store;
var _b = React.useState(), currentFile = _b[0], setCurrentFile = _b[1];
var _b = React.useState(store.get('file')), currentFile = _b[0], setCurrentFile = _b[1];
var handleFileChanged = function (file) {

@@ -69,0 +69,0 @@ setCurrentFile(file);

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@react-pdf-viewer/core"),n=function(){return e.createElement(t.Icon,{size:16},e.createElement("path",{d:"M17.5,11.5c3.314,0,6,2.686,6,6s-2.686,6-6,6s-6-2.686-6-6S14.186,11.5,17.5,11.5z\n M17.5,14.5v6\n M17.5,20.5\n l-2.25-2.25\n M17.5,20.5l2.25-2.25\n M10.5,23.5h-9c-0.552,0-1-0.448-1-1v-21c0-0.552,0.448-1,1-1h13.293\n c0.265,0,0.52,0.105,0.707,0.293L19.207,4.5C19.395,4.687,19.5,4.942,19.5,5.207V8.5"}))},r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o={left:0,top:8},c=function(r){var c=r.onClick,i=e.useContext(t.LocalizationContext),a=i&&i.download?i.download.download:"Download";return e.createElement(t.Tooltip,{position:t.Position.BottomCenter,target:e.createElement(t.Button,{onClick:c},e.createElement(n,null)),content:function(){return a},offset:o})},i=function(t){var n=t.children,r=t.fileNameGenerator,o=t.store,i=e.useState(),a=i[0],l=i[1],u=function(e){l(e)};e.useEffect((function(){return o.subscribe("file",u),function(){o.unsubscribe("file",u)}}),[]);return(n||function(t){return e.createElement(c,{onClick:t.onClick})})({onClick:function(){var e,t,n,o;a&&(e=a,t=r(a),n="string"==typeof e.data?"":URL.createObjectURL(new Blob([e.data],{type:""})),(o=document.createElement("a")).style.display="none",o.href=n||e.name,o.setAttribute("download",t),document.body.appendChild(o),o.click(),document.body.removeChild(o),n&&URL.revokeObjectURL(n))}})};exports.DownloadIcon=n,exports.getFilePlugin=function(n){var o=e.useMemo((function(){return t.createStore({})}),[]),a=function(e){return t=e.name,(n=t.split("/").pop())?n.split("#")[0].split("?")[0]:t;var t,n},l=function(t){return e.createElement(i,r({},t,{fileNameGenerator:n&&n.fileNameGenerator||a,store:o}))};return{onViewerStateChange:function(e){return o.update("file",e.file),e},Download:l,DownloadButton:function(){return e.createElement(l,null,(function(t){return e.createElement(c,r({},t))}))}}};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@react-pdf-viewer/core"),n=function(){return e.createElement(t.Icon,{size:16},e.createElement("path",{d:"M17.5,11.5c3.314,0,6,2.686,6,6s-2.686,6-6,6s-6-2.686-6-6S14.186,11.5,17.5,11.5z\n M17.5,14.5v6\n M17.5,20.5\n l-2.25-2.25\n M17.5,20.5l2.25-2.25\n M10.5,23.5h-9c-0.552,0-1-0.448-1-1v-21c0-0.552,0.448-1,1-1h13.293\n c0.265,0,0.52,0.105,0.707,0.293L19.207,4.5C19.395,4.687,19.5,4.942,19.5,5.207V8.5"}))},r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o={left:0,top:8},c=function(r){var c=r.onClick,i=e.useContext(t.LocalizationContext),a=i&&i.download?i.download.download:"Download";return e.createElement(t.Tooltip,{position:t.Position.BottomCenter,target:e.createElement(t.Button,{onClick:c},e.createElement(n,null)),content:function(){return a},offset:o})},i=function(t){var n=t.children,r=t.fileNameGenerator,o=t.store,i=e.useState(o.get("file")),a=i[0],l=i[1],u=function(e){l(e)};e.useEffect((function(){return o.subscribe("file",u),function(){o.unsubscribe("file",u)}}),[]);return(n||function(t){return e.createElement(c,{onClick:t.onClick})})({onClick:function(){var e,t,n,o;a&&(e=a,t=r(a),n="string"==typeof e.data?"":URL.createObjectURL(new Blob([e.data],{type:""})),(o=document.createElement("a")).style.display="none",o.href=n||e.name,o.setAttribute("download",t),document.body.appendChild(o),o.click(),document.body.removeChild(o),n&&URL.revokeObjectURL(n))}})};exports.DownloadIcon=n,exports.getFilePlugin=function(n){var o=e.useMemo((function(){return t.createStore({})}),[]),a=function(e){return t=e.name,(n=t.split("/").pop())?n.split("#")[0].split("?")[0]:t;var t,n},l=function(t){return e.createElement(i,r({},t,{fileNameGenerator:n&&n.fileNameGenerator||a,store:o}))};return{onViewerStateChange:function(e){return o.update("file",e.file),e},Download:l,DownloadButton:function(){return e.createElement(l,null,(function(t){return e.createElement(c,r({},t))}))}}};
{
"name": "@react-pdf-viewer/get-file",
"version": "2.4.0",
"version": "2.4.1",
"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.4.0"
"@react-pdf-viewer/core": "2.4.1"
},

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

},
"gitHead": "09ee35ddfbac935d8e6b266f2c1cd1421171db93"
"gitHead": "ecc13b17c4b2ce670b4faca550ec036ead8425da"
}
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