@codemirror/view 6.6.0 → 6.7.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/dist/index.d.ts CHANGED
@@ -1402,13 +1402,22 @@ declare class RectangleMarker implements LayerMarker {
1402
1402
  private width;
1403
1403
  private height;
1404
1404
  /**
1405
- Create a marker with the given class and dimensions.
1405
+ Create a marker with the given class and dimensions. If `width`
1406
+ is null, the DOM element will get no width style.
1406
1407
  */
1407
- constructor(className: string, left: number, top: number, width: number, height: number);
1408
+ constructor(className: string, left: number, top: number, width: number | null, height: number);
1408
1409
  draw(): HTMLDivElement;
1409
1410
  update(elt: HTMLElement, prev: RectangleMarker): boolean;
1410
1411
  private adjust;
1411
1412
  eq(p: RectangleMarker): boolean;
1413
+ /**
1414
+ Create a set of rectangles for the given selection range,
1415
+ assigning them theclass`className`. Will create a single
1416
+ rectangle for empty ranges, and a set of selection-style
1417
+ rectangles covering the range's content (in a bidi-aware
1418
+ way) for non-empty ones.
1419
+ */
1420
+ static forRange(view: EditorView, className: string, range: SelectionRange): readonly RectangleMarker[];
1412
1421
  }
1413
1422
  interface LayerConfig {
1414
1423
  /**
@@ -1434,6 +1443,11 @@ interface LayerConfig {
1434
1443
  If given, this is called when the layer is created.
1435
1444
  */
1436
1445
  mount?(layer: HTMLElement, view: EditorView): void;
1446
+ /**
1447
+ If given, called when the layer is removed from the editor or
1448
+ the entire editor is destroyed.
1449
+ */
1450
+ destroy?(layer: HTMLElement, view: EditorView): void;
1437
1451
  }
1438
1452
  /**
1439
1453
  Define a layer.
@@ -1900,4 +1914,17 @@ line](https://codemirror.net/6/docs/ref/#view.highlightActiveLine).
1900
1914
  */
1901
1915
  declare function highlightActiveLineGutter(): Extension;
1902
1916
 
1903
- export { BidiSpan, BlockInfo, BlockType, Command, DOMEventHandlers, DOMEventMap, Decoration, DecorationSet, Direction, EditorView, EditorViewConfig, GutterMarker, KeyBinding, LayerMarker, MatchDecorator, MouseSelectionStyle, Panel, PanelConstructor, PluginSpec, PluginValue, Rect, RectangleMarker, Tooltip, TooltipView, ViewPlugin, ViewUpdate, WidgetType, closeHoverTooltips, crosshairCursor, drawSelection, dropCursor, getPanel, getTooltip, gutter, gutterLineClass, gutters, hasHoverTooltips, highlightActiveLine, highlightActiveLineGutter, highlightSpecialChars, hoverTooltip, keymap, layer, lineNumberMarkers, lineNumbers, logException, panels, placeholder, rectangularSelection, repositionTooltips, runScopeHandlers, scrollPastEnd, showPanel, showTooltip, tooltips };
1917
+ /**
1918
+ Returns an extension that highlights whitespace, adding a
1919
+ `cm-highlightSpace` class to stretches of spaces, and a
1920
+ `cm-highlightTab` class to individual tab characters. By default,
1921
+ the former are shown as faint dots, and the latter as arrows.
1922
+ */
1923
+ declare function highlightWhitespace(): Extension;
1924
+ /**
1925
+ Returns an extension that adds a `cm-trailingSpace` class to all
1926
+ trailing whitespace.
1927
+ */
1928
+ declare function highlightTrailingWhitespace(): Extension;
1929
+
1930
+ export { BidiSpan, BlockInfo, BlockType, Command, DOMEventHandlers, DOMEventMap, Decoration, DecorationSet, Direction, EditorView, EditorViewConfig, GutterMarker, KeyBinding, LayerMarker, MatchDecorator, MouseSelectionStyle, Panel, PanelConstructor, PluginSpec, PluginValue, Rect, RectangleMarker, Tooltip, TooltipView, ViewPlugin, ViewUpdate, WidgetType, closeHoverTooltips, crosshairCursor, drawSelection, dropCursor, getPanel, getTooltip, gutter, gutterLineClass, gutters, hasHoverTooltips, highlightActiveLine, highlightActiveLineGutter, highlightSpecialChars, highlightTrailingWhitespace, highlightWhitespace, hoverTooltip, keymap, layer, lineNumberMarkers, lineNumbers, logException, panels, placeholder, rectangularSelection, repositionTooltips, runScopeHandlers, scrollPastEnd, showPanel, showTooltip, tooltips };