umd/fieldstack.js
/**
 * On `cut` events, native behavior is allowed to occur so that the system
 * clipboard is set properly. This means that we need to take steps to recover
 * the editor DOM state after the `cut` has occurred in order to maintain
 * control of the component.
 *
 * In addition, we can keep a copy of the removed fragment, including all
 * styles and entities, for use as an internal paste.
 */
On `cut` events, native behavior is allowed to occur so that the system
clipboard is set properly. This means that we need to take steps to recover
the editor DOM state after the `cut` has occurred in order to maintain
control of the component.

In addition, we can keep a copy of the removed fragment, including all
styles and entities, for use as an internal paste.
On ` cut ` events native behavior is allowed to occur so that the system clipboard is set properly . This means that we need to take steps to recover the editor DOM state after the ` cut ` has occurred in order to maintain control of the component . In addition we can keep a copy of the removed fragment including all styles and entities for use as an internal paste .
function editOnCut(editor, e) {
  var editorState = editor._latestEditorState;
  var selection = editorState.getSelection();
  var element = e.target;
  var scrollPosition = void 0;
  if (selection.isCollapsed()) {
    e.preventDefault();
    return;
  }
  if (element instanceof Node) {
    scrollPosition = getScrollPosition_1(Style_1.getScrollParent(element));
  }
  var fragment = getFragmentFromSelection_1(editorState);
  editor.setClipboard(fragment);
  editor.setMode('cut');
  setTimeout(function () {
    editor.restoreEditorDOM(scrollPosition);
    editor.exitCurrentMode();
    editor.update(removeFragment(editorState));
  }, 0);
}
function editOnCut ( editor , e ) { var editorState = editor . _latestEditorState ; var selection = editorState . getSelection ( ) ; var element = e . target ; var scrollPosition = void 0 ; if ( selection . isCollapsed ( ) ) { e . preventDefault ( ) ; return ; } if ( element instanceof Node ) { scrollPosition = getScrollPosition_1 ( Style_1 . getScrollParent ( element ) ) ; } var fragment = getFragmentFromSelection_1 ( editorState ) ; editor . setClipboard ( fragment ) ; editor . setMode ( 'cut' ) ; setTimeout ( function ( ) { editor . restoreEditorDOM ( scrollPosition ) ; editor . exitCurrentMode ( ) ; editor . update ( removeFragment ( editorState ) ) ; } , 0 ) ; }
On `cut` events, native behavior is allowed to occur so that the system
 clipboard is set properly.
On ` cut ` events native behavior is allowed to occur so that the system clipboard is set properly .
// No selection, so there's nothing to cut. // Track the current scroll position so that it can be forced back in place // after the editor regains control of the DOM. // Set `cut` mode to disable all event handling temporarily. // Let native `cut` behavior occur, then recover control.