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

@react-pdf-viewer/scroll-mode

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

Comparing version 2.7.1 to 2.7.2

2

lib/cjs/scroll-mode.js

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

var children = _a.children, mode = _a.mode, onClick = _a.onClick;
var l10n = React__namespace.useContext(core.LocalizationContext);
var l10n = React__namespace.useContext(core.LocalizationContext).l10n;
var label = '';

@@ -77,0 +77,0 @@ var icon = React__namespace.createElement(VerticalScrollingIcon, null);

@@ -16,2 +16,2 @@ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("@react-pdf-viewer/core");function o(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach((function(o){if("default"!==o){var t=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(r,o,t.get?t:{enumerable:!0,get:function(){return e[o]}})}})),r.default=e,Object.freeze(r)}var t,c=o(e);exports.ScrollMode=void 0,(t=exports.ScrollMode||(exports.ScrollMode={})).Horizontal="Horizontal",t.Vertical="Vertical",t.Wrapped="Wrapped";

***************************************************************************** */
var l=function(){return(l=Object.assign||function(e){for(var r,o=1,t=arguments.length;o<t;o++)for(var c in r=arguments[o])Object.prototype.hasOwnProperty.call(r,c)&&(e[c]=r[c]);return e}).apply(this,arguments)},n=function(){return c.createElement(r.Icon,{size:16},c.createElement("path",{d:"M6.5,21.5c0,0.552-0.448,1-1,1h-4c-0.552,0-1-0.448-1-1v-20c0-0.552,0.448-1,1-1h4c0.552,0,1,0.448,1,1V21.5z\n M14.5,21.5c0,0.552-0.448,1-1,1h-4c-0.552,0-1-0.448-1-1v-20c0-0.552,0.448-1,1-1h4c0.552,0,1,0.448,1,1V21.5z\n M22.5,21.5 c0,0.552-0.448,1-1,1h-4c-0.552,0-1-0.448-1-1v-20c0-0.552,0.448-1,1-1h4c0.552,0,1,0.448,1,1V21.5z"}))},i=function(){return c.createElement(r.Icon,{size:16},c.createElement("path",{d:"M23.5,5.5c0,0.552-0.448,1-1,1h-21c-0.552,0-1-0.448-1-1v-3c0-0.552,0.448-1,1-1h21c0.552,0,1,0.448,1,1V5.5z\n M23.5,13.5c0,0.552-0.448,1-1,1h-21c-0.552,0-1-0.448-1-1v-3c0-0.552,0.448-1,1-1h21c0.552,0,1,0.448,1,1V13.5z\n M23.5,21.5 c0,0.552-0.448,1-1,1h-21c-0.552,0-1-0.448-1-1v-3c0-0.552,0.448-1,1-1h21c0.552,0,1,0.448,1,1V21.5z"}))},a=function(){return c.createElement(r.Icon,{size:16},c.createElement("path",{d:"M10.5,9.5c0,0.552-0.448,1-1,1h-8c-0.552,0-1-0.448-1-1v-8c0-0.552,0.448-1,1-1h8c0.552,0,1,0.448,1,1V9.5z\n M23.5,9.5c0,0.552-0.448,1-1,1h-8c-0.552,0-1-0.448-1-1v-8c0-0.552,0.448-1,1-1h8c0.552,0,1,0.448,1,1V9.5z\n M10.5,22.5 c0,0.552-0.448,1-1,1h-8c-0.552,0-1-0.448-1-1v-8c0-0.552,0.448-1,1-1h8c0.552,0,1,0.448,1,1V22.5z\n M23.5,22.5c0,0.552-0.448,1-1,1 h-8c-0.552,0-1-0.448-1-1v-8c0-0.552,0.448-1,1-1h8c0.552,0,1,0.448,1,1V22.5z"}))},s=function(e){var o=e.children,t=e.mode,l=e.onClick,s=c.useContext(r.LocalizationContext),d="",u=c.createElement(i,null);switch(t){case exports.ScrollMode.Horizontal:d=s&&s.scrollMode?s.scrollMode.horizontalScrolling:"Horizontal scrolling",u=c.createElement(n,null);break;case exports.ScrollMode.Wrapped:d=s&&s.scrollMode?s.scrollMode.wrappedScrolling:"Wrapped scrolling",u=c.createElement(a,null);break;case exports.ScrollMode.Vertical:default:d=s&&s.scrollMode?s.scrollMode.verticalScrolling:"Vertical scrolling",u=c.createElement(i,null)}return o({icon:u,label:d,onClick:l})},d={left:0,top:8},u=function(e){var o=e.isSelected,t=e.mode,l=e.onClick;return c.createElement(s,{mode:t,onClick:l},(function(e){return c.createElement(r.Tooltip,{ariaControlsSuffix:"scroll-mode-switch",position:r.Position.BottomCenter,target:c.createElement(r.MinimalButton,{ariaLabel:e.label,isSelected:o,onClick:e.onClick},e.icon),content:function(){return e.label},offset:d})}))},m=function(e){var r=c.useState(e.get("scrollMode")||exports.ScrollMode.Vertical),o=r[0],t=r[1],l=function(e){t(e)};return c.useEffect((function(){return e.subscribe("scrollMode",l),function(){e.unsubscribe("scrollMode",l)}}),[]),{scrollMode:o,switchTo:function(r){var o=e.get("getPagesContainer");if(o){var t=o();if(t){switch(r){case exports.ScrollMode.Vertical:t.classList.add("rpv-scroll-mode__vertical"),t.classList.remove("rpv-scroll-mode__horizontal"),t.classList.remove("rpv-scroll-mode__wrapped");break;case exports.ScrollMode.Horizontal:t.classList.add("rpv-scroll-mode__horizontal"),t.classList.remove("rpv-scroll-mode__vertical"),t.classList.remove("rpv-scroll-mode__wrapped");break;case exports.ScrollMode.Wrapped:t.classList.add("rpv-scroll-mode__wrapped"),t.classList.remove("rpv-scroll-mode__vertical"),t.classList.remove("rpv-scroll-mode__horizontal")}e.update("scrollMode",r)}}}}},p=function(e){var r=e.children,o=e.mode,t=e.store,l=m(t),n=l.scrollMode,i=l.switchTo,a=n===o;return(r||function(e){return c.createElement(u,{isSelected:a,mode:e.mode,onClick:e.onClick})})({isSelected:a,mode:o,onClick:function(){return i(o)}})},f=function(e){var o=e.isSelected,t=e.mode,l=e.onClick;return c.createElement(s,{mode:t,onClick:l},(function(e){return c.createElement(r.MenuItem,{checked:o,icon:e.icon,onClick:e.onClick},e.label)}))},v=function(e){var r=e.store,o=m(r).switchTo,t=function(e){if(e()){var t=r.get("scrollMode")||exports.ScrollMode.Vertical;t!==exports.ScrollMode.Vertical&&o(t)}};return c.useEffect((function(){return r.subscribe("getPagesContainer",t),function(){r.unsubscribe("getPagesContainer",t)}}),[]),c.createElement(c.Fragment,null)};exports.HorizontalScrollingIcon=n,exports.VerticalScrollingIcon=i,exports.WrappedScrollingIcon=a,exports.scrollModePlugin=function(e){var o=c.useMemo((function(){return r.createStore({scrollMode:e&&e.scrollMode?e.scrollMode:exports.ScrollMode.Vertical})}),[]),t=function(e){return c.createElement(p,l({},e,{store:o}))};return{install:function(e){o.update("getPagesContainer",e.getPagesContainer)},renderViewer:function(e){var r=e.slot;return r&&r.children&&(r.children=c.createElement(c.Fragment,null,c.createElement(v,{store:o}),r.children)),r},SwitchScrollMode:t,SwitchScrollModeButton:function(e){return c.createElement(t,{mode:e.mode},(function(e){return c.createElement(u,{isSelected:e.isSelected,mode:e.mode,onClick:function(){e.onClick()}})}))},SwitchScrollModeMenuItem:function(e){return c.createElement(t,{mode:e.mode},(function(r){return c.createElement(f,{isSelected:r.isSelected,mode:r.mode,onClick:function(){r.onClick(),e.onClick()}})}))}}};
var l=function(){return(l=Object.assign||function(e){for(var r,o=1,t=arguments.length;o<t;o++)for(var c in r=arguments[o])Object.prototype.hasOwnProperty.call(r,c)&&(e[c]=r[c]);return e}).apply(this,arguments)},n=function(){return c.createElement(r.Icon,{size:16},c.createElement("path",{d:"M6.5,21.5c0,0.552-0.448,1-1,1h-4c-0.552,0-1-0.448-1-1v-20c0-0.552,0.448-1,1-1h4c0.552,0,1,0.448,1,1V21.5z\n M14.5,21.5c0,0.552-0.448,1-1,1h-4c-0.552,0-1-0.448-1-1v-20c0-0.552,0.448-1,1-1h4c0.552,0,1,0.448,1,1V21.5z\n M22.5,21.5 c0,0.552-0.448,1-1,1h-4c-0.552,0-1-0.448-1-1v-20c0-0.552,0.448-1,1-1h4c0.552,0,1,0.448,1,1V21.5z"}))},i=function(){return c.createElement(r.Icon,{size:16},c.createElement("path",{d:"M23.5,5.5c0,0.552-0.448,1-1,1h-21c-0.552,0-1-0.448-1-1v-3c0-0.552,0.448-1,1-1h21c0.552,0,1,0.448,1,1V5.5z\n M23.5,13.5c0,0.552-0.448,1-1,1h-21c-0.552,0-1-0.448-1-1v-3c0-0.552,0.448-1,1-1h21c0.552,0,1,0.448,1,1V13.5z\n M23.5,21.5 c0,0.552-0.448,1-1,1h-21c-0.552,0-1-0.448-1-1v-3c0-0.552,0.448-1,1-1h21c0.552,0,1,0.448,1,1V21.5z"}))},a=function(){return c.createElement(r.Icon,{size:16},c.createElement("path",{d:"M10.5,9.5c0,0.552-0.448,1-1,1h-8c-0.552,0-1-0.448-1-1v-8c0-0.552,0.448-1,1-1h8c0.552,0,1,0.448,1,1V9.5z\n M23.5,9.5c0,0.552-0.448,1-1,1h-8c-0.552,0-1-0.448-1-1v-8c0-0.552,0.448-1,1-1h8c0.552,0,1,0.448,1,1V9.5z\n M10.5,22.5 c0,0.552-0.448,1-1,1h-8c-0.552,0-1-0.448-1-1v-8c0-0.552,0.448-1,1-1h8c0.552,0,1,0.448,1,1V22.5z\n M23.5,22.5c0,0.552-0.448,1-1,1 h-8c-0.552,0-1-0.448-1-1v-8c0-0.552,0.448-1,1-1h8c0.552,0,1,0.448,1,1V22.5z"}))},s=function(e){var o=e.children,t=e.mode,l=e.onClick,s=c.useContext(r.LocalizationContext).l10n,d="",u=c.createElement(i,null);switch(t){case exports.ScrollMode.Horizontal:d=s&&s.scrollMode?s.scrollMode.horizontalScrolling:"Horizontal scrolling",u=c.createElement(n,null);break;case exports.ScrollMode.Wrapped:d=s&&s.scrollMode?s.scrollMode.wrappedScrolling:"Wrapped scrolling",u=c.createElement(a,null);break;case exports.ScrollMode.Vertical:default:d=s&&s.scrollMode?s.scrollMode.verticalScrolling:"Vertical scrolling",u=c.createElement(i,null)}return o({icon:u,label:d,onClick:l})},d={left:0,top:8},u=function(e){var o=e.isSelected,t=e.mode,l=e.onClick;return c.createElement(s,{mode:t,onClick:l},(function(e){return c.createElement(r.Tooltip,{ariaControlsSuffix:"scroll-mode-switch",position:r.Position.BottomCenter,target:c.createElement(r.MinimalButton,{ariaLabel:e.label,isSelected:o,onClick:e.onClick},e.icon),content:function(){return e.label},offset:d})}))},m=function(e){var r=c.useState(e.get("scrollMode")||exports.ScrollMode.Vertical),o=r[0],t=r[1],l=function(e){t(e)};return c.useEffect((function(){return e.subscribe("scrollMode",l),function(){e.unsubscribe("scrollMode",l)}}),[]),{scrollMode:o,switchTo:function(r){var o=e.get("getPagesContainer");if(o){var t=o();if(t){switch(r){case exports.ScrollMode.Vertical:t.classList.add("rpv-scroll-mode__vertical"),t.classList.remove("rpv-scroll-mode__horizontal"),t.classList.remove("rpv-scroll-mode__wrapped");break;case exports.ScrollMode.Horizontal:t.classList.add("rpv-scroll-mode__horizontal"),t.classList.remove("rpv-scroll-mode__vertical"),t.classList.remove("rpv-scroll-mode__wrapped");break;case exports.ScrollMode.Wrapped:t.classList.add("rpv-scroll-mode__wrapped"),t.classList.remove("rpv-scroll-mode__vertical"),t.classList.remove("rpv-scroll-mode__horizontal")}e.update("scrollMode",r)}}}}},p=function(e){var r=e.children,o=e.mode,t=e.store,l=m(t),n=l.scrollMode,i=l.switchTo,a=n===o;return(r||function(e){return c.createElement(u,{isSelected:a,mode:e.mode,onClick:e.onClick})})({isSelected:a,mode:o,onClick:function(){return i(o)}})},f=function(e){var o=e.isSelected,t=e.mode,l=e.onClick;return c.createElement(s,{mode:t,onClick:l},(function(e){return c.createElement(r.MenuItem,{checked:o,icon:e.icon,onClick:e.onClick},e.label)}))},v=function(e){var r=e.store,o=m(r).switchTo,t=function(e){if(e()){var t=r.get("scrollMode")||exports.ScrollMode.Vertical;t!==exports.ScrollMode.Vertical&&o(t)}};return c.useEffect((function(){return r.subscribe("getPagesContainer",t),function(){r.unsubscribe("getPagesContainer",t)}}),[]),c.createElement(c.Fragment,null)};exports.HorizontalScrollingIcon=n,exports.VerticalScrollingIcon=i,exports.WrappedScrollingIcon=a,exports.scrollModePlugin=function(e){var o=c.useMemo((function(){return r.createStore({scrollMode:e&&e.scrollMode?e.scrollMode:exports.ScrollMode.Vertical})}),[]),t=function(e){return c.createElement(p,l({},e,{store:o}))};return{install:function(e){o.update("getPagesContainer",e.getPagesContainer)},renderViewer:function(e){var r=e.slot;return r&&r.children&&(r.children=c.createElement(c.Fragment,null,c.createElement(v,{store:o}),r.children)),r},SwitchScrollMode:t,SwitchScrollModeButton:function(e){return c.createElement(t,{mode:e.mode},(function(e){return c.createElement(u,{isSelected:e.isSelected,mode:e.mode,onClick:function(){e.onClick()}})}))},SwitchScrollModeMenuItem:function(e){return c.createElement(t,{mode:e.mode},(function(r){return c.createElement(f,{isSelected:r.isSelected,mode:r.mode,onClick:function(){r.onClick(),e.onClick()}})}))}}};
{
"name": "@react-pdf-viewer/scroll-mode",
"version": "2.7.1",
"version": "2.7.2",
"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.7.1"
"@react-pdf-viewer/core": "2.7.2"
},

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

},
"gitHead": "e7e1a5a6c3c2706198c71b57fff3cff285c5fe54"
"gitHead": "d5084b21f1e89e11ee45764849b8c61e4e6f4216"
}
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