From d06e9dbc31b8e4c4d42c095f6ea967df164ea802 Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Tue, 29 Oct 2024 17:37:58 +0000 Subject: [PATCH] Update VE core submodule to master (0e82a6db8) New changes: db0f21d03 ve.ce.Surface: Check dataTransfer.files is non-empty e1cd78933 [BREAKING CHANGE] Move selection handling code to SelectionManager b4b63a463 Move drag/drop handling code to DragDropHandler 540272769 Use the onPaste handler for dropped content d3f9d8485 ClipboardHandler tests: Run tests in series 1232c0420 Tests: Introduce ve.dm.example.annotateText to simplify runs of annotated text 69d7ca482 Apply an annotation to imported (pasted/dropped) text 0e82a6db8 ve.ce.ClipboardHandler: Fix async test running Added files: - src/ce/annotations/ve.ce.ImportedDataAnnotation.js - src/ce/ve.ce.DragDropHandler.js - src/ce/ve.ce.SelectionManager.js - src/dm/annotations/ve.dm.ImportedDataAnnotation.js - tests/ce/ve.ce.DragDropHandler.test.js Local changes: - Implement new selection manager architecture Added files: - src/ce/annotations/ve.ce.ImportedDataAnnotation.js - src/ce/ve.ce.DragDropHandler.js - src/ce/ve.ce.SelectionManager.js - src/dm/annotations/ve.dm.ImportedDataAnnotation.js - tests/ce/ve.ce.DragDropHandler.test.js Bug: T371996 Bug: T377427 Bug: T78696 Change-Id: If8d38246badf919c32915beda7c9a14f16e62a8a --- editcheck/modules/EditCheckDialog.js | 2 +- editcheck/modules/init.js | 4 ++-- extension.json | 5 +++++ lib/ve | 2 +- modules/ve-mw/tests/ce/ve.ce.Surface.test.js | 8 +++++++- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/editcheck/modules/EditCheckDialog.js b/editcheck/modules/EditCheckDialog.js index 5bf2a0dbdd..d37764339c 100644 --- a/editcheck/modules/EditCheckDialog.js +++ b/editcheck/modules/EditCheckDialog.js @@ -62,7 +62,7 @@ ve.ui.EditCheckDialog.prototype.update = function () { } ).$element ); selections.push( ve.ce.Selection.static.newFromModel( check.highlight.getSelection(), surfaceView ) ); } ); - surfaceView.drawSelections( 'editCheckWarning', selections ); + surfaceView.getSelectionManager().drawSelections( 'editCheckWarning', selections ); this.$body.empty().append( $checks ); }; diff --git a/editcheck/modules/init.js b/editcheck/modules/init.js index c860a02183..adb12edd1c 100644 --- a/editcheck/modules/init.js +++ b/editcheck/modules/init.js @@ -209,7 +209,7 @@ if ( mw.config.get( 'wgVisualEditorConfig' ).editCheck || mw.editcheck.ecenable selections.push( selection ); } ); // TODO: Make selections clickable when multicheck is enabled - surfaceView.drawSelections( + surfaceView.getSelectionManager().drawSelections( 'editCheck', checks.map( ( check ) => ve.ce.Selection.static.newFromModel( check.highlight.getSelection(), surfaceView ) ) ); @@ -285,7 +285,7 @@ if ( mw.config.get( 'wgVisualEditorConfig' ).editCheck || mw.editcheck.ecenable return saveProcessDeferred.promise().then( ( data ) => { context.removePersistentSource( 'editCheckReferences' ); - surfaceView.drawSelections( 'editCheck', [] ); + surfaceView.getSelectionManager().drawSelections( 'editCheck', [] ); surfaceView.setReviewMode( false ); reviewToolbar.$element.remove(); diff --git a/extension.json b/extension.json index a9f08e802f..a87db6d9a9 100644 --- a/extension.json +++ b/extension.json @@ -933,6 +933,7 @@ "lib/ve/src/dm/nodes/ve.dm.InlineImageNode.js", "lib/ve/src/dm/annotations/ve.dm.LinkAnnotation.js", "lib/ve/src/dm/annotations/ve.dm.TextStyleAnnotation.js", + "lib/ve/src/dm/annotations/ve.dm.ImportedDataAnnotation.js", "lib/ve/src/dm/annotations/ve.dm.AbbreviationAnnotation.js", "lib/ve/src/dm/annotations/ve.dm.BidiAnnotation.js", "lib/ve/src/dm/annotations/ve.dm.BigAnnotation.js", @@ -979,6 +980,8 @@ "lib/ve/src/ce/ve.ce.TableCellableNode.js", "lib/ve/src/ce/ve.ce.Selection.js", "lib/ve/src/ce/ve.ce.ClipboardHandler.js", + "lib/ve/src/ce/ve.ce.DragDropHandler.js", + "lib/ve/src/ce/ve.ce.SelectionManager.js", "lib/ve/src/ce/ve.ce.Surface.js", "lib/ve/src/ce/ve.ce.SurfaceObserver.js", "lib/ve/src/ce/ve.ce.KeyDownHandlerFactory.js", @@ -1032,6 +1035,7 @@ "lib/ve/src/ce/annotations/ve.ce.NailedAnnotation.js", "lib/ve/src/ce/annotations/ve.ce.LinkAnnotation.js", "lib/ve/src/ce/annotations/ve.ce.TextStyleAnnotation.js", + "lib/ve/src/ce/annotations/ve.ce.ImportedDataAnnotation.js", "lib/ve/src/ce/annotations/ve.ce.AbbreviationAnnotation.js", "lib/ve/src/ce/annotations/ve.ce.BidiAnnotation.js", "lib/ve/src/ce/annotations/ve.ce.BigAnnotation.js", @@ -2614,6 +2618,7 @@ "lib/ve/tests/ce/ve.ce.Document.test.js", "modules/ve-mw/tests/ce/ve.ce.Document.test.js", "lib/ve/tests/ce/ve.ce.ClipboardHandler.test.js", + "lib/ve/tests/ce/ve.ce.DragDropHandler.test.js", "lib/ve/tests/ce/ve.ce.Surface.test.js", "modules/ve-mw/tests/ce/ve.ce.Surface.test.js", "lib/ve/tests/ce/ve.ce.RangeState.test.js", diff --git a/lib/ve b/lib/ve index 7a373467ce..0e82a6db85 160000 --- a/lib/ve +++ b/lib/ve @@ -1 +1 @@ -Subproject commit 7a373467ce93d23297846e66fff5bc9419f87cce +Subproject commit 0e82a6db8555ff56a2e51fb6c2a8ecb5ceb729b5 diff --git a/modules/ve-mw/tests/ce/ve.ce.Surface.test.js b/modules/ve-mw/tests/ce/ve.ce.Surface.test.js index 486f1633dc..a619c62a47 100644 --- a/modules/ve-mw/tests/ce/ve.ce.Surface.test.js +++ b/modules/ve-mw/tests/ce/ve.ce.Surface.test.js @@ -86,5 +86,11 @@ QUnit.test( 'beforePaste/afterPaste', ( assert ) => { } ]; - cases.forEach( ve.test.utils.runSurfacePasteTest.bind( this, assert ) ); + const done = assert.async(); + ( async function () { + for ( const caseItem of cases ) { + await ve.test.utils.runSurfacePasteTest( assert, caseItem ); + } + done(); + }() ); } );