@bangle.dev/text-formatting
contrib
Provides more text formatting components on top of the ones provides by @bangle.dev/core
.
# peer depsnpm install @bangle.dev/core @bangle.dev/pmnpm install @bangle.dev/text-formatting
Component#
subscript:Allows text to marked as subscript. Note: Expects a spec named superscript
to exist, you should either use it with provided superscript
component or create one of yours.
MarkSpec#
spec():Plugins#
plugins({ ... }):Named parameters:
- keybindings: ?KeybindingsObject=defaultKeys
For a list of allowed keys see defaultKeys below.
KeybindingsObject#
defaultKeys:- toggleSubscript =
null
: toggle subscript, disabled by default.
CommandObject#
commands:toggleSubscript(): Command
Toggles subscript mark.queryIsSubscriptActive(): QueryCommand<boolean>
Query if the selection is inside a subscript mark or not.
Usage
See example.
Component#
superscript:Allows text to marked as superscript. Note: Expects a spec named subscript
to exist, you should either use it with provided subscript
component or create one of yours.
MarkSpec#
spec():Plugins#
plugins({ ... }):Named parameters:
- keybindings: ?KeybindingsObject=defaultKeys
For a list of allowed keys see defaultKeys below.
KeybindingsObject#
defaultKeys:- toggleSuperscript =
null
: toggle superscript, disabled by default.
CommandObject#
commands:toggleSuperscript(): Command
Toggles superscript mark.queryIsSuperscriptActive(): QueryCommand<boolean>
Query if the selection is inside a superscript mark or not.
Usage
See example.