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
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
The 2017 editor has an infinite viewport, meaning the entire document is
printed on page load. CodeMirror 6 meanwhile only processes text in the
visible viewport. This presents a situation where if large chunks of
text are inserted outside the visible range (such as the "Changes
recovered" feature of VE), it can cause misalignment of the VE surface
and visible CodeMirror layer, as CodeMirror has not accounted for the
off-screen lines of text.
CodeMirror 5 had a `viewportMargin: infinity` option that prevented this
issue, but at the cost of performance. CodeMirror 6 removed this option,
but the same effect can be achieved by tricking CodeMirror into thinking
we're printing the document, in which case it will process all lines.
This seriously hurts performance, and is a nasty hack, but until the
2017 editor is reworked to have a viewport, there may be no other means
to prevent the misalignment.
The discovery of this issue and the fix are courtesy of Fandom engineers
Bug: T357482
Change-Id: If11ce48459e8faf55015108e8c2eabdc16e0d917
This is a follow-up of the patch 1032770, which misses one type of indented table in the test. It also specifies a unified `cm-mw-indenting` CSS class for all types of table indentation.
Bug: T108454
Change-Id: I77174cf3fa56382add6d80bf2ec7106c9b2cb642