New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@react-pdf-viewer/open

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/open - npm Package Compare versions

Comparing version 2.9.1 to 2.10.0

6

lib/cjs/open.js

@@ -17,5 +17,3 @@ 'use strict';

enumerable: true,
get: function () {
return e[k];
}
get: function () { return e[k]; }
});

@@ -25,3 +23,3 @@ }

}
n['default'] = e;
n["default"] = e;
return Object.freeze(n);

@@ -28,0 +26,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 r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var r=n(e),o=function(){return(o=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)},i=function(){return r.createElement(t.Icon,{size:16},r.createElement("path",{d:"M12.5 4.5L12.5 19.5"}),r.createElement("path",{d:"M18 10L12.5 4.5 7 10"}),r.createElement("path",{d:"M17.5.5h5a1,1,0,0,1,1,1v21a1,1,0,0,1-1,1h-5"}),r.createElement("path",{d:"M6.5.5h-5a1,1,0,0,0-1,1v21a1,1,0,0,0,1,1h5"}))},c=function(e){var t=r.useRef(),n=function(){var n=t.current;n&&(n.click(),e.get("triggerOpenFile")&&e.update("triggerOpenFile",!1))},o=function(e){e&&n()};return r.useEffect((function(){return e.subscribe("triggerOpenFile",o),function(){e.unsubscribe("triggerOpenFile",o)}}),[]),{inputRef:t,openFile:n}},u={left:0,top:8},a=function(e){var n=e.enableShortcuts,o=e.store,a=e.onClick,l=r.useContext(t.LocalizationContext).l10n,p=l&&l.open?l.open.openFile:"Open file",f=c(o),s=f.inputRef,m=f.openFile,v=n?t.isMac()?"Meta+O":"Ctrl+O":"";return r.createElement(t.Tooltip,{ariaControlsSuffix:"open",position:t.Position.BottomCenter,target:r.createElement("div",{className:"rpv-open__input-wrapper"},r.createElement("input",{ref:s,className:"rpv-open__input",multiple:!1,tabIndex:-1,title:"",type:"file",onChange:a}),r.createElement(t.MinimalButton,{ariaKeyShortcuts:v,ariaLabel:p,onClick:m},r.createElement(i,null))),content:function(){return p},offset:u})},l=function(e){var t=e.children,n=e.enableShortcuts,o=e.store;return(t||function(e){return r.createElement(a,{enableShortcuts:n,store:o,onClick:e.onClick})})({onClick:function(e){var t=e.target.files;if(t&&t.length){var n=o.get("openFile");n&&n(t[0])}}})},p=function(e){var n=e.store,o=e.onClick,u=r.useContext(t.LocalizationContext).l10n,a=u&&u.open?u.open.openFile:"Open file",l=c(n),p=l.inputRef,f=l.openFile;return r.createElement(t.MenuItem,{icon:r.createElement(i,null),onClick:f},r.createElement("div",{className:"rpv-open__input-wrapper"},r.createElement("input",{ref:p,className:"rpv-open__input",multiple:!1,tabIndex:-1,title:"",type:"file",onChange:o}),a))},f=function(e){var n=e.containerRef,o=e.store,i=function(e){if(!e.shiftKey&&!e.altKey&&"o"===e.key&&(t.isMac()?e.metaKey:e.ctrlKey)){var r=n.current;r&&document.activeElement&&r.contains(document.activeElement)&&(e.preventDefault(),o.update("triggerOpenFile",!0))}};return r.useEffect((function(){if(n.current)return document.addEventListener("keydown",i),function(){document.removeEventListener("keydown",i)}}),[n.current]),r.createElement(r.Fragment,null)};
"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 r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var r=n(e),o=function(){return o=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},o.apply(this,arguments)},i=function(){return r.createElement(t.Icon,{size:16},r.createElement("path",{d:"M12.5 4.5L12.5 19.5"}),r.createElement("path",{d:"M18 10L12.5 4.5 7 10"}),r.createElement("path",{d:"M17.5.5h5a1,1,0,0,1,1,1v21a1,1,0,0,1-1,1h-5"}),r.createElement("path",{d:"M6.5.5h-5a1,1,0,0,0-1,1v21a1,1,0,0,0,1,1h5"}))},c=function(e){var t=r.useRef(),n=function(){var n=t.current;n&&(n.click(),e.get("triggerOpenFile")&&e.update("triggerOpenFile",!1))},o=function(e){e&&n()};return r.useEffect((function(){return e.subscribe("triggerOpenFile",o),function(){e.unsubscribe("triggerOpenFile",o)}}),[]),{inputRef:t,openFile:n}},u={left:0,top:8},a=function(e){var n=e.enableShortcuts,o=e.store,a=e.onClick,l=r.useContext(t.LocalizationContext).l10n,p=l&&l.open?l.open.openFile:"Open file",f=c(o),s=f.inputRef,m=f.openFile,v=n?t.isMac()?"Meta+O":"Ctrl+O":"";return r.createElement(t.Tooltip,{ariaControlsSuffix:"open",position:t.Position.BottomCenter,target:r.createElement("div",{className:"rpv-open__input-wrapper"},r.createElement("input",{ref:s,className:"rpv-open__input",multiple:!1,tabIndex:-1,title:"",type:"file",onChange:a}),r.createElement(t.MinimalButton,{ariaKeyShortcuts:v,ariaLabel:p,onClick:m},r.createElement(i,null))),content:function(){return p},offset:u})},l=function(e){var t=e.children,n=e.enableShortcuts,o=e.store;return(t||function(e){return r.createElement(a,{enableShortcuts:n,store:o,onClick:e.onClick})})({onClick:function(e){var t=e.target.files;if(t&&t.length){var n=o.get("openFile");n&&n(t[0])}}})},p=function(e){var n=e.store,o=e.onClick,u=r.useContext(t.LocalizationContext).l10n,a=u&&u.open?u.open.openFile:"Open file",l=c(n),p=l.inputRef,f=l.openFile;return r.createElement(t.MenuItem,{icon:r.createElement(i,null),onClick:f},r.createElement("div",{className:"rpv-open__input-wrapper"},r.createElement("input",{ref:p,className:"rpv-open__input",multiple:!1,tabIndex:-1,title:"",type:"file",onChange:o}),a))},f=function(e){var n=e.containerRef,o=e.store,i=function(e){if(!e.shiftKey&&!e.altKey&&"o"===e.key&&(t.isMac()?e.metaKey:e.ctrlKey)){var r=n.current;r&&document.activeElement&&r.contains(document.activeElement)&&(e.preventDefault(),o.update("triggerOpenFile",!0))}};return r.useEffect((function(){if(n.current)return document.addEventListener("keydown",i),function(){document.removeEventListener("keydown",i)}}),[n.current]),r.createElement(r.Fragment,null)};
/*! *****************************************************************************

@@ -3,0 +3,0 @@ Copyright (c) Microsoft Corporation.

{
"name": "@react-pdf-viewer/open",
"version": "2.9.1",
"version": "2.10.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.9.1"
"@react-pdf-viewer/core": "2.10.0"
},

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

},
"gitHead": "59d2a32a4609a5920d2d56a95d9cbdf5cc4770a7"
"gitHead": "9318fa98123d3bb4cef78be6fbff29b370a8b1e0"
}
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