@react-pdf-viewer/scroll-mode
Advanced tools
Comparing version 3.7.0 to 3.8.0
'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" | ||
} |
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
18055
255
+ Added@mapbox/node-pre-gyp@1.0.11(transitive)
+ Added@react-pdf-viewer/core@3.8.0(transitive)
+ Addedabbrev@1.1.1(transitive)
+ Addedagent-base@6.0.2(transitive)
+ Addedansi-regex@5.0.1(transitive)
+ Addedaproba@2.0.0(transitive)
+ Addedare-we-there-yet@2.0.0(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedcanvas@2.11.2(transitive)
+ Addedchownr@2.0.0(transitive)
+ Addedcolor-support@1.1.3(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedconsole-control-strings@1.1.0(transitive)
+ Addeddebug@4.3.7(transitive)
+ Addeddecompress-response@4.2.1(transitive)
+ Addeddelegates@1.0.0(transitive)
+ Addeddetect-libc@2.0.3(transitive)
+ Addedemoji-regex@8.0.0(transitive)
+ Addedfs-minipass@2.1.0(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedgauge@3.0.2(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedhas-unicode@2.0.1(transitive)
+ Addedhttps-proxy-agent@5.0.1(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedmake-dir@3.1.0(transitive)
+ Addedmimic-response@2.1.0(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedminipass@3.3.65.0.0(transitive)
+ Addedminizlib@2.1.2(transitive)
+ Addedmkdirp@1.0.4(transitive)
+ Addedms@2.1.3(transitive)
+ Addednan@2.22.0(transitive)
+ Addednode-fetch@2.7.0(transitive)
+ Addednopt@5.0.0(transitive)
+ Addednpmlog@5.0.1(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedpath2d@0.1.1(transitive)
+ Addedpath2d-polyfill@2.1.1(transitive)
+ Addedpdfjs-dist@3.11.174(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedrimraf@3.0.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsemver@6.3.17.6.3(transitive)
+ Addedset-blocking@2.0.0(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedsimple-concat@1.0.1(transitive)
+ Addedsimple-get@3.1.1(transitive)
+ Addedstring-width@4.2.3(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedstrip-ansi@6.0.1(transitive)
+ Addedtar@6.2.1(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)
+ Addedwide-align@1.1.5(transitive)
+ Addedwrappy@1.0.2(transitive)
+ Addedyallist@4.0.0(transitive)
- Removed@react-pdf-viewer/core@3.7.0(transitive)
- Removeddommatrix@1.0.3(transitive)
- Removedpdfjs-dist@2.16.105(transitive)
- Removedweb-streams-polyfill@3.3.3(transitive)
Updated@react-pdf-viewer/core@3.8.0