Gathering detailed insights and metrics for react-quill-image-uploader
Gathering detailed insights and metrics for react-quill-image-uploader
Gathering detailed insights and metrics for react-quill-image-uploader
Gathering detailed insights and metrics for react-quill-image-uploader
quill-image-uploader
A module for Quill rich text editor to allow images to be uploaded to a server instead of being base64 encoded
quill-image-drop-and-paste
A quill editor module for drop and paste image, with a callback hook before insert image into the editor
react-quill
The Quill rich-text editor as a React component.
ngx-quill
Angular components for the easy use of the QuillJS richt text editor.
npm install react-quill-image-uploader
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
5 Stars
16 Commits
2 Forks
2 Watching
7 Branches
1 Contributors
Updated on 08 Jul 2021
JavaScript (81.68%)
CSS (18.32%)
Cumulative downloads
Total Downloads
Last day
19.2%
31
Compared to previous day
Last week
-13.3%
104
Compared to previous week
Last month
-14.8%
426
Compared to previous month
Last year
-2.8%
6,429
Compared to previous year
2
20
a plugin for react-quill which can upload multi image and remember the image url histroy
1npm i react-quill-image-uploader 2// yarn add react-quill-image-uploader
1import ReactQuill from 'react-quill' 2import 'react-quill/dist/quill.snow.css' 3import ReactQuillImageUploader, { 4 saveImageSrc, 5} from 'react-quill-image-uploader' 6 7class App extends React.Component { 8 modules = { 9 toolbar: { 10 container: [['bold', 'italic', 'underline', 'strike'], ['image']], 11 handlers: { 12 image: () => { 13 const { clientX, y: clientY } = window.event 14 const position = { x: clientX, y: clientY } // position the plugin to show 15 this.ReactQuillImageUploaderRef.toggle(position) // show or hide the plugin 16 // toggle() is also ok 17 // this.ReactQuillImageUploaderRef.toggle() 18 }, 19 }, 20 }, 21 } 22 componentDidMount() { 23 this.quill = this.quillRef.getEditor() 24 this.setState({ quill: this.quill }) 25 26 // add new one to history 27 // from version 0.0.1 28 // ReactQuillImageUploader.saveImageSrc("https://iph.href.lu/100x100") 29 // from version 0.0.4 30 ReactQuillImageUploader.saveImage({ 31 name: 'demo.jpg', 32 src: 'https://iph.href.lu/100x100', 33 }) 34 35 // remove all and add new one by the history api 36 37 // es6 38 // import {setHistory} from 'react-quill-image-uploader' 39 // setHistory([{ 40 // name: "demo.jpg", 41 // src: "https://iph.href.lu/100x100" 42 // }]) 43 44 // es5 45 // ReactQuillImageUploader.setHistory([{ 46 // name: "demo.jpg", 47 // src: "https://iph.href.lu/100x100" 48 // }]) 49 } 50 51 uploadImageCallBack = (file, base64) => { 52 // check file.size 53 // check file type by file.name 54 55 return new Promise((resolve, reject) => { 56 // submit file to server 57 let src = 'https://iph.href.lu/200x200' // demo image src 58 if (base64) { 59 src = base64 60 } 61 // upload img thing 62 const uploadSuccess = false 63 if (uploadSuccess) { 64 // insert img into editor manually 65 this.ReactQuillImageUploaderRef.insertImg(src) 66 67 // return data to save to plugin history 68 resolve({ 69 data: { 70 name: file.name || '', 71 link: src, 72 }, 73 }) 74 } else if (!uploadSuccess) { 75 // return resolve({status: 'fail'}) or reject(), plugin will warn the user to upload again, will not save in history 76 // resolve({ 77 // status: 'fail', 78 // }) 79 // resolve() 80 // or 81 setTimeout(() => { 82 return reject() 83 }, 3 * 1000) 84 } else { 85 // return nothing, meaning that do not save anything to history or upload fail panel 86 resolve() 87 } 88 }) 89 } 90 render() { 91 const { modules, className = '', placeholder = 'write here..' } = this.props 92 const { quill = {} } = this.state 93 return ( 94 <div> 95 <ReactQuill 96 ref={el => { 97 this.quillRef = el 98 }} 99 placeholder={placeholder} 100 modules={modules || this.modules} 101 className={className} 102 /> 103 <ReactQuillImageUploader 104 ref={el => { 105 this.ReactQuillImageUploaderRef = el 106 }} 107 isShowUploadFail={true} // default true, uopload fail history is hidden when false 108 isShowHistory={true} // default true, history is hidden when false 109 quill={this.state.quill} 110 uploadCallback={uploadImageCallBack} 111 /> 112 </div> 113 ) 114 } 115}
reject()
as well as resolve({status: 'fail'})
uploadCallback can return nothing
, like audio and videosaveImage
, add public method insertImg
for inserting img by hand。No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/16 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
60 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More