Surface
Abstract Component defined in packages/surface/Surface.js#27 inherits from

Abstract interface for editing components. Dances with contenteditable, so you don't have to.

Run a transformation as a transaction properly configured for this surface.

Parameters
transformation

a transformation function(tx, args) which receives the selection the transaction was started with, and should return output arguments containing a selection, as well.

Example

Returning a new selection:

surface.transaction(function(tx, args) {
  var selection = args.selection;
  ...
  selection = tx.createSelection(...);
  return {
    selection: selection
  };
});

Adding event information to the transaction:

surface.transaction(function(tx, args) {
  tx.info.foo = 'bar';
  ...
});
  • Set the model selection and update the DOM selection accordingly

Selects all text

Inserts a soft break

Copy the current selection. Performs a model/transform/copySelection transformation.

Performs a model/transform/paste transformation