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 🙏

© 2026 – Pkg Stats / Ryan Hefner

hh-slate-editor

v1.1.0

Published

Slate Editor customized by Hahow

Downloads

9

Readme

hh-slate-editor

Slate Editor customized by Hahow

Install

找 release 裡面的檔案,複製網址。例如:

npm install --save https://github.com/hahow/hh-slate-editor/releases/download/1.0.1/hh-slate-editor-1.0.1.tgz

or

yarn add https://github.com/hahow/hh-slate-editor/releases/download/1.0.1/hh-slate-editor-1.0.1.tgz

ScreenShot

Usage

Example

import React, { Component } from 'react';

import SlateEditor from 'hh-slate-editor';

class Demo extends Component {
  constructor (props) {
    super(props);
    this.state = {
      value,
    };
  }

  onChange = (newValue) => {
    this.setState({
      value: newValue,
    });
  }

  uploadImage = (file, fulfilledCallback) => {
    // You need to implement the function to upload image
  }

  onWarning = (msg) => {
  }

  render () {
    return (
      <SlateEditor
        value={value}
        onChange={this.onChange}
        debounceTime={250}
        height={350}
        debugMode={false}
        uploadImage={this.uploadImage}
        onWarning={this.onWarning}
        normalizeValue={false}
        normalizePastedValue={false}
        errorMessage=""
      />
    );
  }
}

Props Explanation

| prop | type | explanation | default value | |---|---|---|---| | value | String | 編輯器文字內容 (html string) | "<p></p>" | | onChange(newValue) | function | 內容有更改時的 onChange。會有 debounce,時間為 debounceTimenewValue 為更動後新的值。 | | | debounceTime | Number | debounce time (in 毫秒) | 250 | | height | Number | 編輯器預設的寬度 (in px) | 350 | | uploadImage(file, fulfilledCallback) | function | 上傳圖片的 function。 file 為 file reference object ,包含 type, name 等參數。 fulfilledCallback 為上傳完成後執行的 callback function | | | normalizePastedValue | boolean | 是否在複製、貼上時,執行 normalize html string 的功能。| true | | debugMode | boolean | (平常不會用到) 是否開啟 debug 模式 | | | onWarning(text) | function | (平常不會用到) 編輯器內部在某些無法處理的情況下,可以噴輸出警告訊息。 | | | normalizeValue | boolean | (平常不會用到) 是否在每一次更新內容時,重新 normalize html string ,以符合 slate editor 的格式。這個功能基本上只有在換編輯器時會用到。 | false | | errorMessage | String | (平常不會用到) 顯示在編輯器下方的警告文字 | ""(空字串) |

Run example

  cd ./example
  yarn start