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.6.1 to 2.7.0

38

lib/cjs/full-screen.js

@@ -30,11 +30,2 @@ 'use strict';

var ExitFullScreenIcon = function () {
return (React__namespace.createElement(core.Icon, { size: 16 },
React__namespace.createElement("path", { d: "M11.5 23.499L11.5 14.499" }),
React__namespace.createElement("path", { d: "M7.5 18.499L11.5 14.499 15.5 18.499" }),
React__namespace.createElement("path", { d: "M11.5 1.499L11.5 10.499" }),
React__namespace.createElement("path", { d: "M7.5 6.499L11.5 10.499 15.5 6.499" }),
React__namespace.createElement("path", { d: "M20.5 12.499L1.5 12.499" })));
};
/*! *****************************************************************************

@@ -66,11 +57,9 @@ Copyright (c) Microsoft Corporation.

var FullScreenIcon = function () {
return (React__namespace.createElement(core.Icon, { size: 16 },
React__namespace.createElement("path", { d: "M0.5 12L23.5 12" }),
React__namespace.createElement("path", { d: "M11.5 1L11.5 23" }),
React__namespace.createElement("path", { d: "M8.5 4L11.5 1 14.5 4" }),
React__namespace.createElement("path", { d: "M20.5 9L23.5 12 20.5 15" }),
React__namespace.createElement("path", { d: "M3.5 15L0.5 12 3.5 9" }),
React__namespace.createElement("path", { d: "M14.5 20L11.5 23 8.5 20" })));
};
var FullScreenIcon = function () { return (React__namespace.createElement(core.Icon, { size: 16 },
React__namespace.createElement("path", { d: "M0.5 12L23.5 12" }),
React__namespace.createElement("path", { d: "M11.5 1L11.5 23" }),
React__namespace.createElement("path", { d: "M8.5 4L11.5 1 14.5 4" }),
React__namespace.createElement("path", { d: "M20.5 9L23.5 12 20.5 15" }),
React__namespace.createElement("path", { d: "M3.5 15L0.5 12 3.5 9" }),
React__namespace.createElement("path", { d: "M14.5 20L11.5 23 8.5 20" }))); };

@@ -82,3 +71,3 @@ var TOOLTIP_OFFSET = { left: 0, top: 8 };

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.MinimalButton, { onClick: onClick },
return (React__namespace.createElement(core.Tooltip, { ariaControlsSuffix: "full-screen-enter", position: core.Position.BottomCenter, target: React__namespace.createElement(core.MinimalButton, { ariaLabel: label, onClick: onClick },
React__namespace.createElement(FullScreenIcon, null)), content: function () { return label; }, offset: TOOLTIP_OFFSET }));

@@ -196,5 +185,14 @@ };

var ExitFullScreenIcon = function () { return (React__namespace.createElement(core.Icon, { size: 16 },
React__namespace.createElement("path", { d: "M11.5 23.499L11.5 14.499" }),
React__namespace.createElement("path", { d: "M7.5 18.499L11.5 14.499 15.5 18.499" }),
React__namespace.createElement("path", { d: "M11.5 1.499L11.5 10.499" }),
React__namespace.createElement("path", { d: "M7.5 6.499L11.5 10.499 15.5 6.499" }),
React__namespace.createElement("path", { d: "M20.5 12.499L1.5 12.499" }))); };
var ExitFullScreenButton = function (_a) {
var store = _a.store;
var _b = React__namespace.useState(false), isFullScreen = _b[0], setFullScreen = _b[1];
var l10n = React__namespace.useContext(core.LocalizationContext);
var exitFullScreenLabel = l10n && l10n.fullScreen ? l10n.fullScreen.exitFullScreen : 'Exit full screen';
var handleFullScreen = function (fullScreen) {

@@ -226,3 +224,3 @@ setFullScreen(fullScreen);

React__namespace.createElement("div", { className: "rpv-full-screen__exit-button-content" },
React__namespace.createElement(core.MinimalButton, { onClick: handleExitFullScreen },
React__namespace.createElement(core.MinimalButton, { ariaLabel: exitFullScreenLabel, onClick: handleExitFullScreen },
React__namespace.createElement(ExitFullScreenIcon, null)))))));

@@ -229,0 +227,0 @@ };

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

"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:"M11.5 23.499L11.5 14.499"}),l.createElement("path",{d:"M7.5 18.499L11.5 14.499 15.5 18.499"}),l.createElement("path",{d:"M11.5 1.499L11.5 10.499"}),l.createElement("path",{d:"M7.5 6.499L11.5 10.499 15.5 6.499"}),l.createElement("path",{d:"M20.5 12.499L1.5 12.499"}))},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:"M0.5 12L23.5 12"}),l.createElement("path",{d:"M11.5 1L11.5 23"}),l.createElement("path",{d:"M8.5 4L11.5 1 14.5 4"}),l.createElement("path",{d:"M20.5 9L23.5 12 20.5 15"}),l.createElement("path",{d:"M3.5 15L0.5 12 3.5 9"}),l.createElement("path",{d:"M14.5 20L11.5 23 8.5 20"}))},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.MinimalButton,{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"},E={ExitFullScreen:"webkitExitFullscreen",FullScreenChange:"webkitfullscreenchange",FullScreenElement:"webkitFullscreenElement",FullScreenEnabled:"webkitFullscreenEnabled",RequestFullScreen:"webkitRequestFullscreen"},f={ExitFullScreen:"msExitFullscreen",FullScreenChange:"MSFullscreenChange",FullScreenElement:"msFullscreenElement",FullScreenEnabled:"msFullscreenEnabled",RequestFullScreen:"msRequestFullscreen"},m="undefined"!=typeof window,F=m&&(r.FullScreenEnabled in document&&s||E.FullScreenEnabled in document&&E||f.FullScreenEnabled in document&&f)||s,S=function(e){return m?e[F.ExitFullScreen]():Promise.resolve({})},d=function(){return m?document[F.FullScreenElement]:null},b=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=d()===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,m&&document.addEventListener(F.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=d();return n&&n!==e?S(n):Promise.resolve()}().then((function(){var n;n=e,m&&n[F.RequestFullScreen]()}))}})},g=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)},p=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-content"},l.createElement(n.MinimalButton,{onClick:function(){o(!1);var e=t.get("getPagesContainer");if(e){var n=e();if(n){var r=d();r&&r===n&&S(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(b,c({},e,{store:t,onEnterFullScreen:r,onExitFullScreen:u}))},i=function(){return l.createElement(p,{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(g,{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 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(u=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)},c=function(){return l.createElement(n.Icon,{size:16},l.createElement("path",{d:"M0.5 12L23.5 12"}),l.createElement("path",{d:"M11.5 1L11.5 23"}),l.createElement("path",{d:"M8.5 4L11.5 1 14.5 4"}),l.createElement("path",{d:"M20.5 9L23.5 12 20.5 15"}),l.createElement("path",{d:"M3.5 15L0.5 12 3.5 9"}),l.createElement("path",{d:"M14.5 20L11.5 23 8.5 20"}))},o={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,{ariaControlsSuffix:"full-screen-enter",position:n.Position.BottomCenter,target:l.createElement(n.MinimalButton,{ariaLabel:u,onClick:t},l.createElement(c,null)),content:function(){return u},offset:o})};
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */!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 i={ExitFullScreen:"exitFullscreen",FullScreenChange:"fullscreenchange",FullScreenElement:"fullscreenElement",FullScreenEnabled:"fullscreenEnabled",RequestFullScreen:"requestFullscreen"},s={ExitFullScreen:"webkitExitFullscreen",FullScreenChange:"webkitfullscreenchange",FullScreenElement:"webkitFullscreenElement",FullScreenEnabled:"webkitFullscreenEnabled",RequestFullScreen:"webkitRequestFullscreen"},f={ExitFullScreen:"msExitFullscreen",FullScreenChange:"MSFullscreenChange",FullScreenElement:"msFullscreenElement",FullScreenEnabled:"msFullscreenEnabled",RequestFullScreen:"msRequestFullscreen"},E="undefined"!=typeof window,m=E&&(r.FullScreenEnabled in document&&i||s.FullScreenEnabled in document&&s||f.FullScreenEnabled in document&&f)||i,F=function(e){return E?e[m.ExitFullScreen]():Promise.resolve({})},S=function(){return E?document[m.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=S()===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,E&&document.addEventListener(m.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=S();return n&&n!==e?F(n):Promise.resolve()}().then((function(){var n;n=e,E&&n[m.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(c,null),onClick:t},u)},g=function(){return l.createElement(n.Icon,{size:16},l.createElement("path",{d:"M11.5 23.499L11.5 14.499"}),l.createElement("path",{d:"M7.5 18.499L11.5 14.499 15.5 18.499"}),l.createElement("path",{d:"M11.5 1.499L11.5 10.499"}),l.createElement("path",{d:"M7.5 6.499L11.5 10.499 15.5 6.499"}),l.createElement("path",{d:"M20.5 12.499L1.5 12.499"}))},p=function(e){var t=e.store,r=l.useState(!1),u=r[0],c=r[1],o=l.useContext(n.LocalizationContext),a=o&&o.fullScreen?o.fullScreen.exitFullScreen:"Exit full screen",i=function(e){c(e)};return l.useEffect((function(){return t.subscribe("isFullScreen",i),function(){t.unsubscribe("isFullScreen",i)}}),[]),l.createElement(l.Fragment,null,u&&l.createElement("div",{className:"rpv-full-screen__exit-button"},l.createElement("div",{className:"rpv-full-screen__exit-button-content"},l.createElement(n.MinimalButton,{ariaLabel:a,onClick:function(){c(!1);var e=t.get("getPagesContainer");if(e){var n=e();if(n){var r=S();r&&r===n&&F(document)}}}},l.createElement(g,null)))))};exports.ExitFullScreenIcon=g,exports.FullScreenIcon=c,exports.fullScreenPlugin=function(e){var t=l.useMemo((function(){return n.createStore({})}),[]),r=e&&e.onEnterFullScreen?e.onEnterFullScreen:function(){},c=e&&e.onExitFullScreen?e.onExitFullScreen:function(){},o=function(e){return l.createElement(d,u({},e,{store:t,onEnterFullScreen:r,onExitFullScreen:c}))},i=function(){return l.createElement(p,{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,u({},e))}))},EnterFullScreenMenuItem:function(e){return l.createElement(o,null,(function(n){return l.createElement(b,{onClick:function(){n.onClick(),e.onClick()}})}))}}};

@@ -10,8 +10,6 @@ /**

import * as React from 'react';
import { Plugin, SpecialZoomLevel } from '@react-pdf-viewer/core';
import { SpecialZoomLevel } from '@react-pdf-viewer/core';
import type { Plugin } from '@react-pdf-viewer/core';
export interface RenderEnterFullScreenProps {
onClick(): void;
}
// Types
export interface EnterFullScreenProps {

@@ -25,2 +23,7 @@ children?(props: RenderEnterFullScreenProps): React.ReactElement;

export interface RenderEnterFullScreenProps {
onClick(): void;
}
// Plugin
export interface FullScreenPlugin extends Plugin {

@@ -41,3 +44,4 @@ EnterFullScreen(props: EnterFullScreenProps): React.ReactElement;

// Components
export class ExitFullScreenIcon extends React.Component {}
export class FullScreenIcon extends React.Component {}
{
"name": "@react-pdf-viewer/full-screen",
"version": "2.6.1",
"version": "2.7.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.6.1"
"@react-pdf-viewer/core": "2.7.0"
},

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

},
"gitHead": "500247f24514da033bf92266f6903decaffebb68"
"gitHead": "331789d286847ac1c8a272c9df82bdab63ba4406"
}
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