@bhsd/codemirror-mediawiki 2.3.2 → 2.3.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 +19 -0
- package/dist/codemirror.d.ts +9 -1
- package/dist/main.min.js +14 -14
- package/dist/mediawiki.d.ts +1 -1
- package/dist/mw.min.js +1 -1
- package/dist/mw.min.js.map +3 -3
- package/i18n/en.json +12 -3
- package/i18n/zh-hans.json +12 -3
- package/i18n/zh-hant.json +12 -3
- package/mediawiki.css +12 -0
- package/mw/base.ts +3 -4
- package/mw/config.ts +4 -1
- package/mw/msg.ts +22 -1
- package/mw/openLinks.ts +4 -1
- package/mw/preference.ts +1 -4
- package/package.json +4 -6
- package/dist/config.d.ts +0 -130
- package/dist/escape.d.ts +0 -2
- package/dist/fold.d.ts +0 -11
- package/dist/main.min.js.map +0 -7
- package/dist/plugins.d.ts +0 -3
- package/src/codemirror.ts +0 -521
- package/src/config.ts +0 -215
- package/src/escape.ts +0 -28
- package/src/fold.ts +0 -128
- package/src/mediawiki.ts +0 -1304
package/README.md
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
- [extraKeys](#extrakeys)
|
|
17
17
|
- [getLinter](#getlinter)
|
|
18
18
|
- [lint](#lint)
|
|
19
|
+
- [localize](#localize)
|
|
19
20
|
- [prefer](#prefer)
|
|
20
21
|
- [setContent](#setcontent)
|
|
21
22
|
- [setIndent](#setindent)
|
|
@@ -181,6 +182,24 @@ cm.lint(doc => [
|
|
|
181
182
|
|
|
182
183
|
</details>
|
|
183
184
|
|
|
185
|
+
## localize
|
|
186
|
+
|
|
187
|
+
<details>
|
|
188
|
+
<summary>Expand</summary>
|
|
189
|
+
|
|
190
|
+
*version added: 2.3.3*
|
|
191
|
+
|
|
192
|
+
**param**: `Record<string, string>` localization table
|
|
193
|
+
Set the localization table.
|
|
194
|
+
|
|
195
|
+
```js
|
|
196
|
+
cm.localize({
|
|
197
|
+
'Find': '查找',
|
|
198
|
+
});
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
</details>
|
|
202
|
+
|
|
184
203
|
## prefer
|
|
185
204
|
|
|
186
205
|
<details>
|
package/dist/codemirror.d.ts
CHANGED
|
@@ -40,7 +40,10 @@ export declare class CodeMirror6 {
|
|
|
40
40
|
* @param indent 缩进字符串
|
|
41
41
|
*/
|
|
42
42
|
setIndent(indent: string): void;
|
|
43
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* 获取默认linter
|
|
45
|
+
* @param opt 选项
|
|
46
|
+
*/
|
|
44
47
|
getLinter(opt?: Record<string, unknown>): Promise<LintSource | undefined>;
|
|
45
48
|
/**
|
|
46
49
|
* 重设编辑器内容
|
|
@@ -57,6 +60,11 @@ export declare class CodeMirror6 {
|
|
|
57
60
|
* @param keys 快捷键
|
|
58
61
|
*/
|
|
59
62
|
extraKeys(keys: KeyBinding[]): void;
|
|
63
|
+
/**
|
|
64
|
+
* 设置翻译信息
|
|
65
|
+
* @param messages 翻译信息
|
|
66
|
+
*/
|
|
67
|
+
localize(messages: Record<string, string>): void;
|
|
60
68
|
/**
|
|
61
69
|
* 替换选中内容
|
|
62
70
|
* @param view EditorView
|