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 3.7.0 to 3.8.0

9

lib/cjs/scroll-mode.js
'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 HorizontalScrollingIcon = 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 c(e){if(e&&e.__esModule)return e;var c=Object.create(null);return e&&Object.keys(e).forEach((function(o){if("default"!==o){var t=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(c,o,t.get?t:{enumerable:!0,get:function(){return e[o]}})}})),c.default=e,Object.freeze(c)}var o=c(require("react")),t=function(){return o.createElement(e.Icon,{size:16},o.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"}))},r=function(){return r=Object.assign||function(e){for(var c,o=1,t=arguments.length;o<t;o++)for(var r in c=arguments[o])Object.prototype.hasOwnProperty.call(c,r)&&(e[r]=c[r]);return e},r.apply(this,arguments)},l=function(){return o.createElement(e.Icon,{size:16},o.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"}))},n=function(){return o.createElement(e.Icon,{size:16},o.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"}))},i=function(c){var r=c.children,i=c.mode,a=c.onClick,u=o.useContext(e.LocalizationContext).l10n,d="",s=o.createElement(l,null);switch(i){case e.ScrollMode.Horizontal:d=u&&u.scrollMode?u.scrollMode.horizontalScrolling:"Horizontal scrolling",s=o.createElement(t,null);break;case e.ScrollMode.Wrapped:d=u&&u.scrollMode?u.scrollMode.wrappedScrolling:"Wrapped scrolling",s=o.createElement(n,null);break;case e.ScrollMode.Vertical:default:d=u&&u.scrollMode?u.scrollMode.verticalScrolling:"Vertical scrolling",s=o.createElement(l,null)}return r({icon:s,label:d,onClick:a})},a={left:0,top:8},u=function(c){var t=c.isSelected,r=c.mode,l=c.onClick,n="";switch(r){case e.ScrollMode.Horizontal:n="scroll-mode__horizontal-button";break;case e.ScrollMode.Wrapped:n="scroll-mode__wrapped-button";break;case e.ScrollMode.Vertical:default:n="scroll-mode__vertical-button"}return o.createElement(i,{mode:r,onClick:l},(function(c){return o.createElement(e.Tooltip,{ariaControlsSuffix:"scroll-mode-switch",position:e.Position.BottomCenter,target:o.createElement(e.MinimalButton,{ariaLabel:c.label,isSelected:t,testId:n,onClick:c.onClick},c.icon),content:function(){return c.label},offset:a})}))},d=function(c){var t=c.children,r=c.mode,l=c.store,n=function(c){var t=o.useState(c.get("scrollMode")||e.ScrollMode.Vertical),r=t[0],l=t[1],n=function(e){l(e)};return o.useEffect((function(){return c.subscribe("scrollMode",n),function(){c.unsubscribe("scrollMode",n)}}),[]),{scrollMode:r}}(l).scrollMode,i=n===r;return(t||function(e){return o.createElement(u,{isSelected:i,mode:e.mode,onClick:e.onClick})})({isSelected:i,mode:r,onClick:function(){l.get("switchScrollMode")(r)}})},s=function(c){var t=c.isSelected,r=c.mode,l=c.onClick,n="";switch(r){case e.ScrollMode.Horizontal:n="scroll-mode__horizontal-menu";break;case e.ScrollMode.Wrapped:n="scroll-mode__wrapped-menu";break;case e.ScrollMode.Vertical:default:n="scroll-mode__vertical-menu"}return o.createElement(i,{mode:r,onClick:l},(function(c){return o.createElement(e.MenuItem,{checked:t,icon:c.icon,testId:n,onClick:c.onClick},c.label)}))};exports.HorizontalScrollingIcon=t,exports.VerticalScrollingIcon=l,exports.WrappedScrollingIcon=n,exports.scrollModePlugin=function(){var c=o.useMemo((function(){return e.createStore({scrollMode:e.ScrollMode.Vertical,switchScrollMode:function(){}})}),[]),t=function(e){return o.createElement(d,r({},e,{store:c}))};return{install:function(e){c.update("switchScrollMode",e.switchScrollMode)},onViewerStateChange:function(e){return c.update("scrollMode",e.scrollMode),e},switchScrollMode:function(e){c.get("switchScrollMode")(e)},SwitchScrollMode:t,SwitchScrollModeButton:function(e){return o.createElement(t,{mode:e.mode},(function(e){return o.createElement(u,{isSelected:e.isSelected,mode:e.mode,onClick:function(){e.onClick()}})}))},SwitchScrollModeMenuItem:function(e){return o.createElement(t,{mode:e.mode},(function(c){return o.createElement(s,{isSelected:c.isSelected,mode:c.mode,onClick:function(){c.onClick(),e.onClick()}})}))}}};
"use strict";var e=require("@react-pdf-viewer/core");function c(e){var c=Object.create(null);return e&&Object.keys(e).forEach((function(o){if("default"!==o){var t=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(c,o,t.get?t:{enumerable:!0,get:function(){return e[o]}})}})),c.default=e,Object.freeze(c)}var o=c(require("react")),t=function(){return o.createElement(e.Icon,{size:16},o.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"}))},l=function(){return l=Object.assign||function(e){for(var c,o=1,t=arguments.length;o<t;o++)for(var l in c=arguments[o])Object.prototype.hasOwnProperty.call(c,l)&&(e[l]=c[l]);return e},l.apply(this,arguments)},r=function(){return o.createElement(e.Icon,{size:16},o.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"}))},n=function(){return o.createElement(e.Icon,{size:16},o.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"}))},i=function(c){var l=c.children,i=c.mode,a=c.onClick,u=o.useContext(e.LocalizationContext).l10n,d="",s=o.createElement(r,null);switch(i){case e.ScrollMode.Horizontal:d=u&&u.scrollMode?u.scrollMode.horizontalScrolling:"Horizontal scrolling",s=o.createElement(t,null);break;case e.ScrollMode.Wrapped:d=u&&u.scrollMode?u.scrollMode.wrappedScrolling:"Wrapped scrolling",s=o.createElement(n,null);break;case e.ScrollMode.Vertical:default:d=u&&u.scrollMode?u.scrollMode.verticalScrolling:"Vertical scrolling",s=o.createElement(r,null)}return l({icon:s,label:d,onClick:a})},a={left:0,top:8},u=function(c){var t=c.isSelected,l=c.mode,r=c.onClick,n="";switch(l){case e.ScrollMode.Horizontal:n="scroll-mode__horizontal-button";break;case e.ScrollMode.Wrapped:n="scroll-mode__wrapped-button";break;case e.ScrollMode.Vertical:default:n="scroll-mode__vertical-button"}return o.createElement(i,{mode:l,onClick:r},(function(c){return o.createElement(e.Tooltip,{ariaControlsSuffix:"scroll-mode-switch",position:e.Position.BottomCenter,target:o.createElement(e.MinimalButton,{ariaLabel:c.label,isSelected:t,testId:n,onClick:c.onClick},c.icon),content:function(){return c.label},offset:a})}))},d=function(c){var t=c.children,l=c.mode,r=c.store,n=function(c){var t=o.useState(c.get("scrollMode")||e.ScrollMode.Vertical),l=t[0],r=t[1],n=function(e){r(e)};return o.useEffect((function(){return c.subscribe("scrollMode",n),function(){c.unsubscribe("scrollMode",n)}}),[]),{scrollMode:l}}(r).scrollMode,i=n===l;return(t||function(e){return o.createElement(u,{isSelected:i,mode:e.mode,onClick:e.onClick})})({isSelected:i,mode:l,onClick:function(){r.get("switchScrollMode")(l)}})},s=function(c){var t=c.isSelected,l=c.mode,r=c.onClick,n="";switch(l){case e.ScrollMode.Horizontal:n="scroll-mode__horizontal-menu";break;case e.ScrollMode.Wrapped:n="scroll-mode__wrapped-menu";break;case e.ScrollMode.Vertical:default:n="scroll-mode__vertical-menu"}return o.createElement(i,{mode:l,onClick:r},(function(c){return o.createElement(e.MenuItem,{checked:t,icon:c.icon,testId:n,onClick:c.onClick},c.label)}))};exports.HorizontalScrollingIcon=t,exports.VerticalScrollingIcon=r,exports.WrappedScrollingIcon=n,exports.scrollModePlugin=function(){var c=o.useMemo((function(){return e.createStore({scrollMode:e.ScrollMode.Vertical,switchScrollMode:function(){}})}),[]),t=function(e){return o.createElement(d,l({},e,{store:c}))};return{install:function(e){c.update("switchScrollMode",e.switchScrollMode)},onViewerStateChange:function(e){return c.update("scrollMode",e.scrollMode),e},switchScrollMode:function(e){c.get("switchScrollMode")(e)},SwitchScrollMode:t,SwitchScrollModeButton:function(e){return o.createElement(t,{mode:e.mode},(function(e){return o.createElement(u,{isSelected:e.isSelected,mode:e.mode,onClick:function(){e.onClick()}})}))},SwitchScrollModeMenuItem:function(e){return o.createElement(t,{mode:e.mode},(function(c){return o.createElement(s,{isSelected:c.isSelected,mode:c.mode,onClick:function(){c.onClick(),e.onClick()}})}))}}};
{
"name": "@react-pdf-viewer/scroll-mode",
"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"
},

@@ -49,5 +49,5 @@ "peerDependencies": {

"build": "npm run clean && npm run js",
"js": "cp src/index.d.ts lib && cp dist/index.js lib && rollup -c ../../rollup.config.js"
"js": "cp src/index.d.ts lib && cp dist/index.js lib && rollup -c ../../rollup.config.cjs"
},
"gitHead": "ccba5d4f68fa44ca7c242837280fcebf92b4f6a6"
"gitHead": "62b141a0ceb569147ca765ab6bbff76c5e480bf8"
}
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