BlockSuite API Documentation / @blocksuite/affine-widget-keyboard-toolbar
@blocksuite/affine-widget-keyboard-toolbar
Classes
AffineKeyboardToolbarWidget
Extends
Constructors
Other
config
Get Signature
get config():
object
Returns
object
items
items:
KeyboardToolbarItem[]
keyboard
Get Signature
get keyboard():
VirtualKeyboardProviderWithAction&object
Returns
VirtualKeyboardProviderWithAction & object
connectedCallback()
connectedCallback():
void
Invoked when the component is added to the document's DOM.
In connectedCallback() you should setup tasks that should only occur when the element is connected to the document. The most common of these is adding event listeners to nodes external to the element, like a keydown event handler added to the window.
connectedCallback() {
super.connectedCallback();
addEventListener('keydown', this._handleKeydown);
}Typically, anything done in connectedCallback() should be undone when the element is disconnected, in disconnectedCallback().
Returns
void
Overrides
WidgetComponent.connectedCallback
render()
render():
TemplateResult<1> | typeofnothing
Invoked on each update to perform rendering tasks. This method may return any value renderable by lit-html's ChildPart - typically a TemplateResult. Setting properties inside this method will not trigger the element to update.
Returns
TemplateResult<1> | typeof nothing
Overrides
attributes
controllers
dev-mode
lifecycle
properties
rendering
styles
updates
Type Aliases
DynamicKeyboardToolPanelGroup()
DynamicKeyboardToolPanelGroup = (
ctx) =>KeyboardToolPanelGroup|null
Parameters
ctx
Returns
KeyboardToolPanelGroup | null
KeyboardIconType
KeyboardIconType =
TemplateResult| (ctx) =>TemplateResult
KeyboardSubToolbarConfig
KeyboardSubToolbarConfig =
object
Properties
autoShow()?
optionalautoShow: (ctx) =>Signal<boolean>
It will enter this sub-toolbar when the condition is met.
Parameters
ctx
Returns
Signal<boolean>
icon
icon:
KeyboardIconType
items
items:
KeyboardToolbarItem[]
KeyboardToolbarActionItem
KeyboardToolbarActionItem =
object
Properties
action()?
optionalaction: (ctx) =>void|Promise<void>
Parameters
ctx
Returns
void | Promise<void>
Description
The action to be executed when the item is clicked.
background?
optionalbackground:string| (ctx) =>string|undefined
disableWhen()?
optionaldisableWhen: (ctx) =>boolean
Parameters
ctx
Returns
boolean
Default
falseDescription
Whether to set the item as disabled status.
icon
icon:
KeyboardIconType
name
name:
string
showWhen()?
optionalshowWhen: (ctx) =>boolean
Parameters
ctx
Returns
boolean
Default
trueDescription
Whether to show the item in the toolbar.
KeyboardToolbarConfig
KeyboardToolbarConfig =
object
Properties
items
items:
KeyboardToolbarItem[]
KeyboardToolbarContext
KeyboardToolbarContext =
object
Properties
closeToolPanel()
closeToolPanel: () =>
void
Close current tool panel and show virtual keyboard
Returns
void
rootComponent
rootComponent:
BlockComponent
std
std:
BlockStdScope
KeyboardToolbarItem
KeyboardToolbarItem =
KeyboardToolbarActionItem|KeyboardSubToolbarConfig|KeyboardToolPanelConfig
KeyboardToolPanelConfig
KeyboardToolPanelConfig =
object
Properties
activeBackground?
optionalactiveBackground:string
activeIcon?
optionalactiveIcon:KeyboardIconType
groups
groups: (
KeyboardToolPanelGroup|DynamicKeyboardToolPanelGroup)[]
icon
icon:
KeyboardIconType
KeyboardToolPanelGroup
KeyboardToolPanelGroup =
object
Properties
items
items:
KeyboardToolbarActionItem[]
name
name:
string
Variables
AFFINE_KEYBOARD_TOOLBAR_WIDGET
constAFFINE_KEYBOARD_TOOLBAR_WIDGET:"affine-keyboard-toolbar-widget"='affine-keyboard-toolbar-widget'
defaultKeyboardToolbarConfig
constdefaultKeyboardToolbarConfig:KeyboardToolbarConfig
KeyboardToolbarConfigExtension
constKeyboardToolbarConfigExtension:ConfigFactory<Partial<KeyboardToolbarConfig>>
keyboardToolbarWidget
constkeyboardToolbarWidget:ExtensionType