@bhsd/codemirror-mediawiki 2.17.5 → 2.18.1

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 CHANGED
@@ -521,6 +521,12 @@ Key bindings:
521
521
 
522
522
  Allow the editor to be scrolled down past the end of the document.
523
523
 
524
+ ## colorPicker
525
+
526
+ *version added: 2.18.0*
527
+
528
+ Provide color pickers for CSS and MediaWiki modes.
529
+
524
530
  ## escape
525
531
 
526
532
  *version added: 2.2.2*
@@ -1,12 +1,13 @@
1
1
  import { EditorView } from '@codemirror/view';
2
2
  import type { KeyBinding } from '@codemirror/view';
3
- import type { Text } from '@codemirror/state';
3
+ import type { Extension, Text } from '@codemirror/state';
4
4
  import type { SyntaxNode } from '@lezer/common';
5
5
  import type { Diagnostic } from '@codemirror/lint';
6
6
  import type { MwConfig } from './token';
7
7
  import type { DocRange } from './fold';
8
8
  export type { MwConfig };
9
9
  export type LintSource = (doc: Text) => Diagnostic[] | Promise<Diagnostic[]>;
10
+ export type Addon<T> = [(config?: T) => Extension, Record<string, T>];
10
11
  /** CodeMirror 6 编辑器 */
11
12
  export declare class CodeMirror6 {
12
13
  #private;
@@ -0,0 +1,5 @@
1
+ import type { Extension } from '@codemirror/state';
2
+ import type { StyleSpec } from 'style-mod';
3
+ import type { Addon } from './codemirror';
4
+ declare const _default: Addon<[Extension?, StyleSpec?]>;
5
+ export default _default;
package/dist/fold.d.ts CHANGED
@@ -1,14 +1,14 @@
1
1
  import type { EditorView } from '@codemirror/view';
2
2
  import type { Extension } from '@codemirror/state';
3
+ import type { Addon } from './codemirror';
3
4
  export interface DocRange {
4
5
  from: number;
5
6
  to: number;
6
7
  }
7
- export declare const foldExtension: Extension;
8
+ declare const _default: Addon<Extension>;
9
+ export default _default;
8
10
  /**
9
11
  * 点击提示折叠模板参数
10
12
  * @param view
11
13
  */
12
14
  export declare const foldHandler: (view: EditorView) => (e: MouseEvent) => void;
13
- export declare const foldOnIndent: Extension;
14
- export declare const defaultFoldExtension: Extension[];