docblocks-core 0.2.1 → 0.2.2
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 +16 -0
- package/dist/index.mjs +12 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# docblocks-core
|
|
2
2
|
|
|
3
|
+
## 0.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 745f1d7: The redo of a remounting step (a type change) restores the pre-change
|
|
8
|
+
selection seat: the redo's stack item carries the pre-undo snapshot,
|
|
9
|
+
which over a remount is the lost-caret residue (none/blocks) rather
|
|
10
|
+
than the pre-change seat. The redo falls back to the seat the matching
|
|
11
|
+
undo restored when the item's own snapshot is not a text selection and
|
|
12
|
+
the undo itself restored a text seat (the remount's case); a non-text
|
|
13
|
+
undo restoration (the canvas' blocks selection) is a legitimate
|
|
14
|
+
pre-undo selection and the redo restores its own snapshot. The view's
|
|
15
|
+
history reseat window suppresses the remount's transient selection loss
|
|
16
|
+
over the undo/redo, and the reseat re-runs when the restoration's
|
|
17
|
+
emission lands.
|
|
18
|
+
|
|
3
19
|
## 0.2.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/index.mjs
CHANGED
|
@@ -5428,6 +5428,14 @@ var SelectionView = class {
|
|
|
5428
5428
|
#pendingChange = null;
|
|
5429
5429
|
/** The selection before the in-flight local/undo-transaction (undo-caret snapshot). */
|
|
5430
5430
|
#pendingBefore = null;
|
|
5431
|
+
/**
|
|
5432
|
+
* The selection the most recent undo restored. The matching redo (popped
|
|
5433
|
+
* from the redo stack) restores it when the redo item's own snapshot is
|
|
5434
|
+
* the remount residue (a type change's forward remount loses the DOM
|
|
5435
|
+
* caret, so the redo item captured the residue's none/blocks, not the
|
|
5436
|
+
* pre-change seat).
|
|
5437
|
+
*/
|
|
5438
|
+
#lastUndoRestored = null;
|
|
5431
5439
|
/** Document subscriptions, all released by destroy(). */
|
|
5432
5440
|
#unsubDocChange;
|
|
5433
5441
|
#onBeforeTransaction;
|
|
@@ -5452,13 +5460,15 @@ var SelectionView = class {
|
|
|
5452
5460
|
event.stackItem.meta.set(this.#metaKey, snapshot);
|
|
5453
5461
|
};
|
|
5454
5462
|
this.#onStackItemPopped = (event) => {
|
|
5455
|
-
|
|
5463
|
+
let saved = event.stackItem.meta.get(this.#metaKey);
|
|
5456
5464
|
if (saved === void 0) return;
|
|
5465
|
+
if (event.type === "redo" && this.#lastUndoRestored !== null && this.#lastUndoRestored.kind === "text" && saved.kind !== "text") saved = this.#lastUndoRestored;
|
|
5457
5466
|
const restored = this.#restoreableSelection(saved);
|
|
5458
5467
|
if (restored === null) return;
|
|
5459
5468
|
this.#state = restored;
|
|
5460
5469
|
this.#emit();
|
|
5461
5470
|
this.#reconcileTracking();
|
|
5471
|
+
if (event.type === "undo") this.#lastUndoRestored = restored;
|
|
5462
5472
|
};
|
|
5463
5473
|
ydoc.on("beforeTransaction", this.#onBeforeTransaction);
|
|
5464
5474
|
ydoc.on("afterTransaction", this.#onAfterTransaction);
|
|
@@ -5500,6 +5510,7 @@ var SelectionView = class {
|
|
|
5500
5510
|
this.#pendingChange = null;
|
|
5501
5511
|
this.#pendingDeltas = /* @__PURE__ */ new Map();
|
|
5502
5512
|
this.#pendingBefore = null;
|
|
5513
|
+
this.#lastUndoRestored = null;
|
|
5503
5514
|
}
|
|
5504
5515
|
/** Subscribe to selection changes (set, rebase, undo/redo restore). Returns unsubscribe. */
|
|
5505
5516
|
onChange(handler) {
|
package/package.json
CHANGED