src/scripts/modules/BaseFormatter.js
/**
         * @func importFromCanvas
         * @access protected
         * @description mediator.exec("format:import:from:canvas", { importFilter() }) - Imports the content from the canvas and replaces the current editor's
         * content via a past execCommand
         * @param  {method} opts.importFilter optional - a filter method that will be given a reference to the canvasBody allowing for custom manipulation of the formatted content.
         */
@func importFromCanvas
@access protected
@description mediator.exec("format:import:from:canvas", { importFilter() }) - Imports the content from the canvas and replaces the current editor's
content via a past execCommand
@param  {method} opts.importFilter optional - a filter method that will be given a reference to the canvasBody allowing for custom manipulation of the formatted content.
@func importFromCanvas @access protected @description mediator . exec ( " format : import : from : canvas " { importFilter () } ) - Imports the content from the canvas and replaces the current editor ' s content via a past execCommand @param { method } opts . importFilter optional - a filter method that will be given a reference to the canvasBody allowing for custom manipulation of the formatted content .
importFromCanvas (opts={}) {
            const { mediator } = this;
            const canvasBody = mediator.get('canvas:body');
            mediator.emit('import:from:canvas:start');
            mediator.exec('canvas:cache:selection');
            mediator.exec('format:clean', canvasBody);
            if (opts.importFilter) {
                opts.importFilter(canvasBody);
            }
            mediator.exec('canvas:select:cachedSelection');
            const canvasSelectionCoordinates = mediator.get('canvas:selection:coordinates');
            mediator.exec('selection:select:all');
            mediator.exec('canvas:export:all');
            mediator.exec('selection:select:coordinates', canvasSelectionCoordinates);
            mediator.emit('import:from:canvas:complete');
        }
importFromCanvas ( opts = { } ) { const { mediator } = this ; const canvasBody = mediator . get ( 'canvas:body' ) ; mediator . emit ( 'import:from:canvas:start' ) ; mediator . exec ( 'canvas:cache:selection' ) ; mediator . exec ( 'format:clean' , canvasBody ) ; if ( opts . importFilter ) { opts . importFilter ( canvasBody ) ; } mediator . exec ( 'canvas:select:cachedSelection' ) ; const canvasSelectionCoordinates = mediator . get ( 'canvas:selection:coordinates' ) ; mediator . exec ( 'selection:select:all' ) ; mediator . exec ( 'canvas:export:all' ) ; mediator . exec ( 'selection:select:coordinates' , canvasSelectionCoordinates ) ; mediator . emit ( 'import:from:canvas:complete' ) ; }
@func importFromCanvas
 @access protected
 @description mediator.exec("format:import:from:canvas", { importFilter() }) - Imports the content from the canvas and replaces the current editor's
 content via a past execCommand
 @param  {method} opts.importFilter optional - a filter method that will be given a reference to the canvasBody allowing for custom manipulation of the formatted content.
@func importFromCanvas @access protected @description mediator . exec ( " format : import : from : canvas " { importFilter () } ) - Imports the content from the canvas and replaces the current editor ' s content via a past execCommand @param { method } opts . importFilter optional - a filter method that will be given a reference to the canvasBody allowing for custom manipulation of the formatted content .