Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@react-pdf-viewer/full-screen

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

Comparing version 2.5.0 to 2.6.0

8

lib/cjs/full-screen.js

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

var label = l10n && l10n.fullScreen ? l10n.fullScreen.enterFullScreen : 'Full screen';
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(FullScreenIcon, null)), content: function () { return label; }, offset: TOOLTIP_OFFSET }));

@@ -215,5 +215,5 @@ };

return (React__namespace.createElement(React__namespace.Fragment, null, isFullScreen &&
React__namespace.createElement("div", { className: 'rpv-full-screen-exit-button' },
React__namespace.createElement("div", { className: 'rpv-full-screen-exit-button-inner' },
React__namespace.createElement(core.Button, { onClick: handleExitFullScreen },
React__namespace.createElement("div", { className: 'rpv-full-screen__exit-button' },
React__namespace.createElement("div", { className: 'rpv-full-screen__exit-button-content' },
React__namespace.createElement(core.MinimalButton, { onClick: handleExitFullScreen },
React__namespace.createElement(ExitFullScreenIcon, null))))));

@@ -220,0 +220,0 @@ };

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),n=require("@react-pdf-viewer/core");function t(e){if(e&&e.__esModule)return e;var n=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}})),n.default=e,Object.freeze(n)}var r,l=t(e),u=function(){return l.createElement(n.Icon,{size:16},l.createElement("path",{d:"M10.515,9.514h3c0.552,0,1,0.448,1,1v3c0,0.552-0.448,1-1,1h-3c-0.552,0-1-0.448-1-1v-3\n C9.515,9.962,9.963,9.514,10.515,9.514z\n M0.531,23.499l6.984-6.985\n M16.515,7.514L23.5,0.529\n M21.515,7.514h-5v-5\n M7.515,21.514v-5 h-5\n M0.523,0.521l6.992,6.993\n M16.515,16.514l6.985,6.985\n M16.515,21.514v-5h5\n M2.515,7.514h5v-5"}))},c=function(){return(c=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var l in n=arguments[t])Object.prototype.hasOwnProperty.call(n,l)&&(e[l]=n[l]);return e}).apply(this,arguments)},o=function(){return l.createElement(n.Icon,{size:16},l.createElement("path",{d:"M15.5,8.499l8-8\n M0.5,23.499l8-8\n M5.5,23.499h-5v-5\n M23.5,5.499v-5h-5\n M15.5,15.499l8,8\n M0.5,0.499l8,8\n M0.5,5.499v-5h5\n M18.5,23.499h5v-5"}))},i={left:0,top:8},a=function(e){var t=e.onClick,r=l.useContext(n.LocalizationContext),u=r&&r.fullScreen?r.fullScreen.enterFullScreen:"Full screen";return l.createElement(n.Tooltip,{position:n.Position.BottomCenter,target:l.createElement(n.Button,{onClick:t},l.createElement(o,null)),content:function(){return u},offset:i})};!function(e){e[e.ExitFullScreen=0]="ExitFullScreen",e[e.FullScreenChange=1]="FullScreenChange",e[e.FullScreenElement=2]="FullScreenElement",e[e.FullScreenEnabled=3]="FullScreenEnabled",e[e.RequestFullScreen=4]="RequestFullScreen"}(r||(r={}));var s={ExitFullScreen:"exitFullscreen",FullScreenChange:"fullscreenchange",FullScreenElement:"fullscreenElement",FullScreenEnabled:"fullscreenEnabled",RequestFullScreen:"requestFullscreen"},f={ExitFullScreen:"webkitExitFullscreen",FullScreenChange:"webkitfullscreenchange",FullScreenElement:"webkitFullscreenElement",FullScreenEnabled:"webkitFullscreenEnabled",RequestFullScreen:"webkitRequestFullscreen"},E={ExitFullScreen:"msExitFullscreen",FullScreenChange:"MSFullscreenChange",FullScreenElement:"msFullscreenElement",FullScreenEnabled:"msFullscreenEnabled",RequestFullScreen:"msRequestFullscreen"},F="undefined"!=typeof window,S=F&&(r.FullScreenEnabled in document&&s||f.FullScreenEnabled in document&&f||E.FullScreenEnabled in document&&E)||s,m=function(e){return F?e[S.ExitFullScreen]():Promise.resolve({})},v=function(){return F?document[S.FullScreenElement]:null},d=function(e){var n=e.children,t=e.store,r=e.onEnterFullScreen,u=e.onExitFullScreen,c=l.useRef(t.get("getPagesContainer")?t.get("getPagesContainer")():null),o=function(){var e=v()===c.current;t.update("isFullScreen",e);var n=t.get("zoom");n&&(e?r(n):u(n))},i=function(e){var n;c.current=e(),n=o,F&&document.addEventListener(S.FullScreenChange,n)};l.useEffect((function(){return t.subscribe("getPagesContainer",i),function(){t.unsubscribe("getPagesContainer",i)}}),[]);return(n||function(e){return l.createElement(a,{onClick:e.onClick})})({onClick:function(){var e=c.current;e&&function(){var e=c.current;if(!e)return Promise.resolve();var n=v();return n&&n!==e?m(n):Promise.resolve()}().then((function(){var n;n=e,F&&n[S.RequestFullScreen]()}))}})},b=function(e){var t=e.onClick,r=l.useContext(n.LocalizationContext),u=r&&r.fullScreen?r.fullScreen.enterFullScreen:"Full screen";return l.createElement(n.MenuItem,{icon:l.createElement(o,null),onClick:t},u)},g=function(e){var t=e.store,r=l.useState(!1),c=r[0],o=r[1],i=function(e){o(e)};return l.useEffect((function(){return t.subscribe("isFullScreen",i),function(){t.unsubscribe("isFullScreen",i)}}),[]),l.createElement(l.Fragment,null,c&&l.createElement("div",{className:"rpv-full-screen-exit-button"},l.createElement("div",{className:"rpv-full-screen-exit-button-inner"},l.createElement(n.Button,{onClick:function(){o(!1);var e=t.get("getPagesContainer");if(e){var n=e();if(n){var r=v();r&&r===n&&m(document)}}}},l.createElement(u,null)))))};exports.ExitFullScreenIcon=u,exports.FullScreenIcon=o,exports.fullScreenPlugin=function(e){var t=l.useMemo((function(){return n.createStore({})}),[]),r=e&&e.onEnterFullScreen?e.onEnterFullScreen:function(){},u=e&&e.onExitFullScreen?e.onExitFullScreen:function(){},o=function(e){return l.createElement(d,c({},e,{store:t,onEnterFullScreen:r,onExitFullScreen:u}))},i=function(){return l.createElement(g,{store:t})};return{install:function(e){t.update("getPagesContainer",e.getPagesContainer),t.update("zoom",e.zoom)},renderViewer:function(e){var n=e.slot;return n.subSlot&&(n.subSlot.children=l.createElement(l.Fragment,null,l.createElement(i,null),n.subSlot.children)),n},EnterFullScreen:o,EnterFullScreenButton:function(){return l.createElement(o,null,(function(e){return l.createElement(a,c({},e))}))},EnterFullScreenMenuItem:function(e){return l.createElement(o,null,(function(n){return l.createElement(b,{onClick:function(){n.onClick(),e.onClick()}})}))}}};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),n=require("@react-pdf-viewer/core");function t(e){if(e&&e.__esModule)return e;var n=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var l=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,l.get?l:{enumerable:!0,get:function(){return e[t]}})}})),n.default=e,Object.freeze(n)}var l,r=t(e),u=function(){return r.createElement(n.Icon,{size:16},r.createElement("path",{d:"M10.515,9.514h3c0.552,0,1,0.448,1,1v3c0,0.552-0.448,1-1,1h-3c-0.552,0-1-0.448-1-1v-3\n C9.515,9.962,9.963,9.514,10.515,9.514z\n M0.531,23.499l6.984-6.985\n M16.515,7.514L23.5,0.529\n M21.515,7.514h-5v-5\n M7.515,21.514v-5 h-5\n M0.523,0.521l6.992,6.993\n M16.515,16.514l6.985,6.985\n M16.515,21.514v-5h5\n M2.515,7.514h5v-5"}))},c=function(){return(c=Object.assign||function(e){for(var n,t=1,l=arguments.length;t<l;t++)for(var r in n=arguments[t])Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e}).apply(this,arguments)},o=function(){return r.createElement(n.Icon,{size:16},r.createElement("path",{d:"M15.5,8.499l8-8\n M0.5,23.499l8-8\n M5.5,23.499h-5v-5\n M23.5,5.499v-5h-5\n M15.5,15.499l8,8\n M0.5,0.499l8,8\n M0.5,5.499v-5h5\n M18.5,23.499h5v-5"}))},i={left:0,top:8},a=function(e){var t=e.onClick,l=r.useContext(n.LocalizationContext),u=l&&l.fullScreen?l.fullScreen.enterFullScreen:"Full screen";return r.createElement(n.Tooltip,{position:n.Position.BottomCenter,target:r.createElement(n.MinimalButton,{onClick:t},r.createElement(o,null)),content:function(){return u},offset:i})};!function(e){e[e.ExitFullScreen=0]="ExitFullScreen",e[e.FullScreenChange=1]="FullScreenChange",e[e.FullScreenElement=2]="FullScreenElement",e[e.FullScreenEnabled=3]="FullScreenEnabled",e[e.RequestFullScreen=4]="RequestFullScreen"}(l||(l={}));var s={ExitFullScreen:"exitFullscreen",FullScreenChange:"fullscreenchange",FullScreenElement:"fullscreenElement",FullScreenEnabled:"fullscreenEnabled",RequestFullScreen:"requestFullscreen"},f={ExitFullScreen:"webkitExitFullscreen",FullScreenChange:"webkitfullscreenchange",FullScreenElement:"webkitFullscreenElement",FullScreenEnabled:"webkitFullscreenEnabled",RequestFullScreen:"webkitRequestFullscreen"},E={ExitFullScreen:"msExitFullscreen",FullScreenChange:"MSFullscreenChange",FullScreenElement:"msFullscreenElement",FullScreenEnabled:"msFullscreenEnabled",RequestFullScreen:"msRequestFullscreen"},F="undefined"!=typeof window,S=F&&(l.FullScreenEnabled in document&&s||f.FullScreenEnabled in document&&f||E.FullScreenEnabled in document&&E)||s,m=function(e){return F?e[S.ExitFullScreen]():Promise.resolve({})},v=function(){return F?document[S.FullScreenElement]:null},d=function(e){var n=e.children,t=e.store,l=e.onEnterFullScreen,u=e.onExitFullScreen,c=r.useRef(t.get("getPagesContainer")?t.get("getPagesContainer")():null),o=function(){var e=v()===c.current;t.update("isFullScreen",e);var n=t.get("zoom");n&&(e?l(n):u(n))},i=function(e){var n;c.current=e(),n=o,F&&document.addEventListener(S.FullScreenChange,n)};r.useEffect((function(){return t.subscribe("getPagesContainer",i),function(){t.unsubscribe("getPagesContainer",i)}}),[]);return(n||function(e){return r.createElement(a,{onClick:e.onClick})})({onClick:function(){var e=c.current;e&&function(){var e=c.current;if(!e)return Promise.resolve();var n=v();return n&&n!==e?m(n):Promise.resolve()}().then((function(){var n;n=e,F&&n[S.RequestFullScreen]()}))}})},b=function(e){var t=e.onClick,l=r.useContext(n.LocalizationContext),u=l&&l.fullScreen?l.fullScreen.enterFullScreen:"Full screen";return r.createElement(n.MenuItem,{icon:r.createElement(o,null),onClick:t},u)},g=function(e){var t=e.store,l=r.useState(!1),c=l[0],o=l[1],i=function(e){o(e)};return r.useEffect((function(){return t.subscribe("isFullScreen",i),function(){t.unsubscribe("isFullScreen",i)}}),[]),r.createElement(r.Fragment,null,c&&r.createElement("div",{className:"rpv-full-screen__exit-button"},r.createElement("div",{className:"rpv-full-screen__exit-button-content"},r.createElement(n.MinimalButton,{onClick:function(){o(!1);var e=t.get("getPagesContainer");if(e){var n=e();if(n){var l=v();l&&l===n&&m(document)}}}},r.createElement(u,null)))))};exports.ExitFullScreenIcon=u,exports.FullScreenIcon=o,exports.fullScreenPlugin=function(e){var t=r.useMemo((function(){return n.createStore({})}),[]),l=e&&e.onEnterFullScreen?e.onEnterFullScreen:function(){},u=e&&e.onExitFullScreen?e.onExitFullScreen:function(){},o=function(e){return r.createElement(d,c({},e,{store:t,onEnterFullScreen:l,onExitFullScreen:u}))},i=function(){return r.createElement(g,{store:t})};return{install:function(e){t.update("getPagesContainer",e.getPagesContainer),t.update("zoom",e.zoom)},renderViewer:function(e){var n=e.slot;return n.subSlot&&(n.subSlot.children=r.createElement(r.Fragment,null,r.createElement(i,null),n.subSlot.children)),n},EnterFullScreen:o,EnterFullScreenButton:function(){return r.createElement(o,null,(function(e){return r.createElement(a,c({},e))}))},EnterFullScreenMenuItem:function(e){return r.createElement(o,null,(function(n){return r.createElement(b,{onClick:function(){n.onClick(),e.onClick()}})}))}}};
{
"name": "@react-pdf-viewer/full-screen",
"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"
},

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

},
"gitHead": "3c7ba1ea082607670f4e2bf69d5312a14baf7057"
"gitHead": "91d6279570bd3d4672b131100392afd6e8658892"
}

Sorry, the diff of this file is not supported yet

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