@buoy-gg/jotai 7.0.38 → 7.0.39
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/lib/commonjs/index.js +112 -1
- package/lib/commonjs/jotai/components/JotaiAtomBrowser.js +199 -1
- package/lib/commonjs/jotai/components/JotaiAtomChangeItem.js +85 -1
- package/lib/commonjs/jotai/components/JotaiAtomDetailContent.js +715 -1
- package/lib/commonjs/jotai/components/JotaiAtomValueDetailContent.js +444 -1
- package/lib/commonjs/jotai/components/JotaiEventFilterView.js +43 -1
- package/lib/commonjs/jotai/components/JotaiIcon.js +18 -1
- package/lib/commonjs/jotai/components/JotaiModal.js +743 -1
- package/lib/commonjs/jotai/hooks/useJotaiAtomChanges.js +69 -1
- package/lib/commonjs/jotai/sync/jotaiSyncAdapter.js +306 -1
- package/lib/commonjs/jotai/utils/jotaiStateStore.js +321 -1
- package/lib/commonjs/jotai/utils/snapshotProvider.js +215 -1
- package/lib/commonjs/jotai/utils/testIDs.js +90 -1
- package/lib/commonjs/jotai/utils/watchAtoms.js +162 -1
- package/lib/commonjs/jotai/utils/writeSemantics.js +47 -1
- package/lib/commonjs/preset.js +90 -1
- package/lib/module/index.js +85 -1
- package/lib/module/jotai/components/JotaiAtomBrowser.js +195 -1
- package/lib/module/jotai/components/JotaiAtomChangeItem.js +81 -1
- package/lib/module/jotai/components/JotaiAtomDetailContent.js +710 -1
- package/lib/module/jotai/components/JotaiAtomValueDetailContent.js +442 -1
- package/lib/module/jotai/components/JotaiEventFilterView.js +39 -1
- package/lib/module/jotai/components/JotaiIcon.js +11 -1
- package/lib/module/jotai/components/JotaiModal.js +738 -1
- package/lib/module/jotai/hooks/useJotaiAtomChanges.js +65 -1
- package/lib/module/jotai/sync/jotaiSyncAdapter.js +303 -1
- package/lib/module/jotai/utils/jotaiStateStore.js +317 -1
- package/lib/module/jotai/utils/snapshotProvider.js +214 -1
- package/lib/module/jotai/utils/testIDs.js +82 -1
- package/lib/module/jotai/utils/watchAtoms.js +157 -1
- package/lib/module/jotai/utils/writeSemantics.js +43 -1
- package/lib/module/preset.js +87 -1
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/jotai/components/JotaiAtomBrowser.d.ts.map +1 -0
- package/lib/typescript/jotai/components/JotaiAtomChangeItem.d.ts.map +1 -0
- package/lib/typescript/jotai/components/JotaiAtomDetailContent.d.ts.map +1 -0
- package/lib/typescript/jotai/components/JotaiAtomValueDetailContent.d.ts.map +1 -0
- package/lib/typescript/jotai/components/JotaiEventFilterView.d.ts.map +1 -0
- package/lib/typescript/jotai/components/JotaiIcon.d.ts.map +1 -0
- package/lib/typescript/jotai/components/JotaiModal.d.ts.map +1 -0
- package/lib/typescript/jotai/hooks/useJotaiAtomChanges.d.ts.map +1 -0
- package/lib/typescript/jotai/sync/jotaiSyncAdapter.d.ts.map +1 -0
- package/lib/typescript/jotai/types/index.d.ts.map +1 -0
- package/lib/typescript/jotai/utils/jotaiStateStore.d.ts.map +1 -0
- package/lib/typescript/jotai/utils/snapshotProvider.d.ts.map +1 -0
- package/lib/typescript/jotai/utils/testIDs.d.ts.map +1 -0
- package/lib/typescript/jotai/utils/watchAtoms.d.ts.map +1 -0
- package/lib/typescript/jotai/utils/writeSemantics.d.ts.map +1 -0
- package/lib/typescript/preset.d.ts.map +1 -0
- package/package.json +3 -3
|
@@ -1 +1,214 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Time Machine snapshot provider for Jotai.
|
|
5
|
+
*
|
|
6
|
+
* Registered into @buoy-gg/shared-ui's stateSnapshotRegistry at module init;
|
|
7
|
+
* consumed by @buoy-gg/time-machine.
|
|
8
|
+
*
|
|
9
|
+
* Coverage is opt-in by nature: only atoms the app passed to `watchAtoms` /
|
|
10
|
+
* `watchDefaultStoreAtoms` are visible. Derived (read-only) atoms are captured
|
|
11
|
+
* for inspection but never restored — they recompute from their sources.
|
|
12
|
+
* Caveat (documented): atoms with custom write functions (`atomWithReducer`)
|
|
13
|
+
* receive ACTIONS through `store.set`, so restoring a raw value can misbehave;
|
|
14
|
+
* nothing in the registry distinguishes them from plain atoms.
|
|
15
|
+
*/
|
|
16
|
+
import { createRestoreScope, emptyRestoreResult, failedRestore, registerStateSnapshotProvider, unionKeys } from "@buoy-gg/shared-ui";
|
|
17
|
+
import { boundedDeepEqual } from "@buoy-gg/shared-ui/dataViewer";
|
|
18
|
+
import { jotaiStateStore } from "./jotaiStateStore";
|
|
19
|
+
function status() {
|
|
20
|
+
const atoms = jotaiStateStore.getAtoms();
|
|
21
|
+
if (atoms.length === 0) {
|
|
22
|
+
return {
|
|
23
|
+
canCapture: false,
|
|
24
|
+
canRestore: false,
|
|
25
|
+
detail: "No Jotai atoms registered — pass your atoms to watchAtoms() / watchDefaultStoreAtoms()"
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
const writable = atoms.filter(a => a.setValue).length;
|
|
29
|
+
return {
|
|
30
|
+
canCapture: true,
|
|
31
|
+
canRestore: writable > 0,
|
|
32
|
+
detail: writable < atoms.length ? `${atoms.length - writable} derived atom(s) recompute automatically and are not restored` : undefined
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
async function capture() {
|
|
36
|
+
const warnings = [];
|
|
37
|
+
const atoms = {};
|
|
38
|
+
let derived = 0;
|
|
39
|
+
for (const info of jotaiStateStore.getAtoms()) {
|
|
40
|
+
try {
|
|
41
|
+
const value = info.getValue();
|
|
42
|
+
if (typeof value === "function") {
|
|
43
|
+
warnings.push(`atom "${info.label}": function value not capturable`);
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
if (!info.setValue) derived += 1;
|
|
47
|
+
atoms[info.label] = {
|
|
48
|
+
value,
|
|
49
|
+
writable: Boolean(info.setValue)
|
|
50
|
+
};
|
|
51
|
+
} catch (e) {
|
|
52
|
+
warnings.push(`atom "${info.label}": capture failed (${String(e)})`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (derived > 0) {
|
|
56
|
+
warnings.push(`${derived} derived atom(s) captured for inspection only (recompute on restore)`);
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
data: {
|
|
60
|
+
atoms
|
|
61
|
+
},
|
|
62
|
+
warnings
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
async function restore(data, options) {
|
|
66
|
+
const snapshot = data;
|
|
67
|
+
const scope = createRestoreScope(options);
|
|
68
|
+
const result = emptyRestoreResult();
|
|
69
|
+
if (!snapshot?.atoms) {
|
|
70
|
+
return failedRestore("empty jotai snapshot");
|
|
71
|
+
}
|
|
72
|
+
let derived = 0;
|
|
73
|
+
for (const [label, entry] of Object.entries(snapshot.atoms)) {
|
|
74
|
+
if (!scope.allows(label)) continue;
|
|
75
|
+
if (!entry.writable) {
|
|
76
|
+
derived += 1;
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
const info = jotaiStateStore.getAtom(label);
|
|
80
|
+
if (!info) {
|
|
81
|
+
result.skipped.push({
|
|
82
|
+
id: label,
|
|
83
|
+
reason: "atom not registered (renamed, or unwatched since snapshot?)"
|
|
84
|
+
});
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
if (!info.setValue) {
|
|
88
|
+
result.skipped.push({
|
|
89
|
+
id: label,
|
|
90
|
+
reason: "atom is now read-only (derived)"
|
|
91
|
+
});
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
try {
|
|
95
|
+
info.setValue(entry.value);
|
|
96
|
+
result.applied += 1;
|
|
97
|
+
} catch (e) {
|
|
98
|
+
result.skipped.push({
|
|
99
|
+
id: label,
|
|
100
|
+
reason: String(e)
|
|
101
|
+
});
|
|
102
|
+
result.ok = false;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
if (derived > 0) {
|
|
106
|
+
result.warnings.push(`${derived} derived atom(s) left to recompute`);
|
|
107
|
+
}
|
|
108
|
+
const excludedWarning = scope.excludedWarning("atom(s)");
|
|
109
|
+
if (excludedWarning) result.warnings.push(excludedWarning);
|
|
110
|
+
return result;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** Per-atom restore preview. `base` omitted = compare against live atoms. */
|
|
114
|
+
async function previewItems(target, base) {
|
|
115
|
+
const targetAtoms = target?.atoms ?? {};
|
|
116
|
+
const liveMode = base === undefined;
|
|
117
|
+
const baseAtoms = {};
|
|
118
|
+
if (liveMode) {
|
|
119
|
+
for (const info of jotaiStateStore.getAtoms()) {
|
|
120
|
+
try {
|
|
121
|
+
baseAtoms[info.label] = {
|
|
122
|
+
value: info.getValue(),
|
|
123
|
+
writable: Boolean(info.setValue)
|
|
124
|
+
};
|
|
125
|
+
} catch {
|
|
126
|
+
// unreadable atom — treated as absent
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
} else {
|
|
130
|
+
Object.assign(baseAtoms, base?.atoms ?? {});
|
|
131
|
+
}
|
|
132
|
+
const items = [];
|
|
133
|
+
const notes = [];
|
|
134
|
+
for (const label of unionKeys(baseAtoms, targetAtoms)) {
|
|
135
|
+
const inTarget = label in targetAtoms;
|
|
136
|
+
if (!inTarget) {
|
|
137
|
+
if (liveMode) notes.push(`atom "${label}" not in snapshot — untouched`);else items.push({
|
|
138
|
+
key: label,
|
|
139
|
+
label,
|
|
140
|
+
verdict: "removed",
|
|
141
|
+
oldValue: baseAtoms[label]?.value
|
|
142
|
+
});
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
const entry = targetAtoms[label];
|
|
146
|
+
const equal = label in baseAtoms && boundedDeepEqual(baseAtoms[label].value, entry.value);
|
|
147
|
+
if (!entry.writable) {
|
|
148
|
+
items.push({
|
|
149
|
+
key: label,
|
|
150
|
+
label,
|
|
151
|
+
verdict: equal ? "unchanged" : "recomputes",
|
|
152
|
+
reason: equal ? undefined : "derived atom — recomputes from its sources",
|
|
153
|
+
oldValue: baseAtoms[label]?.value,
|
|
154
|
+
newValue: entry.value
|
|
155
|
+
});
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
if (liveMode) {
|
|
159
|
+
const info = jotaiStateStore.getAtom(label);
|
|
160
|
+
if (!info) {
|
|
161
|
+
items.push({
|
|
162
|
+
key: label,
|
|
163
|
+
label,
|
|
164
|
+
verdict: "wont-apply",
|
|
165
|
+
reason: "atom not registered (renamed, or unwatched since snapshot?)"
|
|
166
|
+
});
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
if (!info.setValue) {
|
|
170
|
+
items.push({
|
|
171
|
+
key: label,
|
|
172
|
+
label,
|
|
173
|
+
verdict: "wont-apply",
|
|
174
|
+
reason: "atom is now read-only (derived)"
|
|
175
|
+
});
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
if (!(label in baseAtoms)) {
|
|
180
|
+
items.push({
|
|
181
|
+
key: label,
|
|
182
|
+
label,
|
|
183
|
+
verdict: "added",
|
|
184
|
+
newValue: entry.value
|
|
185
|
+
});
|
|
186
|
+
} else if (equal) {
|
|
187
|
+
items.push({
|
|
188
|
+
key: label,
|
|
189
|
+
label,
|
|
190
|
+
verdict: "unchanged"
|
|
191
|
+
});
|
|
192
|
+
} else {
|
|
193
|
+
items.push({
|
|
194
|
+
key: label,
|
|
195
|
+
label,
|
|
196
|
+
verdict: "changed",
|
|
197
|
+
oldValue: baseAtoms[label].value,
|
|
198
|
+
newValue: entry.value
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return {
|
|
203
|
+
items,
|
|
204
|
+
notes
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
registerStateSnapshotProvider({
|
|
208
|
+
id: "jotai",
|
|
209
|
+
label: "Jotai",
|
|
210
|
+
status,
|
|
211
|
+
capture,
|
|
212
|
+
restore,
|
|
213
|
+
previewItems
|
|
214
|
+
});
|
|
@@ -1 +1,82 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Jotai tool test handles.
|
|
5
|
+
*
|
|
6
|
+
* Every tappable and every value the e2e suite reads back is addressed
|
|
7
|
+
* `buoy-jotai-<thing>`. Two rules need explaining, and the second is the one
|
|
8
|
+
* this tool does not share with any other.
|
|
9
|
+
*
|
|
10
|
+
* **A change row's handle carries an ORDINAL, and it counts per ATOM.** Same
|
|
11
|
+
* reason as the Zustand tool: an atom a screen writes to fifty times produces
|
|
12
|
+
* fifty separate, equally real rows, and addressing them by label alone would
|
|
13
|
+
* give fifty views one handle — Detox fails a *matcher* that hits more than
|
|
14
|
+
* one element, so the suite would break on `toExist()` before any assertion,
|
|
15
|
+
* with an error that says nothing about duplicate changes. The handle is
|
|
16
|
+
* `buoy-jotai-row-<slug(atomLabel)>-<n>`, n counting back from the newest row
|
|
17
|
+
* for that atom (1 = newest). Deliberately relative: an atom change has no
|
|
18
|
+
* identity a host could know in advance, and what a test CAN know is "the
|
|
19
|
+
* write I just fired is the newest change to that atom". Read and tap in one
|
|
20
|
+
* beat — a row's ordinal moves the instant another change lands.
|
|
21
|
+
*
|
|
22
|
+
* **The ordinal is per ATOM, and one write can move several atoms.** This is
|
|
23
|
+
* where jotai differs from every store-shaped tool. Atoms form a dependency
|
|
24
|
+
* graph, and this tool watches NODES: a single `set` on a primitive atom
|
|
25
|
+
* notifies every mounted derived atom whose value actually moved, so one
|
|
26
|
+
* press can add a row under three different labels — and add nothing at all
|
|
27
|
+
* under a fourth whose recomputed value happened to be unchanged. Counting
|
|
28
|
+
* ordinals across the whole list would make a row's handle depend on how many
|
|
29
|
+
* *other* atoms the write happened to touch, which is exactly the thing a
|
|
30
|
+
* test of a graph must not assume.
|
|
31
|
+
*
|
|
32
|
+
* **An atom row's handle does NOT carry an ordinal.** An atom is registered
|
|
33
|
+
* once under a label that is unique by construction
|
|
34
|
+
* (`jotaiStateStore.registerAtom` returns early on a label it already holds,
|
|
35
|
+
* and `watchAtoms` marks the atom with a per-label symbol), so
|
|
36
|
+
* `buoy-jotai-atom-<slug(label)>` is as stable as the registration itself —
|
|
37
|
+
* and unlike a change, it is a thing the host knows the name of before the
|
|
38
|
+
* app has booted.
|
|
39
|
+
*
|
|
40
|
+
* The suite mirrors these rules in CommonJS (`example-dev-build/utils/
|
|
41
|
+
* jotaiBench.js`) and asserts the two agree — Detox runs in Node on the host
|
|
42
|
+
* and cannot import TypeScript.
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
/** Prefix every handle in this tool shares. */
|
|
46
|
+
export const JOTAI_TEST_ID = "buoy-jotai";
|
|
47
|
+
|
|
48
|
+
/** `jbenchCount` → `jbenchcount`. Shared with every Buoy tool. */
|
|
49
|
+
export function slugForTestID(value) {
|
|
50
|
+
return String(value ?? "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "unknown";
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Handle for one change row: `buoy-jotai-row-jbenchcount-1`.
|
|
55
|
+
*
|
|
56
|
+
* `ordinal` is 1-based and counts back from the newest row for this atom.
|
|
57
|
+
*/
|
|
58
|
+
export function changeRowTestID(atomLabel, ordinal) {
|
|
59
|
+
return `${JOTAI_TEST_ID}-row-${slugForTestID(atomLabel)}-${ordinal}`;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Handle for one atom row in the browser: `buoy-jotai-atom-jbenchcount`. */
|
|
63
|
+
export function atomRowTestID(atomLabel) {
|
|
64
|
+
return `${JOTAI_TEST_ID}-atom-${slugForTestID(atomLabel)}`;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Row handle per change id for one rendered list, newest-first.
|
|
69
|
+
*
|
|
70
|
+
* Built once for the whole list rather than per row, because an ordinal is a
|
|
71
|
+
* fact about the list and a row cannot compute its own.
|
|
72
|
+
*/
|
|
73
|
+
export function buildChangeRowTestIDs(changes) {
|
|
74
|
+
const seen = new Map();
|
|
75
|
+
const handles = new Map();
|
|
76
|
+
for (const change of changes) {
|
|
77
|
+
const ordinal = (seen.get(change.atomLabel) ?? 0) + 1;
|
|
78
|
+
seen.set(change.atomLabel, ordinal);
|
|
79
|
+
handles.set(change.id, changeRowTestID(change.atomLabel, ordinal));
|
|
80
|
+
}
|
|
81
|
+
return handles;
|
|
82
|
+
}
|
|
@@ -1 +1,157 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Buoy Jotai DevTools — Atom instrumentation
|
|
5
|
+
*
|
|
6
|
+
* watchAtoms() — RECOMMENDED. Pass a Jotai store and a named atom map.
|
|
7
|
+
* Uses store.sub() to observe each atom externally. Never touches atom internals.
|
|
8
|
+
*
|
|
9
|
+
* watchDefaultStoreAtoms() — Convenience wrapper that uses getDefaultStore().
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { jotaiStateStore } from "./jotaiStateStore";
|
|
13
|
+
import { classifyAtomWrite } from "./writeSemantics";
|
|
14
|
+
|
|
15
|
+
/** Any Jotai atom — alias for Atom<unknown> for readability */
|
|
16
|
+
|
|
17
|
+
/** Minimal store shape — what Jotai's createStore() / getDefaultStore() returns */
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Watch a set of Jotai atoms for value changes.
|
|
21
|
+
*
|
|
22
|
+
* Pass a Jotai store and an object mapping display names to atoms.
|
|
23
|
+
* Uses store.sub() to observe each atom — never modifies atom internals.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```tsx
|
|
27
|
+
* import { getDefaultStore } from 'jotai';
|
|
28
|
+
* import { watchAtoms } from '@buoy-gg/jotai';
|
|
29
|
+
* import { countAtom } from './atoms/count';
|
|
30
|
+
* import { authAtom } from './atoms/auth';
|
|
31
|
+
*
|
|
32
|
+
* watchAtoms(getDefaultStore(), {
|
|
33
|
+
* countAtom,
|
|
34
|
+
* authAtom,
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @param store - Jotai store (from createStore() or getDefaultStore())
|
|
39
|
+
* @param atoms - Object mapping display labels to Jotai atoms
|
|
40
|
+
* @param options - Optional configuration
|
|
41
|
+
* @returns Cleanup function that removes all subscriptions
|
|
42
|
+
*/
|
|
43
|
+
export function watchAtoms(store, atoms, options) {
|
|
44
|
+
const enabled = options?.enabled !== false;
|
|
45
|
+
const cleanups = [];
|
|
46
|
+
for (const [label, atom] of Object.entries(atoms)) {
|
|
47
|
+
// Skip if already watched under this label
|
|
48
|
+
const atomAny = atom;
|
|
49
|
+
const watchedKey = Symbol.for(`@@buoy-jotai/watched/${label}`);
|
|
50
|
+
if (atomAny[watchedKey]) continue;
|
|
51
|
+
atomAny[watchedKey] = true;
|
|
52
|
+
let prevValue;
|
|
53
|
+
try {
|
|
54
|
+
prevValue = store.get(atom);
|
|
55
|
+
} catch {
|
|
56
|
+
prevValue = undefined;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Register the atom for the browser view. A setter is captured only when
|
|
60
|
+
// the store supports `set` AND the atom itself is writable (has a `write`
|
|
61
|
+
// function — primitive atoms get a default one, read-only derived atoms
|
|
62
|
+
// have none). Deriveds used to get a setter that threw inside jotai at
|
|
63
|
+
// set time; now they're correctly reported as read-only up front.
|
|
64
|
+
const isWritable = typeof atom.write === "function";
|
|
65
|
+
const setter = store.set && isWritable ? value => {
|
|
66
|
+
store.set(atom, value);
|
|
67
|
+
} : undefined;
|
|
68
|
+
jotaiStateStore.registerAtom(label, () => {
|
|
69
|
+
try {
|
|
70
|
+
return store.get(atom);
|
|
71
|
+
} catch {
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
74
|
+
}, setter,
|
|
75
|
+
// "value" = jotai's shared defaultWrite (a primitive atom: store.set
|
|
76
|
+
// stores the value). "action" = a custom write receiving the value as
|
|
77
|
+
// its argument — still writable, but the editor says so.
|
|
78
|
+
isWritable ? classifyAtomWrite(atom) : undefined);
|
|
79
|
+
|
|
80
|
+
// Record initial value
|
|
81
|
+
if (enabled) {
|
|
82
|
+
jotaiStateStore.addAtomChange({
|
|
83
|
+
atomLabel: label,
|
|
84
|
+
prevValue: undefined,
|
|
85
|
+
nextValue: prevValue,
|
|
86
|
+
category: "initial"
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Subscribe to future changes
|
|
91
|
+
const unsubscribe = store.sub(atom, () => {
|
|
92
|
+
try {
|
|
93
|
+
const nextValue = store.get(atom);
|
|
94
|
+
jotaiStateStore.addAtomChange({
|
|
95
|
+
atomLabel: label,
|
|
96
|
+
prevValue,
|
|
97
|
+
nextValue,
|
|
98
|
+
category: "write"
|
|
99
|
+
});
|
|
100
|
+
prevValue = nextValue;
|
|
101
|
+
} catch {
|
|
102
|
+
// Silently catch — our bug must never propagate into the store
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
cleanups.push(() => {
|
|
106
|
+
unsubscribe();
|
|
107
|
+
delete atomAny[watchedKey];
|
|
108
|
+
jotaiStateStore.unregisterAtom(label);
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
return () => cleanups.forEach(fn => fn());
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Watch atoms using Jotai's default store (no Provider setup required).
|
|
116
|
+
*
|
|
117
|
+
* Convenience wrapper around watchAtoms() — auto-imports getDefaultStore.
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```tsx
|
|
121
|
+
* import { watchDefaultStoreAtoms } from '@buoy-gg/jotai';
|
|
122
|
+
* import { countAtom, authAtom } from './atoms';
|
|
123
|
+
*
|
|
124
|
+
* watchDefaultStoreAtoms({ countAtom, authAtom });
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
export function watchDefaultStoreAtoms(atoms, options) {
|
|
128
|
+
// Dynamic import to avoid bundling jotai internals when not needed
|
|
129
|
+
let store;
|
|
130
|
+
try {
|
|
131
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
132
|
+
const {
|
|
133
|
+
getDefaultStore
|
|
134
|
+
} = require("jotai/vanilla");
|
|
135
|
+
store = getDefaultStore();
|
|
136
|
+
} catch {
|
|
137
|
+
// Try the main jotai entry (React Native)
|
|
138
|
+
try {
|
|
139
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
140
|
+
const {
|
|
141
|
+
getDefaultStore
|
|
142
|
+
} = require("jotai");
|
|
143
|
+
store = getDefaultStore();
|
|
144
|
+
} catch {
|
|
145
|
+
console.warn("[@buoy-gg/jotai] Could not find getDefaultStore from jotai. " + "Pass the store explicitly via watchAtoms(store, atoms) instead.");
|
|
146
|
+
return () => {};
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return watchAtoms(store, atoms, options);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Check if an atom label is currently being watched
|
|
154
|
+
*/
|
|
155
|
+
export function isAtomWatched(label) {
|
|
156
|
+
return jotaiStateStore.getAtom(label) !== undefined;
|
|
157
|
+
}
|
|
@@ -1 +1,43 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* What does `store.set(atom, x)` DO with x?
|
|
5
|
+
*
|
|
6
|
+
* jotai's `atom(initialValue)` gives every primitive atom the SAME shared
|
|
7
|
+
* `defaultWrite` function (see jotai/src/vanilla/atom.ts): it stores x as the
|
|
8
|
+
* atom's new value (or calls it with the previous value when x is a
|
|
9
|
+
* function). Any other `write` is app code — `atomWithReducer` receives
|
|
10
|
+
* ACTIONS, `atomWithStorage` persists as a side effect, a custom write can do
|
|
11
|
+
* anything — so a raw value handed to `store.set` may not mean "set to this".
|
|
12
|
+
*
|
|
13
|
+
* The tool's editor needs that distinction to be honest: a "value" atom edits
|
|
14
|
+
* like plain data; an "action" atom is still writable (the MCP `setAtom` and
|
|
15
|
+
* Time Machine restore already write to them) but the editor says what the
|
|
16
|
+
* write actually does.
|
|
17
|
+
*
|
|
18
|
+
* Detection: a probe primitive atom exposes this jotai instance's
|
|
19
|
+
* `defaultWrite`; identity match is exact. The `toString` fallback covers an
|
|
20
|
+
* app that somehow bundles a second jotai copy (its atoms carry a different —
|
|
21
|
+
* but textually identical — defaultWrite instance). An unrecognized write
|
|
22
|
+
* classifies as "action", which only makes the editor more cautious.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import { atom as probeAtom } from "jotai/vanilla";
|
|
26
|
+
const probe = probeAtom(null);
|
|
27
|
+
const DEFAULT_WRITE = probe.write;
|
|
28
|
+
const DEFAULT_WRITE_SOURCE = typeof DEFAULT_WRITE === "function" ? String(DEFAULT_WRITE) : null;
|
|
29
|
+
|
|
30
|
+
/** Classify a writable atom's write. Call only when `atom.write` exists. */
|
|
31
|
+
export function classifyAtomWrite(candidate) {
|
|
32
|
+
const atomLike = candidate;
|
|
33
|
+
const write = atomLike?.write;
|
|
34
|
+
if (typeof write !== "function") return "action";
|
|
35
|
+
if (write === DEFAULT_WRITE) return "value";
|
|
36
|
+
// Dual-copy fallback: a primitive atom from another jotai instance holds
|
|
37
|
+
// its own value (`init` present) and its write's source is the library's
|
|
38
|
+
// defaultWrite verbatim.
|
|
39
|
+
if (atomLike !== null && "init" in atomLike && DEFAULT_WRITE_SOURCE !== null && String(write) === DEFAULT_WRITE_SOURCE) {
|
|
40
|
+
return "value";
|
|
41
|
+
}
|
|
42
|
+
return "action";
|
|
43
|
+
}
|
package/lib/module/preset.js
CHANGED
|
@@ -1 +1,87 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Pre-configured Jotai DevTools preset for FloatingDevTools
|
|
5
|
+
*
|
|
6
|
+
* ZERO-CONFIG: This preset is auto-discovered by FloatingDevTools!
|
|
7
|
+
* Just install @buoy-gg/jotai and call watchAtoms() with your atoms.
|
|
8
|
+
*
|
|
9
|
+
* @example Automatic (recommended)
|
|
10
|
+
* ```tsx
|
|
11
|
+
* import { getDefaultStore } from 'jotai';
|
|
12
|
+
* import { watchAtoms } from '@buoy-gg/jotai';
|
|
13
|
+
* import { countAtom, authAtom } from './atoms';
|
|
14
|
+
*
|
|
15
|
+
* watchAtoms(getDefaultStore(), { countAtom, authAtom });
|
|
16
|
+
*
|
|
17
|
+
* // The Jotai tool appears automatically in FloatingDevTools!
|
|
18
|
+
* <FloatingDevTools />
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @example Manual (only for custom configuration)
|
|
22
|
+
* ```tsx
|
|
23
|
+
* import { createJotaiTool } from '@buoy-gg/jotai';
|
|
24
|
+
*
|
|
25
|
+
* const customJotaiTool = createJotaiTool({
|
|
26
|
+
* name: "ATOMS",
|
|
27
|
+
* iconColor: "#6C47FF",
|
|
28
|
+
* });
|
|
29
|
+
*
|
|
30
|
+
* <FloatingDevTools apps={[customJotaiTool]} />
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
import { JotaiModal } from "./jotai/components/JotaiModal";
|
|
35
|
+
import { JotaiIcon } from "./jotai/components/JotaiIcon";
|
|
36
|
+
import { createToolFactory, defineToolPreset } from "@buoy-gg/shared-ui";
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Pre-configured Jotai DevTools preset for FloatingDevTools.
|
|
40
|
+
* Includes:
|
|
41
|
+
* - Live atom change monitoring
|
|
42
|
+
* - Atom value inspection (JSON viewer)
|
|
43
|
+
* - Value diff visualization (tree + split)
|
|
44
|
+
* - Filter by atom label
|
|
45
|
+
* - Changed keys tracking for object atoms
|
|
46
|
+
*/
|
|
47
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
48
|
+
export const jotaiToolPreset = defineToolPreset({
|
|
49
|
+
id: "jotai",
|
|
50
|
+
name: "JOTAI",
|
|
51
|
+
description: "Jotai atom & state inspector",
|
|
52
|
+
slot: "both",
|
|
53
|
+
icon: ({
|
|
54
|
+
size
|
|
55
|
+
}) => /*#__PURE__*/_jsx(JotaiIcon, {
|
|
56
|
+
size: size
|
|
57
|
+
}),
|
|
58
|
+
component: JotaiModal,
|
|
59
|
+
props: {
|
|
60
|
+
enableSharedModalDimensions: false
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Create a custom Jotai DevTools configuration.
|
|
66
|
+
* Use this if you want to override default settings.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```tsx
|
|
70
|
+
* import { createJotaiTool } from '@buoy-gg/jotai';
|
|
71
|
+
*
|
|
72
|
+
* const myJotaiTool = createJotaiTool({
|
|
73
|
+
* name: "ATOMS",
|
|
74
|
+
* iconColor: "#6C47FF",
|
|
75
|
+
* });
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export const createJotaiTool = createToolFactory(jotaiToolPreset, options => ({
|
|
79
|
+
enableSharedModalDimensions: options.enableSharedModalDimensions ?? false
|
|
80
|
+
}), options => ({
|
|
81
|
+
icon: ({
|
|
82
|
+
size
|
|
83
|
+
}) => /*#__PURE__*/_jsx(JotaiIcon, {
|
|
84
|
+
size: size,
|
|
85
|
+
color: options.iconColor
|
|
86
|
+
})
|
|
87
|
+
}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAGH,OAAO,gCAAgC,CAAC;AAKxC,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAK5D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAKtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAKlE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAK9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,YAAY,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAOnF,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EACL,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAK3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAKjE,YAAY,EACV,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAKvB,gBAAgB;AAChB,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JotaiAtomBrowser.d.ts","sourceRoot":"","sources":["../../../../src/jotai/components/JotaiAtomBrowser.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAgBH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAI9C,UAAU,qBAAqB;IAC7B,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAuDD,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,WAAW,EACX,UAAU,GACX,EAAE,qBAAqB,+BA4FvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JotaiAtomChangeItem.d.ts","sourceRoot":"","sources":["../../../../src/jotai/components/JotaiAtomChangeItem.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAsB,MAAM,UAAU,CAAC;AAGpE,UAAU,wBAAwB;IAChC,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;IAC3C;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAsDD,eAAO,MAAM,mBAAmB,gEAwB9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JotaiAtomDetailContent.d.ts","sourceRoot":"","sources":["../../../../src/jotai/components/JotaiAtomDetailContent.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAA+C,MAAM,OAAO,CAAC;AA6BpE,OAAO,KAAK,EACV,eAAe,EAEf,mBAAmB,EACpB,MAAM,UAAU,CAAC;AAwOlB,UAAU,2BAA2B;IACnC,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;OAGG;IACH,WAAW,CAAC,EAAE,mBAAmB,CAAC;CACnC;AAED,wBAAgB,sBAAsB,CAAC,EACrC,MAAM,EACN,OAAO,EACP,aAAa,EACb,aAAa,EACb,qBAA6B,EAC7B,WAAsB,GACvB,EAAE,2BAA2B,qBAkL7B;AAED,wBAAgB,qBAAqB,CAAC,EACpC,MAAM,EACN,OAAO,EACP,aAAa,EACb,aAAa,GACd,EAAE;IACD,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC,4BAcA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JotaiAtomValueDetailContent.d.ts","sourceRoot":"","sources":["../../../../src/jotai/components/JotaiAtomValueDetailContent.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AA2BH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAoE9C,UAAU,gCAAgC;IACxC,IAAI,EAAE,aAAa,CAAC;IACpB,kEAAkE;IAClE,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5C;AAED,wBAAgB,2BAA2B,CAAC,EAC1C,IAAI,EACJ,aAAa,GACd,EAAE,gCAAgC,+BA6OlC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JotaiEventFilterView.d.ts","sourceRoot":"","sources":["../../../../src/jotai/components/JotaiEventFilterView.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C,UAAU,yBAAyB;IACjC,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7B,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,YAAY,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,KAAK,EAAE,aAAa,EAAE,CAAC;CACxB;AAQD,wBAAgB,oBAAoB,CAAC,EACnC,eAAe,EACf,eAAe,EACf,YAAY,EACZ,KAAK,GACN,EAAE,yBAAyB,+BAqB3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JotaiIcon.d.ts","sourceRoot":"","sources":["../../../../src/jotai/components/JotaiIcon.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JotaiModal.d.ts","sourceRoot":"","sources":["../../../../src/jotai/components/JotaiModal.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA8CH,OAAO,KAAK,EAAE,eAAe,EAAmB,MAAM,UAAU,CAAC;AAsCjE,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,OAAO,EACP,MAAM,EACN,UAAU,EACV,2BAAmC,EACnC,MAAc,EACd,UAAU,EACV,uBAAuB,EACvB,iBAAiB,EACjB,cAAc,EACd,YAAY,GACb,EAAE,eAAe,sCAuqBjB;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,KAAK,GAAE,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAM,+BAGpE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useJotaiAtomChanges.d.ts","sourceRoot":"","sources":["../../../../src/jotai/hooks/useJotaiAtomChanges.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAG5E,MAAM,WAAW,yBAAyB;IACxC,gCAAgC;IAChC,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B,+CAA+C;IAC/C,eAAe,EAAE,eAAe,EAAE,CAAC;IACnC,8BAA8B;IAC9B,MAAM,EAAE,WAAW,CAAC;IACpB,6BAA6B;IAC7B,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC;IAC7D,wCAAwC;IACxC,KAAK,EAAE;QACL,YAAY,EAAE,MAAM,CAAC;QACrB,sBAAsB,EAAE,MAAM,CAAC;QAC/B,yBAAyB,EAAE,MAAM,CAAC;QAClC,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,2BAA2B;IAC3B,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,iCAAiC;IACjC,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,iCAAiC;IACjC,SAAS,EAAE,OAAO,CAAC;IACnB,4BAA4B;IAC5B,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,6BAA6B;IAC7B,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,uBAAuB;IACvB,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,eAAe,GAAG,SAAS,CAAC;CAC5D;AA8BD,wBAAgB,mBAAmB,IAAI,yBAAyB,CAwC/D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jotaiSyncAdapter.d.ts","sourceRoot":"","sources":["../../../../src/jotai/sync/jotaiSyncAdapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAqBhD;;;;GAIG;AACH,eAAO,MAAM,eAAe;;;;EAG3B,CAAC;AAmFF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;IAiBzB;;;;OAIG;;;;;IAQH;;;OAGG;4BACqB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAsC/B;;;;;OAKG;yBACkB,OAAO;;;;;;;;;;;;;;;IAsC5B;;;;;;;;;;;;;;;OAeG;uBACgB,OAAO;;;;;;;;;;;;;;;EAiEF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/jotai/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,OAAO,GACP,SAAS,CAAC;AAEd;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SA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|
|
|
1
|
+
{"version":3,"file":"snapshotProvider.d.ts","sourceRoot":"","sources":["../../../../src/jotai/utils/snapshotProvider.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testIDs.d.ts","sourceRoot":"","sources":["../../../../src/jotai/utils/testIDs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,+CAA+C;AAC/C,eAAO,MAAM,aAAa,eAAe,CAAC;AAE1C,kEAAkE;AAClE,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAOpD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAE1E;AAED,6EAA6E;AAC7E,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,eAAe,EAAE,GACzB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CASrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watchAtoms.d.ts","sourceRoot":"","sources":["../../../../src/jotai/utils/watchAtoms.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAGlC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,+DAA+D;AAC/D,KAAK,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;AAE7B,mFAAmF;AACnF,UAAU,aAAa;IACrB,GAAG,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC;IACzC,GAAG,EAAE,CAAC,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