@sobree/core 0.1.24 → 0.1.26
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/editor/index.d.ts +51 -120
- package/dist/editor/internal/changePipeline.d.ts +123 -0
- package/dist/editor/internal/frameCaret.d.ts +37 -0
- package/dist/editor/internal/frames.d.ts +105 -0
- package/dist/editor/view/docSerialize/block.d.ts +15 -0
- package/dist/editor/view/docSerialize/index.d.ts +10 -1
- package/dist/editor/view/docSerialize/inline.d.ts +2 -1
- package/dist/editor/wiring.d.ts +3 -0
- package/dist/history/history.d.ts +27 -6
- package/dist/history/types.d.ts +32 -3
- package/dist/index.js +5475 -5166
- package/dist/index.js.map +1 -1
- package/dist/paperStack/paperStack.d.ts +28 -5
- package/package.json +1 -1
package/dist/history/types.d.ts
CHANGED
|
@@ -1,8 +1,37 @@
|
|
|
1
|
+
import { Selection } from '../doc/api';
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
* the
|
|
4
|
-
*
|
|
3
|
+
* Selection inside an editable textbox frame. Frame bodies aren't body
|
|
4
|
+
* registry blocks, so the public `Selection` model can't address them —
|
|
5
|
+
* but undo/redo still needs to put the caret (or range) back. The editor
|
|
6
|
+
* captures this on a frame edit and restores it on undo, exactly as it
|
|
7
|
+
* does the body `Selection`; `History` treats the stashed value as opaque.
|
|
8
|
+
* A collapsed caret has `start === end`.
|
|
5
9
|
*/
|
|
10
|
+
export interface FrameSelection {
|
|
11
|
+
kind: "frame-selection";
|
|
12
|
+
/** `data-anchor-id` of the frame the selection was in. */
|
|
13
|
+
frameId: string;
|
|
14
|
+
/** Character offset of the selection start across the frame's text. */
|
|
15
|
+
start: number;
|
|
16
|
+
/** Character offset of the selection end (=== start for a caret). */
|
|
17
|
+
end: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* What the editor stashes for an undo step: a body `Selection` (incl.
|
|
21
|
+
* `null` when focus is outside) or a {@link FrameSelection}. Restored
|
|
22
|
+
* verbatim on undo/redo so the cursor lands where the body's would.
|
|
23
|
+
*/
|
|
24
|
+
export type CapturedSelection = Selection | FrameSelection;
|
|
25
|
+
/**
|
|
26
|
+
* Both ends of an undo step's cursor: where it sat BEFORE the edit and
|
|
27
|
+
* AFTER it. Undo restores `before` (you land where you started the edit);
|
|
28
|
+
* redo restores `after` (you land where the edit left you) — Word/Docs
|
|
29
|
+
* behaviour. Stashed on each `Y.UndoManager` stack item's meta.
|
|
30
|
+
*/
|
|
31
|
+
export interface UndoSelections {
|
|
32
|
+
before: CapturedSelection;
|
|
33
|
+
after: CapturedSelection;
|
|
34
|
+
}
|
|
6
35
|
export interface HistoryConfig {
|
|
7
36
|
/** Hard cap on entry count (per stack). UndoManager doesn't expose
|
|
8
37
|
* a max-depth knob directly — kept here for forward-compat in case
|