Merge "CodeMirrorWikiEditor: add bracketMatching as default extension"

This commit is contained in:
jenkins-bot 2023-12-11 11:01:53 +00:00 committed by Gerrit Code Review
commit ed36d5284f
7 changed files with 26 additions and 8 deletions

View file

@ -35,3 +35,10 @@ _NOTE: Consider using [Fresh](https://gerrit.wikimedia.org/g/fresh/) to run thes
Older QUnit tests are in `resources/mode/mediawiki/tests/qunit/`. These will
eventually be moved over to `tests/qunit` and rewritten for CodeMirror 6.
## CodeMirror 6 change log
This list changes that come by default with the CodeMirror 6 upgrade.
Some may be removed pending user feedback:
* Bracket matching now highlights unmatched brackets in red

13
package-lock.json generated
View file

@ -10,6 +10,7 @@
"@babel/plugin-transform-runtime": "7.22.15",
"@babel/preset-env": "7.3.0",
"@codemirror/commands": "6.2.5",
"@codemirror/language": "6.9.3",
"@codemirror/search": "6.5.4",
"@codemirror/state": "6.2.1",
"@codemirror/view": "6.18.1",
@ -1331,9 +1332,9 @@
}
},
"node_modules/@codemirror/language": {
"version": "6.9.1",
"resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.9.1.tgz",
"integrity": "sha512-lWRP3Y9IUdOms6DXuBpoWwjkR7yRmnS0hKYCbSfPz9v6Em1A1UCRujAkDiCrdYfs1Z0Eu4dGtwovNPStIfkgNA==",
"version": "6.9.3",
"resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.9.3.tgz",
"integrity": "sha512-qq48pYzoi6ldYWV/52+Z9Ou6QouVI+8YwvxFbUypI33NbjG2UeRHKENRyhwljTTiOqjQ33FjyZj6EREQ9apAOQ==",
"dev": true,
"dependencies": {
"@codemirror/state": "^6.0.0",
@ -21915,9 +21916,9 @@
}
},
"@codemirror/language": {
"version": "6.9.1",
"resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.9.1.tgz",
"integrity": "sha512-lWRP3Y9IUdOms6DXuBpoWwjkR7yRmnS0hKYCbSfPz9v6Em1A1UCRujAkDiCrdYfs1Z0Eu4dGtwovNPStIfkgNA==",
"version": "6.9.3",
"resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.9.3.tgz",
"integrity": "sha512-qq48pYzoi6ldYWV/52+Z9Ou6QouVI+8YwvxFbUypI33NbjG2UeRHKENRyhwljTTiOqjQ33FjyZj6EREQ9apAOQ==",
"dev": true,
"requires": {
"@codemirror/state": "^6.0.0",

View file

@ -23,6 +23,7 @@
"@babel/plugin-transform-runtime": "7.22.15",
"@babel/preset-env": "7.3.0",
"@codemirror/commands": "6.2.5",
"@codemirror/language": "6.9.3",
"@codemirror/search": "6.5.4",
"@codemirror/state": "6.2.1",
"@codemirror/view": "6.18.1",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,3 +1,10 @@
.cm-editor {
height: 100%;
}
.cm-matchingBracket,
.cm-focused .cm-matchingBracket {
background-color: #eee;
box-shadow: inset 0 0 1px 1px #999;
font-weight: bold;
}

View file

@ -3,6 +3,7 @@ import { EditorSelection } from '@codemirror/state';
import { EditorView, keymap } from '@codemirror/view';
import { defaultKeymap, history, historyKeymap } from '@codemirror/commands';
import { searchKeymap } from '@codemirror/search';
import { bracketMatching } from '@codemirror/language';
/**
* @class CodeMirrorWikiEditor
@ -43,6 +44,7 @@ export default class CodeMirrorWikiEditor extends CodeMirror {
*/
const extensions = [
...this.defaultExtensions,
bracketMatching(),
history(),
// See also the default attributes at contentAttributesExtension() in the parent class.
EditorView.contentAttributes.of( {