@pixerate/editor 0.28.0 → 0.30.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/README.md +20 -1
- package/dist/HistoryManager-DWSLd6Tf.d.ts +150 -0
- package/dist/HistoryManager-DeQQMBCj.d.cts +150 -0
- package/dist/agent/index.cjs +20 -427
- package/dist/agent/index.cjs.map +1 -1
- package/dist/agent/index.d.cts +4 -342
- package/dist/agent/index.d.ts +4 -342
- package/dist/agent/index.js +14 -421
- package/dist/agent/index.js.map +1 -1
- package/dist/animation/index.cjs +6 -2
- package/dist/animation/index.cjs.map +1 -1
- package/dist/animation/index.d.cts +3 -73
- package/dist/animation/index.d.ts +3 -73
- package/dist/animation/index.js +17 -13
- package/dist/{builtins-nMXh9sT3.d.cts → builtins-DxC3aUR2.d.cts} +2 -2
- package/dist/{builtins-haN82vjT.d.ts → builtins-NGxNxQfJ.d.ts} +2 -2
- package/dist/canvas/index.cjs +338 -28
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +109 -4
- package/dist/canvas/index.d.ts +109 -4
- package/dist/canvas/index.js +323 -13
- package/dist/canvas/index.js.map +1 -1
- package/dist/chunk-36BLROHV.js +438 -0
- package/dist/chunk-36BLROHV.js.map +1 -0
- package/dist/{chunk-OYEFRO3D.cjs → chunk-6MDQKHRH.cjs} +4 -4
- package/dist/{chunk-OYEFRO3D.cjs.map → chunk-6MDQKHRH.cjs.map} +1 -1
- package/dist/{chunk-ARRTP33I.js → chunk-D6S5M7HV.js} +2 -2
- package/dist/{chunk-ARRTP33I.js.map → chunk-D6S5M7HV.js.map} +1 -1
- package/dist/{chunk-MXZJ4PKN.js → chunk-DDADOHJW.js} +8 -8
- package/dist/{chunk-CPOKFNBG.cjs → chunk-I6BZB5ZH.cjs} +2 -2
- package/dist/{chunk-CPOKFNBG.cjs.map → chunk-I6BZB5ZH.cjs.map} +1 -1
- package/dist/chunk-PIIAZV3L.cjs +244 -0
- package/dist/chunk-PIIAZV3L.cjs.map +1 -0
- package/dist/{chunk-G2I4QJOT.cjs → chunk-QKLRAA4T.cjs} +3 -244
- package/dist/chunk-QKLRAA4T.cjs.map +1 -0
- package/dist/{chunk-2H7ZHPEJ.js → chunk-QVZZGT4X.js} +1 -242
- package/dist/chunk-QVZZGT4X.js.map +1 -0
- package/dist/chunk-UB2OY7FD.js +262 -0
- package/dist/chunk-UB2OY7FD.js.map +1 -0
- package/dist/chunk-V7CC7RZ6.cjs +438 -0
- package/dist/chunk-V7CC7RZ6.cjs.map +1 -0
- package/dist/{chunk-PWJARCI4.js → chunk-W7BOBWZD.js} +5 -196
- package/dist/chunk-W7BOBWZD.js.map +1 -0
- package/dist/{chunk-TTYCN6ZH.cjs → chunk-XHRZSB77.cjs} +8 -199
- package/dist/chunk-XHRZSB77.cjs.map +1 -0
- package/dist/chunk-XZ4L3R4K.cjs +262 -0
- package/dist/chunk-XZ4L3R4K.cjs.map +1 -0
- package/dist/chunk-YK57D7PW.js +244 -0
- package/dist/chunk-YK57D7PW.js.map +1 -0
- package/dist/commands/index.cjs +2 -2
- package/dist/commands/index.cjs.map +1 -1
- package/dist/commands/index.d.cts +2 -2
- package/dist/commands/index.d.ts +2 -2
- package/dist/commands/index.js +1 -1
- package/dist/commands/index.js.map +1 -1
- package/dist/easing-DTmX99QG.d.cts +88 -0
- package/dist/easing-DTmX99QG.d.ts +88 -0
- package/dist/extensions/index.cjs +5 -5
- package/dist/extensions/index.cjs.map +1 -1
- package/dist/extensions/index.js +9 -9
- package/dist/generation/index.cjs +2 -2
- package/dist/generation/index.cjs.map +1 -1
- package/dist/generation/index.js +1 -1
- package/dist/generation/index.js.map +1 -1
- package/dist/history/index.cjs +4 -2
- package/dist/history/index.cjs.map +1 -1
- package/dist/history/index.d.cts +3 -149
- package/dist/history/index.d.ts +3 -149
- package/dist/history/index.js +5 -3
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.js.map +1 -1
- package/dist/index.cjs +15 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +22 -20
- package/dist/index.js.map +1 -1
- package/dist/parameters/index.cjs +1320 -0
- package/dist/parameters/index.cjs.map +1 -0
- package/dist/parameters/index.d.cts +625 -0
- package/dist/parameters/index.d.ts +625 -0
- package/dist/parameters/index.js +1320 -0
- package/dist/parameters/index.js.map +1 -0
- package/dist/tools/index.cjs +31 -0
- package/dist/tools/index.cjs.map +1 -0
- package/dist/tools/index.d.cts +343 -0
- package/dist/tools/index.d.ts +343 -0
- package/dist/tools/index.js +31 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/{types-GT5a5YAX.d.cts → types-DsiXGmjo.d.cts} +1 -1
- package/dist/{types-GT5a5YAX.d.ts → types-DsiXGmjo.d.ts} +1 -1
- package/package.json +11 -1
- package/dist/chunk-2H7ZHPEJ.js.map +0 -1
- package/dist/chunk-G2I4QJOT.cjs.map +0 -1
- package/dist/chunk-PWJARCI4.js.map +0 -1
- package/dist/chunk-TTYCN6ZH.cjs.map +0 -1
- /package/dist/{chunk-MXZJ4PKN.js.map → chunk-DDADOHJW.js.map} +0 -0
package/dist/history/index.cjs
CHANGED
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
var _chunkPIIAZV3Lcjs = require('../chunk-PIIAZV3L.cjs');
|
|
7
8
|
|
|
8
9
|
|
|
9
|
-
var _chunkG2I4QJOTcjs = require('../chunk-G2I4QJOT.cjs');
|
|
10
10
|
|
|
11
|
+
var _chunkQKLRAA4Tcjs = require('../chunk-QKLRAA4T.cjs');
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
|
|
@@ -15,5 +16,6 @@ var _chunkG2I4QJOTcjs = require('../chunk-G2I4QJOT.cjs');
|
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
|
|
20
|
+
exports.DirtyTracker = _chunkPIIAZV3Lcjs.DirtyTracker; exports.HistoryManager = _chunkQKLRAA4Tcjs.HistoryManager; exports.bindDirtyToHistory = _chunkPIIAZV3Lcjs.bindDirtyToHistory; exports.createDirtyTracker = _chunkPIIAZV3Lcjs.createDirtyTracker; exports.createHistoryManager = _chunkQKLRAA4Tcjs.createHistoryManager; exports.defaultIsEqual = _chunkPIIAZV3Lcjs.defaultIsEqual; exports.withoutDirty = _chunkPIIAZV3Lcjs.withoutDirty;
|
|
19
21
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/editor/editor/packages/core/dist/history/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/editor/editor/packages/core/dist/history/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B;AACE;AACA;AACF,yDAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACF,gbAAC","file":"/home/runner/work/editor/editor/packages/core/dist/history/index.cjs"}
|
package/dist/history/index.d.cts
CHANGED
|
@@ -1,151 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* UI-agnostic History and Undo/Redo manager supporting command closures,
|
|
5
|
-
* snapshot diffs, transaction batching, high-frequency event coalescing,
|
|
6
|
-
* keyed gestures, undo marks, a memory budget and a History-panel listing.
|
|
7
|
-
*/
|
|
8
|
-
declare class HistoryManager {
|
|
9
|
-
private undoStack;
|
|
10
|
-
private redoStack;
|
|
11
|
-
private readonly maxDepth;
|
|
12
|
-
private readonly maxBytes;
|
|
13
|
-
private readonly sizeOf?;
|
|
14
|
-
private isApplying;
|
|
15
|
-
private batchDepth;
|
|
16
|
-
private currentBatch;
|
|
17
|
-
private listeners;
|
|
18
|
-
private onStateChange?;
|
|
19
|
-
private cachedState;
|
|
20
|
-
private cachedEntries;
|
|
21
|
-
private nextId;
|
|
22
|
-
private revision;
|
|
23
|
-
/** Bumped by `clear()`; marks from an earlier epoch are stale. */
|
|
24
|
-
private epoch;
|
|
25
|
-
/** Number of steps dropped from the bottom (depth / byte budget) so far. */
|
|
26
|
-
private dropped;
|
|
27
|
-
/** Key of the gesture that the top step belongs to (see `executeMerged`). */
|
|
28
|
-
private gestureKey;
|
|
29
|
-
private gestureEntryId;
|
|
30
|
-
/** Key every merged execute takes while a gesture is held (`beginGesture`). */
|
|
31
|
-
private heldKey;
|
|
32
|
-
constructor(options?: HistoryManagerOptions);
|
|
33
|
-
private computeState;
|
|
34
|
-
/**
|
|
35
|
-
* Returns a snapshot of the current history state.
|
|
36
|
-
* Cached to maintain referential equality across renders for useSyncExternalStore.
|
|
37
|
-
*/
|
|
38
|
-
getState(): HistoryState;
|
|
39
|
-
/**
|
|
40
|
-
* Monotonic counter bumped on every history change (execute, merge, undo,
|
|
41
|
-
* redo, revert, clear). Useful as a cache key, e.g. for `DirtyTracker`.
|
|
42
|
-
*/
|
|
43
|
-
getRevision(): number;
|
|
44
|
-
private notify;
|
|
45
|
-
private measure;
|
|
46
|
-
private makeEntry;
|
|
47
|
-
/** Pushes a step, clears redo and applies the depth and byte limits. */
|
|
48
|
-
private record;
|
|
49
|
-
/**
|
|
50
|
-
* Keeps the stacks within `maxBytes`: the oldest undo steps that do not fit
|
|
51
|
-
* are dropped, but the most recent undo step is always kept.
|
|
52
|
-
*/
|
|
53
|
-
private trim;
|
|
54
|
-
/** Approximate bytes held by the undo and redo stacks (see `maxBytes`). */
|
|
55
|
-
getByteSize(): number;
|
|
56
|
-
private resetGesture;
|
|
57
|
-
/**
|
|
58
|
-
* Executes a command and pushes it onto the undo stack.
|
|
59
|
-
* Clears the redo stack and ends the current gesture.
|
|
60
|
-
*/
|
|
61
|
-
execute(command: Command): void;
|
|
62
|
-
/**
|
|
63
|
-
* Executes a command as part of a continuous interaction (slider scrub, node drag).
|
|
64
|
-
*
|
|
65
|
-
* - With `options.key` (or while a gesture is held with `beginGesture`):
|
|
66
|
-
* consecutive merged executes with the same key fold into one undo step,
|
|
67
|
-
* however long the gesture lasts. Recording any other command, undo, redo,
|
|
68
|
-
* `revertTo`, `goTo`, `clear` or `endGesture()` ends the gesture.
|
|
69
|
-
* - Without a key: coalesces with the previous command if they share the same
|
|
70
|
-
* `tag` and occurred within `windowMs` (default: 300ms).
|
|
71
|
-
*/
|
|
72
|
-
executeMerged(command: Command, options?: MergedExecutionOptions): void;
|
|
73
|
-
/**
|
|
74
|
-
* Holds a gesture: until `endGesture()`, every `executeMerged` call (whatever
|
|
75
|
-
* its own key or tag) joins one undo step, e.g. an automation pass and
|
|
76
|
-
* whatever is dragged during it. Commands recorded with `execute` still end
|
|
77
|
-
* the current step; the next merged execute then starts a new one.
|
|
78
|
-
*/
|
|
79
|
-
beginGesture(key: string): void;
|
|
80
|
-
/** Ends the current (keyed or held) gesture; the next merged execute starts a new step. */
|
|
81
|
-
endGesture(): void;
|
|
82
|
-
/** The key of the gesture currently merging into the top step, if any. */
|
|
83
|
-
getGestureKey(): string | null;
|
|
84
|
-
/**
|
|
85
|
-
* Batches multiple commands executed within `fn` into a single atomic undo entry.
|
|
86
|
-
*/
|
|
87
|
-
batch(name: string, fn: () => void): void;
|
|
88
|
-
/**
|
|
89
|
-
* Reverts already-executed commands of an aborted batch, newest first.
|
|
90
|
-
* Commands executed by the undo closures themselves are not recorded.
|
|
91
|
-
*/
|
|
92
|
-
private rollback;
|
|
93
|
-
/** Undoes the top step (caller holds `isApplying`). Throws leave it on the stack. */
|
|
94
|
-
private undoOne;
|
|
95
|
-
private redoOne;
|
|
96
|
-
/**
|
|
97
|
-
* Reverts the most recent command on the undo stack.
|
|
98
|
-
* Returns true if a command was undone, false otherwise.
|
|
99
|
-
*/
|
|
100
|
-
undo(): boolean;
|
|
101
|
-
/**
|
|
102
|
-
* Re-applies the most recent undone command on the redo stack.
|
|
103
|
-
* Returns true if a command was redone, false otherwise.
|
|
104
|
-
*/
|
|
105
|
-
redo(): boolean;
|
|
106
|
-
/**
|
|
107
|
-
* Captures the current point in the history (its top step), for `revertTo`.
|
|
108
|
-
*/
|
|
109
|
-
mark(): HistoryMark;
|
|
110
|
-
/** Whether `mark` still points into the undo history. */
|
|
111
|
-
isMarkValid(mark: HistoryMark): boolean;
|
|
112
|
-
/**
|
|
113
|
-
* Takes back every step made since `mark` (merged or not), e.g. to cancel a
|
|
114
|
-
* drag with Escape: the state returns to how it was at `mark`, and neither
|
|
115
|
-
* undo nor redo keeps the reverted steps. Does nothing when `mark` has left
|
|
116
|
-
* the history (undone past, dropped by the limits, or cleared).
|
|
117
|
-
* Returns how many steps were taken back.
|
|
118
|
-
*/
|
|
119
|
-
revertTo(mark: HistoryMark): number;
|
|
120
|
-
/**
|
|
121
|
-
* Lists the steps for a History panel: undo steps oldest first, then redo
|
|
122
|
-
* steps (the next redo first). Cached until the history changes.
|
|
123
|
-
*/
|
|
124
|
-
getEntries(): HistoryEntry[];
|
|
125
|
-
/**
|
|
126
|
-
* Undoes or redoes until the step at `index` (from `getEntries`) is the
|
|
127
|
-
* current one; `-1` undoes everything. Returns how many steps were applied.
|
|
128
|
-
*/
|
|
129
|
-
goTo(index: number): number;
|
|
130
|
-
/**
|
|
131
|
-
* Clears both undo and redo stacks.
|
|
132
|
-
*/
|
|
133
|
-
clear(): void;
|
|
134
|
-
/**
|
|
135
|
-
* Subscribes to history state changes.
|
|
136
|
-
* The listener is immediately invoked with the current state.
|
|
137
|
-
* Returns an unsubscribe function.
|
|
138
|
-
*/
|
|
139
|
-
subscribe(listener: (state: HistoryState) => void): () => void;
|
|
140
|
-
/**
|
|
141
|
-
* Utility helper to create a Command from before/after state snapshots.
|
|
142
|
-
*/
|
|
143
|
-
static createSnapshotCommand<T>(options: SnapshotCommandOptions<T>): Command;
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Creates and initializes a new HistoryManager instance.
|
|
147
|
-
*/
|
|
148
|
-
declare function createHistoryManager(options?: HistoryManagerOptions): HistoryManager;
|
|
1
|
+
export { C as Command, c as HistoryEntry, a as HistoryManagerOptions, b as HistoryMark, H as HistoryState, M as MergedExecutionOptions, S as SnapshotCommandOptions } from '../types-DsiXGmjo.cjs';
|
|
2
|
+
export { H as HistoryManager, c as createHistoryManager } from '../HistoryManager-DeQQMBCj.cjs';
|
|
149
3
|
|
|
150
4
|
/**
|
|
151
5
|
* Compares two values for structural equality.
|
|
@@ -276,4 +130,4 @@ interface HistoryDirtyBinding<T> {
|
|
|
276
130
|
*/
|
|
277
131
|
declare function bindDirtyToHistory<T>(options: BindDirtyToHistoryOptions<T>): HistoryDirtyBinding<T>;
|
|
278
132
|
|
|
279
|
-
export { type BindDirtyToHistoryOptions,
|
|
133
|
+
export { type BindDirtyToHistoryOptions, type DirtyHistorySource, DirtyTracker, type DirtyTrackerOptions, type HistoryDirtyBinding, bindDirtyToHistory, createDirtyTracker, defaultIsEqual, withoutDirty };
|
package/dist/history/index.d.ts
CHANGED
|
@@ -1,151 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* UI-agnostic History and Undo/Redo manager supporting command closures,
|
|
5
|
-
* snapshot diffs, transaction batching, high-frequency event coalescing,
|
|
6
|
-
* keyed gestures, undo marks, a memory budget and a History-panel listing.
|
|
7
|
-
*/
|
|
8
|
-
declare class HistoryManager {
|
|
9
|
-
private undoStack;
|
|
10
|
-
private redoStack;
|
|
11
|
-
private readonly maxDepth;
|
|
12
|
-
private readonly maxBytes;
|
|
13
|
-
private readonly sizeOf?;
|
|
14
|
-
private isApplying;
|
|
15
|
-
private batchDepth;
|
|
16
|
-
private currentBatch;
|
|
17
|
-
private listeners;
|
|
18
|
-
private onStateChange?;
|
|
19
|
-
private cachedState;
|
|
20
|
-
private cachedEntries;
|
|
21
|
-
private nextId;
|
|
22
|
-
private revision;
|
|
23
|
-
/** Bumped by `clear()`; marks from an earlier epoch are stale. */
|
|
24
|
-
private epoch;
|
|
25
|
-
/** Number of steps dropped from the bottom (depth / byte budget) so far. */
|
|
26
|
-
private dropped;
|
|
27
|
-
/** Key of the gesture that the top step belongs to (see `executeMerged`). */
|
|
28
|
-
private gestureKey;
|
|
29
|
-
private gestureEntryId;
|
|
30
|
-
/** Key every merged execute takes while a gesture is held (`beginGesture`). */
|
|
31
|
-
private heldKey;
|
|
32
|
-
constructor(options?: HistoryManagerOptions);
|
|
33
|
-
private computeState;
|
|
34
|
-
/**
|
|
35
|
-
* Returns a snapshot of the current history state.
|
|
36
|
-
* Cached to maintain referential equality across renders for useSyncExternalStore.
|
|
37
|
-
*/
|
|
38
|
-
getState(): HistoryState;
|
|
39
|
-
/**
|
|
40
|
-
* Monotonic counter bumped on every history change (execute, merge, undo,
|
|
41
|
-
* redo, revert, clear). Useful as a cache key, e.g. for `DirtyTracker`.
|
|
42
|
-
*/
|
|
43
|
-
getRevision(): number;
|
|
44
|
-
private notify;
|
|
45
|
-
private measure;
|
|
46
|
-
private makeEntry;
|
|
47
|
-
/** Pushes a step, clears redo and applies the depth and byte limits. */
|
|
48
|
-
private record;
|
|
49
|
-
/**
|
|
50
|
-
* Keeps the stacks within `maxBytes`: the oldest undo steps that do not fit
|
|
51
|
-
* are dropped, but the most recent undo step is always kept.
|
|
52
|
-
*/
|
|
53
|
-
private trim;
|
|
54
|
-
/** Approximate bytes held by the undo and redo stacks (see `maxBytes`). */
|
|
55
|
-
getByteSize(): number;
|
|
56
|
-
private resetGesture;
|
|
57
|
-
/**
|
|
58
|
-
* Executes a command and pushes it onto the undo stack.
|
|
59
|
-
* Clears the redo stack and ends the current gesture.
|
|
60
|
-
*/
|
|
61
|
-
execute(command: Command): void;
|
|
62
|
-
/**
|
|
63
|
-
* Executes a command as part of a continuous interaction (slider scrub, node drag).
|
|
64
|
-
*
|
|
65
|
-
* - With `options.key` (or while a gesture is held with `beginGesture`):
|
|
66
|
-
* consecutive merged executes with the same key fold into one undo step,
|
|
67
|
-
* however long the gesture lasts. Recording any other command, undo, redo,
|
|
68
|
-
* `revertTo`, `goTo`, `clear` or `endGesture()` ends the gesture.
|
|
69
|
-
* - Without a key: coalesces with the previous command if they share the same
|
|
70
|
-
* `tag` and occurred within `windowMs` (default: 300ms).
|
|
71
|
-
*/
|
|
72
|
-
executeMerged(command: Command, options?: MergedExecutionOptions): void;
|
|
73
|
-
/**
|
|
74
|
-
* Holds a gesture: until `endGesture()`, every `executeMerged` call (whatever
|
|
75
|
-
* its own key or tag) joins one undo step, e.g. an automation pass and
|
|
76
|
-
* whatever is dragged during it. Commands recorded with `execute` still end
|
|
77
|
-
* the current step; the next merged execute then starts a new one.
|
|
78
|
-
*/
|
|
79
|
-
beginGesture(key: string): void;
|
|
80
|
-
/** Ends the current (keyed or held) gesture; the next merged execute starts a new step. */
|
|
81
|
-
endGesture(): void;
|
|
82
|
-
/** The key of the gesture currently merging into the top step, if any. */
|
|
83
|
-
getGestureKey(): string | null;
|
|
84
|
-
/**
|
|
85
|
-
* Batches multiple commands executed within `fn` into a single atomic undo entry.
|
|
86
|
-
*/
|
|
87
|
-
batch(name: string, fn: () => void): void;
|
|
88
|
-
/**
|
|
89
|
-
* Reverts already-executed commands of an aborted batch, newest first.
|
|
90
|
-
* Commands executed by the undo closures themselves are not recorded.
|
|
91
|
-
*/
|
|
92
|
-
private rollback;
|
|
93
|
-
/** Undoes the top step (caller holds `isApplying`). Throws leave it on the stack. */
|
|
94
|
-
private undoOne;
|
|
95
|
-
private redoOne;
|
|
96
|
-
/**
|
|
97
|
-
* Reverts the most recent command on the undo stack.
|
|
98
|
-
* Returns true if a command was undone, false otherwise.
|
|
99
|
-
*/
|
|
100
|
-
undo(): boolean;
|
|
101
|
-
/**
|
|
102
|
-
* Re-applies the most recent undone command on the redo stack.
|
|
103
|
-
* Returns true if a command was redone, false otherwise.
|
|
104
|
-
*/
|
|
105
|
-
redo(): boolean;
|
|
106
|
-
/**
|
|
107
|
-
* Captures the current point in the history (its top step), for `revertTo`.
|
|
108
|
-
*/
|
|
109
|
-
mark(): HistoryMark;
|
|
110
|
-
/** Whether `mark` still points into the undo history. */
|
|
111
|
-
isMarkValid(mark: HistoryMark): boolean;
|
|
112
|
-
/**
|
|
113
|
-
* Takes back every step made since `mark` (merged or not), e.g. to cancel a
|
|
114
|
-
* drag with Escape: the state returns to how it was at `mark`, and neither
|
|
115
|
-
* undo nor redo keeps the reverted steps. Does nothing when `mark` has left
|
|
116
|
-
* the history (undone past, dropped by the limits, or cleared).
|
|
117
|
-
* Returns how many steps were taken back.
|
|
118
|
-
*/
|
|
119
|
-
revertTo(mark: HistoryMark): number;
|
|
120
|
-
/**
|
|
121
|
-
* Lists the steps for a History panel: undo steps oldest first, then redo
|
|
122
|
-
* steps (the next redo first). Cached until the history changes.
|
|
123
|
-
*/
|
|
124
|
-
getEntries(): HistoryEntry[];
|
|
125
|
-
/**
|
|
126
|
-
* Undoes or redoes until the step at `index` (from `getEntries`) is the
|
|
127
|
-
* current one; `-1` undoes everything. Returns how many steps were applied.
|
|
128
|
-
*/
|
|
129
|
-
goTo(index: number): number;
|
|
130
|
-
/**
|
|
131
|
-
* Clears both undo and redo stacks.
|
|
132
|
-
*/
|
|
133
|
-
clear(): void;
|
|
134
|
-
/**
|
|
135
|
-
* Subscribes to history state changes.
|
|
136
|
-
* The listener is immediately invoked with the current state.
|
|
137
|
-
* Returns an unsubscribe function.
|
|
138
|
-
*/
|
|
139
|
-
subscribe(listener: (state: HistoryState) => void): () => void;
|
|
140
|
-
/**
|
|
141
|
-
* Utility helper to create a Command from before/after state snapshots.
|
|
142
|
-
*/
|
|
143
|
-
static createSnapshotCommand<T>(options: SnapshotCommandOptions<T>): Command;
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Creates and initializes a new HistoryManager instance.
|
|
147
|
-
*/
|
|
148
|
-
declare function createHistoryManager(options?: HistoryManagerOptions): HistoryManager;
|
|
1
|
+
export { C as Command, c as HistoryEntry, a as HistoryManagerOptions, b as HistoryMark, H as HistoryState, M as MergedExecutionOptions, S as SnapshotCommandOptions } from '../types-DsiXGmjo.js';
|
|
2
|
+
export { H as HistoryManager, c as createHistoryManager } from '../HistoryManager-DWSLd6Tf.js';
|
|
149
3
|
|
|
150
4
|
/**
|
|
151
5
|
* Compares two values for structural equality.
|
|
@@ -276,4 +130,4 @@ interface HistoryDirtyBinding<T> {
|
|
|
276
130
|
*/
|
|
277
131
|
declare function bindDirtyToHistory<T>(options: BindDirtyToHistoryOptions<T>): HistoryDirtyBinding<T>;
|
|
278
132
|
|
|
279
|
-
export { type BindDirtyToHistoryOptions,
|
|
133
|
+
export { type BindDirtyToHistoryOptions, type DirtyHistorySource, DirtyTracker, type DirtyTrackerOptions, type HistoryDirtyBinding, bindDirtyToHistory, createDirtyTracker, defaultIsEqual, withoutDirty };
|
package/dist/history/index.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DirtyTracker,
|
|
3
|
-
HistoryManager,
|
|
4
3
|
bindDirtyToHistory,
|
|
5
4
|
createDirtyTracker,
|
|
6
|
-
createHistoryManager,
|
|
7
5
|
defaultIsEqual,
|
|
8
6
|
withoutDirty
|
|
9
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-YK57D7PW.js";
|
|
8
|
+
import {
|
|
9
|
+
HistoryManager,
|
|
10
|
+
createHistoryManager
|
|
11
|
+
} from "../chunk-QVZZGT4X.js";
|
|
10
12
|
export {
|
|
11
13
|
DirtyTracker,
|
|
12
14
|
HistoryManager,
|