@bhsd/codemirror-mediawiki 2.28.0 → 2.28.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/README.md +43 -9
- package/dist/codemirror.d.ts +2 -0
- package/dist/fold.d.ts +0 -1
- package/dist/linter.d.mts +8 -8
- package/dist/linter.d.ts +8 -8
- package/dist/main.min.js +16 -16
- package/dist/mw.min.js +21 -21
- package/dist/mwConfig.mjs +6 -10
- package/dist/wiki.min.js +21 -21
- package/i18n/en.json +1 -1
- package/i18n/zh-hans.json +1 -1
- package/i18n/zh-hant.json +1 -1
- package/mediawiki.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
- [Description](#description)
|
|
10
10
|
- [Usage](#usage)
|
|
11
|
+
- [JavaScript](#javascript)
|
|
12
|
+
- [CSS](#css)
|
|
11
13
|
- [Constructor](#constructor)
|
|
12
14
|
- [Accessors](#accessors)
|
|
13
15
|
- [lang](#lang)
|
|
@@ -15,6 +17,7 @@
|
|
|
15
17
|
- [view](#view)
|
|
16
18
|
- [visible](#visible)
|
|
17
19
|
- [Methods](#methods)
|
|
20
|
+
- [destroy](#destroy)
|
|
18
21
|
- [extraKeys](#extrakeys)
|
|
19
22
|
- [getLinter](#getlinter)
|
|
20
23
|
- [getNodeAt](#getnodeat)
|
|
@@ -46,9 +49,11 @@
|
|
|
46
49
|
- [highlightTrailingWhitespace](#highlighttrailingwhitespace)
|
|
47
50
|
- [highlightWhitespace](#highlightwhitespace)
|
|
48
51
|
- [hover](#hover)
|
|
52
|
+
- [inlayHints](#inlayhints)
|
|
49
53
|
- [openLinks](#openlinks)
|
|
50
54
|
- [refHover](#refhover)
|
|
51
55
|
- [scrollPastEnd](#scrollpastend)
|
|
56
|
+
- [signatureHelp](#signaturehelp)
|
|
52
57
|
- [tagMatching](#tagmatching)
|
|
53
58
|
- [Known issues](#known-issues)
|
|
54
59
|
- [Syntax Highlighting](#syntax-highlighting)
|
|
@@ -67,6 +72,8 @@ Nonetheless, this repository also provides a customized version with additional
|
|
|
67
72
|
|
|
68
73
|
You can download the code via CDN, for example:
|
|
69
74
|
|
|
75
|
+
## JavaScript
|
|
76
|
+
|
|
70
77
|
```js
|
|
71
78
|
// static import
|
|
72
79
|
import {CodeMirror6} from 'https://cdn.jsdelivr.net/npm/@bhsd/codemirror-mediawiki';
|
|
@@ -91,6 +98,18 @@ or
|
|
|
91
98
|
const {CodeMirror6} = await import('https://unpkg.com/@bhsd/codemirror-mediawiki');
|
|
92
99
|
```
|
|
93
100
|
|
|
101
|
+
## CSS
|
|
102
|
+
|
|
103
|
+
```html
|
|
104
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@bhsd/codemirror-mediawiki/mediawiki.css">
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
or
|
|
108
|
+
|
|
109
|
+
```html
|
|
110
|
+
<link rel="stylesheet" href="https://unpkg.com/@bhsd/codemirror-mediawiki/mediawiki.css">
|
|
111
|
+
```
|
|
112
|
+
|
|
94
113
|
# Constructor
|
|
95
114
|
|
|
96
115
|
<details>
|
|
@@ -161,6 +180,21 @@ Whether the editor is visible, read-only.
|
|
|
161
180
|
|
|
162
181
|
# Methods
|
|
163
182
|
|
|
183
|
+
## destroy
|
|
184
|
+
|
|
185
|
+
<details>
|
|
186
|
+
<summary>Expand</summary>
|
|
187
|
+
|
|
188
|
+
*version added: 2.28.2*
|
|
189
|
+
|
|
190
|
+
Destroy the instance. This method is irrevocable and not recommended for general use. Instead, you should call the [`toggle`](#toggle) method to hide the editor.
|
|
191
|
+
|
|
192
|
+
```js
|
|
193
|
+
cm.destroy();
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
</details>
|
|
197
|
+
|
|
164
198
|
## extraKeys
|
|
165
199
|
|
|
166
200
|
<details>
|
|
@@ -561,6 +595,12 @@ Show spaces and tabs as dots and arrows.
|
|
|
561
595
|
|
|
562
596
|
Show the help information of a magic word when hovering.
|
|
563
597
|
|
|
598
|
+
## inlayHints
|
|
599
|
+
|
|
600
|
+
*version added: 2.22.0*
|
|
601
|
+
|
|
602
|
+
Show inlay hints for anonymous parameters.
|
|
603
|
+
|
|
564
604
|
## openLinks
|
|
565
605
|
|
|
566
606
|
*version added: 2.19.6*
|
|
@@ -579,23 +619,17 @@ Show the content of the `<ref>` tag defined elsewhere when hovering.
|
|
|
579
619
|
|
|
580
620
|
Allow the editor to be scrolled down past the end of the document.
|
|
581
621
|
|
|
582
|
-
## tagMatching
|
|
583
|
-
|
|
584
|
-
*version added: 2.4.1*
|
|
585
|
-
|
|
586
|
-
Matched or unmatched tags are highlighted in cyan or dark red when the cursor is inside.
|
|
587
|
-
|
|
588
622
|
## signatureHelp
|
|
589
623
|
|
|
590
624
|
*version added: 2.21.1*
|
|
591
625
|
|
|
592
626
|
Show the parser function signature when typing.
|
|
593
627
|
|
|
594
|
-
##
|
|
628
|
+
## tagMatching
|
|
595
629
|
|
|
596
|
-
*version added: 2.
|
|
630
|
+
*version added: 2.4.1*
|
|
597
631
|
|
|
598
|
-
|
|
632
|
+
Matched or unmatched tags are highlighted in cyan or dark red when the cursor is inside.
|
|
599
633
|
|
|
600
634
|
# Known issues
|
|
601
635
|
|
package/dist/codemirror.d.ts
CHANGED
package/dist/fold.d.ts
CHANGED
|
@@ -21,7 +21,6 @@ export declare const braceStackUpdate: (state: EditorState, node: SyntaxNode) =>
|
|
|
21
21
|
export declare const foldable: (state: EditorState, posOrNode: number | SyntaxNode, tree?: Tree | null) => DocRange | false;
|
|
22
22
|
export declare const foldableLine: ({ state, viewport: { to: end }, viewportLineBlocks }: EditorView, { from: f, to: t }: DocRange) => DocRange | false;
|
|
23
23
|
declare const _default: [(e?: Extension | undefined) => Extension, {
|
|
24
|
-
lua: Extension[];
|
|
25
24
|
mediawiki: (Extension | StateField<Tooltip | null>)[];
|
|
26
25
|
}];
|
|
27
26
|
export default _default;
|
package/dist/linter.d.mts
CHANGED
|
@@ -3,7 +3,7 @@ import type { Linter } from 'eslint';
|
|
|
3
3
|
import type { Warning } from 'stylelint';
|
|
4
4
|
import type { Diagnostic } from 'luacheck-browserify';
|
|
5
5
|
export type Option = Record<string, unknown> | null | undefined;
|
|
6
|
-
export type LiveOption = (runtime?:
|
|
6
|
+
export type LiveOption = (runtime?: boolean) => Option;
|
|
7
7
|
declare type getLinter<T> = () => (text: string) => T;
|
|
8
8
|
declare type asyncLinter<T, S = Record<string, unknown>> = ((text: string, config?: Option) => T) & {
|
|
9
9
|
config?: S;
|
|
@@ -19,6 +19,13 @@ declare interface MixedDiagnostic extends Omit<DiagnosticBase, 'range'> {
|
|
|
19
19
|
from?: number;
|
|
20
20
|
to?: number;
|
|
21
21
|
}
|
|
22
|
+
declare interface JsonError {
|
|
23
|
+
message: string;
|
|
24
|
+
severity: 'error';
|
|
25
|
+
line: string | undefined;
|
|
26
|
+
column: string | undefined;
|
|
27
|
+
position: string | undefined;
|
|
28
|
+
}
|
|
22
29
|
/**
|
|
23
30
|
* 获取 Wikitext LSP
|
|
24
31
|
* @param opt 选项
|
|
@@ -31,13 +38,6 @@ export declare const getJsLinter: getAsyncLinter<Linter.LintMessage[]>;
|
|
|
31
38
|
export declare const getCssLinter: getAsyncLinter<Promise<Warning[]>>;
|
|
32
39
|
/** 获取 Luacheck */
|
|
33
40
|
export declare const getLuaLinter: getAsyncLinter<Promise<Diagnostic[]>>;
|
|
34
|
-
declare interface JsonError {
|
|
35
|
-
message: string;
|
|
36
|
-
severity: 'error';
|
|
37
|
-
line: string | undefined;
|
|
38
|
-
column: string | undefined;
|
|
39
|
-
position: string | undefined;
|
|
40
|
-
}
|
|
41
41
|
/** JSON.parse */
|
|
42
42
|
export declare const getJsonLinter: getLinter<JsonError[]>;
|
|
43
43
|
export {};
|
package/dist/linter.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { Linter } from 'eslint';
|
|
|
3
3
|
import type { Warning } from 'stylelint';
|
|
4
4
|
import type { Diagnostic } from 'luacheck-browserify';
|
|
5
5
|
export type Option = Record<string, unknown> | null | undefined;
|
|
6
|
-
export type LiveOption = (runtime?:
|
|
6
|
+
export type LiveOption = (runtime?: boolean) => Option;
|
|
7
7
|
declare type getLinter<T> = () => (text: string) => T;
|
|
8
8
|
declare type asyncLinter<T, S = Record<string, unknown>> = ((text: string, config?: Option) => T) & {
|
|
9
9
|
config?: S;
|
|
@@ -19,6 +19,13 @@ declare interface MixedDiagnostic extends Omit<DiagnosticBase, 'range'> {
|
|
|
19
19
|
from?: number;
|
|
20
20
|
to?: number;
|
|
21
21
|
}
|
|
22
|
+
declare interface JsonError {
|
|
23
|
+
message: string;
|
|
24
|
+
severity: 'error';
|
|
25
|
+
line: string | undefined;
|
|
26
|
+
column: string | undefined;
|
|
27
|
+
position: string | undefined;
|
|
28
|
+
}
|
|
22
29
|
/**
|
|
23
30
|
* 获取 Wikitext LSP
|
|
24
31
|
* @param opt 选项
|
|
@@ -31,13 +38,6 @@ export declare const getJsLinter: getAsyncLinter<Linter.LintMessage[]>;
|
|
|
31
38
|
export declare const getCssLinter: getAsyncLinter<Promise<Warning[]>>;
|
|
32
39
|
/** 获取 Luacheck */
|
|
33
40
|
export declare const getLuaLinter: getAsyncLinter<Promise<Diagnostic[]>>;
|
|
34
|
-
declare interface JsonError {
|
|
35
|
-
message: string;
|
|
36
|
-
severity: 'error';
|
|
37
|
-
line: string | undefined;
|
|
38
|
-
column: string | undefined;
|
|
39
|
-
position: string | undefined;
|
|
40
|
-
}
|
|
41
41
|
/** JSON.parse */
|
|
42
42
|
export declare const getJsonLinter: getLinter<JsonError[]>;
|
|
43
43
|
export {};
|