@react-pdf-viewer/zoom
Advanced tools
Comparing version 2.6.0 to 2.6.1
@@ -89,5 +89,4 @@ 'use strict'; | ||
var LEVELS$1 = [ | ||
0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1, 1.3, 1.5, 1.7, 1.9, | ||
2.1, 2.4, 2.7, 3.0, 3.3, 3.7, 4.1, 4.6, 5.1, 5.7, 6.3, 7.0, 7.7, 8.5, 9.4, | ||
10, | ||
0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1, 1.3, 1.5, 1.7, 1.9, 2.1, 2.4, 2.7, 3.0, 3.3, 3.7, 4.1, 4.6, | ||
5.1, 5.7, 6.3, 7.0, 7.7, 8.5, 9.4, 10, | ||
]; | ||
@@ -103,3 +102,3 @@ var increase = function (currentLevel) { | ||
var isMac = function () { return (typeof window !== "undefined") ? /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform) : false; }; | ||
var isMac = function () { return (typeof window !== 'undefined' ? /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform) : false); }; | ||
var ShortcutHandler = function (_a) { | ||
@@ -154,3 +153,3 @@ var containerRef = _a.containerRef, store = _a.store; | ||
}, [containerRef.current]); | ||
return (React__namespace.createElement(React__namespace.Fragment, null)); | ||
return React__namespace.createElement(React__namespace.Fragment, null); | ||
}; | ||
@@ -174,8 +173,10 @@ | ||
var renderTarget = function (toggle) { | ||
var click = function () { toggle(); }; | ||
return (React__namespace.createElement("span", { className: 'rpv-zoom__popover-target', onClick: click }, | ||
React__namespace.createElement("span", { className: 'rpv-zoom__popover-target-scale' }, | ||
var click = function () { | ||
toggle(); | ||
}; | ||
return (React__namespace.createElement("span", { className: "rpv-zoom__popover-target", onClick: click }, | ||
React__namespace.createElement("span", { className: "rpv-zoom__popover-target-scale" }, | ||
Math.round(scale * 100), | ||
"%"), | ||
React__namespace.createElement("span", { className: 'rpv-zoom__popover-target-arrow' }))); | ||
React__namespace.createElement("span", { className: "rpv-zoom__popover-target-arrow" }))); | ||
}; | ||
@@ -185,3 +186,6 @@ var renderContent = function (toggle) { return (React__namespace.createElement(core.Menu, null, | ||
var level = k; | ||
var clickMenuItem = function () { toggle(); onZoom(level); }; | ||
var clickMenuItem = function () { | ||
toggle(); | ||
onZoom(level); | ||
}; | ||
return (React__namespace.createElement(core.MenuItem, { key: level, onClick: clickMenuItem }, getSpcialLevelLabel(level))); | ||
@@ -191,3 +195,6 @@ }), | ||
LEVELS.map(function (level) { | ||
var clickMenuItem = function () { toggle(); onZoom(level); }; | ||
var clickMenuItem = function () { | ||
toggle(); | ||
onZoom(level); | ||
}; | ||
return (React__namespace.createElement(core.MenuItem, { key: level, onClick: clickMenuItem }, Math.round(level * 100) + "%")); | ||
@@ -284,11 +291,17 @@ }))); }; | ||
var store = React__namespace.useMemo(function () { return core.createStore({}); }, []); | ||
var CurrentScaleDecorator = function (props) { return (React__namespace.createElement(CurrentScale, __assign({}, props, { store: store }))); }; | ||
var ZoomInDecorator = function (props) { return (React__namespace.createElement(ZoomIn, __assign({}, props, { store: store }))); }; | ||
var ZoomInButtonDecorator = function () { return (React__namespace.createElement(ZoomInDecorator, null, function (props) { return React__namespace.createElement(ZoomInButton, __assign({}, props)); })); }; | ||
var ZoomInMenuItemDecorator = function (props) { return (React__namespace.createElement(ZoomInDecorator, null, function (p) { return React__namespace.createElement(ZoomInMenuItem, { onClick: function () { p.onClick(); props.onClick(); } }); })); }; | ||
var ZoomOutDecorator = function (props) { return (React__namespace.createElement(ZoomOut, __assign({}, props, { store: store }))); }; | ||
var ZoomOutButtonDecorator = function () { return (React__namespace.createElement(ZoomOutDecorator, null, function (props) { return React__namespace.createElement(ZoomOutButton, __assign({}, props)); })); }; | ||
var ZoomOutMenuItemDecorator = function (props) { return (React__namespace.createElement(ZoomOutDecorator, null, function (p) { return React__namespace.createElement(ZoomOutMenuItem, { onClick: function () { p.onClick(); props.onClick(); } }); })); }; | ||
var CurrentScaleDecorator = function (props) { return React__namespace.createElement(CurrentScale, __assign({}, props, { store: store })); }; | ||
var ZoomInDecorator = function (props) { return React__namespace.createElement(ZoomIn, __assign({}, props, { store: store })); }; | ||
var ZoomInButtonDecorator = function () { return React__namespace.createElement(ZoomInDecorator, null, function (props) { return React__namespace.createElement(ZoomInButton, __assign({}, props)); }); }; | ||
var ZoomInMenuItemDecorator = function (props) { return (React__namespace.createElement(ZoomInDecorator, null, function (p) { return (React__namespace.createElement(ZoomInMenuItem, { onClick: function () { | ||
p.onClick(); | ||
props.onClick(); | ||
} })); })); }; | ||
var ZoomOutDecorator = function (props) { return React__namespace.createElement(ZoomOut, __assign({}, props, { store: store })); }; | ||
var ZoomOutButtonDecorator = function () { return React__namespace.createElement(ZoomOutDecorator, null, function (props) { return React__namespace.createElement(ZoomOutButton, __assign({}, props)); }); }; | ||
var ZoomOutMenuItemDecorator = function (props) { return (React__namespace.createElement(ZoomOutDecorator, null, function (p) { return (React__namespace.createElement(ZoomOutMenuItem, { onClick: function () { | ||
p.onClick(); | ||
props.onClick(); | ||
} })); })); }; | ||
var ZoomDecorator = function (props) { return React__namespace.createElement(Zoom, __assign({}, props, { store: store })); }; | ||
var ZoomPopoverDecorator = function () { return (React__namespace.createElement(ZoomDecorator, null, function (props) { return React__namespace.createElement(ZoomPopover, __assign({}, props)); })); }; | ||
var ZoomPopoverDecorator = function () { return React__namespace.createElement(ZoomDecorator, null, function (props) { return React__namespace.createElement(ZoomPopover, __assign({}, props)); }); }; | ||
var renderViewer = function (props) { | ||
@@ -302,3 +315,3 @@ var slot = props.slot; | ||
React__namespace.createElement(ShortcutHandler, { containerRef: props.containerRef, store: store }), | ||
slot.children)) | ||
slot.children)), | ||
}; | ||
@@ -305,0 +318,0 @@ return __assign(__assign({}, slot), updateSlot); |
{ | ||
"name": "@react-pdf-viewer/zoom", | ||
"version": "2.6.0", | ||
"version": "2.6.1", | ||
"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.6.0" | ||
"@react-pdf-viewer/core": "2.6.1" | ||
}, | ||
@@ -53,3 +53,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "91d6279570bd3d4672b131100392afd6e8658892" | ||
"gitHead": "500247f24514da033bf92266f6903decaffebb68" | ||
} |
Sorry, the diff of this file is not supported yet
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
26515
425
+ Added@react-pdf-viewer/core@2.6.1(transitive)
- Removed@react-pdf-viewer/core@2.6.0(transitive)
Updated@react-pdf-viewer/core@2.6.1