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.11.0 to 3.0.0

6

lib/cjs/get-file.js

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

var label = l10n && l10n.download ? l10n.download.download : 'Download';
return (React__namespace.createElement(core.Tooltip, { ariaControlsSuffix: "get-file", position: core.Position.BottomCenter, target: React__namespace.createElement(core.MinimalButton, { ariaLabel: label, onClick: onClick },
return (React__namespace.createElement(core.Tooltip, { ariaControlsSuffix: "get-file", position: core.Position.BottomCenter, target: React__namespace.createElement(core.MinimalButton, { ariaLabel: label, testId: "get-file__download-button", onClick: onClick },
React__namespace.createElement(DownloadIcon, null)), content: function () { return label; }, offset: TOOLTIP_OFFSET }));

@@ -101,3 +101,3 @@ };

: isChromeIOS()
? download("data:application/pdf;base64," + encodeUint8Array(data), saveAs)
? download("data:application/pdf;base64,".concat(encodeUint8Array(data)), saveAs)
: downloadBlob(data, saveAs, 'application/pdf');

@@ -141,3 +141,3 @@ });

var label = l10n && l10n.download ? l10n.download.download : 'Download';
return (React__namespace.createElement(core.MenuItem, { icon: React__namespace.createElement(DownloadIcon, null), onClick: onClick }, label));
return (React__namespace.createElement(core.MenuItem, { icon: React__namespace.createElement(DownloadIcon, null), testId: "get-file__download-menu", onClick: onClick }, label));
};

@@ -144,0 +144,0 @@

@@ -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},r.apply(this,arguments)},i=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"}))},a={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(i,null)),content:function(){return c},offset:a})},u=function(e,t){var n=document.createElement("a");n.style.display="none",n.href=e,n.setAttribute("download",t),document.body.appendChild(n),n.click(),document.body.removeChild(n)},l=function(e,t,n){var o=URL.createObjectURL(new Blob([e],{type:n}));u(o,t),o&&URL.revokeObjectURL(o)},f=function(e,t){e.getData().then((function(e){/iphone|ipod|ipad/i.test(navigator.userAgent)&&!/CriOS/i.test(navigator.userAgent)?l(e,t,"application/octet-stream"):/iphone|ipod|ipad/i.test(navigator.userAgent)&&/CriOS/i.test(navigator.userAgent)?u("data:application/pdf;base64,"+function(e){return btoa(Array(e.length).fill("").map((function(t,n){return String.fromCharCode(e[n])})).join(""))}(e),t):l(e,t,"application/pdf")}))},d=function(e){var t=e.children,n=e.fileNameGenerator,r=e.store,i=o.useState(r.get("file")),a=i[0],u=i[1],l=o.useState(r.get("doc")),d=l[0],s=l[1],p=function(e){s(e)},m=function(e){u(e)};o.useEffect((function(){return r.subscribe("doc",p),r.subscribe("file",m),function(){r.subscribe("doc",p),r.unsubscribe("file",m)}}),[]);return(t||function(e){return o.createElement(c,{onClick:e.onClick})})({onClick:function(){d&&a&&f(d,n(a))}})},s=function(e){var n=e.onClick,r=o.useContext(t.LocalizationContext).l10n,a=r&&r.download?r.download.download:"Download";return o.createElement(t.MenuItem,{icon:o.createElement(i,null),onClick:n},a)};
"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},r.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"}))},i={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,testId:"get-file__download-button",onClick:n},o.createElement(a,null)),content:function(){return c},offset:i})},l=function(e,t){var n=document.createElement("a");n.style.display="none",n.href=e,n.setAttribute("download",t),document.body.appendChild(n),n.click(),document.body.removeChild(n)},u=function(e,t,n){var o=URL.createObjectURL(new Blob([e],{type:n}));l(o,t),o&&URL.revokeObjectURL(o)},f=function(e,t){e.getData().then((function(e){/iphone|ipod|ipad/i.test(navigator.userAgent)&&!/CriOS/i.test(navigator.userAgent)?u(e,t,"application/octet-stream"):/iphone|ipod|ipad/i.test(navigator.userAgent)&&/CriOS/i.test(navigator.userAgent)?l("data:application/pdf;base64,".concat(function(e){return btoa(Array(e.length).fill("").map((function(t,n){return String.fromCharCode(e[n])})).join(""))}(e)),t):u(e,t,"application/pdf")}))},d=function(e){var t=e.children,n=e.fileNameGenerator,r=e.store,a=o.useState(r.get("file")),i=a[0],l=a[1],u=o.useState(r.get("doc")),d=u[0],s=u[1],p=function(e){s(e)},m=function(e){l(e)};o.useEffect((function(){return r.subscribe("doc",p),r.subscribe("file",m),function(){r.subscribe("doc",p),r.unsubscribe("file",m)}}),[]);return(t||function(e){return o.createElement(c,{onClick:e.onClick})})({onClick:function(){d&&i&&f(d,n(i))}})},s=function(e){var n=e.onClick,r=o.useContext(t.LocalizationContext).l10n,i=r&&r.download?r.download.download:"Download";return o.createElement(t.MenuItem,{icon:o.createElement(a,null),testId:"get-file__download-menu",onClick:n},i)};
/*! *****************************************************************************

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

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

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

},
"gitHead": "5e4074055f48210e89c1fdf5b1cc53d78d56be44"
"gitHead": "db24bf8b47a1ef4ee9da726af7f66268468c3420"
}
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