module.exports = {
  run(editor, sender) {
    // const bm = editor.BlockManager;
    const bm = editor.TemplateList;
    const pn = editor.Panels;
    //console.log(bm);

    if (!this.blocks) {
      bm.render();
      const id = 'template-list';
      const blocks = document.createElement('div');
      const panels = pn.getPanel(id) || pn.addPanel({ id });
      blocks.appendChild(bm.getContainer());
      panels.set('appendContent', blocks).trigger('change:appendContent');
      this.blocks = blocks;
    }

    this.blocks.style.display = 'block';
  },

  stop() {
    const blocks = this.blocks;
    blocks && (blocks.style.display = 'none');
  }
};
