npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

leafer-x-clip-resize-inner-editor

v1.10.0

Published

leafer 裁剪插件,提供支持裁剪的图片组件,支持双击开启内部编辑进行裁剪

Downloads

609

Readme

leafer-x-clip-resize-inner-editor

npm version npm downloads bundle License

leafer 图片裁剪 内部编辑器插件

安装

npm i leafer-x-clip-resize-inner-editor

特点

  1. 添加了自定义元素 ClipImage(裁剪的必要元素)
  2. 实现:移动、缩放、旋转裁剪,支持图片拉伸
  3. 基于 innerEditor 开发规范开发,支持双击开启/关闭内部编辑
  4. 详细使用方式移步 [playground]

样式

  1. 基础线框样式和旋转按钮会继承配置的编辑器样式
  2. 其他控制点为表现出明显的裁剪,使用了新的裁剪样式

截图示例

GIF 示例

快速使用

import { App } from 'leafer-ui'
import { ClipImage, ClipResizeEditor } from 'leafer-x-clip-resize-inner-editor'
import '@leafer-in/editor'
import '@leafer-in/viewport'
import '@leafer-in/view'

// 为元素注册内部编辑器
ClipImage.setEditInner(ClipResizeEditor.name)

const app = new App({
  view: window,
  editor: {},
})

// 最简创建, 默认无剪裁
const ui = new ClipImage({
  url: '/static/test2.jpg',
  editable: true,
})

app.tree.add(ui)

License

MIT License © 2024-PRESENT XiaDeYu

MIT License © 2023-PRESENT Chao (Leafer) Wan