import WidgetHelper from "../widget-helper";
import LayoutEditable from "./editable";

export default class BaseLayout extends WidgetHelper
{
  static get requires()
  {
    return [LayoutEditable];
  }

  init()
  {
    super.init();
    const model = this.editor.model;
    model.schema.extend('layout-editable', {allowIn: this._schemaName()});
  }

  _schemaDefinition()
  {
    return {
      allowIn: ['$root', 'layout-editable', this._schemaName()],
      isBlock: true,
      isInline: false,
      isObject: true,
      isLimit: true
    };
  }
}
