Skip to main content

BridgeState

The BridgeState is the latest state of the editor webview on the native side, it's extendable by BridgeExtensions and is generally used with useBridgeState

The list above is the interface of BridgeState in case you use TenTapStarterkit or using all the BridgeExtensions the lib exports, on each prop we specify what bridgeExtension adds it

BridgeState properties

editable

boolean
Is the editor editable or not
extended by CoreBridge

selection

{ from: number; to: number }
The selection on the editor-web
extended by CoreBridge

isFocused

boolean
true when the editor is focused
extended by CoreBridge

isReady

boolean
true when the editor is fully loaded
extended by CoreBridge

isBlockquoteActive

boolean
true when the cursor is where blockquote is active
extended by BlockquoteBridge

canToggleBlockquote

boolean
true when it's possible to toggle blockquote
extended by BlockquoteBridge

isCodeActive

boolean
true when the cursor is where code is active
extended by CodeBridge

canToggleCode

boolean
true when it's possible to toggle code
extended by CodeBridge

isBoldActive

boolean
true when the cursor is where bold is active
extended by BoldBridge

canToggleBold

boolean
true when it's possible to toggle bold
extended by BoldBridge

isItalicActive

boolean
true when the cursor is where italic is active
extended by ItalicBridge

canToggleItalic

boolean
true when it's possible to toggle italic
extended by ItalicBridge

isUnderlineActive

boolean
true when the cursor is where underline is active
extended by UnderlineBridge

canToggleUnderline

boolean
true when it's possible to toggle underline
extended by UnderlineBridge

isStrikeActive

boolean
true when the cursor is where Strike is active
extended by StrikeBridge

canToggleStrike

boolean
true when it's possible to toggle Strike
extended by StrikeBridge

isBulletListActive

boolean
true when the cursor is where bullet list is active
extended by BulletListBridge

canToggleBulletList

boolean
true when it's possible to toggle bullet list
extended by BulletListBridge

isOrderedListActive

boolean
true when the cursor is where ordered list is active
extended by OrderedListBridge

canToggleOrderedList

boolean
true when it's possible to toggle ordered list
extended by OrderedListBridge

isTaskListActive

boolean
true when the cursor is where task list is active
extended by TaskListBridge

canToggleTaskList

boolean
true when it's possible to toggle task list
extended by TaskListBridge

headingLevel

number | undefined
undefined when no heading is applied, number of the heading level
extended by HeadingBridge

canToggleHeading

boolean
true when it's possible to toggle heading
extended by HeadingBridge

canLift

boolean
true when it's possible to lift list item
extended by ListItemBridge

canSink

boolean
true when it's possible to sink a list item
extended by ListItemBridge

canUndo

boolean
true when it's possible to undo the doc history stack
extended by HistoryBridge

canRedo

boolean
true when it's possible to redo the doc history stack
extended by HistoryBridge

activeColor

string | undefined
undefined when no color is applied, string of the color that is active on the selection
extended by ColorBridge

activeHighlight

string | undefined
undefined when no highlight is applied, string of the highlight that active on the selection
extended by HighlightBridge

isLinkActive

boolean
true when the link is in the selection
extended by LinkBridge

boolean
true when it's possible to add link, for example when there is no selection it not possible
extended by LinkBridge

string | undefined
undefined when there is no link, string of the link that active on the selection position
extended by LinkBridge

useBridgeState

a react hook to subscribe to changes on the BridgeState, get EditorBridge