<kupu:wire
  implementation="plone"
  xmlns:kupu="http://kupu.oscom.org/namespaces/dist"
  >

  <!-- Plone specific wiring -->

  <kupu:fill-slot name="html">
    <kupu:insert-part feature="wysiwyg_support" part="editorbox" />
    <kupu:insert-part feature="wysiwyg_support" part="textformatselector" />
  </kupu:fill-slot>

  <kupu:fill-slot name="has_kupu">
    <kupu:insert-part feature="xmlconfig" part="xmlconfig" />
    <kupu:insert-part feature="body" part="fulleditor" />
    <kupu:insert-part feature="wysiwyg_support" part="eventhandler" />
  </kupu:fill-slot>

  <kupu:fill-slot name="not_has_kupu">
    <kupu:insert-part feature="wysiwyg_support" part="textarea" />
  </kupu:fill-slot>

  <kupu:fill-slot name="fulleditor">
    <!-- because we don't have access to the right slots in Plone, we
         need to put styles and JS includes in fulleditor -->
    <kupu:insert-part feature="head" part="styles" />
    <kupu:insert-part feature="drawers" part="styles" />
    <kupu:insert-part feature="head" part="jsincludes" />
    <kupu:insert-part feature="saveonpart" part="jsincludes" />
    <kupu:insert-part feature="sourceedit" part="jsincludes" />
    <kupu:insert-part feature="drawers" part="jsincludes" />
    <kupu:insert-part feature="head" part="bootstrap-editor" />

    <kupu:insert-part feature="toolbar" part="toolbar" />
    <kupu:insert-part feature="toolboxes" part="toolboxes" />
    <kupu:insert-part feature="colorchooser" part="colorchooser" />
    <kupu:insert-part feature="body" part="editorframe" />
  </kupu:fill-slot>

</kupu:wire>
