
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@mokahr/react-zoom
Advanced tools
一个可缩放、拖动的react组件 支持mac双指手势
npm install --save @mokahr/react-zoom
import Zoom from '@mokahr/react-zoom';
/**
* toolbarRender 自定义toolbar render函数
*
* @param {Number} zoom 当前缩放比例 基数是100
* @param {Function} onZoom 改变缩放比例的function
* @param {Function} onReset 重置缩放 会根据当前children的宽高 计算出 合适的比例(刚好全显示 除去留白)
* 位置(水平居中,垂直置顶在顶部留白下)的function
* @param {Number} minZoom 当前最小缩放比例
* @param {Number} minZoom 当前最大缩放比例
*/
// demo
const toolbarRender = (zoom, onZoom, onReset, minZoom = 10, maxZoom = 200) => (
<div>
<div onClick={onReset}>复位</div>
<div
onClick={
zoom > minZoom
? () => onZoom(Math.ceil(zoom / 10) * 10 - 10)
: null
}
>-</div>
<div>{zoom}%</div>
<div
onClick={
zoom < maxZoom
? () => onZoom(Math.floor(zoom / 10) * 10 + 10)
: null
}
>+</div>
</div>
);
<Zoom
// 最小缩放比例 基数 100
minZoom={10}
// 最大缩放比例 基数 100
maxZoom={200}
// 顶部底部留白 xx px
padding={20}
// 自定义toolbar
toolbarRender={toolbarRender}
>
<div>需要缩放的组件</div>
</Zoom>
FAQs
zoom component for react
The npm package @mokahr/react-zoom receives a total of 1 weekly downloads. As such, @mokahr/react-zoom popularity was classified as not popular.
We found that @mokahr/react-zoom demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.