@codemirror/view 6.22.3 → 6.23.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
@@ -95,9 +95,12 @@ interface MarkDecorationSpec {
95
95
  /**
96
96
  When using sets of decorations in
97
97
  [`bidiIsolatedRanges`](https://codemirror.net/6/docs/ref/##view.EditorView^bidiIsolatedRanges),
98
- this property provides the direction of the isolates.
98
+ this property provides the direction of the isolates. When null
99
+ or not given, it indicates the range has `dir=auto`, and its
100
+ direction should be derived from the first strong directional
101
+ character in it.
99
102
  */
100
- bidiIsolate?: Direction;
103
+ bidiIsolate?: Direction | null;
101
104
  /**
102
105
  Decoration specs allow extra properties, which can be retrieved
103
106
  through the decoration's [`spec`](https://codemirror.net/6/docs/ref/#view.Decoration.spec)
@@ -475,7 +478,7 @@ interface MeasureRequest<T> {
475
478
  write?(measure: T, view: EditorView): void;
476
479
  /**
477
480
  When multiple requests with the same key are scheduled, only the
478
- last one will actually be ran.
481
+ last one will actually be run.
479
482
  */
480
483
  key?: any;
481
484
  }
@@ -892,6 +895,13 @@ declare class EditorView {
892
895
  */
893
896
  moveByGroup(start: SelectionRange, forward: boolean): SelectionRange;
894
897
  /**
898
+ Get the cursor position visually at the start or end of a line.
899
+ Note that this may differ from the _logical_ position at its
900
+ start or end (which is simply at `line.from`/`line.to`) if text
901
+ at the start or end goes against the line's base text direction.
902
+ */
903
+ visualLineSide(line: Line, end: boolean): SelectionRange;
904
+ /**
895
905
  Move to the next line boundary in the given direction. If
896
906
  `includeWrap` is true, line wrapping is on, and there is a
897
907
  further wrap point on the current line, the wrap point will be
@@ -1188,6 +1198,16 @@ declare class EditorView {
1188
1198
  */
1189
1199
  static decorations: Facet<DecorationSet | ((view: EditorView) => DecorationSet), readonly (DecorationSet | ((view: EditorView) => DecorationSet))[]>;
1190
1200
  /**
1201
+ Facet that works much like
1202
+ [`decorations`](https://codemirror.net/6/docs/ref/#view.EditorView^decorations), but puts its
1203
+ inputs at the very bottom of the precedence stack, meaning mark
1204
+ decorations provided here will only be split by other, partially
1205
+ overlapping \`outerDecorations\` ranges, and wrap around all
1206
+ regular decorations. Use this for mark elements that should, as
1207
+ much as possible, remain in one piece.
1208
+ */
1209
+ static outerDecorations: Facet<DecorationSet | ((view: EditorView) => DecorationSet), readonly (DecorationSet | ((view: EditorView) => DecorationSet))[]>;
1210
+ /**
1191
1211
  Used to provide ranges that should be treated as atoms as far as
1192
1212
  cursor motion is concerned. This causes methods like
1193
1213
  [`moveByChar`](https://codemirror.net/6/docs/ref/#view.EditorView.moveByChar) and
package/dist/index.d.ts CHANGED
@@ -95,9 +95,12 @@ interface MarkDecorationSpec {
95
95
  /**
96
96
  When using sets of decorations in
97
97
  [`bidiIsolatedRanges`](https://codemirror.net/6/docs/ref/##view.EditorView^bidiIsolatedRanges),
98
- this property provides the direction of the isolates.
98
+ this property provides the direction of the isolates. When null
99
+ or not given, it indicates the range has `dir=auto`, and its
100
+ direction should be derived from the first strong directional
101
+ character in it.
99
102
  */
100
- bidiIsolate?: Direction;
103
+ bidiIsolate?: Direction | null;
101
104
  /**
102
105
  Decoration specs allow extra properties, which can be retrieved
103
106
  through the decoration's [`spec`](https://codemirror.net/6/docs/ref/#view.Decoration.spec)
@@ -475,7 +478,7 @@ interface MeasureRequest<T> {
475
478
  write?(measure: T, view: EditorView): void;
476
479
  /**
477
480
  When multiple requests with the same key are scheduled, only the
478
- last one will actually be ran.
481
+ last one will actually be run.
479
482
  */
480
483
  key?: any;
481
484
  }
@@ -892,6 +895,13 @@ declare class EditorView {
892
895
  */
893
896
  moveByGroup(start: SelectionRange, forward: boolean): SelectionRange;
894
897
  /**
898
+ Get the cursor position visually at the start or end of a line.
899
+ Note that this may differ from the _logical_ position at its
900
+ start or end (which is simply at `line.from`/`line.to`) if text
901
+ at the start or end goes against the line's base text direction.
902
+ */
903
+ visualLineSide(line: Line, end: boolean): SelectionRange;
904
+ /**
895
905
  Move to the next line boundary in the given direction. If
896
906
  `includeWrap` is true, line wrapping is on, and there is a
897
907
  further wrap point on the current line, the wrap point will be
@@ -1188,6 +1198,16 @@ declare class EditorView {
1188
1198
  */
1189
1199
  static decorations: Facet<DecorationSet | ((view: EditorView) => DecorationSet), readonly (DecorationSet | ((view: EditorView) => DecorationSet))[]>;
1190
1200
  /**
1201
+ Facet that works much like
1202
+ [`decorations`](https://codemirror.net/6/docs/ref/#view.EditorView^decorations), but puts its
1203
+ inputs at the very bottom of the precedence stack, meaning mark
1204
+ decorations provided here will only be split by other, partially
1205
+ overlapping \`outerDecorations\` ranges, and wrap around all
1206
+ regular decorations. Use this for mark elements that should, as
1207
+ much as possible, remain in one piece.
1208
+ */
1209
+ static outerDecorations: Facet<DecorationSet | ((view: EditorView) => DecorationSet), readonly (DecorationSet | ((view: EditorView) => DecorationSet))[]>;
1210
+ /**
1191
1211
  Used to provide ranges that should be treated as atoms as far as
1192
1212
  cursor motion is concerned. This causes methods like
1193
1213
  [`moveByChar`](https://codemirror.net/6/docs/ref/#view.EditorView.moveByChar) and