Commit graph

14638 commits

Author SHA1 Message Date
Ed Sanders d06e9dbc31 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
2024-10-30 17:52:56 +00:00
jenkins-bot 80eff2ac37 Merge "MWGalleryDialog: Highlight item at closest index when removing an image" 2024-10-29 14:50:15 +00:00
jenkins-bot 407bb951b8 Merge "MWGalleryItemWidget: Remove unnecessary event argument" 2024-10-29 14:50:13 +00:00
jenkins-bot 9425db2172 Merge "Update VE core submodule to master (bae9101b7)" 2024-10-29 14:17:54 +00:00
Ed Sanders 4bc814f1a0 Update VE core submodule to master (bae9101b7)
New changes:
7906a6b9e build: Updating npm dependencies
92e6a5338 TextStyleAnnotation: Don't register abstract base class
456ca9b2e Localisation updates from https://translatewiki.net.
a68ba80d2 Get all annotations by ranges
dc49d9592 Demos: Default to WMUI theme
222ac7d23 Add unit tests for ve.dm.BranchNode#getAnnotationRanges
ba73b9e91 Return annotation ranges in lexicographic order
6e40aa524 Localisation updates from https://translatewiki.net.
1a4640a4a ve.ce.Surface: Remove unused $deactivatedSelection and $findResults
9455e0f0a ve.ce.Surface: Replace text/xcustom clipboard storage with a custom key
ddd14aa9b [BREAKING CHANGE] Move paste handling code to ve.ce.ClipboardHandler
19f0e500b CollabProcessDialog: Replace mw.user.getName with platform method
ecd607353 Implement pasteSourceDetectors
bae9101b7 Localisation updates from https://translatewiki.net.

Added files:
- src/ce/ve.ce.ClipboardHandler.js
- tests/ce/ve.ce.ClipboardHandler.test.js

Local changes:
* Implement new paste handler architecture
* Use new clipboard key

Bug: T360624
Bug: T376306
Bug: T78696
Change-Id: Iea10d32b6132ae364d486cc6b96895bb937ac944
2024-10-22 15:31:24 +01:00
Ed Sanders 3dfef738e2 MWGalleryDialog: Highlight item at closest index when removing an image
Bug: T373981
Change-Id: Ib0edc97279c6ec4e0529197d9beb1d7c9c51ee28
2024-10-21 17:18:43 +00:00
Ed Sanders 332188807a MWGalleryNode: Check node still exists when updating
Bug: T377717
Change-Id: I13f9c1ced3e59d4d88aaca02b884d06cc57b11a6
2024-10-21 14:03:15 +01:00
Ed Sanders 4cd67004de editcheck: Remove mw.editcheck.Diff
This object just contained a pointer to the surface and dm,
and had one utility method.

Move the method to mw.editcheck, and pass around a surface model
or document model to other methods as appropriate.

Change-Id: Ie81d76dea2823b633328f982ee20027808bfc8e3
2024-10-17 17:10:02 +01:00
jenkins-bot c2dd7617a3 Merge "ve.ce.MWPreNode: Fix primaryCommandName" 2024-10-08 16:38:41 +00:00
Ed Sanders 67b5e1c5e1 ve.ce.MWPreNode: Fix primaryCommandName
Change-Id: I20f3c946ef9a7436756dc298fa9609ffd05ce5a1
2024-10-08 15:16:02 +01:00
Bartosz Dziewoński 365cefa878 tests: Use real mw.Api in ve.ui.MWTemplateTitleInputWidget tests
Otherwise the changes to mw.widgets.TitleWidget in
Iec338e9f595b452c19ce8e74eb81339fbce11640 cause the test to fail.
To avoid making real API requests, use fake server instead.

Change-Id: I7ff705af79760e33200a2dfbfdd05138c18bb110
2024-10-07 19:24:43 +00:00
Bartosz Dziewoński e6f1698bcb Fix "target is undefined" exception when loading fails
When loading the editor fails, getTarget() should return a rejected
promise. However, the rejection handler that logs the loading error
also accidentally converted the promise to a resolved one.

The easiest way to reproduce is to enable offline mode in your
browser's developer tools, then click "Edit".

Change-Id: Icf6ea14f4d4e3afcb6608f4c0c49b76c297bf9a3
2024-10-07 19:24:43 +00:00
Ed Sanders 365950cbe6 Get attached node from document model, instead of surface
Change-Id: I37b3dfeabe7666878884d21113f928691363a39a
Depends-On: I813c341cb1a0751443880d2e05aa209d3d973a00
2024-10-01 15:01:43 +00:00
Ed Sanders cefa56ecb9 Use fixed font size for UI componenets in Vector 22
Use rem's to set the font size of the toolbar and local/global
overlays, as the font size is now variable in that skin.

Bug: T373875
Change-Id: Ib2511debd01dbc0cf03ff6d92cd9bfe71078c387
2024-09-05 11:21:08 +01:00
Ed Sanders ac652a2e36 MWGalleryItemWidget: Remove unnecessary event argument
Listeners will already know which object emitted the event.
Currently this event is used once as a aggregate event,
(as 'editItem' in the ve.ui.MWGalleryGroupWidget constructor)
in which case the emitting object is already prepended as the
first argument (as documented in OO.EmitterList.prototype.aggregate).

Change-Id: I490f368af8e9cae60eacac918bf83702999f705b
2024-09-04 10:58:06 +01:00
jenkins-bot f363c943cc Merge "Allow &veaction=editsource to load 2017WTE regardless of user prefs" 2024-08-30 06:20:42 +00:00
jenkins-bot 1b777d45e0 Merge "Fix exception editing cross-wiki redirects" 2024-08-29 22:54:21 +00:00
Mahmoud Al-Qudsi a9278f654b Fix exception editing cross-wiki redirects
As described in T326169, when editing a (manually created) cross-wiki redirect,
VisualEditor will throw a null dereference exception causing it to fail to load
in the browser (looking like it is just taking forever to load).

This patch prevents the exception from occurring by not attempting to write to
the null object.

Bug: T326169
Change-Id: I50fa803c7b4ce65dac1fe345431d8b8f9d0b3d61
2024-08-28 13:27:09 -05:00
Bartosz Dziewoński b4fc696ad5 Reattempt save as temporary user only when we were previously anon
…but not when we were previously logged-in. Temporary accounts no
longer leak IP addresses, but it's still not nice to lose attribution
of edits by logged-in users.

Follow-up to 317d6dd724.

Bug: T345975
Change-Id: I24c786c0f060921f773e1d6d1c7463f1cc79aab2
2024-08-27 23:23:11 +02:00
jenkins-bot 24c53a321e Merge "Reattempt save when refreshing temporary user if session expired" 2024-08-27 13:49:58 +00:00
Bartosz Dziewoński c93d4a9695 Allow &veaction=editsource to load 2017WTE regardless of user prefs
Bug: T239796
Change-Id: I0391d44d15763980cfb48b2945bac35e5b08e930
2024-08-26 20:13:36 +02:00
Timo Tijhof 07a132d310 tests: Force templateDataInstalled condition for MWTemplateTitleInputWidget
Change-Id: I730a0e53547d4e7510fcec09905ea98030490c0d
2024-08-22 00:29:16 +01:00
jenkins-bot fcce9b0b89 Merge "Move edit section colorings to core" 2024-08-17 14:19:55 +00:00
jenkins-bot b54f4ebb28 Merge "Fix getTemplateDataQueryTitle() when the title ends with a newline" 2024-08-16 15:30:57 +00:00
Ebrahim Byagowi 84557b6d13 Move edit section colorings to core
Bug: T372436
Depends-On: I691dbef2313e006de4b7d096232c531d81bdd380
Change-Id: If6c606cd6d3816b9286aee0ffd4d96be704521d4
2024-08-14 22:24:00 +03:30
Jamie Kuppens 317d6dd724 Reattempt save when refreshing temporary user if session expired
A notice already appears and informs the user of the visual editor that
they're not logged in if their session has ended. Showing an additional
error dialog informing the editor of this when saving changes is not
needed.

Bug: T345975
Change-Id: I20a904dbc6d3c2f0d08e4ceea27e35ee1b65bb71
2024-08-13 16:33:55 -07:00
jenkins-bot c3e7d584e5 Merge "Reenable Cite-related test" 2024-08-05 08:10:00 +00:00
Ebrahim Byagowi 5c798b0eea Move editsection bidi isolate to MediaWiki
MediaWiki needs this even without VisualEditor so let's move it there.

Bug: T371702
Depends-On: I4dcfa3916a07e92565b5667adb2ead0115fdb438
Change-Id: I0562ea1e5bd28eabd3ef0bcd8372155da67bcd0c
2024-08-02 18:52:54 +03:30
Ebrahim Byagowi 0f85b14328 Define brackets spacing in a direction aware way
This also resolves the bug but it hides the underlying issue on it
that's why I like to have this but after having
Ia7dd8076c8789ed04d3fb52a078c70561ee5c6f8

Bug: T371665
Change-Id: I7340829acbd2bf3fcccfb631848964e5338470b0
2024-08-02 11:30:27 +03:30
Ebrahim Byagowi 6965da7012 Don't set direction for editsections
This causes editsection to jump

Bug: T371665
Change-Id: Ia7dd8076c8789ed04d3fb52a078c70561ee5c6f8
2024-08-02 11:09:45 +03:30
Sébastien Beyou 6ea7ab19fd Fix getTemplateDataQueryTitle() when the title ends with a newline
According to ECMAScript, .trim() and RegExp’s "\s" capture the same
characters, so I replace the initial "\s*" by .trim() to remove
whitespaces and line terminators at the beginning and at the end.

Bug: T371000
Change-Id: Id9188f97a3136b986b052b71cd4079c1109ea8ff
2024-07-26 16:18:29 +02:00
James D. Forrester 8c9605921c DesktopArticleTarget: Set wgCurRevisionId and wgRevisionId once publish goes through
Bug: T370771
Change-Id: I0100c155352ec55275f40616f87e69af52d6e97b
2024-07-25 12:28:15 -04:00
Ed Sanders b302e0288b Disable edit mode switch in multi-user environment
Bug: T370819
Change-Id: I8244aaa0783e35ca70385045a8165e0bcb9a91dc
2024-07-24 13:37:18 +01:00
Adam Wight 67417c28b8 Reenable Cite-related test
Bug: T370512
Depends-On: Id8684ccee2e6725af2c861da20fc31af1067e614
Change-Id: I8453ce99daae2dbec58088186961a30ae9d1c3e7
2024-07-24 11:44:35 +02:00
Adam Wight b4da46585c Temporarily disable Cite-related test
This can be reenabled once Cite changes are merged.

The disabled test is also updated in this patch so that it will pass
with the new Cite code.

Bug: T370512
Change-Id: I56b52c399d2c76689fdcb0bc7fd50a8c0ced28fd
2024-07-24 11:43:33 +02:00
Timo Tijhof ba6f60032b tests: Fix DesktopArticleTarget dirtying location.href
Without this, wheneve VE is installed, test execution ends with the
address bar rewritten to Special:Badtitle, which affects reloads etc
and makes debugging anything else harder.

Bug: T250045
Change-Id: Ic453ae388c842369ff1cb1e84dcad4a8bbc7d54f
2024-07-20 04:05:42 +00:00
jenkins-bot c322fe0459 Merge "Rewrite a conditional to make the logic a little clearer." 2024-07-17 10:22:07 +00:00
jenkins-bot 4a4bda78ab Merge "Reenable test after Cite-related fix" 2024-07-15 12:07:23 +00:00
Zoë 652e140dc5 Rewrite a conditional to make the logic a little clearer.
I spent a couple minutes looking at this before I saw that we needed
`this.updateVisibility()` to only fire if the loop iterated at least
once.

Change-Id: I7d03f73a35e3ded539898effa064dc0e14ba595f
2024-07-08 15:27:07 +01:00
Ed Sanders bc9c900b6a Use transitionend events instead of hard coding animation time
transitionend is supported by all our target browsers.

Also use requestAnimationFrame without a fallback as
this is also supported by all browsers.

Change-Id: I563cacdc8b2365ad4b69dfccb7e46a9f176dbd9b
2024-07-03 00:43:19 +01:00
Divec e64037f19d Merge "Remove slug animation values overrides" 2024-07-02 18:36:03 +00:00
jenkins-bot 1ac180346c Merge "Replace hardcoded colors with Codex design tokens" 2024-07-02 17:30:01 +00:00
Adam Wight a0ece81a44 Reenable test after Cite-related fix
Bug: T247921
Change-Id: Ic5ddcb2b861186f3defd10447b4d1b525bda3fbf
Depends-On: Ieff73769f8ebbc3724f6a9b498487c4e7d09aa2e
2024-07-02 10:39:41 +00:00
Adam Wight 4715dd444d Temporarily skip a Cite-related test
Needs to be skipped in order to merge a change in Cite.

Bug: T247921
Change-Id: I32276021713876b3dac2210c26bbd27500009c14
2024-07-02 12:31:43 +02:00
jenkins-bot c3f87d277f Merge "Remove VE user-agent based browser compatibility checks" 2024-06-20 17:05:08 +00:00
jenkins-bot 2603c5c718 Merge "Update VE core submodule to master (65e536c1c)" 2024-06-19 16:24:21 +00:00
David Lynch 955bfc4b68 findAddedContentNeedingReference was removed accidentally
Replace it with a hasAddedContentNeedingReference that'll need to be
kept in-sync with the internal logic in AddReferenceEditCheck while
we're tagging this.

Follow-up to d69d366469.

Bug: T367920
Change-Id: I9f4f96bf5c6c4b7b3131b1435426b2e283c9833a
2024-06-18 16:12:30 -05:00
Bartosz Dziewoński 4c93b27c7d Update VE core submodule to master (65e536c1c)
New changes:
3135ad109 Update OOUI to v0.50.0
0eb93c340 Localisation updates from https://translatewiki.net.
2e23d8cac ve.ui.Surface: Improve documentation of surface padding
d42086d50 Allow TableCellableNode to span multiple DOM elements
65e536c1c Localisation updates from https://translatewiki.net.

Local changes:
* Allow MWTransclusionTableCellNode to span multiple DOM elements

Bug: T366984
Bug: T367061
Change-Id: I67239ac72f29b9729b73c7604ee3680ceb1b8475
2024-06-17 20:06:18 +02:00
Ed Sanders 8cb070f4d7 Remove VE user-agent based browser compatibility checks
Bug: T367735
Change-Id: I07fb1bbbd2f907672400cb9bc74fd40dea973da9
2024-06-17 13:03:04 +01:00
libraryupgrader 9e9ee59272 build: Updating npm dependencies
* eslint-config-wikimedia: 0.28.0 → 0.28.2
  The following rules are failing and were disabled:
  * modules:
    * no-jquery/no-append-html
  * modules/ve-mw/dm:
    * no-jquery/no-append-html

* grunt-stylelint: 0.20.0 → 0.20.1
* stylelint-config-wikimedia: 0.17.1 → 0.17.2
* braces: 3.0.2 → 3.0.3
  * https://github.com/advisories/GHSA-grv7-fg5c-xmjg

Change-Id: If171a41f93d4e96606df99fb394a9f961dc36ebd
2024-06-16 15:25:54 +00:00