Installations
npm install prosemirror-example-setup-abhi
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
8.3.0
NPM Version
5.5.1
Score
73
Supply Chain
98.9
Quality
74.7
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Languages
JavaScript (100%)
Developer
Download Statistics
Total Downloads
585
Last Day
1
Last Week
7
Last Month
11
Last Year
59
GitHub Statistics
7,865 Stars
198 Commits
342 Forks
108 Watching
1 Branches
36 Contributors
Bundle Size
179.71 kB
Minified
55.02 kB
Minified + Gzipped
Package Meta Information
Latest Version
1.0.1
Package Id
prosemirror-example-setup-abhi@1.0.1
Size
27.98 kB
NPM Version
5.5.1
Node Version
8.3.0
Total Downloads
Cumulative downloads
Total Downloads
585
Last day
0%
1
Compared to previous day
Last week
250%
7
Compared to previous week
Last month
450%
11
Compared to previous month
Last year
-18.1%
59
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
prosemirror-example-setup
[ WEBSITE | ISSUES | FORUM | GITTER ]
This is a non-core example module for ProseMirror. ProseMirror is a well-behaved rich semantic content editor based on contentEditable, with support for collaborative editing and custom document schemas.
This module provides an example of the glue code one might write to tie the modules that make up ProseMirror into an actual presentable editor. It is not meant to be very reusable, though it might be helpful to get something up-and-running quickly.
The project page has more information, a number of examples and the documentation.
This code is released under an MIT license. There's a forum for general discussion and support requests, and the Github bug tracker is the place to report issues.
Documentation
This module exports the following items:
exampleSetup
(options: Object) → [Plugin]
Create an array of plugins pre-configured for the given schema. The resulting array will include the following plugins:
-
Input rules for smart quotes and creating the block types in the schema using markdown conventions (say
"> "
to create a blockquote) -
A keymap that defines keys to create an manipulate the nodes in the schema
-
A keymap binding the default keys provided by the prosemirror-commands module
-
The undo history plugin
-
The drop cursor plugin
-
The gap cursor plugin
-
A custom plugin that adds a
menuContent
prop for the prosemirror-menu wrapper, and a CSS class that enables the additional styling defined instyle/style.css
in this package
These options are supported:
-
schema
: Schema
The schema to use. This influences the menu items and key bindings that are generated. Assumes that node names correspond to those in the schema modules in the main distribution. -
mapKeys
: ?Object
Can be used to adjust the key bindings created. -
menuBar
: ?bool
Set to false to disable the menu bar. -
floatingMenu
: ?bool
Set to false to make the menu bar non-floating. -
menuContent
: [[MenuItem]]
Can be used to override the menu content. -
history
: ?bool
Set this tofalse
to disable adding the history plugin to the result.
buildMenuItems
(schema: Schema) → Object
Given a schema, look for default mark and node types in it and return an object with relevant menu items relating to those marks:
-
toggleStrong
: MenuItem
A menu item to toggle the strong mark. -
toggleEm
: MenuItem
A menu item to toggle the emphasis mark. -
toggleCode
: MenuItem
A menu item to toggle the code font mark. -
toggleLink
: MenuItem
A menu item to toggle the link mark. -
insertImage
: MenuItem
A menu item to insert an image. -
wrapBulletList
: MenuItem
A menu item to wrap the selection in a bullet list. -
wrapOrderedList
: MenuItem
A menu item to wrap the selection in an ordered list. -
wrapBlockQuote
: MenuItem
A menu item to wrap the selection in a block quote. -
makeParagraph
: MenuItem
A menu item to set the current textblock to be a normal paragraph. -
makeCodeBlock
: MenuItem
A menu item to set the current textblock to be a code block. -
insertTable
: MenuItem
An item to insert a table. -
addRowBefore
,addRowAfter
,removeRow
,addColumnBefore
,addColumnAfter
,removeColumn
: MenuItem
Table-manipulation items. -
makeHead[N]
: MenuItem
Where N is 1 to 6. Menu items to set the current textblock to be a heading of level N. -
insertHorizontalRule
: MenuItem
A menu item to insert a horizontal rule.
The return value also contains some prefabricated menu elements and menus, that you can use instead of composing your own menu from scratch:
-
insertMenu
: Dropdown
A dropdown containing theinsertImage
andinsertHorizontalRule
items. -
typeMenu
: Dropdown
A dropdown containing the items for making the current textblock a paragraph, code block, or heading. -
fullMenu
: [[MenuElement]]
An array of arrays of menu elements for use as the full menu for, for example the menu bar.
buildKeymap
(schema: Schema, remap: ?Object) → Object
Inspect the given schema looking for marks and nodes from the basic schema, and if found, add key bindings related to them. This will add:
- Mod-b for toggling strong
- Mod-i for toggling emphasis
- Mod-` for toggling code font
- Ctrl-Shift-0 for making the current textblock a paragraph
- Ctrl-Shift-1 to Ctrl-Shift-Digit6 for making the current textblock a heading of the corresponding level
- Ctrl-Shift-Backslash to make the current textblock a code block
- Ctrl-Shift-8 to wrap the selection in an ordered list
- Ctrl-Shift-9 to wrap the selection in a bullet list
- Ctrl-> to wrap the selection in a block quote
- Enter to split a non-empty textblock in a list item while at the same time splitting the list item
- Mod-Enter to insert a hard break
- Mod-_ to insert a horizontal rule
You can suppress or map these bindings by passing a mapKeys
argument, which maps key names (say "Mod-B"
to either false
, to
remove the binding, or a new key name string.
buildInputRules
(schema: Schema) → [InputRule]
A set of input rules for creating the basic block quotes, lists, code blocks, and heading.
We aim to be an inclusive, welcoming community. To make that explicit, we have a code of conduct that applies to communication around the project.
No vulnerabilities found.
Reason
5 commit(s) out of 30 and 18 issue activity out of 30 found in the last 90 days -- score normalized to 10
Reason
no vulnerabilities detected
Reason
tokens are read-only in GitHub workflows
Reason
no dangerous workflow patterns detected
Reason
all dependencies are pinned
Details
- Info: GitHub-owned GitHubActions are pinned
- Info: Third-party GitHubActions are pinned
- Info: Dockerfile dependencies are pinned
- Info: no insecure (not pinned by hash) dependency downloads found in Dockerfiles
- Info: no insecure (not pinned by hash) dependency downloads found in shell scripts
Reason
license file detected
Details
- Info: : LICENSE:1
Reason
no binaries found in the repo
Reason
GitHub code reviews found for 2 commits out of the last 30 -- score normalized to 0
Details
- Warn: no reviews found for commit: c312d4e35f1887c77da4558ecb9f1e8a59bfc27b
- Warn: no reviews found for commit: 3a0e69f79aa1b938a3fa3ecd8dbbbc4688c2ddcc
- Warn: no reviews found for commit: ead01b12d7853bf0f87fad2be5939fb58e117478
- Warn: no reviews found for commit: ece2180399303be85749b1dc83d42b191d6f8ab0
- Warn: no reviews found for commit: 956f3e2ad94c09f0093a23e46760c40f5461339c
- Warn: no reviews found for commit: f639199c9371939db4bf66d3d5ff18d3ead0b535
- Warn: no reviews found for commit: bc30c3b27f69329c60414c6840e86246e7cf476c
- Warn: no reviews found for commit: e134e8c0a752aeccbf1e74ec39410b2fb589fe6f
- Warn: no reviews found for commit: 94aaa0cafeb811520a3925785cd3ca726862a68a
- Warn: no reviews found for commit: 5be5db2398fc9675a0550ca15163387a8944b6d9
- Warn: no reviews found for commit: 91128e2c932a01fede7363a91e12aa81c0562a4a
- Warn: no reviews found for commit: bd7766a7568da1ba04777602a7a97d1cb3793abd
- Warn: no reviews found for commit: f285878b049554d492c49e2d28eea3942d54807c
- Warn: no reviews found for commit: f6c42f8fd930b7d8f881f99d9ec058555363ed17
- Warn: no reviews found for commit: 57ae62d04698b1c393c45b0fbe9204caa8f86cf4
- Warn: no reviews found for commit: 08804aa5d8beecd21bd0e3f2988e5e200abbef59
- Warn: no reviews found for commit: a78cbb1d1f81ee32e15a23c970d7804739599d57
- Warn: no reviews found for commit: 8c0bed626c3d8e5537a455b2ac83ce968c0d4046
- Warn: no reviews found for commit: b277eac7237776d6f6b21f0fe48f8137b9bdb90d
- Warn: no reviews found for commit: f76ad375c1f5cd68dcf12f6d594f7edadc88d563
- Warn: no reviews found for commit: fbdf3b0947028f7e14ab064a9020e02393916e45
- Warn: no reviews found for commit: fd19fe078963b75f6764c8c7a94a2c9ecb7461e2
- Warn: no reviews found for commit: 82a5db135b7ed73836e5794f526d15656c504c44
- Warn: no reviews found for commit: 0a2d4226dc0aa26f17bb713c7b308cda2a760f8b
- Warn: no reviews found for commit: ebfcdb233e33217184eb5ade3789b7da4a79f9d2
- Warn: no reviews found for commit: 2a2efc160d192a3ed71a633c8fb250f68881e67f
- Warn: no reviews found for commit: 352a071c1bce4a590bc35b3082e57df0bd76b3a5
- Warn: no reviews found for commit: 3ba8ed6dba42dc6a0d57bda1826d95ffadc6d6f2
Reason
no badge detected
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
security policy file not detected
Reason
no update tool detected
Details
- Warn: dependabot config file not detected in source location. We recommend setting this configuration in code so it can be easily verified by others.
- Warn: renovatebot config file not detected in source location. We recommend setting this configuration in code so it can be easily verified by others.
Reason
project is not fuzzed
Score
5.8
/10
Last Scanned on 2022-08-15
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