Gathering detailed insights and metrics for @deedmob/quill-image-resize-alt-module
Gathering detailed insights and metrics for @deedmob/quill-image-resize-alt-module
React port of the quill image resize module, with support for custom image alt text
npm install @deedmob/quill-image-resize-alt-module
Typescript
Module System
Node Version
NPM Version
70.7
Supply Chain
98.4
Quality
77
Maintenance
50
Vulnerability
99.6
License
JavaScript (100%)
Total Downloads
24,040
Last Day
1
Last Week
7
Last Month
14
Last Year
3,023
1 Stars
44 Commits
1 Forks
1 Watching
1 Branches
Minified
Minified + Gzipped
Latest Version
4.0.0
Package Id
@deedmob/quill-image-resize-alt-module@4.0.0
Unpacked Size
57.19 kB
Size
16.87 kB
File Count
16
NPM Version
6.14.11
Node Version
12.20.2
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
133.3%
7
Compared to previous week
Last month
-90.7%
14
Compared to previous month
Last year
-58.2%
3,023
Compared to previous year
this is a fork in order to allow overriding the alt text prompt text. This fork introduces the
altTextPromptText
option. We also changed an icon.
A module for Quill rich text editor to allow images to be resized.
Also see quill-image-drop-module, a module that enables copy-paste and drag/drop for Quill.
1import Quill from "quill"; 2import ImageResize from "quill-image-resize-alt-module"; 3 4Quill.register("modules/imageResize", ImageResize); 5 6const quill = new Quill(editor, { 7 // ... 8 modules: { 9 // ... 10 imageResize: { 11 parchment: Quill.import("parchment"), 12 // See optional "config" below 13 }, 14 }, 15});
Copy image-resize.min.js into your web root or include from node_modules
1<script src="/node_modules/quill-image-resize-alt-module/image-resize.min.js"></script>
1var quill = new Quill(editor, { 2 // ... 3 modules: { 4 // ... 5 ImageResize: { 6 // See optional "config" below 7 }, 8 }, 9});
For the default experience, pass an object with parchment, like so:
1var quill = new Quill(editor, { 2 // ... 3 modules: { 4 // ... 5 ImageResize: { 6 parchment: Quill.import("parchment"), 7 }, 8 }, 9});
Functionality is broken down into modules, which can be mixed and matched as you like. For example, the default is to include all modules:
1const quill = new Quill(editor, { 2 // ... 3 modules: { 4 // ... 5 ImageResize: { 6 modules: ["Resize", "DisplaySize", "Toolbar"], 7 }, 8 }, 9});
Each module is described below.
Resize
- Resize the imageAdds handles to the image's corners which can be dragged with the mouse to resize the image.
The look and feel can be controlled with options:
1var quill = new Quill(editor, { 2 // ... 3 modules: { 4 // ... 5 ImageResize: { 6 // ... 7 handleStyles: { 8 backgroundColor: "black", 9 border: "none", 10 color: white, 11 // other camelCase styles for size display 12 }, 13 }, 14 }, 15});
DisplaySize
- Display pixel sizeShows the size of the image in pixels near the bottom right of the image.
The look and feel can be controlled with options:
1var quill = new Quill(editor, { 2 // ... 3 modules: { 4 // ... 5 ImageResize: { 6 // ... 7 displayStyles: { 8 backgroundColor: "black", 9 border: "none", 10 color: white, 11 // other camelCase styles for size display 12 }, 13 }, 14 }, 15});
Toolbar
- Image alignment toolsDisplays a toolbar below the image, where the user can select an alignment for the image.
The look and feel can be controlled with options:
1var quill = new Quill(editor, { 2 // ... 3 modules: { 4 // ... 5 ImageResize: { 6 // ... 7 toolbarStyles: { 8 backgroundColor: "black", 9 border: "none", 10 color: white, 11 // other camelCase styles for size display 12 }, 13 toolbarButtonStyles: { 14 // ... 15 }, 16 toolbarButtonSvgStyles: { 17 // ... 18 }, 19 }, 20 }, 21});
BaseModule
- Include your own custom moduleYou can write your own module by extending the BaseModule
class, and then including it in
the module setup.
For example,
1import { Resize, BaseModule } from "quill-image-resize-alt-module"; 2 3class MyModule extends BaseModule { 4 // See src/modules/BaseModule.js for documentation on the various lifecycle callbacks 5} 6 7var quill = new Quill(editor, { 8 // ... 9 modules: { 10 // ... 11 ImageResize: { 12 modules: [MyModule, Resize], 13 // ... 14 }, 15 }, 16});
No vulnerabilities found.
No security vulnerabilities found.