Gathering detailed insights and metrics for quill-blot-formatter-mobile
Gathering detailed insights and metrics for quill-blot-formatter-mobile
Gathering detailed insights and metrics for quill-blot-formatter-mobile
Gathering detailed insights and metrics for quill-blot-formatter-mobile
parchment
A document model for rich text editors
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.
@enzedonline/quill-blot-formatter2
An update for quill-blot-formatter to make quilljs v2 compatible.
quill-blot-formatter-2
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.
npm install quill-blot-formatter-mobile
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
6 Stars
116 Commits
2 Forks
1 Watching
2 Branches
1 Contributors
Updated on 24 Apr 2024
JavaScript (94.98%)
HTML (5.02%)
Cumulative downloads
Total Downloads
Last day
39.5%
60
Compared to previous day
Last week
18.2%
234
Compared to previous week
Last month
17.7%
757
Compared to previous month
Last year
57.3%
7,571
Compared to previous year
3
1
This is a fork of quill-blot-formatter
that adds support for touch screen on mobile devices.
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
.
Using yarn
:
yarn add quill-blot-formatter-mobile
Using npm
:
npm install --save quill-blot-formatter-mobile
1import Quill from 'quill'; 2 3// from the index, which exports a lot of useful modules 4import BlotFormatter from 'quill-blot-formatter-mobile'; 5 6// or, from each individual module 7import BlotFormatter from 'quill-blot-formatter-mobile/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});
quill-blot-formatter-mobile.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-mobile/dist/quill-blot-formatter-mobile.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>
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.
Each spec should call this.formatter.show(this);
to request activation. See specs/
for the built-in specs.
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.
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-mobile' 5 6// or, from individual modules 7import BlotFormatter from 'quill-blot-formatter-mobile/dist/BlotFormatter'; 8import AlignAction from 'quill-blot-formatter-mobile/dist/actions/align/AlignAction'; 9import DeleteAction from 'quill-blot-formatter-mobile/dist/actions/DeleteAction'; 10import ImageSpec from 'quill-blot-formatter-mobile/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});
Options
.overlay.style
, resize.handleStyle
, etc) set those to null
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/30 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 SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
22 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
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 More