@react-pdf-viewer/get-file
Advanced tools
Comparing version 3.7.0 to 3.8.0
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
var core = require('@react-pdf-viewer/core'); | ||
var React = require('react'); | ||
function _interopNamespace(e) { | ||
if (e && e.__esModule) return e; | ||
function _interopNamespaceDefault(e) { | ||
var n = Object.create(null); | ||
@@ -22,7 +19,7 @@ if (e) { | ||
} | ||
n["default"] = e; | ||
n.default = e; | ||
return Object.freeze(n); | ||
} | ||
var React__namespace = /*#__PURE__*/_interopNamespace(React); | ||
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React); | ||
@@ -29,0 +26,0 @@ var DownloadIcon = function () { return (React__namespace.createElement(core.Icon, { size: 16 }, |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@react-pdf-viewer/core");function t(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 n=t(require("react")),o=function(){return n.createElement(e.Icon,{size:16},n.createElement("path",{d:"M5.5,11.5c-.275,0-.341.159-.146.354l6.292,6.293a.5.5,0,0,0,.709,0l6.311-6.275c.2-.193.13-.353-.145-.355L15.5,11.5V1.5a1,1,0,0,0-1-1h-5a1,1,0,0,0-1,1V11a.5.5,0,0,1-.5.5Z"}),n.createElement("path",{d:"M23.5,18.5v4a1,1,0,0,1-1,1H1.5a1,1,0,0,1-1-1v-4"}))},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={left:0,top:8},a=function(t){var r=t.onClick,a=n.useContext(e.LocalizationContext).l10n,c=a&&a.download?a.download.download:"Download";return n.createElement(e.Tooltip,{ariaControlsSuffix:"get-file",position:e.Position.BottomCenter,target:n.createElement(e.MinimalButton,{ariaLabel:c,testId:"get-file__download-button",onClick:r},n.createElement(o,null)),content:function(){return c},offset:i})},c=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}));c(o,t),o&&URL.revokeObjectURL(o)},u=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)?c("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):l(e,t,"application/pdf")}))},f=function(e){var t=e.children,o=e.fileNameGenerator,r=e.store,i=n.useState(r.get("file")),c=i[0],l=i[1],f=n.useState(r.get("doc")),d=f[0],s=f[1],p=function(e){s(e)},m=function(e){l(e)};n.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 n.createElement(a,{onClick:e.onClick})})({onClick:function(){d&&c&&u(d,o(c))}})},d=function(t){var r=t.onClick,i=n.useContext(e.LocalizationContext).l10n,a=i&&i.download?i.download.download:"Download";return n.createElement(e.MenuItem,{icon:n.createElement(o,null),testId:"get-file__download-menu",onClick:r},a)};exports.DownloadIcon=o,exports.getFilePlugin=function(t){var o=n.useMemo((function(){return e.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},c=function(e){return n.createElement(f,r({},e,{fileNameGenerator:t&&t.fileNameGenerator||i,store:o}))};return{onDocumentLoad:function(e){o.update("doc",e.doc),o.update("file",e.file)},Download:c,DownloadButton:function(){return n.createElement(c,null,(function(e){return n.createElement(a,r({},e))}))},DownloadMenuItem:function(e){return n.createElement(c,null,(function(t){return n.createElement(d,{onClick:function(){t.onClick(),e.onClick()}})}))}}}; | ||
"use strict";var e=require("@react-pdf-viewer/core");function t(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 n=t(require("react")),o=function(){return n.createElement(e.Icon,{size:16},n.createElement("path",{d:"M5.5,11.5c-.275,0-.341.159-.146.354l6.292,6.293a.5.5,0,0,0,.709,0l6.311-6.275c.2-.193.13-.353-.145-.355L15.5,11.5V1.5a1,1,0,0,0-1-1h-5a1,1,0,0,0-1,1V11a.5.5,0,0,1-.5.5Z"}),n.createElement("path",{d:"M23.5,18.5v4a1,1,0,0,1-1,1H1.5a1,1,0,0,1-1-1v-4"}))},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={left:0,top:8},a=function(t){var r=t.onClick,a=n.useContext(e.LocalizationContext).l10n,c=a&&a.download?a.download.download:"Download";return n.createElement(e.Tooltip,{ariaControlsSuffix:"get-file",position:e.Position.BottomCenter,target:n.createElement(e.MinimalButton,{ariaLabel:c,testId:"get-file__download-button",onClick:r},n.createElement(o,null)),content:function(){return c},offset:i})},c=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}));c(o,t),o&&URL.revokeObjectURL(o)},u=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)?c("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):l(e,t,"application/pdf")}))},f=function(e){var t=e.children,o=e.fileNameGenerator,r=e.store,i=n.useState(r.get("file")),c=i[0],l=i[1],f=n.useState(r.get("doc")),d=f[0],s=f[1],p=function(e){s(e)},m=function(e){l(e)};n.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 n.createElement(a,{onClick:e.onClick})})({onClick:function(){d&&c&&u(d,o(c))}})},d=function(t){var r=t.onClick,i=n.useContext(e.LocalizationContext).l10n,a=i&&i.download?i.download.download:"Download";return n.createElement(e.MenuItem,{icon:n.createElement(o,null),testId:"get-file__download-menu",onClick:r},a)};exports.DownloadIcon=o,exports.getFilePlugin=function(t){var o=n.useMemo((function(){return e.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},c=function(e){return n.createElement(f,r({},e,{fileNameGenerator:t&&t.fileNameGenerator||i,store:o}))};return{onDocumentLoad:function(e){o.update("doc",e.doc),o.update("file",e.file)},Download:c,DownloadButton:function(){return n.createElement(c,null,(function(e){return n.createElement(a,r({},e))}))},DownloadMenuItem:function(e){return n.createElement(c,null,(function(t){return n.createElement(d,{onClick:function(){t.onClick(),e.onClick()}})}))}}}; |
{ | ||
"name": "@react-pdf-viewer/get-file", | ||
"version": "3.7.0", | ||
"version": "3.8.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": "3.7.0" | ||
"@react-pdf-viewer/core": "3.8.0" | ||
}, | ||
@@ -48,5 +48,5 @@ "peerDependencies": { | ||
"clean": "rm -rf lib && mkdir lib", | ||
"build": "npm run clean && cp src/index.d.ts lib && cp dist/index.js lib && rollup -c ../../rollup.config.js" | ||
"build": "npm run clean && cp src/index.d.ts lib && cp dist/index.js lib && rollup -c ../../rollup.config.cjs" | ||
}, | ||
"gitHead": "ccba5d4f68fa44ca7c242837280fcebf92b4f6a6" | ||
"gitHead": "62b141a0ceb569147ca765ab6bbff76c5e480bf8" | ||
} |
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
15392
206
+ Added@mapbox/node-pre-gyp@1.0.11(transitive)
+ Added@react-pdf-viewer/core@3.8.0(transitive)
+ Addedabbrev@1.1.1(transitive)
+ Addedagent-base@6.0.2(transitive)
+ Addedansi-regex@5.0.1(transitive)
+ Addedaproba@2.0.0(transitive)
+ Addedare-we-there-yet@2.0.0(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedcanvas@2.11.2(transitive)
+ Addedchownr@2.0.0(transitive)
+ Addedcolor-support@1.1.3(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedconsole-control-strings@1.1.0(transitive)
+ Addeddebug@4.3.7(transitive)
+ Addeddecompress-response@4.2.1(transitive)
+ Addeddelegates@1.0.0(transitive)
+ Addeddetect-libc@2.0.3(transitive)
+ Addedemoji-regex@8.0.0(transitive)
+ Addedfs-minipass@2.1.0(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedgauge@3.0.2(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedhas-unicode@2.0.1(transitive)
+ Addedhttps-proxy-agent@5.0.1(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedmake-dir@3.1.0(transitive)
+ Addedmimic-response@2.1.0(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedminipass@3.3.65.0.0(transitive)
+ Addedminizlib@2.1.2(transitive)
+ Addedmkdirp@1.0.4(transitive)
+ Addedms@2.1.3(transitive)
+ Addednan@2.22.0(transitive)
+ Addednode-fetch@2.7.0(transitive)
+ Addednopt@5.0.0(transitive)
+ Addednpmlog@5.0.1(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedpath2d@0.1.1(transitive)
+ Addedpath2d-polyfill@2.1.1(transitive)
+ Addedpdfjs-dist@3.11.174(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedrimraf@3.0.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsemver@6.3.17.6.3(transitive)
+ Addedset-blocking@2.0.0(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedsimple-concat@1.0.1(transitive)
+ Addedsimple-get@3.1.1(transitive)
+ Addedstring-width@4.2.3(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedstrip-ansi@6.0.1(transitive)
+ Addedtar@6.2.1(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)
+ Addedwide-align@1.1.5(transitive)
+ Addedwrappy@1.0.2(transitive)
+ Addedyallist@4.0.0(transitive)
- Removed@react-pdf-viewer/core@3.7.0(transitive)
- Removeddommatrix@1.0.3(transitive)
- Removedpdfjs-dist@2.16.105(transitive)
- Removedweb-streams-polyfill@3.3.3(transitive)
Updated@react-pdf-viewer/core@3.8.0