1414 * 'canvas:document' : 'getCanvasDocument',
1515 * 'canvas:window' : 'getCanvasWindow',
1616 * 'canvas:body' : 'getCanvasBody',
17- * 'canvas:formatted:block': 'getFormattedBlock',
1817 * 'canvas:selection:coordinates' : 'getSelectionCoordinates',
1918 * 'canvas:selection': 'getSelection',
20- * 'canvas:selection:in:or:contains': 'selectionInOrContains'
2119 * },
2220 * commands: {
2321 * 'canvas:content' : 'setContent',
24- * 'canvas:insert:range' : 'insertRange',
25- * 'canvas:insert:node' : 'insertNode',
26- * 'canvas:select:all' : 'selectAll',
2722 * 'canvas:select:by:coordinates' : 'selectByCoordinates',
28- * 'canvas:import:selection' : 'importSelection',
29- * 'canvas:export:prep': 'exportPrep',
3023 * 'canvas:export:all': 'exportAll',
3124 * 'canvas:cache:selection': 'cacheSelection',
3225 * 'canvas:select:cachedSelection': 'selectCachedSelection',
@@ -55,19 +48,12 @@ const Canvas = Module({
5548 'canvas:document' : 'getCanvasDocument' ,
5649 'canvas:window' : 'getCanvasWindow' ,
5750 'canvas:body' : 'getCanvasBody' ,
58- 'canvas:formatted:block' : 'getFormattedBlock' ,
5951 'canvas:selection:coordinates' : 'getSelectionCoordinates' ,
60- 'canvas:selection' : 'getSelection' ,
61- 'canvas:selection:in:or:contains' : 'selectionInOrContains'
52+ 'canvas:selection' : 'getSelection'
6253 } ,
6354 commands : {
6455 'canvas:content' : 'setContent' ,
65- 'canvas:insert:range' : 'insertRange' ,
66- 'canvas:insert:node' : 'insertNode' ,
67- 'canvas:select:all' : 'selectAll' ,
6856 'canvas:select:by:coordinates' : 'selectByCoordinates' ,
69- 'canvas:import:selection' : 'importSelection' ,
70- 'canvas:export:prep' : 'exportPrep' ,
7157 'canvas:export:all' : 'exportAll' ,
7258 'canvas:cache:selection' : 'cacheSelection' ,
7359 'canvas:select:cachedSelection' : 'selectCachedSelection' ,
@@ -257,13 +243,6 @@ const Canvas = Module({
257243 canvasBody . appendChild ( rangeDocFrag ) ;
258244 } ,
259245
260- insertNode ( node ) {
261- const nodeClone = node . cloneNode ( true ) ;
262- const canvasBody = this . getCanvasBody ( ) ;
263- this . reset ( ) ;
264- canvasBody . appendChild ( nodeClone ) ;
265- } ,
266-
267246 selectAll ( opts = { } ) {
268247 const { mediator } = this ;
269248 mediator . exec ( 'selection:select:all' , opts ) ;
@@ -277,31 +256,6 @@ const Canvas = Module({
277256 mediator . exec ( 'selection:select:coordinates' , rangeCoordinates ) ;
278257 } ,
279258
280- importSelection ( opts = { } ) {
281- const { mediator } = this ;
282- let rangeCoordinates ;
283-
284- if ( opts . toRoot ) {
285- rangeCoordinates = mediator . get ( 'selection:range:relative:toroot' ) ;
286- mediator . exec ( 'selection:expand:toroot' ) ;
287- }
288-
289- const selectionRange = mediator . get ( 'selection:range' ) ;
290-
291- this . insertRange ( selectionRange ) ;
292- if ( opts . toRoot ) {
293- this . selectByCoordinates ( rangeCoordinates ) ;
294- } else {
295- this . selectAll ( ) ;
296- }
297- this . setCanvasBodyEditable ( ) ;
298-
299- } ,
300-
301- exportPrep ( ) {
302- this . cleanHtml ( ) ;
303- } ,
304-
305259 exportAll ( ) {
306260 const { mediator } = this ;
307261 const canvasBody = this . getCanvasBody ( ) ;
@@ -311,13 +265,6 @@ const Canvas = Module({
311265 mediator . exec ( 'contenteditable:inserthtml' , exportHTMLString ) ;
312266 } ,
313267
314- getFormattedBlock ( ) {
315- const { mediator } = this ;
316- mediator . exec ( 'selection:expand:toroot' ) ;
317- const blockRange = mediator . get ( 'selection:range' ) ;
318- return blockRange . cloneContents ( ) ;
319- } ,
320-
321268 cleanHtml ( ) {
322269 const canvasDoc = this . getCanvasDocument ( ) ;
323270 const canvasBody = this . getCanvasBody ( ) ;
@@ -367,11 +314,6 @@ const Canvas = Module({
367314 return mediator . get ( 'selection:range:coordinates' ) ;
368315 } ,
369316
370- selectionInOrContains ( selectors ) {
371- const { mediator } = this ;
372- return mediator . get ( 'selection:in:or:contains' , selectors ) ;
373- } ,
374-
375317 destroy ( ) {
376318 const { props } = this ;
377319 const { iframe } = props ;
0 commit comments