@bhsd/codemirror-mediawiki 2.6.1 → 2.6.3
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 +18 -1
- package/dist/codemirror.d.ts +9 -0
- package/dist/main.min.js +10 -10
- package/dist/mw.min.js +3 -2
- package/dist/mw.min.js.map +3 -3
- package/i18n/en.json +5 -2
- package/i18n/zh-hans.json +5 -2
- package/i18n/zh-hant.json +5 -2
- package/mw/README.md +15 -0
- package/mw/base.ts +19 -9
- package/mw/msg.ts +3 -3
- package/mw/preference.ts +50 -17
- package/mw/textSelection.ts +17 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
- [lint](#lint)
|
|
20
20
|
- [localize](#localize)
|
|
21
21
|
- [prefer](#prefer)
|
|
22
|
+
- [scrollTo](#scrollto)
|
|
22
23
|
- [setContent](#setcontent)
|
|
23
24
|
- [setIndent](#setindent)
|
|
24
25
|
- [setLanguage](#setlanguage)
|
|
@@ -287,6 +288,22 @@ cm.prefer({
|
|
|
287
288
|
|
|
288
289
|
</details>
|
|
289
290
|
|
|
291
|
+
## scrollTo
|
|
292
|
+
|
|
293
|
+
<details>
|
|
294
|
+
<summary>Expand</summary>
|
|
295
|
+
|
|
296
|
+
*version added: 2.6.2*
|
|
297
|
+
|
|
298
|
+
**param**: [`number | {anchor: number, head: number}`](https://codemirror.net/docs/ref/#state.SelectionRange.anchor) the position or range to scroll to, default as the current cursor position
|
|
299
|
+
Scroll to the given position or range.
|
|
300
|
+
|
|
301
|
+
```js
|
|
302
|
+
cm.scrollTo();
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
</details>
|
|
306
|
+
|
|
290
307
|
## setContent
|
|
291
308
|
|
|
292
309
|
<details>
|
|
@@ -376,7 +393,7 @@ Refresh linting immediately.
|
|
|
376
393
|
|
|
377
394
|
*version added: 2.4.7*
|
|
378
395
|
|
|
379
|
-
**param**: [`Config`](https://github.com/bhsd-harry/wikiparser-node/wiki/types#config) the [WikiLint](https://npmjs.com/package/wikilint) configuration
|
|
396
|
+
**param**: [`Config`](https://github.com/bhsd-harry/wikiparser-node/wiki/types#config) the [WikiLint](https://www.npmjs.com/package/wikilint) configuration
|
|
380
397
|
**returns**: `MwConfig`
|
|
381
398
|
Derive the configuration for the MediaWiki mode from WikiLint configuration.
|
|
382
399
|
|
package/dist/codemirror.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import type { MwConfig } from './mediawiki';
|
|
|
8
8
|
export type { MwConfig };
|
|
9
9
|
export type LintSource = (doc: Text) => Diagnostic[] | Promise<Diagnostic[]>;
|
|
10
10
|
export declare const CDN = "https://testingcf.jsdelivr.net";
|
|
11
|
+
/** CodeMirror 6 编辑器 */
|
|
11
12
|
export declare class CodeMirror6 {
|
|
12
13
|
#private;
|
|
13
14
|
get textarea(): HTMLTextAreaElement;
|
|
@@ -73,6 +74,14 @@ export declare class CodeMirror6 {
|
|
|
73
74
|
* @param position 位置
|
|
74
75
|
*/
|
|
75
76
|
getNodeAt(position: number): SyntaxNode | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* 滚动至指定位置
|
|
79
|
+
* @param r 位置
|
|
80
|
+
*/
|
|
81
|
+
scrollTo(r?: number | {
|
|
82
|
+
anchor: number;
|
|
83
|
+
head: number;
|
|
84
|
+
}): void;
|
|
76
85
|
/**
|
|
77
86
|
* 替换选中内容
|
|
78
87
|
* @param view
|