This fixes some Chromium-specific issues where offsetWidth was rounded
up and could cause misalignment issues. It does not fix all alignment
issues, but should hopefully be an improvement in most cases.
Other changes:
* Add Core VE padding to match CM5 variant (doesn't affect WMF cluster)
* Remove redundant margin rules from VE surface
* Minor code cleanup
Bug: T357482
Change-Id: Ic4246c0b8c39914021bbc2a84d52b332dafec20a
Just like the 2017 editor, we show the number of results and which one
is currently highlighted.
This patch also brings the Tab behaviour closer to the 2017 editor.
Hitting Tab from the search input focuses the replace input, followed by
the replacement buttons, then the find buttons, then the content
editable. Shift+Tab largely does the reverse, except Shift+Tab from the
editor doesn't bring you to the search panel. Doing this would require a
lot of work for minor benefit, as we'd need to determine which panel to
focus to.
Add basic unit test
Bug: T371436
Change-Id: I968f91320ecb6ab9e9da0994052d33c76f85974b
RTL rules within and around the content need to apply to the content
language, not the interface language, so we want to disable the normal
CSSJanus auto-flipping.
Bug: T357482
Bug: T374196
Change-Id: If0becbf7e0baa61118a22af375be0d107567226d
I74bcbc46b0 erroneously passed the model's directionality (how it is
saved) and not the view. This caused misalignment issues when changing
directionality.
Bug: T374196
Follow-Up: I74bcbc46b0b62ff2ed138fe57d852a3cd87c22d0
Change-Id: I81e863e19d6d0bad2cc2be743df896e17a8dc548
Forward keydown events on the CodeMirror DOM element to the #wpTextbox1
element, on which WikiEditor's handlers are registered.
CM6 support to come later.
Bug: T62928
Depends-On: I18db5b6c53000457524573a9ae06939e8df0dc4f
Change-Id: I0e67f2db6b29636fe25583e926a9fb12a69e3851
This does the same as before.
Also:
* Make use of more fitting ??= operator.
* We can use & for union types, I believe.
Change-Id: I359408473882a9337b40ec464562a4358f8d3241
This fixes a bug in the 2017 editor implementation where changes to the
gutter width were calculated before the gutter element was updated.
This fix prevents misalignment issues when copying and pasting large
amounts of content.
Bug: T373649
Change-Id: I74bcbc46b0b62ff2ed138fe57d852a3cd87c22d0
This was introduced in Iac30ffe274 to control the rollout of CM6 to RTL
wikis separately from LTR wikis because of various bugs. While RTL still
isn't perfect, it is stable enough now (hewiki has not complained) and
the 2017 editor is also fully supported. Thus, we no longer need this
feature flag.
Bug: T170001
Change-Id: Ia439527aaab07644b358cedf9603cd9d148b6608
If CodeMirror 6 is enabled and a request is made for ext.CodeMirror
(which is a dependency of all CM5 modules), emit a warning. This should
only effect scripts and gadgets on the WMF cluster.
The CM5 ResourceLoader modules will later be tagged as deprecated after
CM6 is rolled out to all WMF wikis.
Bug: T373720
Change-Id: Ia25e896b80766b5b16b9b69343f24557007b5570
It seems odd to have multiple ways of searching. The CodeMirror
implementation follows modern day UI standards while still offering the
same functionality, so we hijack the search button to use it instead of
the jQuery UI-based WikiEditor search dialog. The dialog is restored if
CodeMirror is switched off.
Bug: T372171
Change-Id: Iab897a17a01b7e04a13a8725afd2eb9e802776ba
Use Codex design tokens where possible, and implement custom dark
theming for things for which there is no suitable design token.
This means we're changing the colors for light mode ever so slightly.
We need to style the search panel for dark mode, so we might as well
tackle T371436 and use CSS-only Codex components. The same is done for
the "Go to line" panel (can be opened with Mod+Alt+g). The messages in
this panel are now also localizable.
The search panel (and goto line panel) are abstracted, with helpers to
create the Codex components. These will not only be used here but also
for the upcoming preferences panel (T359498).
Visually, the search and goto panels were inspired by the 2017 editor
and share a similar layout. CodeMirror similarly uses a more compact
design than usual to maximize the real estate of the editor itself.
Other changes:
* Bump codemirror/search to get latest bug fixes
* Remove stylelint ignorance and fix errors
* Move CM5 styles to ext.CodeMirror.less
* Move CM-specific styles out of mediawiki.less and into codemirror.less
* Move WikiEditor-specific styles to codemirror.wikieditor.less
(incidentally, these only apply to CodeMirror 6)
* Correct qqq documentation; the "dialog" should be called a "panel"
* extension.json: alphabetize list of messages
Bug: T365311
Bug: T371436
Bug: T359498
Change-Id: I6a3bbc6bce4e490886753ff484e377c1763de456