@codemirror/view 6.11.3 → 6.13.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/CHANGELOG.md +24 -0
- package/dist/index.cjs +270 -214
- package/dist/index.d.cts +1969 -0
- package/dist/index.d.ts +24 -7
- package/dist/index.js +271 -215
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -70,7 +70,12 @@ interface WidgetDecorationSpec {
|
|
|
70
70
|
cursor is on the same position. Otherwise, it'll be drawn before
|
|
71
71
|
it. When multiple widgets sit at the same position, their `side`
|
|
72
72
|
values will determine their ordering—those with a lower value
|
|
73
|
-
come first. Defaults to 0.
|
|
73
|
+
come first. Defaults to 0. May not be more than 10000 or less
|
|
74
|
+
than -10000.
|
|
75
|
+
|
|
76
|
+
Block widgets are always drawn before inline widgets when side
|
|
77
|
+
is non-positive, and after them when side is positive,
|
|
78
|
+
regardless of the value of `side`.
|
|
74
79
|
*/
|
|
75
80
|
side?: number;
|
|
76
81
|
/**
|
|
@@ -174,6 +179,13 @@ declare abstract class WidgetType {
|
|
|
174
179
|
*/
|
|
175
180
|
get estimatedHeight(): number;
|
|
176
181
|
/**
|
|
182
|
+
For inline widgets that are displayed inline (as opposed to
|
|
183
|
+
`inline-block`) and introduce line breaks (through `<br>` tags
|
|
184
|
+
or textual newlines), this must indicate the amount of line
|
|
185
|
+
breaks they introduce. Defaults to 0.
|
|
186
|
+
*/
|
|
187
|
+
get lineBreaks(): number;
|
|
188
|
+
/**
|
|
177
189
|
Can be used to configure which kinds of events inside the widget
|
|
178
190
|
should be ignored by the editor. The default is to ignore all
|
|
179
191
|
events.
|
|
@@ -518,11 +530,6 @@ declare class BlockInfo {
|
|
|
518
530
|
*/
|
|
519
531
|
get type(): BlockType | readonly BlockInfo[];
|
|
520
532
|
/**
|
|
521
|
-
If this is a widget block, this will return the widget
|
|
522
|
-
associated with it.
|
|
523
|
-
*/
|
|
524
|
-
get widget(): WidgetType | null;
|
|
525
|
-
/**
|
|
526
533
|
The end of the element as a document position.
|
|
527
534
|
*/
|
|
528
535
|
get to(): number;
|
|
@@ -530,6 +537,16 @@ declare class BlockInfo {
|
|
|
530
537
|
The bottom position of the element.
|
|
531
538
|
*/
|
|
532
539
|
get bottom(): number;
|
|
540
|
+
/**
|
|
541
|
+
If this is a widget block, this will return the widget
|
|
542
|
+
associated with it.
|
|
543
|
+
*/
|
|
544
|
+
get widget(): WidgetType | null;
|
|
545
|
+
/**
|
|
546
|
+
If this is a textblock, this holds the number of line breaks
|
|
547
|
+
that appear in widgets inside the block.
|
|
548
|
+
*/
|
|
549
|
+
get widgetLineBreaks(): number;
|
|
533
550
|
}
|
|
534
551
|
|
|
535
552
|
/**
|
|
@@ -605,7 +622,7 @@ interface EditorViewConfig extends EditorStateConfig {
|
|
|
605
622
|
if provided, should probably call the view's [`update`
|
|
606
623
|
method](https://codemirror.net/6/docs/ref/#view.EditorView.update).
|
|
607
624
|
*/
|
|
608
|
-
dispatch?: (tr: Transaction) => void;
|
|
625
|
+
dispatch?: (tr: Transaction, view: EditorView) => void;
|
|
609
626
|
}
|
|
610
627
|
/**
|
|
611
628
|
An editor view represents the editor's user interface. It holds
|