1.0.19 • Published 3 years ago

@sientech/quill-image-alt-blot v1.0.19

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

@sientech/quill-image-alt-blot

Quill Rich Editor 擴充可支援插入有 alt 的圖片

install

yarn add @sientech/quill-image-alt-blot

usage

  • ImageBlotAlt: 擴展原 embed blots, 可建立包含 alt 資料的 blot
  • AltImageUploader: 擴展 quill-image-uploader 模組,在插入資料時,使用 ImageBlotAlt blot。
import { ImageBlotAlt, AltImageUploader } from '@sientech/quill-image-alt-blot'
import '@sientech/quill-image-alt-blot/dist/index.css'

import { Quill } from 'quill'

// register blot
Quill.register(ImageBlotAlt)


// register imageUploader
Quill.register("modules/imageUploader", AltImageUploader);
const quill = new Quill(editor, {
  // ...
  modules: {
    imageUploader: {
      upload: (file) => {
        return new Promise((resolve, reject) => {
          setTimeout(() => {
            resolve(
              {
                src: 'img src',
                alt: 'img alt',
                caption: 'img caption'
              }
            );
          }, 3500);
        });
      },
    },
  },
});

ref

1.0.19

3 years ago

1.0.18

3 years ago

1.0.3

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago