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

dyeditor

v1.4.5

Published

DYEditor is custom made to use [CKEditor5](https://www.npmjs.com/package/ckeditor5) in React.

Downloads

57

Readme

DYEditor

DYEditor is custom made to use CKEditor5 in React. By using this, you can use CKEditor5 more conveniently.
CKEditor5 is a really good library. However, my friends around me found it difficult to use. So I simplified the functions to make them easier to use. And, by making both the Base64 image uploader and storage uploader methods available, you can easily upload images.

Install

The code source is at DYEditor repository

npm install dyeditor

Usages

If you use something like reset.css, the style will not be applied.

dyeditor has 1 component and 3 functions.

import DYEditor, { getData, uploadImages, getEditorTag } from 'dyeditor';

DYEditor

DYEditor component has 3 props.

import DYEditor from 'dyeditor';

function ReactComponent({_data, _readOnly, _imageUploader}) {
    return <DYEditor
        data={_data}
        readOnly={_readOnly}
        imageUpload={{uploader:_uploader, resizing: _resizing}} // uploader must be a function that takes a file as input and a imageUrl as output.
    />
}

props

  • data
    data is an initial value. The default value is "".
  • readOnly
    You can select read mode or write mode. true is read mode, false is write mode. The default value is false, which is read mode.
  • imageUpload
    • uploader You can use Base64 image upload, storage image upload, or no image upload. If uploader is a function, it uses image upload. Which image upload to use is covered in the description of uploadImages. The default value is null, and image upload is not used. uploader must be a function that takes a file as input and a imageUrl as output.
    • resizing You can select using resizing or not when upload images. true is using resizing image, false is using original image. The default value is false, which is not using resizing image.

getData

When the getData function is called, the created html of DYEditor is returned.

uploadImages

The uploadImages function saves the Base64 image of DYEditor as a file in the user's storage and converts it to an image URL. Therefore, after executing uploadImages, it is recommended to save the return value of getData() in the Database. If you want to save the Base64 image to the database, you can use the return value of getData() without executing uploadImages. uploadImages is an async function.

import { getData, uploadImages } from 'dyeditor';

let content;
// use Base64
content = getData();
// use storage
uploadImages().then(results=>{ // results is the success or failure of uploadimages
    content = getData();
})

getEditorTag

When you want to customize the editor ui, use the getEditorTag function. getEditorTag is an async function that returns an editor HTML element.

import { getEditorTag } from 'dyeditor';

getEditorTag().then(editorHTMLTag=>{
    // customize editor ui
})

Example

You can run an example using dkeditor in DYEditor repository.

git clone https://github.com/DongYu-Kim/DYEditor.git
cd dyeditor
npm install
npm run start

Contribution

Contribute by fixing documentation, reporting code errors, etc...
Sending an e-mail is probably the fastest way to respond.