Registry / testing / quill-blot-formatter-2

quill-blot-formatter-2

JSON →
library2.0.1jsnpmunverified

A module for the Quill text editor (v2) that allows blots (images, iframe videos) to be resized, aligned, and deleted via an interactive overlay. Built-in formatters: resize, realign, delete. Built-in blot support: images and iframe videos. Extensible via custom BlotSpec and Action classes. This is version 2.0.1 (latest), requires Quill ^2.0.0 as a peer dependency, and ships TypeScript types. Differentiators: fully typed, actively maintained fork of the older quill-image-resize-module, supports iframe videos out of the box, and allows custom actions.

npm install quill-blot-formatter-2
INSTALL
IMPORT
SIG · QUILL-BLOT-FORMATT
Q
quill-blot-formatter-2
testingjavascriptv2.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import BlotFormatter from 'quill-blot-formatter'
const BlotFormatter = require('quill-blot-formatter')
The default export is the main BlotFormatter class. In CommonJS, use require('quill-blot-formatter').default (or destructure from the namespace).
BlotFormatter
import BlotFormatter from 'quill-blot-formatter'
import { BlotFormatter } from 'quill-blot-formatter'
BlotFormatter is the default export, not a named export. Named import will give undefined.
default (from dist/BlotFormatter)
import BlotFormatter from 'quill-blot-formatter/dist/BlotFormatter'
import BlotFormatter from 'quill-blot-formatter'
While both paths work, importing from the top-level index re-exports from dist/BlotFormatter. The dist path is useful for tree-shaking.

Registers the BlotFormatter module with Quill v2 and initializes it. The module adds resize, align, and delete handles to images and iframe videos.

import Quill from 'quill'; import BlotFormatter from 'quill-blot-formatter'; Quill.register('modules/blotFormatter', BlotFormatter); const quill = new Quill('#editor', { theme: 'snow', modules: { blotFormatter: { // Optional: override specs, actions, or styles } } });
Debug
Known issues
breakingVersion 2.x requires Quill ^2.0.0. Does NOT work with Quill 1.x.
fix
Upgrade Quill to v2 or use the older quill-image-resize-module for Quill 1.x.
affects: >=2.0.0
deprecatedThe 'quill-image-resize-module' is unmaintained. Use 'quill-blot-formatter' instead.
fix
Replace import of quill-image-resize-module with quill-blot-formatter.
affects: >=0.0.0
gotchaWhen using script tags, the global is 'QuillBlotFormatter.default', not 'QuillBlotFormatter'.
fix
Use Quill.register('modules/blotFormatter', QuillBlotFormatter.default);
affects: >=0.0.0
gotchaCommonJS require() does not directly return the default export. You must use require('...').default or destructure from the namespace object.
fix
const BlotFormatter = require('quill-blot-formatter').default;
affects: >=0.0.0
deprecatedImporting from 'quill-blot-formatter/dist/QuillBlotFormatter' is no longer the correct path; use 'quill-blot-formatter/dist/BlotFormatter'.
fix
Change import to 'quill-blot-formatter/dist/BlotFormatter'.
affects: >=2.0.0
Errors
Common errors & fixes
ERROR in ./node_modules/quill-blot-formatter/index.js 1:0-38 Module not found: Error: Can't resolve 'quill'
Quill is a peer dependency that must be installed separately.
fix
Run: npm install quill@^2.0.0
TypeError: Cannot read properties of undefined (reading 'default')
Using require() without .default when the module is an ES module default export.
fix
Use: const BlotFormatter = require('quill-blot-formatter').default;
BlotFormatter is not a constructor
Importing { BlotFormatter } as a named export instead of default import.
fix
Use: import BlotFormatter from 'quill-blot-formatter';
QuillBlotFormatter is not defined
Using script tag but expecting global 'QuillBlotFormatter' without .default.
fix
Use: Quill.register('modules/blotFormatter', QuillBlotFormatter.default);
Uncaught TypeError: Cannot read properties of null (reading 'prototype')
Quill version mismatch: using Quill 1.x with quill-blot-formatter 2.x.
fix
Upgrade Quill to v2: npm install quill@^2.0.0
Upgrade
Version history
2.0.1latest on npm
Audit
Dependencies
quillrequiredpeer dependency: required at runtime, must be version ^2.0.0
Agent activity
11 hits · last 30 days
node
10
Amazon
1
Resources
quill-blot-formatter-2 — npm install quill-blot-formatter-2 · libregistry