valtio-history 0.1.0 → 0.2.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 +3 -0
- package/package.json +4 -3
- package/src/history-utility.d.ts +20 -3
- package/src/history-utility.js +63 -25
- package/src/history-utility.js.map +1 -1
- package/src/index.js +1 -4
- package/src/index.js.map +1 -1
package/README.md
CHANGED
|
@@ -6,6 +6,8 @@ valtio utility for creating a proxy state with history tracking
|
|
|
6
6
|
|
|
7
7
|
https://valtio.pmnd.rs/docs/api/utils/proxyWithHistory
|
|
8
8
|
|
|
9
|
+
see detailed [api docs](https://github.com/valtiojs/valtio-history/blob/main/packages/history-utility/docs/modules.md) for more info.
|
|
10
|
+
|
|
9
11
|
---
|
|
10
12
|
|
|
11
13
|
## Migrating from `valtio/utils`
|
|
@@ -50,3 +52,4 @@ export default function App() {
|
|
|
50
52
|
- the `history` object has changes
|
|
51
53
|
- `history.snapshots` is renamed to `history.nodes`
|
|
52
54
|
- a `HistoryNode` has the structure `{ snapshot: Snapshot<T>; createdAt: Date; updatedAt?: Date; }`
|
|
55
|
+
- The second parameter of `proxyWithHistory` is now an object instead of a `boolean`. `{ skipSubscribe?: boolean }`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "valtio-history",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"author": "Daishi Kato",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"valtio": ">=1.0.0"
|
|
23
23
|
},
|
|
24
|
-
"type": "
|
|
24
|
+
"type": "module",
|
|
25
25
|
"main": "./src/index.js",
|
|
26
|
-
"typings": "./src/index.d.ts"
|
|
26
|
+
"typings": "./src/index.d.ts",
|
|
27
|
+
"module": "./src/index.js"
|
|
27
28
|
}
|
package/src/history-utility.d.ts
CHANGED
|
@@ -28,6 +28,12 @@ export type History<T> = {
|
|
|
28
28
|
*/
|
|
29
29
|
index: number;
|
|
30
30
|
};
|
|
31
|
+
export type HistoryOptions = {
|
|
32
|
+
/**
|
|
33
|
+
* determines if the internal subscribe behaviour should be skipped.
|
|
34
|
+
*/
|
|
35
|
+
skipSubscribe?: boolean;
|
|
36
|
+
};
|
|
31
37
|
/**
|
|
32
38
|
* This creates a new proxy with history support (ProxyHistoryObject).
|
|
33
39
|
* It includes following main properties:<br>
|
|
@@ -50,8 +56,8 @@ export type History<T> = {
|
|
|
50
56
|
* Notes: <br>
|
|
51
57
|
* - Suspense/promise is not supported. <br>
|
|
52
58
|
*
|
|
53
|
-
* @param initialValue - any
|
|
54
|
-
* @param
|
|
59
|
+
* @param initialValue - any value to be tracked
|
|
60
|
+
* @param options - use to configure the proxyWithHistory utility.
|
|
55
61
|
* @returns proxyObject
|
|
56
62
|
*
|
|
57
63
|
* @example
|
|
@@ -60,7 +66,7 @@ export type History<T> = {
|
|
|
60
66
|
* count: 1,
|
|
61
67
|
* })
|
|
62
68
|
*/
|
|
63
|
-
export declare function proxyWithHistory<V>(initialValue: V,
|
|
69
|
+
export declare function proxyWithHistory<V>(initialValue: V, options?: HistoryOptions | boolean): {
|
|
64
70
|
/**
|
|
65
71
|
* any value to be tracked (does not have to be an object)
|
|
66
72
|
*/
|
|
@@ -126,6 +132,10 @@ export declare function proxyWithHistory<V>(initialValue: V, skipSubscribe?: boo
|
|
|
126
132
|
* utility to clone a snapshot
|
|
127
133
|
*/
|
|
128
134
|
clone: <T_10>(value: T_10) => T_10;
|
|
135
|
+
/**
|
|
136
|
+
* a function to go to a specific index in history
|
|
137
|
+
*/
|
|
138
|
+
goTo: (index: number) => void;
|
|
129
139
|
/**
|
|
130
140
|
* a function to return true if undo is available
|
|
131
141
|
* @returns boolean
|
|
@@ -148,6 +158,13 @@ export declare function proxyWithHistory<V>(initialValue: V, skipSubscribe?: boo
|
|
|
148
158
|
* a function to execute saving history when changes are made to `value`
|
|
149
159
|
*/
|
|
150
160
|
saveHistory: () => void;
|
|
161
|
+
/**
|
|
162
|
+
* a function that returns true when the history should be updated
|
|
163
|
+
*
|
|
164
|
+
* @param ops - subscribeOps from subscribe callback
|
|
165
|
+
* @returns boolean
|
|
166
|
+
*/
|
|
167
|
+
shouldSaveHistory: (ops: ([op: "set", path: (string | symbol)[], value: unknown, prevValue: unknown] | [op: "delete", path: (string | symbol)[], prevValue: unknown] | [op: "resolve", path: (string | symbol)[], value: unknown] | [op: "reject", path: (string | symbol)[], error: unknown])[]) => boolean;
|
|
151
168
|
/**
|
|
152
169
|
* a function to subscribe to changes made to `value`
|
|
153
170
|
*/
|
package/src/history-utility.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.proxyWithHistory = void 0;
|
|
4
|
-
const vanilla_1 = require("valtio/vanilla");
|
|
1
|
+
import { unstable_buildProxyFunction as buildProxyFunction, proxy, ref, snapshot, subscribe, } from 'valtio/vanilla';
|
|
5
2
|
const isObject = (value) => !!value && typeof value === 'object';
|
|
6
3
|
let refSet;
|
|
7
4
|
const deepClone = (value) => {
|
|
8
5
|
if (!refSet) {
|
|
9
|
-
refSet = (
|
|
6
|
+
refSet = buildProxyFunction()[2];
|
|
10
7
|
}
|
|
11
8
|
if (!isObject(value) || refSet.has(value)) {
|
|
12
9
|
return value;
|
|
@@ -19,6 +16,27 @@ const deepClone = (value) => {
|
|
|
19
16
|
});
|
|
20
17
|
return baseObject;
|
|
21
18
|
};
|
|
19
|
+
const normalizeOptions = (options) => {
|
|
20
|
+
if (typeof options === 'boolean') {
|
|
21
|
+
if (import.meta.env?.MODE !== 'production') {
|
|
22
|
+
console.warn(`The second parameter of 'proxyWithHistory' as boolean is deprecated and support for boolean will be removed
|
|
23
|
+
in the next major version. Please use the object syntax instead:
|
|
24
|
+
|
|
25
|
+
{ skipSubscribe: boolean }
|
|
26
|
+
`);
|
|
27
|
+
}
|
|
28
|
+
return { skipSubscribe: options };
|
|
29
|
+
}
|
|
30
|
+
const defaultOptions = {
|
|
31
|
+
skipSubscribe: false,
|
|
32
|
+
};
|
|
33
|
+
if (!options)
|
|
34
|
+
return defaultOptions;
|
|
35
|
+
return {
|
|
36
|
+
...defaultOptions,
|
|
37
|
+
...options,
|
|
38
|
+
};
|
|
39
|
+
};
|
|
22
40
|
/**
|
|
23
41
|
* This creates a new proxy with history support (ProxyHistoryObject).
|
|
24
42
|
* It includes following main properties:<br>
|
|
@@ -41,8 +59,8 @@ const deepClone = (value) => {
|
|
|
41
59
|
* Notes: <br>
|
|
42
60
|
* - Suspense/promise is not supported. <br>
|
|
43
61
|
*
|
|
44
|
-
* @param initialValue - any
|
|
45
|
-
* @param
|
|
62
|
+
* @param initialValue - any value to be tracked
|
|
63
|
+
* @param options - use to configure the proxyWithHistory utility.
|
|
46
64
|
* @returns proxyObject
|
|
47
65
|
*
|
|
48
66
|
* @example
|
|
@@ -51,8 +69,9 @@ const deepClone = (value) => {
|
|
|
51
69
|
* count: 1,
|
|
52
70
|
* })
|
|
53
71
|
*/
|
|
54
|
-
function proxyWithHistory(initialValue,
|
|
55
|
-
const
|
|
72
|
+
export function proxyWithHistory(initialValue, options) {
|
|
73
|
+
const utilOptions = normalizeOptions(options);
|
|
74
|
+
const proxyObject = proxy({
|
|
56
75
|
/**
|
|
57
76
|
* any value to be tracked (does not have to be an object)
|
|
58
77
|
*/
|
|
@@ -63,7 +82,7 @@ function proxyWithHistory(initialValue, skipSubscribe = false) {
|
|
|
63
82
|
* - history.nodes: the nodes of the history for each change <br>
|
|
64
83
|
* - history.wip: field for holding sandbox changes; used to avoid infinite loops<br>
|
|
65
84
|
*/
|
|
66
|
-
history:
|
|
85
|
+
history: ref({
|
|
67
86
|
wip: undefined,
|
|
68
87
|
nodes: [],
|
|
69
88
|
index: -1,
|
|
@@ -75,7 +94,7 @@ function proxyWithHistory(initialValue, skipSubscribe = false) {
|
|
|
75
94
|
*/
|
|
76
95
|
getCurrentChangeDate: () => {
|
|
77
96
|
const node = proxyObject.history.nodes[proxyObject.history.index];
|
|
78
|
-
return node
|
|
97
|
+
return node?.createdAt;
|
|
79
98
|
},
|
|
80
99
|
/**
|
|
81
100
|
* utility method to get a history node.
|
|
@@ -88,12 +107,24 @@ function proxyWithHistory(initialValue, skipSubscribe = false) {
|
|
|
88
107
|
getNode: (index) => {
|
|
89
108
|
const node = proxyObject.history.nodes[index];
|
|
90
109
|
return node
|
|
91
|
-
?
|
|
110
|
+
? { ...node, snapshot: proxyObject.clone(node.snapshot) }
|
|
111
|
+
: undefined;
|
|
92
112
|
},
|
|
93
113
|
/**
|
|
94
114
|
* utility to clone a snapshot
|
|
95
115
|
*/
|
|
96
116
|
clone: deepClone,
|
|
117
|
+
/**
|
|
118
|
+
* a function to go to a specific index in history
|
|
119
|
+
*/
|
|
120
|
+
goTo: (index) => {
|
|
121
|
+
const node = proxyObject.history.nodes[index];
|
|
122
|
+
if (!node)
|
|
123
|
+
return;
|
|
124
|
+
proxyObject.history.wip = proxyObject.clone(node.snapshot);
|
|
125
|
+
proxyObject.value = proxyObject.history.wip;
|
|
126
|
+
proxyObject.history.index = index;
|
|
127
|
+
},
|
|
97
128
|
/**
|
|
98
129
|
* a function to return true if undo is available
|
|
99
130
|
* @returns boolean
|
|
@@ -103,9 +134,8 @@ function proxyWithHistory(initialValue, skipSubscribe = false) {
|
|
|
103
134
|
* a function to go back in history
|
|
104
135
|
*/
|
|
105
136
|
undo: () => {
|
|
106
|
-
var _a;
|
|
107
137
|
if (proxyObject.canUndo()) {
|
|
108
|
-
proxyObject.history.wip = proxyObject.clone(
|
|
138
|
+
proxyObject.history.wip = proxyObject.clone(proxyObject.history.nodes[--proxyObject.history.index]?.snapshot);
|
|
109
139
|
proxyObject.value = proxyObject.history.wip;
|
|
110
140
|
}
|
|
111
141
|
},
|
|
@@ -118,9 +148,8 @@ function proxyWithHistory(initialValue, skipSubscribe = false) {
|
|
|
118
148
|
* a function to go forward in history
|
|
119
149
|
*/
|
|
120
150
|
redo: () => {
|
|
121
|
-
var _a;
|
|
122
151
|
if (proxyObject.canRedo()) {
|
|
123
|
-
proxyObject.history.wip = proxyObject.clone(
|
|
152
|
+
proxyObject.history.wip = proxyObject.clone(proxyObject.history.nodes[++proxyObject.history.index]?.snapshot);
|
|
124
153
|
proxyObject.value = proxyObject.history.wip;
|
|
125
154
|
}
|
|
126
155
|
},
|
|
@@ -131,18 +160,24 @@ function proxyWithHistory(initialValue, skipSubscribe = false) {
|
|
|
131
160
|
proxyObject.history.nodes.splice(proxyObject.history.index + 1);
|
|
132
161
|
proxyObject.history.nodes.push({
|
|
133
162
|
createdAt: new Date(),
|
|
134
|
-
snapshot:
|
|
163
|
+
snapshot: snapshot(proxyObject).value,
|
|
135
164
|
});
|
|
136
165
|
++proxyObject.history.index;
|
|
137
166
|
},
|
|
167
|
+
/**
|
|
168
|
+
* a function that returns true when the history should be updated
|
|
169
|
+
*
|
|
170
|
+
* @param ops - subscribeOps from subscribe callback
|
|
171
|
+
* @returns boolean
|
|
172
|
+
*/
|
|
173
|
+
shouldSaveHistory: (ops) => ops.every((op) => op[1][0] === 'value' &&
|
|
174
|
+
(op[0] !== 'set' || op[2] !== proxyObject.history.wip)),
|
|
138
175
|
/**
|
|
139
176
|
* a function to subscribe to changes made to `value`
|
|
140
177
|
*/
|
|
141
|
-
subscribe: () =>
|
|
142
|
-
if (
|
|
143
|
-
(op[0] !== 'set' || op[2] !== proxyObject.history.wip))) {
|
|
178
|
+
subscribe: () => subscribe(proxyObject, (ops) => {
|
|
179
|
+
if (proxyObject.shouldSaveHistory(ops))
|
|
144
180
|
proxyObject.saveHistory();
|
|
145
|
-
}
|
|
146
181
|
}),
|
|
147
182
|
// history rewrite utilities
|
|
148
183
|
/**
|
|
@@ -165,7 +200,7 @@ function proxyWithHistory(initialValue, skipSubscribe = false) {
|
|
|
165
200
|
if (isCurrentIndex) {
|
|
166
201
|
const resolvedIndex = isLastIndex ? index - 1 : index + 1;
|
|
167
202
|
const resolvedNode = proxyObject.history.nodes[resolvedIndex];
|
|
168
|
-
proxyObject.history.wip = proxyObject.clone(resolvedNode
|
|
203
|
+
proxyObject.history.wip = proxyObject.clone(resolvedNode?.snapshot);
|
|
169
204
|
proxyObject.value = proxyObject.history.wip;
|
|
170
205
|
if (isLastIndex)
|
|
171
206
|
proxyObject.history.index--;
|
|
@@ -197,7 +232,11 @@ function proxyWithHistory(initialValue, skipSubscribe = false) {
|
|
|
197
232
|
const isCurrentIndex = proxyObject.history.index === index;
|
|
198
233
|
if (!node)
|
|
199
234
|
return;
|
|
200
|
-
proxyObject.history.nodes[index] =
|
|
235
|
+
proxyObject.history.nodes[index] = {
|
|
236
|
+
...node,
|
|
237
|
+
snapshot: value,
|
|
238
|
+
updatedAt: new Date(),
|
|
239
|
+
};
|
|
201
240
|
if (isCurrentIndex) {
|
|
202
241
|
proxyObject.history.wip = value;
|
|
203
242
|
proxyObject.value = proxyObject.history.wip;
|
|
@@ -205,10 +244,9 @@ function proxyWithHistory(initialValue, skipSubscribe = false) {
|
|
|
205
244
|
},
|
|
206
245
|
});
|
|
207
246
|
proxyObject.saveHistory();
|
|
208
|
-
if (!skipSubscribe) {
|
|
247
|
+
if (!utilOptions.skipSubscribe) {
|
|
209
248
|
proxyObject.subscribe();
|
|
210
249
|
}
|
|
211
250
|
return proxyObject;
|
|
212
251
|
}
|
|
213
|
-
exports.proxyWithHistory = proxyWithHistory;
|
|
214
252
|
//# sourceMappingURL=history-utility.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history-utility.js","sourceRoot":"","sources":["../../../../packages/history-utility/src/history-utility.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"history-utility.js","sourceRoot":"","sources":["../../../../packages/history-utility/src/history-utility.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,IAAI,kBAAkB,EACjD,KAAK,EACL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aAClD;QACH,CAAC;KACF,CAAC,CAAC;IAEH,WAAW,CAAC,WAAW,EAAE,CAAC;IAE1B,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE;QAC9B,WAAW,CAAC,SAAS,EAAE,CAAC;KACzB;IAED,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
package/src/index.js
CHANGED
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/history-utility/src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/history-utility/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|