datafolder 1.0.14 → 1.0.16
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/README.md +4 -0
- package/package.json +3 -2
- package/src/QyAcl.d.ts +4 -4
- package/src/QyAcl.js +92 -93
- package/src/QyAclSaver_Worker.d.ts +2 -2
- package/src/QyAclWriter.d.ts +3 -2
- package/src/QyAclWriter.js +14 -5
- package/src/QyBatch.js +0 -2
- package/src/QyBinWriter.js +0 -2
- package/src/QyCD.d.ts +1 -1
- package/src/QyCache.d.ts +1 -1
- package/src/QyCache.js +25 -23
- package/src/QyDefaultOptions.js +3 -2
- package/src/QyExpire.js +1 -3
- package/src/QyFileLogger.js +6 -7
- package/src/QyItem.js +1 -1
- package/src/QyKVData.d.ts +2 -2
- package/src/QyKVData.js +2 -2
- package/src/QyKVDataCleaner_Worker.js +49 -49
- package/src/QyKVDataLoader.d.ts +1 -1
- package/src/QyKVDataLoader.js +18 -18
- package/src/QyKVDataSaver_Worker.d.ts +2 -2
- package/src/QyKVDataSaver_Worker.js +5 -14
- package/src/QyMessageWorker.js +24 -25
- package/src/QyMessager.d.ts +3 -3
- package/src/QyMessager.js +29 -29
- package/src/QyMod.d.ts +1 -1
- package/src/QyMod.js +6 -6
- package/src/QyOpRunner.d.ts +1 -1
- package/src/QyOpRunner.js +3 -2
- package/src/QyQueue.d.ts +1 -1
- package/src/QyQueue.js +5 -5
- package/src/QySaver.d.ts +1 -1
- package/src/QySaver.js +1 -1
- package/src/QySnapshotCompactor_Worker.js +5 -5
- package/src/QySnapshotSaver_Worker.d.ts +1 -1
- package/src/QySnapshotSaver_Worker.js +2 -2
- package/src/QySnapshots.d.ts +1 -1
- package/src/QySnapshots.js +6 -6
- package/src/QyUnionNode.d.ts +1 -1
- package/src/QyUnionNode.js +1 -1
- package/static/codemirror.bundle/editor.bundle.js +155 -87
- package/test/testQyGraphQL.js +198 -0
|
@@ -6596,6 +6596,7 @@
|
|
|
6596
6596
|
this.cache.reused.set(oldTile, 2 /* Reused.DOM */);
|
|
6597
6597
|
let text = new TextTile(composition.text, composition.text.nodeValue);
|
|
6598
6598
|
text.flags |= 8 /* TileFlag.Composition */;
|
|
6599
|
+
this.pos = composition.range.toB;
|
|
6599
6600
|
head.append(text);
|
|
6600
6601
|
}
|
|
6601
6602
|
addInlineWidget(widget, marks, openStart) {
|
|
@@ -8120,7 +8121,7 @@
|
|
|
8120
8121
|
// (including the position after the last piece). For a text tile,
|
|
8121
8122
|
// these will be character clusters, for a composite tile, these
|
|
8122
8123
|
// will be child tiles.
|
|
8123
|
-
scan(positions, getRects) {
|
|
8124
|
+
scan(positions, getRects, recursed = false) {
|
|
8124
8125
|
let lo = 0, hi = positions.length - 1, seen = new Set();
|
|
8125
8126
|
let bidi = this.bidiIn(positions[0], positions[hi]);
|
|
8126
8127
|
let above, below;
|
|
@@ -8193,18 +8194,19 @@
|
|
|
8193
8194
|
if (!closestRect) {
|
|
8194
8195
|
let side = above && (!below || (this.y - above.bottom < below.top - this.y)) ? above : below;
|
|
8195
8196
|
this.y = (side.top + side.bottom) / 2;
|
|
8196
|
-
return this.scan(positions, getRects);
|
|
8197
|
+
return this.scan(positions, getRects, true);
|
|
8197
8198
|
}
|
|
8198
8199
|
// Handle the case where closest matched a higher element on the
|
|
8199
8200
|
// same line as an element below/above the coords
|
|
8200
|
-
if (closestDx) {
|
|
8201
|
-
|
|
8201
|
+
if (closestDx && !recursed) {
|
|
8202
|
+
let { top, bottom } = closestRect;
|
|
8203
|
+
if (above && above.bottom > (top + top + bottom) / 3) {
|
|
8202
8204
|
this.y = above.bottom - 1;
|
|
8203
|
-
return this.scan(positions, getRects);
|
|
8205
|
+
return this.scan(positions, getRects, true);
|
|
8204
8206
|
}
|
|
8205
|
-
if (below && below.top <
|
|
8207
|
+
if (below && below.top < (top + bottom + bottom) / 3) {
|
|
8206
8208
|
this.y = below.top + 1;
|
|
8207
|
-
return this.scan(positions, getRects);
|
|
8209
|
+
return this.scan(positions, getRects, true);
|
|
8208
8210
|
}
|
|
8209
8211
|
}
|
|
8210
8212
|
let ltr = (bidi ? this.dirAt(positions[closestI], 1) : this.baseDir) == Direction.LTR;
|
|
@@ -9498,7 +9500,7 @@
|
|
|
9498
9500
|
view.inputState.compositionFirstChange = null;
|
|
9499
9501
|
if (browser.chrome && browser.android) {
|
|
9500
9502
|
// Delay flushing for a bit on Android because it'll often fire a
|
|
9501
|
-
// bunch of contradictory changes in a row at end of
|
|
9503
|
+
// bunch of contradictory changes in a row at end of composition
|
|
9502
9504
|
view.observer.flushSoon();
|
|
9503
9505
|
}
|
|
9504
9506
|
else if (view.inputState.compositionPendingChange) {
|
|
@@ -9573,8 +9575,8 @@
|
|
|
9573
9575
|
const appliedFirefoxHack = /*@__PURE__*/new Set;
|
|
9574
9576
|
// In Firefox, when cut/copy handlers are added to the document, that
|
|
9575
9577
|
// somehow avoids a bug where those events aren't fired when the
|
|
9576
|
-
// selection is empty. See
|
|
9577
|
-
//
|
|
9578
|
+
// selection is empty. See issue #1082 and
|
|
9579
|
+
// https://bugzilla.mozilla.org/show_bug.cgi?id=995961
|
|
9578
9580
|
function firefoxCopyCutHack(doc) {
|
|
9579
9581
|
if (!appliedFirefoxHack.has(doc)) {
|
|
9580
9582
|
appliedFirefoxHack.add(doc);
|
|
@@ -9629,8 +9631,7 @@
|
|
|
9629
9631
|
}
|
|
9630
9632
|
refresh(whiteSpace, lineHeight, charWidth, textHeight, lineLength, knownHeights) {
|
|
9631
9633
|
let lineWrapping = wrappingWhiteSpace.indexOf(whiteSpace) > -1;
|
|
9632
|
-
let changed = Math.abs(lineHeight - this.lineHeight) > 0.3 || this.lineWrapping != lineWrapping
|
|
9633
|
-
Math.abs(charWidth - this.charWidth) > 0.1;
|
|
9634
|
+
let changed = Math.abs(lineHeight - this.lineHeight) > 0.3 || this.lineWrapping != lineWrapping;
|
|
9634
9635
|
this.lineWrapping = lineWrapping;
|
|
9635
9636
|
this.lineHeight = lineHeight;
|
|
9636
9637
|
this.charWidth = charWidth;
|
|
@@ -11060,7 +11061,7 @@
|
|
|
11060
11061
|
flexShrink: 0,
|
|
11061
11062
|
display: "block",
|
|
11062
11063
|
whiteSpace: "pre",
|
|
11063
|
-
wordWrap: "normal", //
|
|
11064
|
+
wordWrap: "normal", // Issue #456
|
|
11064
11065
|
boxSizing: "border-box",
|
|
11065
11066
|
minHeight: "100%",
|
|
11066
11067
|
padding: "4px 0",
|
|
@@ -11479,7 +11480,7 @@
|
|
|
11479
11480
|
readSelectionRange() {
|
|
11480
11481
|
let { view } = this;
|
|
11481
11482
|
// The Selection object is broken in shadow roots in Safari. See
|
|
11482
|
-
//
|
|
11483
|
+
// issue #414
|
|
11483
11484
|
let selection = getSelection(view.root);
|
|
11484
11485
|
if (!selection)
|
|
11485
11486
|
return false;
|
|
@@ -12948,7 +12949,7 @@
|
|
|
12948
12949
|
}
|
|
12949
12950
|
/**
|
|
12950
12951
|
Create a theme extension. The first argument can be a
|
|
12951
|
-
[`style-mod`](https://
|
|
12952
|
+
[`style-mod`](https://code.haverbeke.berlin/marijn/style-mod#documentation)
|
|
12952
12953
|
style spec providing the styles for the theme. These will be
|
|
12953
12954
|
prefixed with a generated class for the style.
|
|
12954
12955
|
|
|
@@ -12994,7 +12995,7 @@
|
|
|
12994
12995
|
}
|
|
12995
12996
|
/**
|
|
12996
12997
|
Facet to add a [style
|
|
12997
|
-
module](https://
|
|
12998
|
+
module](https://code.haverbeke.berlin/marijn/style-mod#documentation) to
|
|
12998
12999
|
an editor view. The view will ensure that the module is
|
|
12999
13000
|
mounted in its [document
|
|
13000
13001
|
root](https://codemirror.net/6/docs/ref/#view.EditorView.constructor^config.root).
|
|
@@ -14832,11 +14833,13 @@
|
|
|
14832
14833
|
arrow: tooltips.some(t => t.arrow),
|
|
14833
14834
|
};
|
|
14834
14835
|
});
|
|
14836
|
+
const hoverPlugin = /*@__PURE__*/Facet.define();
|
|
14835
14837
|
class HoverPlugin {
|
|
14836
|
-
constructor(view, source, field, setHover, hoverTime) {
|
|
14838
|
+
constructor(view, source, field, locked, setHover, hoverTime) {
|
|
14837
14839
|
this.view = view;
|
|
14838
14840
|
this.source = source;
|
|
14839
14841
|
this.field = field;
|
|
14842
|
+
this.locked = locked;
|
|
14840
14843
|
this.setHover = setHover;
|
|
14841
14844
|
this.hoverTime = hoverTime;
|
|
14842
14845
|
this.hoverTimeout = -1;
|
|
@@ -14847,7 +14850,7 @@
|
|
|
14847
14850
|
view.dom.addEventListener("mouseleave", this.mouseleave = this.mouseleave.bind(this));
|
|
14848
14851
|
view.dom.addEventListener("mousemove", this.mousemove = this.mousemove.bind(this));
|
|
14849
14852
|
}
|
|
14850
|
-
update() {
|
|
14853
|
+
update(update) {
|
|
14851
14854
|
if (this.pending) {
|
|
14852
14855
|
this.pending = null;
|
|
14853
14856
|
clearTimeout(this.restartTimeout);
|
|
@@ -14891,19 +14894,29 @@
|
|
|
14891
14894
|
let rtl = bidi && bidi.dir == Direction.RTL ? -1 : 1;
|
|
14892
14895
|
side = (lastMove.x < posCoords.left ? -rtl : rtl);
|
|
14893
14896
|
}
|
|
14897
|
+
this.activateHover(view, pos, side);
|
|
14898
|
+
}
|
|
14899
|
+
activateHover(view, pos, side, locked) {
|
|
14894
14900
|
let open = this.source(view, pos, side);
|
|
14895
|
-
|
|
14901
|
+
let done = (value) => {
|
|
14902
|
+
if (value && !(Array.isArray(value) && !value.length)) {
|
|
14903
|
+
let tooltips = Array.isArray(value) ? value : [value];
|
|
14904
|
+
if (locked)
|
|
14905
|
+
this.locked.set(tooltips, locked);
|
|
14906
|
+
view.dispatch({ effects: this.setHover.of(tooltips) });
|
|
14907
|
+
}
|
|
14908
|
+
};
|
|
14909
|
+
if (open && "then" in open) {
|
|
14896
14910
|
let pending = this.pending = { pos };
|
|
14897
14911
|
open.then(result => {
|
|
14898
14912
|
if (this.pending == pending) {
|
|
14899
14913
|
this.pending = null;
|
|
14900
|
-
|
|
14901
|
-
view.dispatch({ effects: this.setHover.of(Array.isArray(result) ? result : [result]) });
|
|
14914
|
+
done(result);
|
|
14902
14915
|
}
|
|
14903
14916
|
}, e => logException(view.state, e, "hover tooltip"));
|
|
14904
14917
|
}
|
|
14905
|
-
else
|
|
14906
|
-
|
|
14918
|
+
else {
|
|
14919
|
+
done(open);
|
|
14907
14920
|
}
|
|
14908
14921
|
}
|
|
14909
14922
|
get tooltip() {
|
|
@@ -14917,7 +14930,7 @@
|
|
|
14917
14930
|
if (this.hoverTimeout < 0)
|
|
14918
14931
|
this.hoverTimeout = setTimeout(this.checkHover, this.hoverTime);
|
|
14919
14932
|
let { active, tooltip } = this;
|
|
14920
|
-
if (active.length && tooltip && !isInTooltip(tooltip.dom, event) || this.pending) {
|
|
14933
|
+
if (active.length && !this.locked.has(active) && tooltip && !isInTooltip(tooltip.dom, event) || this.pending) {
|
|
14921
14934
|
let { pos } = active[0] || this.pending, end = (_b = (_a = active[0]) === null || _a === void 0 ? void 0 : _a.end) !== null && _b !== void 0 ? _b : pos;
|
|
14922
14935
|
if ((pos == end ? this.view.posAtCoords(this.lastMove) != pos
|
|
14923
14936
|
: !isOverRange(this.view, pos, end, event.clientX, event.clientY))) {
|
|
@@ -14930,7 +14943,7 @@
|
|
|
14930
14943
|
clearTimeout(this.hoverTimeout);
|
|
14931
14944
|
this.hoverTimeout = -1;
|
|
14932
14945
|
let { active } = this;
|
|
14933
|
-
if (active.length) {
|
|
14946
|
+
if (active.length && !this.locked.has(active)) {
|
|
14934
14947
|
let { tooltip } = this;
|
|
14935
14948
|
let inTooltip = tooltip && tooltip.dom.contains(event.relatedTarget);
|
|
14936
14949
|
if (!inTooltip)
|
|
@@ -14942,7 +14955,8 @@
|
|
|
14942
14955
|
watchTooltipLeave(tooltip) {
|
|
14943
14956
|
let watch = (event) => {
|
|
14944
14957
|
tooltip.removeEventListener("mouseleave", watch);
|
|
14945
|
-
|
|
14958
|
+
let { active } = this;
|
|
14959
|
+
if (active.length && !this.locked.has(active) && !this.view.dom.contains(event.relatedTarget))
|
|
14946
14960
|
this.view.dispatch({ effects: this.setHover.of([]) });
|
|
14947
14961
|
};
|
|
14948
14962
|
tooltip.addEventListener("mouseleave", watch);
|
|
@@ -14993,49 +15007,85 @@
|
|
|
14993
15007
|
*/
|
|
14994
15008
|
function hoverTooltip(source, options = {}) {
|
|
14995
15009
|
let setHover = StateEffect.define();
|
|
15010
|
+
// This would be better stored in the state field, but we've set
|
|
15011
|
+
// down the type of the field in our interface, so it's indirectly
|
|
15012
|
+
// stored by array identity.
|
|
15013
|
+
let locked = new WeakMap();
|
|
14996
15014
|
let hoverState = StateField.define({
|
|
14997
15015
|
create() { return []; },
|
|
14998
15016
|
update(value, tr) {
|
|
15017
|
+
let lock = locked.get(value);
|
|
14999
15018
|
if (value.length) {
|
|
15000
15019
|
if (options.hideOnChange && (tr.docChanged || tr.selection))
|
|
15001
15020
|
value = [];
|
|
15021
|
+
else if (lock && lock(tr))
|
|
15022
|
+
value = [];
|
|
15002
15023
|
else if (options.hideOn)
|
|
15003
15024
|
value = value.filter(v => !options.hideOn(tr, v));
|
|
15004
|
-
|
|
15005
|
-
|
|
15006
|
-
|
|
15007
|
-
|
|
15008
|
-
|
|
15009
|
-
|
|
15010
|
-
|
|
15011
|
-
|
|
15012
|
-
|
|
15013
|
-
|
|
15014
|
-
|
|
15025
|
+
}
|
|
15026
|
+
if (tr.docChanged && value.length) {
|
|
15027
|
+
let mapped = [];
|
|
15028
|
+
for (let tooltip of value) {
|
|
15029
|
+
let newPos = tr.changes.mapPos(tooltip.pos, -1, MapMode.TrackDel);
|
|
15030
|
+
if (newPos != null) {
|
|
15031
|
+
let copy = Object.assign(Object.create(null), tooltip);
|
|
15032
|
+
copy.pos = newPos;
|
|
15033
|
+
if (copy.end != null)
|
|
15034
|
+
copy.end = tr.changes.mapPos(copy.end);
|
|
15035
|
+
mapped.push(copy);
|
|
15015
15036
|
}
|
|
15016
|
-
value = mapped;
|
|
15017
15037
|
}
|
|
15038
|
+
value = mapped;
|
|
15018
15039
|
}
|
|
15019
15040
|
for (let effect of tr.effects) {
|
|
15020
|
-
if (effect.is(setHover))
|
|
15041
|
+
if (effect.is(setHover)) {
|
|
15021
15042
|
value = effect.value;
|
|
15022
|
-
|
|
15043
|
+
lock = undefined;
|
|
15044
|
+
}
|
|
15045
|
+
if (effect.is(closeHoverTooltipEffect) && !effect.value || effect.value == hoverState)
|
|
15023
15046
|
value = [];
|
|
15024
15047
|
}
|
|
15048
|
+
if (value.length && lock)
|
|
15049
|
+
locked.set(value, lock);
|
|
15025
15050
|
return value;
|
|
15026
15051
|
},
|
|
15027
15052
|
provide: f => showHoverTooltip.from(f)
|
|
15028
15053
|
});
|
|
15054
|
+
const plugin = ViewPlugin.define(view => new HoverPlugin(view, source, hoverState, locked, setHover, options.hoverTime || 300 /* Hover.Time */));
|
|
15029
15055
|
return {
|
|
15030
15056
|
active: hoverState,
|
|
15031
15057
|
extension: [
|
|
15032
15058
|
hoverState,
|
|
15033
|
-
|
|
15059
|
+
plugin,
|
|
15060
|
+
hoverPlugin.of(plugin),
|
|
15034
15061
|
showHoverTooltipHost
|
|
15035
15062
|
]
|
|
15036
15063
|
};
|
|
15037
15064
|
}
|
|
15038
15065
|
/**
|
|
15066
|
+
Activate hover tooltips for the given position and side. If you
|
|
15067
|
+
provide a specific hover tooltip (the value returned from
|
|
15068
|
+
[`hoverTooltip`](https://codemirror.net/6/docs/ref/#view.hoverTooltip)), only that one will be
|
|
15069
|
+
activated. If not given, all hover tooltips at the given position
|
|
15070
|
+
are triggered.
|
|
15071
|
+
|
|
15072
|
+
Note that tooltips opened this way don't close automatically, and
|
|
15073
|
+
you'll want to pass an `until` callback or use
|
|
15074
|
+
[`closeHoverTooltip`](https://codemirror.net/6/docs/ref/#view.closeHoverTooltip)/[`closeHoverTooltips`](https://codemirror.net/6/docs/ref/#view.closeHoverTooltips)
|
|
15075
|
+
to deactivate them.
|
|
15076
|
+
*/
|
|
15077
|
+
function activateHover(view, pos, side, options = {}) {
|
|
15078
|
+
var _a;
|
|
15079
|
+
let plugins = view.state.facet(hoverPlugin).map(p => view.plugin(p)).filter((p) => !!p);
|
|
15080
|
+
if (options.tooltip && options.tooltip.active) {
|
|
15081
|
+
let found = plugins.find(p => p.field == options.tooltip.active);
|
|
15082
|
+
if (found)
|
|
15083
|
+
plugins = [found];
|
|
15084
|
+
}
|
|
15085
|
+
for (let plugin of plugins)
|
|
15086
|
+
plugin.activateHover(view, pos, side, (_a = options.until) !== null && _a !== void 0 ? _a : (() => false));
|
|
15087
|
+
}
|
|
15088
|
+
/**
|
|
15039
15089
|
Get the active tooltip view for a given tooltip, if available.
|
|
15040
15090
|
*/
|
|
15041
15091
|
function getTooltip(view, tooltip) {
|
|
@@ -21869,8 +21919,13 @@
|
|
|
21869
21919
|
The current match (only holds a meaningful value after
|
|
21870
21920
|
[`next`](https://codemirror.net/6/docs/ref/#search.SearchCursor.next) has been called and when
|
|
21871
21921
|
`done` is false).
|
|
21922
|
+
|
|
21923
|
+
The `precise` flag will be set to false if the match starts or
|
|
21924
|
+
ends _inside_ a character that, when normalized, expands to
|
|
21925
|
+
multiple characters. It indicates that the `from`-`to` range
|
|
21926
|
+
covers content that isn't part of the actual match.
|
|
21872
21927
|
*/
|
|
21873
|
-
this.value = { from: 0, to: 0 };
|
|
21928
|
+
this.value = { from: 0, to: 0, precise: false };
|
|
21874
21929
|
/**
|
|
21875
21930
|
Whether the end of the iterated region has been reached.
|
|
21876
21931
|
*/
|
|
@@ -21921,44 +21976,45 @@
|
|
|
21921
21976
|
this.bufferPos += codePointSize(next);
|
|
21922
21977
|
let norm = this.normalize(str);
|
|
21923
21978
|
if (norm.length)
|
|
21924
|
-
for (let i = 0, pos = start;; i++) {
|
|
21979
|
+
for (let i = 0, pos = start, posPrecise = true;; i++) {
|
|
21925
21980
|
let code = norm.charCodeAt(i);
|
|
21926
|
-
let match = this.match(code, pos, this.bufferPos + this.bufferStart);
|
|
21927
|
-
if (
|
|
21928
|
-
|
|
21929
|
-
|
|
21930
|
-
return this;
|
|
21931
|
-
}
|
|
21932
|
-
break;
|
|
21981
|
+
let match = this.match(code, pos, posPrecise, this.bufferPos + this.bufferStart, i == norm.length - 1);
|
|
21982
|
+
if (match) {
|
|
21983
|
+
this.value = match;
|
|
21984
|
+
return this;
|
|
21933
21985
|
}
|
|
21934
|
-
if (
|
|
21986
|
+
if (i == norm.length - 1)
|
|
21987
|
+
break;
|
|
21988
|
+
if (posPrecise && i < str.length && str.charCodeAt(i) == code)
|
|
21935
21989
|
pos++;
|
|
21990
|
+
else
|
|
21991
|
+
posPrecise = false;
|
|
21936
21992
|
}
|
|
21937
21993
|
}
|
|
21938
21994
|
}
|
|
21939
|
-
match(code, pos, end) {
|
|
21995
|
+
match(code, pos, posPrecise, end, endPrecise) {
|
|
21940
21996
|
let match = null;
|
|
21941
|
-
for (let i = 0; i < this.matches.length;
|
|
21942
|
-
let
|
|
21943
|
-
if (this.query.charCodeAt(index) == code) {
|
|
21944
|
-
if (index == this.query.length - 1) {
|
|
21945
|
-
match = { from:
|
|
21997
|
+
for (let i = 0; i < this.matches.length;) {
|
|
21998
|
+
let partial = this.matches[i], keep = false;
|
|
21999
|
+
if (this.query.charCodeAt(partial.index) == code) {
|
|
22000
|
+
if (partial.index == this.query.length - 1) {
|
|
22001
|
+
match = { from: partial.from, to: end, precise: endPrecise && partial.precise };
|
|
21946
22002
|
}
|
|
21947
22003
|
else {
|
|
21948
|
-
|
|
22004
|
+
partial.index++;
|
|
21949
22005
|
keep = true;
|
|
21950
22006
|
}
|
|
21951
22007
|
}
|
|
21952
|
-
if (
|
|
21953
|
-
|
|
21954
|
-
|
|
21955
|
-
|
|
22008
|
+
if (keep)
|
|
22009
|
+
i++;
|
|
22010
|
+
else
|
|
22011
|
+
this.matches.splice(i, 1);
|
|
21956
22012
|
}
|
|
21957
22013
|
if (this.query.charCodeAt(0) == code) {
|
|
21958
22014
|
if (this.query.length == 1)
|
|
21959
|
-
match = { from: pos, to: end };
|
|
22015
|
+
match = { from: pos, to: end, precise: posPrecise && endPrecise };
|
|
21960
22016
|
else
|
|
21961
|
-
this.matches.push(1,
|
|
22017
|
+
this.matches.push({ from: pos, index: 1, precise: posPrecise });
|
|
21962
22018
|
}
|
|
21963
22019
|
if (match && this.test && !this.test(match.from, match.to, this.buffer, this.bufferStart))
|
|
21964
22020
|
match = null;
|
|
@@ -21968,7 +22024,7 @@
|
|
|
21968
22024
|
if (typeof Symbol != "undefined")
|
|
21969
22025
|
SearchCursor.prototype[Symbol.iterator] = function () { return this; };
|
|
21970
22026
|
|
|
21971
|
-
const empty = { from: -1, to: -1, match: /*@__PURE__*//.*/.exec("") };
|
|
22027
|
+
const empty = { from: -1, to: -1, match: /*@__PURE__*//.*/.exec(""), precise: true };
|
|
21972
22028
|
const baseFlags = "gm" + (/x/.unicode == null ? "" : "u");
|
|
21973
22029
|
/**
|
|
21974
22030
|
This class is similar to [`SearchCursor`](https://codemirror.net/6/docs/ref/#search.SearchCursor)
|
|
@@ -21993,7 +22049,9 @@
|
|
|
21993
22049
|
/**
|
|
21994
22050
|
Will contain an object with the extent of the match and the
|
|
21995
22051
|
match object when [`next`](https://codemirror.net/6/docs/ref/#search.RegExpCursor.next)
|
|
21996
|
-
sucessfully finds a match.
|
|
22052
|
+
sucessfully finds a match. The `precise` flag is always true for
|
|
22053
|
+
this type of cursor, and only there to make sure this cursor is
|
|
22054
|
+
a subtype of `SearchCursor`.
|
|
21997
22055
|
*/
|
|
21998
22056
|
this.value = empty;
|
|
21999
22057
|
if (/\\[sWDnr]|\n|\r|\[\^/.test(query))
|
|
@@ -22038,7 +22096,7 @@
|
|
|
22038
22096
|
if (from == this.curLineStart + this.curLine.length)
|
|
22039
22097
|
this.nextLine();
|
|
22040
22098
|
if ((from < to || from > this.value.to) && (!this.test || this.test(from, to, match))) {
|
|
22041
|
-
this.value = { from, to, match };
|
|
22099
|
+
this.value = { from, to, precise: true, match };
|
|
22042
22100
|
return this;
|
|
22043
22101
|
}
|
|
22044
22102
|
off = this.matchPos - this.curLineStart;
|
|
@@ -22111,7 +22169,7 @@
|
|
|
22111
22169
|
// again, since it'll likely be able to match more
|
|
22112
22170
|
if ((this.flat.to >= this.to || match.index + match[0].length <= this.flat.text.length - 10) &&
|
|
22113
22171
|
(!this.test || this.test(from, to, match))) {
|
|
22114
|
-
this.value = { from, to, match };
|
|
22172
|
+
this.value = { from, to, precise: true, match };
|
|
22115
22173
|
this.matchPos = toCharEnd(this.text, to + (from == to ? 1 : 0));
|
|
22116
22174
|
return this;
|
|
22117
22175
|
}
|
|
@@ -22730,10 +22788,12 @@
|
|
|
22730
22788
|
let next = match;
|
|
22731
22789
|
let changes = [], selection, replacement;
|
|
22732
22790
|
let effects = [];
|
|
22733
|
-
if (next.
|
|
22791
|
+
if (!next.precise) {
|
|
22792
|
+
next = query.nextMatch(state, next.from, next.to);
|
|
22793
|
+
}
|
|
22794
|
+
else if (next.from == from && next.to == to) {
|
|
22734
22795
|
replacement = state.toText(query.getReplacement(next));
|
|
22735
22796
|
changes.push({ from: next.from, to: next.to, insert: replacement });
|
|
22736
|
-
next = query.nextMatch(state, next.from, next.to);
|
|
22737
22797
|
effects.push(EditorView.announce.of(state.phrase("replaced match on line $", state.doc.lineAt(from).number) + "."));
|
|
22738
22798
|
}
|
|
22739
22799
|
let changeSet = view.state.changes(changes);
|
|
@@ -22757,10 +22817,12 @@
|
|
|
22757
22817
|
const replaceAll = /*@__PURE__*/searchCommand((view, { query }) => {
|
|
22758
22818
|
if (view.state.readOnly)
|
|
22759
22819
|
return false;
|
|
22760
|
-
let changes =
|
|
22761
|
-
|
|
22762
|
-
|
|
22763
|
-
|
|
22820
|
+
let changes = [];
|
|
22821
|
+
for (let match of query.matchAll(view.state, 1e9)) {
|
|
22822
|
+
let { from, to, precise } = match;
|
|
22823
|
+
if (precise)
|
|
22824
|
+
changes.push({ from, to, insert: query.getReplacement(match) });
|
|
22825
|
+
}
|
|
22764
22826
|
if (!changes.length)
|
|
22765
22827
|
return false;
|
|
22766
22828
|
let announceText = view.state.phrase("replaced $ matches", changes.length) + ".";
|
|
@@ -23508,8 +23570,8 @@
|
|
|
23508
23570
|
let off = Math.floor(selected / max);
|
|
23509
23571
|
return { from: off * max, to: (off + 1) * max };
|
|
23510
23572
|
}
|
|
23511
|
-
let off = Math.
|
|
23512
|
-
return { from: total -
|
|
23573
|
+
let off = Math.ceil((total - selected) / max);
|
|
23574
|
+
return { from: total - off * max, to: total - (off - 1) * max };
|
|
23513
23575
|
}
|
|
23514
23576
|
class CompletionTooltip {
|
|
23515
23577
|
constructor(view, stateField, applyCompletion) {
|
|
@@ -24368,7 +24430,8 @@
|
|
|
24368
24430
|
content: '"···"',
|
|
24369
24431
|
opacity: 0.5,
|
|
24370
24432
|
display: "block",
|
|
24371
|
-
textAlign: "center"
|
|
24433
|
+
textAlign: "center",
|
|
24434
|
+
cursor: "pointer",
|
|
24372
24435
|
},
|
|
24373
24436
|
".cm-tooltip.cm-completionInfo": {
|
|
24374
24437
|
position: "absolute",
|
|
@@ -25216,6 +25279,10 @@
|
|
|
25216
25279
|
return false;
|
|
25217
25280
|
}
|
|
25218
25281
|
view.dispatch({ selection: { anchor: next.from, head: next.to }, scrollIntoView: true });
|
|
25282
|
+
activateHover(view, next.from, 1, {
|
|
25283
|
+
tooltip: lintHover,
|
|
25284
|
+
until: tr => tr.docChanged || tr.newSelection.main.head < next.from || tr.newSelection.main.head > next.to
|
|
25285
|
+
});
|
|
25219
25286
|
return true;
|
|
25220
25287
|
};
|
|
25221
25288
|
/**
|
|
@@ -25525,7 +25592,7 @@
|
|
|
25525
25592
|
backgroundRepeat: "repeat-x",
|
|
25526
25593
|
paddingBottom: "0.7px",
|
|
25527
25594
|
},
|
|
25528
|
-
".cm-lintRange-error": { backgroundImage: /*@__PURE__*/underline("#
|
|
25595
|
+
".cm-lintRange-error": { backgroundImage: /*@__PURE__*/underline("#f11") },
|
|
25529
25596
|
".cm-lintRange-warning": { backgroundImage: /*@__PURE__*/underline("orange") },
|
|
25530
25597
|
".cm-lintRange-info": { backgroundImage: /*@__PURE__*/underline("#999") },
|
|
25531
25598
|
".cm-lintRange-hint": { backgroundImage: /*@__PURE__*/underline("#66d") },
|
|
@@ -25606,6 +25673,7 @@
|
|
|
25606
25673
|
}
|
|
25607
25674
|
return sev;
|
|
25608
25675
|
}
|
|
25676
|
+
const lintHover = /*@__PURE__*/hoverTooltip(lintTooltip, { hideOn: hideTooltip });
|
|
25609
25677
|
const lintExtensions = [
|
|
25610
25678
|
lintState,
|
|
25611
25679
|
/*@__PURE__*/EditorView.decorations.compute([lintState], state => {
|
|
@@ -25614,7 +25682,7 @@
|
|
|
25614
25682
|
activeMark.range(selected.from, selected.to)
|
|
25615
25683
|
]);
|
|
25616
25684
|
}),
|
|
25617
|
-
|
|
25685
|
+
lintHover,
|
|
25618
25686
|
baseTheme
|
|
25619
25687
|
];
|
|
25620
25688
|
|
|
@@ -25874,16 +25942,12 @@
|
|
|
25874
25942
|
if (term == 0 /* Term.Err */ &&
|
|
25875
25943
|
(!this.stack.length || this.stack[this.stack.length - 1] < this.buffer.length + this.bufferBase)) {
|
|
25876
25944
|
// Try to omit/merge adjacent error nodes
|
|
25877
|
-
let
|
|
25878
|
-
if (top == 0 &&
|
|
25879
|
-
top = cur.bufferBase - cur.parent.bufferBase;
|
|
25880
|
-
cur = cur.parent;
|
|
25881
|
-
}
|
|
25882
|
-
if (top > 0 && cur.buffer[top - 4] == 0 /* Term.Err */ && cur.buffer[top - 1] > -1) {
|
|
25945
|
+
let top = this.buffer.length;
|
|
25946
|
+
if (top > 0 && this.buffer[top - 4] == 0 /* Term.Err */ && this.buffer[top - 1] > -1) {
|
|
25883
25947
|
if (start == end)
|
|
25884
25948
|
return;
|
|
25885
|
-
if (
|
|
25886
|
-
|
|
25949
|
+
if (this.buffer[top - 2] >= start) {
|
|
25950
|
+
this.buffer[top - 2] = end;
|
|
25887
25951
|
return;
|
|
25888
25952
|
}
|
|
25889
25953
|
}
|
|
@@ -25982,6 +26046,10 @@
|
|
|
25982
26046
|
split() {
|
|
25983
26047
|
let parent = this;
|
|
25984
26048
|
let off = parent.buffer.length;
|
|
26049
|
+
// Leave off top error node, if there, because that might be
|
|
26050
|
+
// merged with other nodes.
|
|
26051
|
+
if (off && parent.buffer[off - 4] == 0 /* Term.Err */)
|
|
26052
|
+
off -= 4;
|
|
25985
26053
|
// Because the top of the buffer (after this.pos) may be mutated
|
|
25986
26054
|
// to reorder reductions and skipped tokens, and shared buffers
|
|
25987
26055
|
// should be immutable, this copies any outstanding skipped tokens
|