Installations
npm install quill-blot-formatter-2
Score
72.5
Supply Chain
99.4
Quality
77.6
Maintenance
100
Vulnerability
98.2
License
Releases
Unable to fetch releases
Developer
Fandom-OSS
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
Yes
Node Version
16.13.2
NPM Version
8.1.2
Statistics
135 Stars
103 Commits
50 Forks
1 Watching
1 Branches
2 Contributors
Updated on 30 Sept 2024
Bundle Size
25.09 kB
Minified
5.01 kB
Minified + Gzipped
Languages
JavaScript (94.9%)
HTML (5.1%)
Total Downloads
Cumulative downloads
Total Downloads
4,969
Last day
-63.9%
22
Compared to previous day
Last week
-34.2%
192
Compared to previous week
Last month
-25.5%
995
Compared to previous month
Last year
0%
4,969
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Quill Blot Formatter
A quill module to format document blots. Heavily inspired by quill-image-resize-module. Out of the box supports resizing and realigning images and iframe videos, but can be easily extended using BlotSpec
and Action
.
Demo
Installation
Using yarn
:
yarn add quill-blot-formatter
Using npm
:
npm install --save quill-blot-formatter
Usage
As Module
1import Quill from 'quill'; 2 3// from the index, which exports a lot of useful modules 4import BlotFormatter from 'quill-blot-formatter'; 5 6// or, from each individual module 7import BlotFormatter from 'quill-blot-formatter/dist/BlotFormatter'; 8 9Quill.register('modules/blotFormatter', BlotFormatter); 10 11const quill = new Quill(..., { 12 modules: { 13 ... 14 blotFormatter: { 15 // see config options below 16 } 17 } 18});
Script Tag
quill-blot-formatter.min.js
is provided which exports the same modules as index.js
under the global QuillBlotFormatter
.
1<script src="<quill>"></script> 2<script src="node_modules/quill-blot-formatter/dist/quill-blot-formatter.min.js"></script> 3<script> 4 Quill.register('modules/blotFormatter', QuillBlotFormatter.default); 5 const quill = new Quill(..., { 6 modules: { 7 ... 8 blotFormatter: { 9 // see config options below 10 } 11 } 12 } 13 }); 14</script>
BlotSpec
The BlotSpec
classes define how BlotFormatter
interacts with blots. They take the BlotFormatter
as a constructor arg and have the following functions:
init(): void
Called after all specs have been constructed. Use this to bind to quill events to determine when to activate a specific spec.
getActions(): Class<Action>[]
The actions
that are allowed on this blot. The default is [AlignAction, ResizeAction, DeleteAction]
.
getTargetElement(): ?HTMLElement
When the spec is active this should return the element that is to be formatter
getOverlayElement(): ?HTMLElement
When the spec is active this should return the element to display the formatting overlay. This defaults to return getTargetElement()
since they will typically be the same element.
setSelection(): void
After the spec is activated this should set the quill selection using setSelection
. Defaults to quill.setSelection(null)
.
onHide(): void
Called when the spec is deactivated by the user clicking away from the blot. Use this to clean up any state in the spec during activation.
Notes
Each spec should call this.formatter.show(this);
to request activation. See specs/
for the built-in specs.
Action
The Action
classes define the actions available to a blot once its spec is activated. They take the BlotFormatter
as a constructor arg and have the following functions:
onCreate(): void
Called immediately after the action is created. Use this to bind quill events and create elements to attach to the overlay.
onUpdate(): void
Called when the formatter has changed something on the blot. Use this to update any internal state.
onDestroy(): void
Called when the formatter is hidden by the user.
See actions/
for the existing actions.
Options
Using quill module options it's easy to disable existing specs, actions, or to override any of the styles provided by this module. For example: if you wanted to remove resizing, support only images, and change the overlay border the following config would work:
1import Quill from 'quill'; 2 3// from main module 4import BlotFormatter, { AlignAction, DeleteAction, ImageSpec } from 'quill-blot-formatter' 5 6// or, from individual modules 7import BlotFormatter from 'quill-blot-formatter/dist/BlotFormatter'; 8import AlignAction from 'quill-blot-formatter/dist/actions/align/AlignAction'; 9import DeleteAction from 'quill-blot-formatter/dist/actions/DeleteAction'; 10import ImageSpec from 'quill-blot-formatter/dist/specs/ImageSpec'; 11 12Quill.register('modules/blotFormatter', BlotFormatter); 13 14class CustomImageSpec extends ImageSpec { 15 getActions() { 16 return [AlignAction, DeleteAction]; 17 } 18} 19 20const quill = new Quill(..., { 21 modules: { 22 ... 23 blotFormatter: { 24 specs: [ 25 CustomImageSpec, 26 ], 27 overlay: { 28 style: { 29 border: '2px solid red', 30 } 31 } 32 } 33 } 34});
Notes
- For all supported options as well as the default see
Options
. - object properties are merged, but array properties override the defaults.
- To completely disable styles (
overlay.style
,resize.handleStyle
, etc) set those tonull
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0
Reason
Found 1/26 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 effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 5 are checked with a SAST tool
Reason
62 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx
- Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-hr2v-3952-633q
- Warn: Project is vulnerable to: GHSA-vh7m-p724-62c2
- Warn: Project is vulnerable to: GHSA-r9p9-mrjm-926w
- Warn: Project is vulnerable to: GHSA-434g-2637-qmqr
- Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m
- Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw
- Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p
- Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747
- Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h
- Warn: Project is vulnerable to: GHSA-qrmc-fj45-qfc2
- Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3
- Warn: Project is vulnerable to: MAL-2023-462
- Warn: Project is vulnerable to: GHSA-xf7w-r453-m56c
- Warn: Project is vulnerable to: GHSA-44pw-h2cw-w3vq
- Warn: Project is vulnerable to: GHSA-jp4x-w63m-7wgm
- Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp
- Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj
- Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37
- Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546
- Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq
- Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488
- Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g
- Warn: Project is vulnerable to: GHSA-fvqr-27wr-82fm
- Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574
- Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm
- Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695
- Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-4xcv-9jjx-gfj3
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m / GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-588m-9qg5-35pq
- Warn: Project is vulnerable to: GHSA-4943-9vgg-gr5r
- Warn: Project is vulnerable to: GHSA-6g33-f262-xjp4
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-g4rg-993r-mgx7
- Warn: Project is vulnerable to: GHSA-2m39-62fm-q8r3
- Warn: Project is vulnerable to: GHSA-mf6x-7mm4-x2g7
- Warn: Project is vulnerable to: GHSA-j44m-qm6p-hp7m
- Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9
- Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh
- Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp
Score
1.7
/10
Last Scanned on 2024-11-25
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 MoreOther packages similar to quill-blot-formatter-2
quill-blot-formatter
a module for the Quill text editor to allow blots to be reformatted. Built in formatters: resize and realign. Built in blot support: images and iframe videos.
parchment
A document model for rich text editors
@enzedonline/quill-blot-formatter2
An update for quill-blot-formatter to make quilljs v2 compatible.
quill-blot-formatter-mobile
a module for the Quill text editor to allow blots to be reformatted. Built in formatters: resize and realign. Built in blot support: images and iframe videos.