Skip to content

Function: mountAdvanced() ​

ts
function mountAdvanced(
   target, 
   editor, 
   options?
): KitAdvanced;

Mount the default kit's advanced UI: image dialog and uploads, table actions, task list and code block buttons in the kit toolbar, the / command menu, @ mentions and the selection bubble. Also turns on the advanced behaviour (editor.enable()), keeping the document and undo history. The editor must have advancedSchema(). Load this module on demand, so none of it is in your main bundle.

Parameters ​

ParameterType
targetHTMLElement
editorEditor
options?KitAdvancedOptions

Returns ​

KitAdvanced

Example ​

ts
const { mountAdvanced } = await import('@writeon/kit/advanced')
mountAdvanced(document.querySelector('.rte-root'), editor, {
  messages: uz,
  upload: fetchUploader({ url: '/api/upload' }),
  mentions: (query) => searchPeople(query),
})