JSPM

quill-file-uploader

1.5.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 15
  • Score
    100M100P100Q42575F
  • License MIT

A module for Quill rich text editor to allow images to be uploaded to a server instead of being base64 encoded

Package Exports

  • quill-file-uploader
  • quill-file-uploader/dist/fileUploader.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (quill-file-uploader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Quill FileUploader Module

A module for Quill rich text editor to allow images and audio to be uploaded to a server instead of being base64 encoded. Replaces the image button provided by quill, also handles drag, dropped and pasted images.

Demo

Uploader demo

Install

Install with npm:

npm install quill-file-uploader --save

Webpack/ES6

import Quill from "quill";
import FileUploader from "quill-file-uploader";

Quill.register("modules/fileUploader", FileUploader);

const quill = new Quill(editor, {
  // ...
  modules: {
    // ...
    fileUploader: {
      accept: [{image: ['jpeg', 'png', 'gif'], audio: ['mpeg', 'aac']}],
      upload: (file) => {
        return new Promise((resolve, reject) => {
          setTimeout(() => {
            resolve(
              "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6a/JavaScript-logo.png/480px-JavaScript-logo.png"
            );
          }, 3500);
        });
      },
    },
  },
});

Quickstart (React with react-quill)

React Example on CodeSandbox