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.3.1 to 3.3.2

8

lib/cjs/scroll-mode.js

@@ -5,4 +5,4 @@ 'use strict';

var core = require('@react-pdf-viewer/core');
var React = require('react');
var core = require('@react-pdf-viewer/core');

@@ -29,2 +29,5 @@ function _interopNamespace(e) {

var HorizontalScrollingIcon = function () { return (React__namespace.createElement(core.Icon, { size: 16 },
React__namespace.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" }))); };
/******************************************************************************

@@ -56,5 +59,2 @@ Copyright (c) Microsoft Corporation.

var HorizontalScrollingIcon = function () { return (React__namespace.createElement(core.Icon, { size: 16 },
React__namespace.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" }))); };
var VerticalScrollingIcon = function () { return (React__namespace.createElement(core.Icon, { size: 16 },

@@ -61,0 +61,0 @@ React__namespace.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" }))); };

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

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

@@ -9,5 +9,5 @@ /**

import type { Plugin } from '@react-pdf-viewer/core';
import { ScrollMode } from '@react-pdf-viewer/core';
import * as React from 'react';
import { ScrollMode } from '@react-pdf-viewer/core';
import type { Plugin } from '@react-pdf-viewer/core';

@@ -14,0 +14,0 @@ // Types

{
"name": "@react-pdf-viewer/scroll-mode",
"version": "3.3.1",
"version": "3.3.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": "3.3.1"
"@react-pdf-viewer/core": "3.3.2"
},

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

},
"gitHead": "3cffac5b07d0745738913f28797527363c0b0594"
"gitHead": "9da7355cc710985d46ac3a0e70c8d6ada994c1a9"
}
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