@codemirror/view 6.15.3 → 6.17.0

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/index.d.cts CHANGED
@@ -2,7 +2,47 @@ import * as _codemirror_state from '@codemirror/state';
2
2
  import { RangeSet, RangeValue, Range, EditorState, Extension, Transaction, ChangeSet, EditorSelection, EditorStateConfig, TransactionSpec, SelectionRange, Line, StateEffect, Facet } from '@codemirror/state';
3
3
  import { StyleModule, StyleSpec } from 'style-mod';
4
4
 
5
- declare type Attrs = {
5
+ /**
6
+ Used to indicate [text direction](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection).
7
+ */
8
+ declare enum Direction {
9
+ /**
10
+ Left-to-right.
11
+ */
12
+ LTR = 0,
13
+ /**
14
+ Right-to-left.
15
+ */
16
+ RTL = 1
17
+ }
18
+ /**
19
+ Represents a contiguous range of text that has a single direction
20
+ (as in left-to-right or right-to-left).
21
+ */
22
+ declare class BidiSpan {
23
+ /**
24
+ The start of the span (relative to the start of the line).
25
+ */
26
+ readonly from: number;
27
+ /**
28
+ The end of the span.
29
+ */
30
+ readonly to: number;
31
+ /**
32
+ The ["bidi
33
+ level"](https://unicode.org/reports/tr9/#Basic_Display_Algorithm)
34
+ of the span (in this context, 0 means
35
+ left-to-right, 1 means right-to-left, 2 means left-to-right
36
+ number inside right-to-left text).
37
+ */
38
+ readonly level: number;
39
+ /**
40
+ The direction of this span.
41
+ */
42
+ get dir(): Direction;
43
+ }
44
+
45
+ type Attrs = {
6
46
  [name: string]: string;
7
47
  };
8
48
 
@@ -15,7 +55,7 @@ interface Rect {
15
55
  readonly top: number;
16
56
  readonly bottom: number;
17
57
  }
18
- declare type ScrollStrategy = "nearest" | "start" | "end" | "center";
58
+ type ScrollStrategy = "nearest" | "start" | "end" | "center";
19
59
 
20
60
  interface MarkDecorationSpec {
21
61
  /**
@@ -53,6 +93,12 @@ interface MarkDecorationSpec {
53
93
  */
54
94
  tagName?: string;
55
95
  /**
96
+ When using sets of decorations in
97
+ [`bidiIsolatedRanges`](https://codemirror.net/6/docs/ref/##view.EditorView^bidiIsolatedRanges),
98
+ this property provides the direction of the isolates.
99
+ */
100
+ bidiIsolate?: Direction;
101
+ /**
56
102
  Decoration specs allow extra properties, which can be retrieved
57
103
  through the decoration's [`spec`](https://codemirror.net/6/docs/ref/#view.Decoration.spec)
58
104
  property.
@@ -215,7 +261,7 @@ A decoration set represents a collection of decorated ranges,
215
261
  organized for efficient access and mapping. See
216
262
  [`RangeSet`](https://codemirror.net/6/docs/ref/#state.RangeSet) for its methods.
217
263
  */
218
- declare type DecorationSet = RangeSet<Decoration>;
264
+ type DecorationSet = RangeSet<Decoration>;
219
265
  /**
220
266
  The different types of blocks that can occur in an editor view.
221
267
  */
@@ -314,7 +360,7 @@ apply to the editor, and if it can, perform it as a side effect
314
360
  (which usually means [dispatching](https://codemirror.net/6/docs/ref/#view.EditorView.dispatch) a
315
361
  transaction) and return `true`.
316
362
  */
317
- declare type Command = (target: EditorView) => boolean;
363
+ type Command = (target: EditorView) => boolean;
318
364
  /**
319
365
  Log or report an unhandled exception in client code. Should
320
366
  probably only be used by extension code that allows client code to
@@ -416,7 +462,7 @@ interface MeasureRequest<T> {
416
462
  */
417
463
  key?: any;
418
464
  }
419
- declare type AttrSource = Attrs | ((view: EditorView) => Attrs | null);
465
+ type AttrSource = Attrs | ((view: EditorView) => Attrs | null);
420
466
  /**
421
467
  View [plugins](https://codemirror.net/6/docs/ref/#view.ViewPlugin) are given instances of this
422
468
  class, which describe what happened, whenever the view is updated.
@@ -505,7 +551,7 @@ interface MouseSelectionStyle {
505
551
  */
506
552
  update: (update: ViewUpdate) => boolean | void;
507
553
  }
508
- declare type MakeSelectionStyle = (view: EditorView, event: MouseEvent) => MouseSelectionStyle | null;
554
+ type MakeSelectionStyle = (view: EditorView, event: MouseEvent) => MouseSelectionStyle | null;
509
555
 
510
556
  /**
511
557
  Record used to represent information about a block-level element
@@ -554,46 +600,6 @@ declare class BlockInfo {
554
600
  get widgetLineBreaks(): number;
555
601
  }
556
602
 
557
- /**
558
- Used to indicate [text direction](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection).
559
- */
560
- declare enum Direction {
561
- /**
562
- Left-to-right.
563
- */
564
- LTR = 0,
565
- /**
566
- Right-to-left.
567
- */
568
- RTL = 1
569
- }
570
- /**
571
- Represents a contiguous range of text that has a single direction
572
- (as in left-to-right or right-to-left).
573
- */
574
- declare class BidiSpan {
575
- /**
576
- The start of the span (relative to the start of the line).
577
- */
578
- readonly from: number;
579
- /**
580
- The end of the span.
581
- */
582
- readonly to: number;
583
- /**
584
- The ["bidi
585
- level"](https://unicode.org/reports/tr9/#Basic_Display_Algorithm)
586
- of the span (in this context, 0 means
587
- left-to-right, 1 means right-to-left, 2 means left-to-right
588
- number inside right-to-left text).
589
- */
590
- readonly level: number;
591
- /**
592
- The direction of this span.
593
- */
594
- get dir(): Direction;
595
- }
596
-
597
603
  /**
598
604
  The type of object given to the [`EditorView`](https://codemirror.net/6/docs/ref/#view.EditorView)
599
605
  constructor.
@@ -621,11 +627,16 @@ interface EditorViewConfig extends EditorStateConfig {
621
627
  */
622
628
  root?: Document | ShadowRoot;
623
629
  /**
624
- Override the transaction [dispatch
625
- function](https://codemirror.net/6/docs/ref/#view.EditorView.dispatch) for this editor view, which
626
- is the way updates get routed to the view. Your implementation,
627
- if provided, should probably call the view's [`update`
628
- method](https://codemirror.net/6/docs/ref/#view.EditorView.update).
630
+ Override the way transactions are
631
+ [dispatched](https://codemirror.net/6/docs/ref/#view.EditorView.dispatch) for this editor view.
632
+ Your implementation, if provided, should probably call the
633
+ view's [`update` method](https://codemirror.net/6/docs/ref/#view.EditorView.update).
634
+ */
635
+ dispatchTransactions?: (trs: readonly Transaction[], view: EditorView) => void;
636
+ /**
637
+ **Deprecated** single-transaction version of
638
+ `dispatchTransactions`. Will force transactions to be dispatched
639
+ one at a time when used.
629
640
  */
630
641
  dispatch?: (tr: Transaction, view: EditorView) => void;
631
642
  }
@@ -681,7 +692,7 @@ declare class EditorView {
681
692
  composition there.
682
693
  */
683
694
  get compositionStarted(): boolean;
684
- private _dispatch;
695
+ private dispatchTransactions;
685
696
  private _root;
686
697
  /**
687
698
  The document or shadow root that the view lives in.
@@ -721,14 +732,19 @@ declare class EditorView {
721
732
  constructor(config?: EditorViewConfig);
722
733
  /**
723
734
  All regular editor state updates should go through this. It
724
- takes a transaction or transaction spec and updates the view to
725
- show the new state produced by that transaction. Its
726
- implementation can be overridden with an
727
- [option](https://codemirror.net/6/docs/ref/#view.EditorView.constructor^config.dispatch). This
728
- function is bound to the view instance, so it does not have to
729
- be called as a method.
735
+ takes a transaction, array of transactions, or transaction spec
736
+ and updates the view to show the new state produced by that
737
+ transaction. Its implementation can be overridden with an
738
+ [option](https://codemirror.net/6/docs/ref/#view.EditorView.constructor^config.dispatchTransactions).
739
+ This function is bound to the view instance, so it does not have
740
+ to be called as a method.
741
+
742
+ Note that when multiple `TransactionSpec` arguments are
743
+ provided, these define a single transaction (the specs will be
744
+ merged), not a sequence of transactions.
730
745
  */
731
746
  dispatch(tr: Transaction): void;
747
+ dispatch(trs: readonly Transaction[]): void;
732
748
  dispatch(...specs: TransactionSpec[]): void;
733
749
  /**
734
750
  Update the view for the given array of transactions. This will
@@ -907,6 +923,14 @@ declare class EditorView {
907
923
  */
908
924
  coordsAtPos(pos: number, side?: -1 | 1): Rect | null;
909
925
  /**
926
+ Return the rectangle around a given character. If `pos` does not
927
+ point in front of a character that is in the viewport and
928
+ rendered (i.e. not replaced, not a line break), this will return
929
+ null. For space characters that are a line wrap point, this will
930
+ return the position before the line break.
931
+ */
932
+ coordsForChar(pos: number): Rect | null;
933
+ /**
910
934
  The default width of a character in the editor. May not
911
935
  accurately reflect the width of all characters (given variable
912
936
  width fonts or styling of invididual ranges).
@@ -1027,8 +1051,12 @@ declare class EditorView {
1027
1051
  positions between which the change was found, and the new
1028
1052
  content. When one returns true, no further input handlers are
1029
1053
  called and the default behavior is prevented.
1054
+
1055
+ The `insert` argument can be used to get the default transaction
1056
+ that would be applied for this input. This can be useful when
1057
+ dispatching the custom behavior as a separate transaction.
1030
1058
  */
1031
- static inputHandler: Facet<(view: EditorView, from: number, to: number, text: string) => boolean, readonly ((view: EditorView, from: number, to: number, text: string) => boolean)[]>;
1059
+ static inputHandler: Facet<(view: EditorView, from: number, to: number, text: string, insert: () => Transaction) => boolean, readonly ((view: EditorView, from: number, to: number, text: string, insert: () => Transaction) => boolean)[]>;
1032
1060
  /**
1033
1061
  This facet can be used to provide functions that create effects
1034
1062
  to be dispatched when the editor's focus state changes.
@@ -1114,6 +1142,16 @@ declare class EditorView {
1114
1142
  */
1115
1143
  static atomicRanges: Facet<(view: EditorView) => _codemirror_state.RangeSet<any>, readonly ((view: EditorView) => _codemirror_state.RangeSet<any>)[]>;
1116
1144
  /**
1145
+ When range decorations add a `unicode-bidi: isolate` style, they
1146
+ should also include a
1147
+ [`bidiIsolate`](https://codemirror.net/6/docs/ref/#view.MarkDecorationSpec.bidiIsolate) property
1148
+ in their decoration spec, and be exposed through this facet, so
1149
+ that the editor can compute the proper text order. (Other values
1150
+ for `unicode-bidi`, except of course `normal`, are not
1151
+ supported.)
1152
+ */
1153
+ static bidiIsolatedRanges: Facet<DecorationSet | ((view: EditorView) => DecorationSet), readonly (DecorationSet | ((view: EditorView) => DecorationSet))[]>;
1154
+ /**
1117
1155
  Facet that allows extensions to provide additional scroll
1118
1156
  margins (space around the sides of the scrolling element that
1119
1157
  should be considered invisible). This can be useful when the
@@ -1162,6 +1200,12 @@ declare class EditorView {
1162
1200
  [selector: string]: StyleSpec;
1163
1201
  }): Extension;
1164
1202
  /**
1203
+ Provides a Content Security Policy nonce to use when creating
1204
+ the style sheets for the editor. Holds the empty string when no
1205
+ nonce has been provided.
1206
+ */
1207
+ static cspNonce: Facet<string, string>;
1208
+ /**
1165
1209
  Facet that provides additional DOM attributes for the editor's
1166
1210
  editable DOM element.
1167
1211
  */
@@ -1205,7 +1249,7 @@ to hold the appropriate event object type. For unknown events, it
1205
1249
  is inferred to `any`, and should be explicitly set if you want type
1206
1250
  checking.
1207
1251
  */
1208
- declare type DOMEventHandlers<This> = {
1252
+ type DOMEventHandlers<This> = {
1209
1253
  [event in keyof DOMEventMap]?: (this: This, event: DOMEventMap[event], view: EditorView) => boolean | void;
1210
1254
  };
1211
1255
 
@@ -1314,7 +1358,7 @@ handlers handled it.
1314
1358
  */
1315
1359
  declare function runScopeHandlers(view: EditorView, event: KeyboardEvent, scope: string): boolean;
1316
1360
 
1317
- declare type SelectionConfig = {
1361
+ type SelectionConfig = {
1318
1362
  /**
1319
1363
  The length of a full cursor blink cycle, in milliseconds.
1320
1364
  Defaults to 1200. Can be set to 0 to disable blinking.
@@ -1780,7 +1824,7 @@ invalidate the existing tooltip positions.
1780
1824
  */
1781
1825
  declare function repositionTooltips(view: EditorView): void;
1782
1826
 
1783
- declare type PanelConfig = {
1827
+ type PanelConfig = {
1784
1828
  /**
1785
1829
  By default, panels will be placed inside the editor's DOM
1786
1830
  structure. You can use this option to override where panels with
@@ -1834,7 +1878,7 @@ declare function getPanel(view: EditorView, panel: PanelConstructor): Panel | nu
1834
1878
  A function that initializes a panel. Used in
1835
1879
  [`showPanel`](https://codemirror.net/6/docs/ref/#view.showPanel).
1836
1880
  */
1837
- declare type PanelConstructor = (view: EditorView) => Panel;
1881
+ type PanelConstructor = (view: EditorView) => Panel;
1838
1882
  /**
1839
1883
  Opening a panel is done by providing a constructor function for
1840
1884
  the panel through this facet. (The panel is closed again when its
@@ -1875,7 +1919,7 @@ Markers given to this facet should _only_ define an
1875
1919
  in all gutters for the line).
1876
1920
  */
1877
1921
  declare const gutterLineClass: Facet<RangeSet<GutterMarker>, readonly RangeSet<GutterMarker>[]>;
1878
- declare type Handlers = {
1922
+ type Handlers = {
1879
1923
  [event: string]: (view: EditorView, line: BlockInfo, event: Event) => boolean;
1880
1924
  };
1881
1925
  interface GutterConfig {
package/dist/index.d.ts CHANGED
@@ -2,7 +2,47 @@ import * as _codemirror_state from '@codemirror/state';
2
2
  import { RangeSet, RangeValue, Range, EditorState, Extension, Transaction, ChangeSet, EditorSelection, EditorStateConfig, TransactionSpec, SelectionRange, Line, StateEffect, Facet } from '@codemirror/state';
3
3
  import { StyleModule, StyleSpec } from 'style-mod';
4
4
 
5
- declare type Attrs = {
5
+ /**
6
+ Used to indicate [text direction](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection).
7
+ */
8
+ declare enum Direction {
9
+ /**
10
+ Left-to-right.
11
+ */
12
+ LTR = 0,
13
+ /**
14
+ Right-to-left.
15
+ */
16
+ RTL = 1
17
+ }
18
+ /**
19
+ Represents a contiguous range of text that has a single direction
20
+ (as in left-to-right or right-to-left).
21
+ */
22
+ declare class BidiSpan {
23
+ /**
24
+ The start of the span (relative to the start of the line).
25
+ */
26
+ readonly from: number;
27
+ /**
28
+ The end of the span.
29
+ */
30
+ readonly to: number;
31
+ /**
32
+ The ["bidi
33
+ level"](https://unicode.org/reports/tr9/#Basic_Display_Algorithm)
34
+ of the span (in this context, 0 means
35
+ left-to-right, 1 means right-to-left, 2 means left-to-right
36
+ number inside right-to-left text).
37
+ */
38
+ readonly level: number;
39
+ /**
40
+ The direction of this span.
41
+ */
42
+ get dir(): Direction;
43
+ }
44
+
45
+ type Attrs = {
6
46
  [name: string]: string;
7
47
  };
8
48
 
@@ -15,7 +55,7 @@ interface Rect {
15
55
  readonly top: number;
16
56
  readonly bottom: number;
17
57
  }
18
- declare type ScrollStrategy = "nearest" | "start" | "end" | "center";
58
+ type ScrollStrategy = "nearest" | "start" | "end" | "center";
19
59
 
20
60
  interface MarkDecorationSpec {
21
61
  /**
@@ -53,6 +93,12 @@ interface MarkDecorationSpec {
53
93
  */
54
94
  tagName?: string;
55
95
  /**
96
+ When using sets of decorations in
97
+ [`bidiIsolatedRanges`](https://codemirror.net/6/docs/ref/##view.EditorView^bidiIsolatedRanges),
98
+ this property provides the direction of the isolates.
99
+ */
100
+ bidiIsolate?: Direction;
101
+ /**
56
102
  Decoration specs allow extra properties, which can be retrieved
57
103
  through the decoration's [`spec`](https://codemirror.net/6/docs/ref/#view.Decoration.spec)
58
104
  property.
@@ -215,7 +261,7 @@ A decoration set represents a collection of decorated ranges,
215
261
  organized for efficient access and mapping. See
216
262
  [`RangeSet`](https://codemirror.net/6/docs/ref/#state.RangeSet) for its methods.
217
263
  */
218
- declare type DecorationSet = RangeSet<Decoration>;
264
+ type DecorationSet = RangeSet<Decoration>;
219
265
  /**
220
266
  The different types of blocks that can occur in an editor view.
221
267
  */
@@ -314,7 +360,7 @@ apply to the editor, and if it can, perform it as a side effect
314
360
  (which usually means [dispatching](https://codemirror.net/6/docs/ref/#view.EditorView.dispatch) a
315
361
  transaction) and return `true`.
316
362
  */
317
- declare type Command = (target: EditorView) => boolean;
363
+ type Command = (target: EditorView) => boolean;
318
364
  /**
319
365
  Log or report an unhandled exception in client code. Should
320
366
  probably only be used by extension code that allows client code to
@@ -416,7 +462,7 @@ interface MeasureRequest<T> {
416
462
  */
417
463
  key?: any;
418
464
  }
419
- declare type AttrSource = Attrs | ((view: EditorView) => Attrs | null);
465
+ type AttrSource = Attrs | ((view: EditorView) => Attrs | null);
420
466
  /**
421
467
  View [plugins](https://codemirror.net/6/docs/ref/#view.ViewPlugin) are given instances of this
422
468
  class, which describe what happened, whenever the view is updated.
@@ -505,7 +551,7 @@ interface MouseSelectionStyle {
505
551
  */
506
552
  update: (update: ViewUpdate) => boolean | void;
507
553
  }
508
- declare type MakeSelectionStyle = (view: EditorView, event: MouseEvent) => MouseSelectionStyle | null;
554
+ type MakeSelectionStyle = (view: EditorView, event: MouseEvent) => MouseSelectionStyle | null;
509
555
 
510
556
  /**
511
557
  Record used to represent information about a block-level element
@@ -554,46 +600,6 @@ declare class BlockInfo {
554
600
  get widgetLineBreaks(): number;
555
601
  }
556
602
 
557
- /**
558
- Used to indicate [text direction](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection).
559
- */
560
- declare enum Direction {
561
- /**
562
- Left-to-right.
563
- */
564
- LTR = 0,
565
- /**
566
- Right-to-left.
567
- */
568
- RTL = 1
569
- }
570
- /**
571
- Represents a contiguous range of text that has a single direction
572
- (as in left-to-right or right-to-left).
573
- */
574
- declare class BidiSpan {
575
- /**
576
- The start of the span (relative to the start of the line).
577
- */
578
- readonly from: number;
579
- /**
580
- The end of the span.
581
- */
582
- readonly to: number;
583
- /**
584
- The ["bidi
585
- level"](https://unicode.org/reports/tr9/#Basic_Display_Algorithm)
586
- of the span (in this context, 0 means
587
- left-to-right, 1 means right-to-left, 2 means left-to-right
588
- number inside right-to-left text).
589
- */
590
- readonly level: number;
591
- /**
592
- The direction of this span.
593
- */
594
- get dir(): Direction;
595
- }
596
-
597
603
  /**
598
604
  The type of object given to the [`EditorView`](https://codemirror.net/6/docs/ref/#view.EditorView)
599
605
  constructor.
@@ -621,11 +627,16 @@ interface EditorViewConfig extends EditorStateConfig {
621
627
  */
622
628
  root?: Document | ShadowRoot;
623
629
  /**
624
- Override the transaction [dispatch
625
- function](https://codemirror.net/6/docs/ref/#view.EditorView.dispatch) for this editor view, which
626
- is the way updates get routed to the view. Your implementation,
627
- if provided, should probably call the view's [`update`
628
- method](https://codemirror.net/6/docs/ref/#view.EditorView.update).
630
+ Override the way transactions are
631
+ [dispatched](https://codemirror.net/6/docs/ref/#view.EditorView.dispatch) for this editor view.
632
+ Your implementation, if provided, should probably call the
633
+ view's [`update` method](https://codemirror.net/6/docs/ref/#view.EditorView.update).
634
+ */
635
+ dispatchTransactions?: (trs: readonly Transaction[], view: EditorView) => void;
636
+ /**
637
+ **Deprecated** single-transaction version of
638
+ `dispatchTransactions`. Will force transactions to be dispatched
639
+ one at a time when used.
629
640
  */
630
641
  dispatch?: (tr: Transaction, view: EditorView) => void;
631
642
  }
@@ -681,7 +692,7 @@ declare class EditorView {
681
692
  composition there.
682
693
  */
683
694
  get compositionStarted(): boolean;
684
- private _dispatch;
695
+ private dispatchTransactions;
685
696
  private _root;
686
697
  /**
687
698
  The document or shadow root that the view lives in.
@@ -721,14 +732,19 @@ declare class EditorView {
721
732
  constructor(config?: EditorViewConfig);
722
733
  /**
723
734
  All regular editor state updates should go through this. It
724
- takes a transaction or transaction spec and updates the view to
725
- show the new state produced by that transaction. Its
726
- implementation can be overridden with an
727
- [option](https://codemirror.net/6/docs/ref/#view.EditorView.constructor^config.dispatch). This
728
- function is bound to the view instance, so it does not have to
729
- be called as a method.
735
+ takes a transaction, array of transactions, or transaction spec
736
+ and updates the view to show the new state produced by that
737
+ transaction. Its implementation can be overridden with an
738
+ [option](https://codemirror.net/6/docs/ref/#view.EditorView.constructor^config.dispatchTransactions).
739
+ This function is bound to the view instance, so it does not have
740
+ to be called as a method.
741
+
742
+ Note that when multiple `TransactionSpec` arguments are
743
+ provided, these define a single transaction (the specs will be
744
+ merged), not a sequence of transactions.
730
745
  */
731
746
  dispatch(tr: Transaction): void;
747
+ dispatch(trs: readonly Transaction[]): void;
732
748
  dispatch(...specs: TransactionSpec[]): void;
733
749
  /**
734
750
  Update the view for the given array of transactions. This will
@@ -907,6 +923,14 @@ declare class EditorView {
907
923
  */
908
924
  coordsAtPos(pos: number, side?: -1 | 1): Rect | null;
909
925
  /**
926
+ Return the rectangle around a given character. If `pos` does not
927
+ point in front of a character that is in the viewport and
928
+ rendered (i.e. not replaced, not a line break), this will return
929
+ null. For space characters that are a line wrap point, this will
930
+ return the position before the line break.
931
+ */
932
+ coordsForChar(pos: number): Rect | null;
933
+ /**
910
934
  The default width of a character in the editor. May not
911
935
  accurately reflect the width of all characters (given variable
912
936
  width fonts or styling of invididual ranges).
@@ -1027,8 +1051,12 @@ declare class EditorView {
1027
1051
  positions between which the change was found, and the new
1028
1052
  content. When one returns true, no further input handlers are
1029
1053
  called and the default behavior is prevented.
1054
+
1055
+ The `insert` argument can be used to get the default transaction
1056
+ that would be applied for this input. This can be useful when
1057
+ dispatching the custom behavior as a separate transaction.
1030
1058
  */
1031
- static inputHandler: Facet<(view: EditorView, from: number, to: number, text: string) => boolean, readonly ((view: EditorView, from: number, to: number, text: string) => boolean)[]>;
1059
+ static inputHandler: Facet<(view: EditorView, from: number, to: number, text: string, insert: () => Transaction) => boolean, readonly ((view: EditorView, from: number, to: number, text: string, insert: () => Transaction) => boolean)[]>;
1032
1060
  /**
1033
1061
  This facet can be used to provide functions that create effects
1034
1062
  to be dispatched when the editor's focus state changes.
@@ -1114,6 +1142,16 @@ declare class EditorView {
1114
1142
  */
1115
1143
  static atomicRanges: Facet<(view: EditorView) => _codemirror_state.RangeSet<any>, readonly ((view: EditorView) => _codemirror_state.RangeSet<any>)[]>;
1116
1144
  /**
1145
+ When range decorations add a `unicode-bidi: isolate` style, they
1146
+ should also include a
1147
+ [`bidiIsolate`](https://codemirror.net/6/docs/ref/#view.MarkDecorationSpec.bidiIsolate) property
1148
+ in their decoration spec, and be exposed through this facet, so
1149
+ that the editor can compute the proper text order. (Other values
1150
+ for `unicode-bidi`, except of course `normal`, are not
1151
+ supported.)
1152
+ */
1153
+ static bidiIsolatedRanges: Facet<DecorationSet | ((view: EditorView) => DecorationSet), readonly (DecorationSet | ((view: EditorView) => DecorationSet))[]>;
1154
+ /**
1117
1155
  Facet that allows extensions to provide additional scroll
1118
1156
  margins (space around the sides of the scrolling element that
1119
1157
  should be considered invisible). This can be useful when the
@@ -1162,6 +1200,12 @@ declare class EditorView {
1162
1200
  [selector: string]: StyleSpec;
1163
1201
  }): Extension;
1164
1202
  /**
1203
+ Provides a Content Security Policy nonce to use when creating
1204
+ the style sheets for the editor. Holds the empty string when no
1205
+ nonce has been provided.
1206
+ */
1207
+ static cspNonce: Facet<string, string>;
1208
+ /**
1165
1209
  Facet that provides additional DOM attributes for the editor's
1166
1210
  editable DOM element.
1167
1211
  */
@@ -1205,7 +1249,7 @@ to hold the appropriate event object type. For unknown events, it
1205
1249
  is inferred to `any`, and should be explicitly set if you want type
1206
1250
  checking.
1207
1251
  */
1208
- declare type DOMEventHandlers<This> = {
1252
+ type DOMEventHandlers<This> = {
1209
1253
  [event in keyof DOMEventMap]?: (this: This, event: DOMEventMap[event], view: EditorView) => boolean | void;
1210
1254
  };
1211
1255
 
@@ -1314,7 +1358,7 @@ handlers handled it.
1314
1358
  */
1315
1359
  declare function runScopeHandlers(view: EditorView, event: KeyboardEvent, scope: string): boolean;
1316
1360
 
1317
- declare type SelectionConfig = {
1361
+ type SelectionConfig = {
1318
1362
  /**
1319
1363
  The length of a full cursor blink cycle, in milliseconds.
1320
1364
  Defaults to 1200. Can be set to 0 to disable blinking.
@@ -1780,7 +1824,7 @@ invalidate the existing tooltip positions.
1780
1824
  */
1781
1825
  declare function repositionTooltips(view: EditorView): void;
1782
1826
 
1783
- declare type PanelConfig = {
1827
+ type PanelConfig = {
1784
1828
  /**
1785
1829
  By default, panels will be placed inside the editor's DOM
1786
1830
  structure. You can use this option to override where panels with
@@ -1834,7 +1878,7 @@ declare function getPanel(view: EditorView, panel: PanelConstructor): Panel | nu
1834
1878
  A function that initializes a panel. Used in
1835
1879
  [`showPanel`](https://codemirror.net/6/docs/ref/#view.showPanel).
1836
1880
  */
1837
- declare type PanelConstructor = (view: EditorView) => Panel;
1881
+ type PanelConstructor = (view: EditorView) => Panel;
1838
1882
  /**
1839
1883
  Opening a panel is done by providing a constructor function for
1840
1884
  the panel through this facet. (The panel is closed again when its
@@ -1875,7 +1919,7 @@ Markers given to this facet should _only_ define an
1875
1919
  in all gutters for the line).
1876
1920
  */
1877
1921
  declare const gutterLineClass: Facet<RangeSet<GutterMarker>, readonly RangeSet<GutterMarker>[]>;
1878
- declare type Handlers = {
1922
+ type Handlers = {
1879
1923
  [event: string]: (view: EditorView, line: BlockInfo, event: Event) => boolean;
1880
1924
  };
1881
1925
  interface GutterConfig {