How to use the editor/model/Editor function in editor

To help you get started, we’ve selected a few editor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github artf / grapesjs / test / specs / dom_components / model / Component.js View on Github external
beforeEach(() => {
    em = new Editor({});
    dcomp = new DomComponents();
    compOpts = {
      em,
      componentTypes: dcomp.componentTypes,
      domc: dcomp
    };
    obj = new Component({}, compOpts);
    dcomp.init({ em });
  });
github artf / grapesjs / test / specs / selector_manager / index.js View on Github external
beforeEach(() => {
      em = new Editor({});
      obj = new SelectorManager().init({ em });
    });
github artf / grapesjs / test / specs / code_manager / model / CodeModels.js View on Github external
beforeEach(() => {
    em = new Editor({});
    newCssComp = () => new CssComposer().init({ em });

    cc = em.get('CssComposer');
    obj = new CssGenerator();
    dcomp = new DomComponents();
    comp = new Component(
      {},
      {
        em,
        componentTypes: dcomp.componentTypes
      }
    );
  });
github artf / grapesjs / test / specs / dom_components / index.js View on Github external
beforeEach(() => {
      em = new Editor({
        avoidInlineStyle: 1
      });
      config = {
        em,
        storeWrapper: 1
      };
      obj = new DomComponents().init(config);
    });
github artf / grapesjs / test / specs / dom_components / model / Component.js View on Github external
beforeEach(() => {
    em = new Editor({});
    dcomp = new DomComponents();
    compOpts = {
      componentTypes: dcomp.componentTypes
    };
  });
github artf / grapesjs / test / specs / dom_components / view / ComponentV.js View on Github external
beforeEach(() => {
    em = new Editor({});
    dcomp = new DomComponents();
    compOpts = {
      em,
      componentTypes: dcomp.componentTypes
    };
    model = new Component({}, compOpts);
    view = new ComponentView({
      model
    });
    document.body.innerHTML = '<div id="fixtures"></div>';
    fixtures = document.body.querySelector('#fixtures');
    fixtures.appendChild(view.render().el);
  });
github artf / grapesjs / test / specs / code_manager / model / CodeModels.js View on Github external
beforeEach(() => {
    em = new Editor();
    obj = new HtmlGenerator();
    dcomp = new DomComponents();
    comp = new Component(
      {},
      {
        em,
        componentTypes: dcomp.componentTypes
      }
    );
  });
github artf / grapesjs / test / specs / style_manager / view / PropertySelectView.js View on Github external
beforeEach(() =&gt; {
    em = new Editor({});
    dcomp = new DomComponents();
    compOpts = { em, componentTypes: dcomp.componentTypes };
    propTarget = { ...Backbone.Events };
    target = new Component({}, compOpts);
    component = new Component({}, compOpts);
    model = new Property({
      type: 'select',
      list: options,
      property: propName
    });
    propTarget.model = component;
    view = new PropertySelectView({
      model,
      propTarget
    });
    document.body.innerHTML = '<div id="fixtures"></div>';
github artf / grapesjs / test / specs / selector_manager / view / ClassTagView.js View on Github external
beforeEach(() =&gt; {
    coll = new Selectors();
    testLabel = 'TestLabel';
    em = new EditorModel();
    var model = coll.add({
      name: 'test',
      label: testLabel
    });
    obj = new ClassTagView({
      config: { em },
      model,
      coll
    });
    //obj.target = { get() {} };
    //_.extend(obj.target, Backbone.Events);
    document.body.innerHTML = '<div id="fixtures"></div>';
    fixtures = document.body.querySelector('#fixtures');
    fixtures.appendChild(obj.render().el);
  });
github artf / grapesjs / test / specs / style_manager / view / PropertyRadioView.js View on Github external
beforeEach(() =&gt; {
    em = new Editor({});
    dcomp = new DomComponents();
    compOpts = { em, componentTypes: dcomp.componentTypes };
    propTarget = { ...Backbone.Events };
    target = new Component({}, compOpts);
    component = new Component({}, compOpts);
    model = new Property({
      type: 'radio',
      list: options,
      property: propName
    });
    propTarget.model = component;
    view = new PropertyRadioView({
      model,
      propTarget
    });
    document.body.innerHTML = '<div id="fixtures"></div>';