Customising topbar and toolbar
To customise the topbar and toolbar, we will be using the ids: topbar or toolbar, and follow the same view, controller structure.
Below is a trivial example of toolbar customisation. Here, we have removed the Insert Numbered List button, and replaced the Insert Paragraph button with our own component using a customised on-click handler.
const toolbarExtend = {
id: "toolbar",
view: {
items: [
{
component: "div",
target: {
key:"title",value: "Insert Numbered List",
viewState: VIEW_STATE.REPLACE
}
},
{
{
"component": "button",
"icon": "textParagraph",
"variant": "action",
"quiet": true,
"title": "Insert Paragraph",
"on-click": "INSERT_P"
},
target: {
key:"title",value: "Insert Paragraph",
viewState: VIEW_STATE.REPLACE
}
},
]
},
controller: {
INSERT_P(){
this.next("AUTHOR_INSERT_ELEMENT", "p" )
}
}
}