@react-pdf-viewer/scroll-mode
Advanced tools
Comparing version 2.9.1 to 2.10.0
@@ -17,5 +17,3 @@ 'use strict'; | ||
enumerable: true, | ||
get: function () { | ||
return e[k]; | ||
} | ||
get: function () { return e[k]; } | ||
}); | ||
@@ -25,3 +23,3 @@ } | ||
} | ||
n['default'] = e; | ||
n["default"] = e; | ||
return Object.freeze(n); | ||
@@ -28,0 +26,0 @@ } |
@@ -16,2 +16,2 @@ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("@react-pdf-viewer/core");function t(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:function(){return e[t]}})}})),r.default=e,Object.freeze(r)}var o,c=t(e);exports.ScrollMode=void 0,(o=exports.ScrollMode||(exports.ScrollMode={})).Horizontal="Horizontal",o.Vertical="Vertical",o.Wrapped="Wrapped"; | ||
***************************************************************************** */ | ||
var l=function(){return(l=Object.assign||function(e){for(var r,t=1,o=arguments.length;t<o;t++)for(var c in r=arguments[t])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 t=e.children,o=e.mode,l=e.onClick,s=c.useContext(r.LocalizationContext).l10n,d="",u=c.createElement(i,null);switch(o){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 t({icon:u,label:d,onClick:l})},d={left:0,top:8},u=function(e){var t=e.isSelected,o=e.mode,l=e.onClick;return c.createElement(s,{mode:o,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:t,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),t=r[0],o=r[1],l=function(e){o(e)};return c.useEffect((function(){return e.subscribe("scrollMode",l),function(){e.unsubscribe("scrollMode",l)}}),[]),{scrollMode:t,switchTo:function(r){var t=e.get("getPagesContainer");if(t){var o=t();if(o){switch(r){case exports.ScrollMode.Vertical:o.classList.add("rpv-scroll-mode__vertical"),o.classList.remove("rpv-scroll-mode__horizontal"),o.classList.remove("rpv-scroll-mode__wrapped");break;case exports.ScrollMode.Horizontal:o.classList.add("rpv-scroll-mode__horizontal"),o.classList.remove("rpv-scroll-mode__vertical"),o.classList.remove("rpv-scroll-mode__wrapped");break;case exports.ScrollMode.Wrapped:o.classList.add("rpv-scroll-mode__wrapped"),o.classList.remove("rpv-scroll-mode__vertical"),o.classList.remove("rpv-scroll-mode__horizontal")}e.update("scrollMode",r)}}}}},p=function(e){var r=e.children,t=e.mode,o=e.store,l=m(o),n=l.scrollMode,i=l.switchTo,a=n===t;return(r||function(e){return c.createElement(u,{isSelected:a,mode:e.mode,onClick:e.onClick})})({isSelected:a,mode:t,onClick:function(){return i(t)}})},f=function(e){var t=e.isSelected,o=e.mode,l=e.onClick;return c.createElement(s,{mode:o,onClick:l},(function(e){return c.createElement(r.MenuItem,{checked:t,icon:e.icon,onClick:e.onClick},e.label)}))},v=function(e){var t=e.store,o=c.useContext(r.ThemeContext).direction===r.TextDirection.RightToLeft,l=m(t).switchTo,n=function(e){var r=e();if(r){o?r.classList.add("rpv-scroll-mode--rtl"):r.classList.remove("rpv-scroll-mode--rtl");var c=t.get("scrollMode")||exports.ScrollMode.Vertical;c!==exports.ScrollMode.Vertical&&l(c)}};return c.useEffect((function(){return t.subscribe("getPagesContainer",n),function(){t.unsubscribe("getPagesContainer",n)}}),[]),c.createElement(c.Fragment,null)};exports.HorizontalScrollingIcon=n,exports.VerticalScrollingIcon=i,exports.WrappedScrollingIcon=a,exports.scrollModePlugin=function(e){var t=c.useMemo((function(){return r.createStore({scrollMode:e&&e.scrollMode?e.scrollMode:exports.ScrollMode.Vertical})}),[]),o=function(e){return c.createElement(p,l({},e,{store:t}))};return{install:function(e){t.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:t}),r.children)),r},SwitchScrollMode:o,SwitchScrollModeButton:function(e){return c.createElement(o,{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(o,{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,t=1,o=arguments.length;t<o;t++)for(var c in r=arguments[t])Object.prototype.hasOwnProperty.call(r,c)&&(e[c]=r[c]);return e},l.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 t=e.children,o=e.mode,l=e.onClick,s=c.useContext(r.LocalizationContext).l10n,d="",u=c.createElement(i,null);switch(o){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 t({icon:u,label:d,onClick:l})},d={left:0,top:8},u=function(e){var t=e.isSelected,o=e.mode,l=e.onClick;return c.createElement(s,{mode:o,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:t,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),t=r[0],o=r[1],l=function(e){o(e)};return c.useEffect((function(){return e.subscribe("scrollMode",l),function(){e.unsubscribe("scrollMode",l)}}),[]),{scrollMode:t,switchTo:function(r){var t=e.get("getPagesContainer");if(t){var o=t();if(o){switch(r){case exports.ScrollMode.Vertical:o.classList.add("rpv-scroll-mode__vertical"),o.classList.remove("rpv-scroll-mode__horizontal"),o.classList.remove("rpv-scroll-mode__wrapped");break;case exports.ScrollMode.Horizontal:o.classList.add("rpv-scroll-mode__horizontal"),o.classList.remove("rpv-scroll-mode__vertical"),o.classList.remove("rpv-scroll-mode__wrapped");break;case exports.ScrollMode.Wrapped:o.classList.add("rpv-scroll-mode__wrapped"),o.classList.remove("rpv-scroll-mode__vertical"),o.classList.remove("rpv-scroll-mode__horizontal")}e.update("scrollMode",r)}}}}},p=function(e){var r=e.children,t=e.mode,o=e.store,l=m(o),n=l.scrollMode,i=l.switchTo,a=n===t;return(r||function(e){return c.createElement(u,{isSelected:a,mode:e.mode,onClick:e.onClick})})({isSelected:a,mode:t,onClick:function(){return i(t)}})},f=function(e){var t=e.isSelected,o=e.mode,l=e.onClick;return c.createElement(s,{mode:o,onClick:l},(function(e){return c.createElement(r.MenuItem,{checked:t,icon:e.icon,onClick:e.onClick},e.label)}))},v=function(e){var t=e.store,o=c.useContext(r.ThemeContext).direction===r.TextDirection.RightToLeft,l=m(t).switchTo,n=function(e){var r=e();if(r){o?r.classList.add("rpv-scroll-mode--rtl"):r.classList.remove("rpv-scroll-mode--rtl");var c=t.get("scrollMode")||exports.ScrollMode.Vertical;c!==exports.ScrollMode.Vertical&&l(c)}};return c.useEffect((function(){return t.subscribe("getPagesContainer",n),function(){t.unsubscribe("getPagesContainer",n)}}),[]),c.createElement(c.Fragment,null)};exports.HorizontalScrollingIcon=n,exports.VerticalScrollingIcon=i,exports.WrappedScrollingIcon=a,exports.scrollModePlugin=function(e){var t=c.useMemo((function(){return r.createStore({scrollMode:e&&e.scrollMode?e.scrollMode:exports.ScrollMode.Vertical})}),[]),o=function(e){return c.createElement(p,l({},e,{store:t}))};return{install:function(e){t.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:t}),r.children)),r},SwitchScrollMode:o,SwitchScrollModeButton:function(e){return c.createElement(o,{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(o,{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.9.1", | ||
"version": "2.10.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.9.1" | ||
"@react-pdf-viewer/core": "2.10.0" | ||
}, | ||
@@ -52,3 +52,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "59d2a32a4609a5920d2d56a95d9cbdf5cc4770a7" | ||
"gitHead": "9318fa98123d3bb4cef78be6fbff29b370a8b1e0" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22217
303
+ Added@react-pdf-viewer/core@2.10.0(transitive)
- Removed@react-pdf-viewer/core@2.9.1(transitive)