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 🙏

© 2024 – Pkg Stats / Ryan Hefner

freeman-editor

v1.1.3

Published

react 富文本编辑器

Downloads

3

Readme

富文本编辑器

用于富文本编辑器需要上传图片等应用场景

//内置组件依赖antd,如果项目未使用请单独安装
npm i antd --save


npm i freeman-editor --save
    import Editor from 'freeman-editor';
    <Editor
        //如果不使用rc-form,则可以使用 value 和 onchange 自行处理组件内的值
        value={this.state.editorHtml}
        onchange={(value)=>{
            this.setState({
                editorHtml: value
            })
        }}

        //推荐使用 rc-form 的 getFieldProps 模式
        //{...getFieldProps('editorHtml')}

        // 编辑器宽度,默认为640
        width={640}
        // 压缩属性配置
        compressConfig={{
            // 图片最大尺寸,超过该尺寸时压缩,默认为640
            imgMaxWidth: 750,
            // 压缩后图片类型,如需透明效果请 输入 "image/png", 默认为jpg
            imgType: 'image/jpeg',
            // 压缩后图片质量,png格式下无效,取值范围 0~1。默认为1
            quality: 0.6,
        }}
        //上传属性配置
        uploadConfig={{
            // base64图片上传地址,默认为 /upload/base64。如果是bucky用户可以参考添加自己的action http://git.lianjia.com/sh-fe/store-component/blob/master/freeman-editor/src/base64.js
            url: 'https://xxx.com/upload/base64',
            // 上传时base64的key值,默认为 imgData
            name: 'imgData',
            // 返回json对象中哪个参数是图片的url ,此处模板中返回内容为 {name:"xxx",url:"http://xxxx.jpg"}
            resUrlField: 'url'
        }}

        //允许插入视频
        useVideo={false}
    />

已实现功能: · 富文本编辑器基础功能 · 编辑器压缩图片后上传图片 · 配置上传路径与参数 · 多个富文本编辑器同时使用,互不干扰 · 连续上传同一张图片 · 配置插入视频


计划未来迭代功能: · 定时保存草稿 · 恢复历史草稿版本 · 加入视频插入教程