@bhsd/codemirror-mediawiki 3.10.1 → 3.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/codemirror.js +3 -3
- package/dist/fold.js +1 -1
- package/dist/hover.js +7 -3
- package/dist/inlay.js +1 -1
- package/dist/main.min.js +29 -29
- package/dist/mediawiki.js +5 -3
- package/dist/mw.min.js +31 -31
- package/dist/mwConfig.js +1 -1
- package/dist/ref.js +1 -1
- package/dist/token.js +5 -5
- package/dist/wiki.min.js +30 -30
- package/i18n/en.json +1 -1
- package/i18n/zh-hans.json +1 -1
- package/i18n/zh-hant.json +1 -1
- package/package.json +20 -20
package/dist/codemirror.js
CHANGED
|
@@ -3,7 +3,7 @@ import { EditorSelection, Compartment, EditorState, SelectionRange, } from '@cod
|
|
|
3
3
|
import { syntaxHighlighting, defaultHighlightStyle, indentOnInput, indentUnit, ensureSyntaxTree, syntaxTree, } from '@codemirror/language';
|
|
4
4
|
import { defaultKeymap, historyKeymap, history, redo, indentWithTab, insertNewlineKeepIndent, deleteCharBackwardStrict, } from '@codemirror/commands';
|
|
5
5
|
import { search, searchKeymap } from '@codemirror/search';
|
|
6
|
-
import { linter, lintGutter,
|
|
6
|
+
import { linter, lintGutter, nextDiagnostic } from '@codemirror/lint';
|
|
7
7
|
import elt from 'crelt';
|
|
8
8
|
import { base, panelSelector, panelsSelector, diagnosticSelector, noDetectionLangs } from './constants.js';
|
|
9
9
|
import { light } from './theme.js';
|
|
@@ -307,7 +307,7 @@ export class CodeMirror6 {
|
|
|
307
307
|
return diagnostics;
|
|
308
308
|
})),
|
|
309
309
|
lintGutter(),
|
|
310
|
-
keymap.of(
|
|
310
|
+
keymap.of([{ key: 'F8', run: nextDiagnostic }]),
|
|
311
311
|
optionalFunctions.statusBar(cm, lintSources[0].fixer),
|
|
312
312
|
]
|
|
313
313
|
: [];
|
|
@@ -434,7 +434,7 @@ export class CodeMirror6 {
|
|
|
434
434
|
});
|
|
435
435
|
}
|
|
436
436
|
else if (!show && this.#visible) {
|
|
437
|
-
const { state: { selection: { main: { from, to, head } } }, hasFocus } = this.#view, {
|
|
437
|
+
const { state: { selection: { main: { from, to, head } } }, hasFocus } = this.#view, { scrollTop } = this.#view.scrollDOM;
|
|
438
438
|
this.#view.dom.style.setProperty('display', 'none', 'important');
|
|
439
439
|
this.#textarea.style.display = '';
|
|
440
440
|
this.#textarea.setSelectionRange(from, to, head === to ? 'forward' : 'backward');
|
package/dist/fold.js
CHANGED
|
@@ -141,7 +141,7 @@ const foldSelector = '.cm-tooltip-fold';
|
|
|
141
141
|
* @param state
|
|
142
142
|
*/
|
|
143
143
|
const create = (state) => {
|
|
144
|
-
const {
|
|
144
|
+
const { head } = state.selection.main, range = foldable(state, head);
|
|
145
145
|
if (range) {
|
|
146
146
|
const { from, to } = range;
|
|
147
147
|
let folded = false;
|
package/dist/hover.js
CHANGED
|
@@ -24,9 +24,13 @@ export const getHoverFromApi = async (state, pos, side, paramSuggest, templateda
|
|
|
24
24
|
return {
|
|
25
25
|
contents: {
|
|
26
26
|
kind: 'plaintext',
|
|
27
|
-
value: (description ? `<p>${escHTML(description)}</p>` : '')
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
value: (description ? `<p>${escHTML(description)}</p>` : '')
|
|
28
|
+
+ ['Required', 'Suggested', 'Optional', 'Deprecated'].map(name => {
|
|
29
|
+
const sectionResult = result.filter(([, , , section]) => section === name);
|
|
30
|
+
return sectionResult.length === 0
|
|
31
|
+
? ''
|
|
32
|
+
: `<h4>${name}</h4><ul>${sectionResult.map(([keys, , info]) => `<li>${keys.map(key => `<code>${escHTML(key)}</code>`).join('/')}${info && ` - ${escHTML(info)}`}</li>`).join('')}</ul>`;
|
|
33
|
+
}).join(''),
|
|
30
34
|
},
|
|
31
35
|
range: { start: indexToPos(doc, node.from), end: indexToPos(doc, node.to) },
|
|
32
36
|
};
|
package/dist/inlay.js
CHANGED
|
@@ -22,7 +22,7 @@ const stateEffect = StateEffect.define(), field = StateField.define({
|
|
|
22
22
|
const str = doc.toString();
|
|
23
23
|
for (const effect of effects) {
|
|
24
24
|
if (effect.is(stateEffect)) {
|
|
25
|
-
const {
|
|
25
|
+
const { text, inlayHints } = effect.value;
|
|
26
26
|
if (str === text) {
|
|
27
27
|
return inlayHints
|
|
28
28
|
? Decoration.set(inlayHints.map(({ position, label }) => Decoration.widget({
|