@react-pdf-viewer/get-file
Advanced tools
Comparing version 2.5.0 to 2.6.0
@@ -66,3 +66,3 @@ 'use strict'; | ||
var label = l10n && l10n.download ? l10n.download.download : 'Download'; | ||
return (React__namespace.createElement(core.Tooltip, { position: core.Position.BottomCenter, target: React__namespace.createElement(core.Button, { onClick: onClick }, | ||
return (React__namespace.createElement(core.Tooltip, { position: core.Position.BottomCenter, target: React__namespace.createElement(core.MinimalButton, { onClick: onClick }, | ||
React__namespace.createElement(DownloadIcon, null)), content: function () { return label; }, offset: TOOLTIP_OFFSET })); | ||
@@ -69,0 +69,0 @@ }; |
@@ -1,1 +0,1 @@ | ||
"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 o.createElement(t.Icon,{size:16},o.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"}))},c=function(){return(c=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)},l={left:0,top:8},i=function(e){var n=e.onClick,c=o.useContext(t.LocalizationContext),i=c&&c.download?c.download.download:"Download";return o.createElement(t.Tooltip,{position:t.Position.BottomCenter,target:o.createElement(t.Button,{onClick:n},o.createElement(r,null)),content:function(){return i},offset:l})},a=function(e){var t=e.children,n=e.fileNameGenerator,r=e.store,c=o.useState(r.get("file")),l=c[0],a=c[1],u=function(e){a(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;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,c=o.useContext(t.LocalizationContext),l=c&&c.download?c.download.download:"Download";return o.createElement(t.MenuItem,{icon:o.createElement(r,null),onClick:n},l)};exports.DownloadIcon=r,exports.getFilePlugin=function(e){var n=o.useMemo((function(){return t.createStore({})}),[]),r=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(a,c({},t,{fileNameGenerator:e&&e.fileNameGenerator||r,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(i,c({},e))}))},DownloadMenuItem:function(e){return o.createElement(l,null,(function(t){return o.createElement(u,{onClick:function(){t.onClick(),e.onClick()}})}))}}}; | ||
"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 o.createElement(t.Icon,{size:16},o.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"}))},c=function(){return(c=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)},i={left:0,top:8},l=function(e){var n=e.onClick,c=o.useContext(t.LocalizationContext),l=c&&c.download?c.download.download:"Download";return o.createElement(t.Tooltip,{position:t.Position.BottomCenter,target:o.createElement(t.MinimalButton,{onClick:n},o.createElement(r,null)),content:function(){return l},offset:i})},a=function(e){var t=e.children,n=e.fileNameGenerator,r=e.store,c=o.useState(r.get("file")),i=c[0],a=c[1],u=function(e){a(e)};o.useEffect((function(){return r.subscribe("file",u),function(){r.unsubscribe("file",u)}}),[]);return(t||function(e){return o.createElement(l,{onClick:e.onClick})})({onClick:function(){var e,t,o,r;i&&(e=i,t=n(i),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,c=o.useContext(t.LocalizationContext),i=c&&c.download?c.download.download:"Download";return o.createElement(t.MenuItem,{icon:o.createElement(r,null),onClick:n},i)};exports.DownloadIcon=r,exports.getFilePlugin=function(e){var n=o.useMemo((function(){return t.createStore({})}),[]),r=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},i=function(t){return o.createElement(a,c({},t,{fileNameGenerator:e&&e.fileNameGenerator||r,store:n}))};return{onViewerStateChange:function(e){return n.update("file",e.file),e},Download:i,DownloadButton:function(){return o.createElement(i,null,(function(e){return o.createElement(l,c({},e))}))},DownloadMenuItem:function(e){return o.createElement(i,null,(function(t){return o.createElement(u,{onClick:function(){t.onClick(),e.onClick()}})}))}}}; |
{ | ||
"name": "@react-pdf-viewer/get-file", | ||
"version": "2.5.0", | ||
"version": "2.6.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.5.0" | ||
"@react-pdf-viewer/core": "2.6.0" | ||
}, | ||
@@ -50,3 +50,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "3c7ba1ea082607670f4e2bf69d5312a14baf7057" | ||
"gitHead": "91d6279570bd3d4672b131100392afd6e8658892" | ||
} |
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
13900
+ Added@react-pdf-viewer/core@2.6.0(transitive)
- Removed@react-pdf-viewer/core@2.5.0(transitive)
Updated@react-pdf-viewer/core@2.6.0