@codemirror/state 0.19.2 → 0.19.3
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 +6 -0
- package/dist/index.cjs +31 -12
- package/dist/index.d.ts +26 -8
- package/dist/index.js +31 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1106,7 +1106,7 @@ class StateField {
|
|
|
1106
1106
|
*/
|
|
1107
1107
|
get extension() { return this; }
|
|
1108
1108
|
}
|
|
1109
|
-
const Prec_ = {
|
|
1109
|
+
const Prec_ = { lowest: 4, low: 3, default: 2, high: 1, highest: 0 };
|
|
1110
1110
|
function prec(value) {
|
|
1111
1111
|
return (ext) => new PrecExtension(ext, value);
|
|
1112
1112
|
}
|
|
@@ -1122,23 +1122,42 @@ precedence and then by order within each precedence.
|
|
|
1122
1122
|
*/
|
|
1123
1123
|
const Prec = {
|
|
1124
1124
|
/**
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
specified later in the extension ordering.
|
|
1125
|
+
The lowest precedence level. Meant for things that should end up
|
|
1126
|
+
near the end of the extension order.
|
|
1128
1127
|
*/
|
|
1129
|
-
|
|
1128
|
+
lowest: prec(Prec_.lowest),
|
|
1130
1129
|
/**
|
|
1131
|
-
|
|
1130
|
+
A lower-than-default precedence, for extensions.
|
|
1131
|
+
*/
|
|
1132
|
+
low: prec(Prec_.low),
|
|
1133
|
+
/**
|
|
1134
|
+
The default precedence, which is also used for extensions
|
|
1135
|
+
without an explicit precedence.
|
|
1132
1136
|
*/
|
|
1133
1137
|
default: prec(Prec_.default),
|
|
1134
1138
|
/**
|
|
1135
|
-
A higher-than-default precedence
|
|
1139
|
+
A higher-than-default precedence, for extensions that should
|
|
1140
|
+
come before those with default precedence.
|
|
1141
|
+
*/
|
|
1142
|
+
high: prec(Prec_.high),
|
|
1143
|
+
/**
|
|
1144
|
+
The highest precedence level, for extensions that should end up
|
|
1145
|
+
near the start of the precedence ordering.
|
|
1146
|
+
*/
|
|
1147
|
+
highest: prec(Prec_.highest),
|
|
1148
|
+
// FIXME Drop these in some future breaking version
|
|
1149
|
+
/**
|
|
1150
|
+
Backwards-compatible synonym for `Prec.lowest`.
|
|
1151
|
+
*/
|
|
1152
|
+
fallback: prec(Prec_.lowest),
|
|
1153
|
+
/**
|
|
1154
|
+
Backwards-compatible synonym for `Prec.high`.
|
|
1136
1155
|
*/
|
|
1137
|
-
extend: prec(Prec_.
|
|
1156
|
+
extend: prec(Prec_.high),
|
|
1138
1157
|
/**
|
|
1139
|
-
|
|
1158
|
+
Backwards-compatible synonym for `Prec.highest`.
|
|
1140
1159
|
*/
|
|
1141
|
-
override: prec(Prec_.
|
|
1160
|
+
override: prec(Prec_.highest)
|
|
1142
1161
|
};
|
|
1143
1162
|
class PrecExtension {
|
|
1144
1163
|
constructor(inner, prec) {
|
|
@@ -1244,7 +1263,7 @@ class Configuration {
|
|
|
1244
1263
|
}
|
|
1245
1264
|
}
|
|
1246
1265
|
function flatten(extension, compartments, newCompartments) {
|
|
1247
|
-
let result = [[], [], [], []];
|
|
1266
|
+
let result = [[], [], [], [], []];
|
|
1248
1267
|
let seen = new Map();
|
|
1249
1268
|
function inner(ext, prec) {
|
|
1250
1269
|
let known = seen.get(ext);
|
|
@@ -1576,7 +1595,7 @@ class Transaction {
|
|
|
1576
1595
|
*/
|
|
1577
1596
|
isUserEvent(event) {
|
|
1578
1597
|
let e = this.annotation(Transaction.userEvent);
|
|
1579
|
-
return e && (e == event || e.length > event.length && e.slice(0, event.length) == event && e[event.length] == ".");
|
|
1598
|
+
return !!(e && (e == event || e.length > event.length && e.slice(0, event.length) == event && e[event.length] == "."));
|
|
1580
1599
|
}
|
|
1581
1600
|
}
|
|
1582
1601
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -509,21 +509,39 @@ precedence and then by order within each precedence.
|
|
|
509
509
|
*/
|
|
510
510
|
declare const Prec: {
|
|
511
511
|
/**
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
specified later in the extension ordering.
|
|
512
|
+
The lowest precedence level. Meant for things that should end up
|
|
513
|
+
near the end of the extension order.
|
|
515
514
|
*/
|
|
516
|
-
|
|
515
|
+
lowest: (ext: Extension) => Extension;
|
|
516
|
+
/**
|
|
517
|
+
A lower-than-default precedence, for extensions.
|
|
518
|
+
*/
|
|
519
|
+
low: (ext: Extension) => Extension;
|
|
517
520
|
/**
|
|
518
|
-
The
|
|
521
|
+
The default precedence, which is also used for extensions
|
|
522
|
+
without an explicit precedence.
|
|
519
523
|
*/
|
|
520
524
|
default: (ext: Extension) => Extension;
|
|
521
525
|
/**
|
|
522
|
-
A higher-than-default precedence
|
|
526
|
+
A higher-than-default precedence, for extensions that should
|
|
527
|
+
come before those with default precedence.
|
|
528
|
+
*/
|
|
529
|
+
high: (ext: Extension) => Extension;
|
|
530
|
+
/**
|
|
531
|
+
The highest precedence level, for extensions that should end up
|
|
532
|
+
near the start of the precedence ordering.
|
|
533
|
+
*/
|
|
534
|
+
highest: (ext: Extension) => Extension;
|
|
535
|
+
/**
|
|
536
|
+
Backwards-compatible synonym for `Prec.lowest`.
|
|
537
|
+
*/
|
|
538
|
+
fallback: (ext: Extension) => Extension;
|
|
539
|
+
/**
|
|
540
|
+
Backwards-compatible synonym for `Prec.high`.
|
|
523
541
|
*/
|
|
524
542
|
extend: (ext: Extension) => Extension;
|
|
525
543
|
/**
|
|
526
|
-
|
|
544
|
+
Backwards-compatible synonym for `Prec.highest`.
|
|
527
545
|
*/
|
|
528
546
|
override: (ext: Extension) => Extension;
|
|
529
547
|
};
|
|
@@ -783,7 +801,7 @@ declare class Transaction {
|
|
|
783
801
|
has `"select.pointer"` as user event, `"select"` and
|
|
784
802
|
`"select.pointer"` will match it.
|
|
785
803
|
*/
|
|
786
|
-
isUserEvent(event: string): boolean
|
|
804
|
+
isUserEvent(event: string): boolean;
|
|
787
805
|
/**
|
|
788
806
|
Annotation used to store transaction timestamps.
|
|
789
807
|
*/
|
package/dist/index.js
CHANGED
|
@@ -1102,7 +1102,7 @@ class StateField {
|
|
|
1102
1102
|
*/
|
|
1103
1103
|
get extension() { return this; }
|
|
1104
1104
|
}
|
|
1105
|
-
const Prec_ = {
|
|
1105
|
+
const Prec_ = { lowest: 4, low: 3, default: 2, high: 1, highest: 0 };
|
|
1106
1106
|
function prec(value) {
|
|
1107
1107
|
return (ext) => new PrecExtension(ext, value);
|
|
1108
1108
|
}
|
|
@@ -1118,23 +1118,42 @@ precedence and then by order within each precedence.
|
|
|
1118
1118
|
*/
|
|
1119
1119
|
const Prec = {
|
|
1120
1120
|
/**
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
specified later in the extension ordering.
|
|
1121
|
+
The lowest precedence level. Meant for things that should end up
|
|
1122
|
+
near the end of the extension order.
|
|
1124
1123
|
*/
|
|
1125
|
-
|
|
1124
|
+
lowest: /*@__PURE__*/prec(Prec_.lowest),
|
|
1126
1125
|
/**
|
|
1127
|
-
|
|
1126
|
+
A lower-than-default precedence, for extensions.
|
|
1127
|
+
*/
|
|
1128
|
+
low: /*@__PURE__*/prec(Prec_.low),
|
|
1129
|
+
/**
|
|
1130
|
+
The default precedence, which is also used for extensions
|
|
1131
|
+
without an explicit precedence.
|
|
1128
1132
|
*/
|
|
1129
1133
|
default: /*@__PURE__*/prec(Prec_.default),
|
|
1130
1134
|
/**
|
|
1131
|
-
A higher-than-default precedence
|
|
1135
|
+
A higher-than-default precedence, for extensions that should
|
|
1136
|
+
come before those with default precedence.
|
|
1137
|
+
*/
|
|
1138
|
+
high: /*@__PURE__*/prec(Prec_.high),
|
|
1139
|
+
/**
|
|
1140
|
+
The highest precedence level, for extensions that should end up
|
|
1141
|
+
near the start of the precedence ordering.
|
|
1142
|
+
*/
|
|
1143
|
+
highest: /*@__PURE__*/prec(Prec_.highest),
|
|
1144
|
+
// FIXME Drop these in some future breaking version
|
|
1145
|
+
/**
|
|
1146
|
+
Backwards-compatible synonym for `Prec.lowest`.
|
|
1147
|
+
*/
|
|
1148
|
+
fallback: /*@__PURE__*/prec(Prec_.lowest),
|
|
1149
|
+
/**
|
|
1150
|
+
Backwards-compatible synonym for `Prec.high`.
|
|
1132
1151
|
*/
|
|
1133
|
-
extend: /*@__PURE__*/prec(Prec_.
|
|
1152
|
+
extend: /*@__PURE__*/prec(Prec_.high),
|
|
1134
1153
|
/**
|
|
1135
|
-
|
|
1154
|
+
Backwards-compatible synonym for `Prec.highest`.
|
|
1136
1155
|
*/
|
|
1137
|
-
override: /*@__PURE__*/prec(Prec_.
|
|
1156
|
+
override: /*@__PURE__*/prec(Prec_.highest)
|
|
1138
1157
|
};
|
|
1139
1158
|
class PrecExtension {
|
|
1140
1159
|
constructor(inner, prec) {
|
|
@@ -1240,7 +1259,7 @@ class Configuration {
|
|
|
1240
1259
|
}
|
|
1241
1260
|
}
|
|
1242
1261
|
function flatten(extension, compartments, newCompartments) {
|
|
1243
|
-
let result = [[], [], [], []];
|
|
1262
|
+
let result = [[], [], [], [], []];
|
|
1244
1263
|
let seen = new Map();
|
|
1245
1264
|
function inner(ext, prec) {
|
|
1246
1265
|
let known = seen.get(ext);
|
|
@@ -1572,7 +1591,7 @@ class Transaction {
|
|
|
1572
1591
|
*/
|
|
1573
1592
|
isUserEvent(event) {
|
|
1574
1593
|
let e = this.annotation(Transaction.userEvent);
|
|
1575
|
-
return e && (e == event || e.length > event.length && e.slice(0, event.length) == event && e[event.length] == ".");
|
|
1594
|
+
return !!(e && (e == event || e.length > event.length && e.slice(0, event.length) == event && e[event.length] == "."));
|
|
1576
1595
|
}
|
|
1577
1596
|
}
|
|
1578
1597
|
/**
|