atom.io 0.25.6 → 0.27.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/data/dist/index.d.ts +3 -3
- package/data/dist/index.js +33 -25
- package/data/package.json +1 -4
- package/data/src/dict.ts +3 -3
- package/dist/chunk-AK23DRMD.js +21 -0
- package/dist/{chunk-HYXKCFVY.js → chunk-IBTHB2PI.js} +59 -60
- package/dist/{chunk-MR5NETHW.js → chunk-IW6WYRS7.js} +4 -5
- package/dist/chunk-XWL6SNVU.js +7 -0
- package/dist/index.d.ts +32 -54
- package/dist/index.js +33 -21
- package/ephemeral/dist/index.d.ts +7 -7
- package/ephemeral/dist/index.js +1 -1
- package/ephemeral/package.json +1 -4
- package/ephemeral/src/find-state.ts +7 -7
- package/eslint-plugin/dist/index.js +7 -8
- package/eslint-plugin/package.json +1 -4
- package/immortal/dist/index.d.ts +7 -7
- package/immortal/dist/index.js +1 -1
- package/immortal/package.json +1 -4
- package/immortal/src/seek-state.ts +8 -8
- package/internal/dist/index.d.ts +56 -59
- package/internal/dist/index.js +178 -170
- package/internal/package.json +1 -4
- package/internal/src/families/create-atom-family.ts +4 -4
- package/internal/src/families/create-readonly-selector-family.ts +2 -2
- package/internal/src/families/create-regular-atom-family.ts +2 -2
- package/internal/src/families/create-selector-family.ts +4 -4
- package/internal/src/families/create-writable-selector-family.ts +2 -2
- package/internal/src/families/dispose-from-store.ts +3 -7
- package/internal/src/families/find-in-store.ts +9 -9
- package/internal/src/families/init-family-member.ts +25 -37
- package/internal/src/families/seek-in-store.ts +11 -10
- package/internal/src/get-state/get-from-store.ts +3 -3
- package/internal/src/molecule/grow-molecule-in-store.ts +9 -9
- package/internal/src/mutable/index.ts +0 -1
- package/internal/src/mutable/tracker-family.ts +2 -2
- package/internal/src/set-state/set-into-store.ts +4 -4
- package/internal/src/store/deposit.ts +3 -3
- package/internal/src/store/withdraw.ts +10 -9
- package/introspection/dist/index.js +32 -30
- package/introspection/package.json +1 -4
- package/json/dist/index.d.ts +10 -27
- package/json/dist/index.js +3 -3
- package/json/package.json +1 -4
- package/json/src/index.ts +8 -3
- package/json/src/select-json-family.ts +4 -4
- package/package.json +36 -65
- package/react/dist/index.d.ts +4 -4
- package/react/dist/index.js +2 -2
- package/react/package.json +1 -4
- package/react/src/parse-state-overloads.ts +4 -4
- package/react/src/use-i.ts +3 -3
- package/react/src/use-json.ts +3 -3
- package/react/src/use-o.ts +3 -3
- package/react-devtools/dist/index.d.ts +1 -1
- package/react-devtools/dist/index.js +90 -72
- package/react-devtools/package.json +1 -4
- package/react-devtools/src/StateIndex.tsx +5 -4
- package/realtime/dist/index.d.ts +3 -3
- package/realtime/dist/index.js +8 -9
- package/realtime/package.json +1 -4
- package/realtime/src/realtime-continuity.ts +2 -2
- package/realtime-client/dist/index.js +6 -6
- package/realtime-client/package.json +1 -4
- package/realtime-react/dist/index.d.ts +4 -4
- package/realtime-react/dist/index.js +9 -11
- package/realtime-react/package.json +1 -4
- package/realtime-react/src/use-pull-atom-family-member.ts +2 -2
- package/realtime-react/src/use-pull-mutable-family-member.ts +2 -2
- package/realtime-react/src/use-pull-selector-family-member.ts +2 -2
- package/realtime-server/dist/index.d.ts +9 -9
- package/realtime-server/dist/index.js +59 -54
- package/realtime-server/package.json +1 -4
- package/realtime-server/src/ipc-sockets/custom-socket.ts +2 -2
- package/realtime-server/src/realtime-family-provider.ts +3 -2
- package/realtime-server/src/realtime-mutable-family-provider.ts +2 -2
- package/realtime-testing/dist/index.js +3 -3
- package/realtime-testing/package.json +1 -4
- package/src/atom.ts +15 -42
- package/src/dispose-state.ts +2 -2
- package/src/get-state.ts +4 -4
- package/src/index.ts +5 -5
- package/src/molecule.ts +4 -3
- package/src/selector.ts +17 -39
- package/src/set-state.ts +3 -2
- package/src/silo.ts +4 -4
- package/transceivers/set-rtx/dist/index.js +11 -11
- package/transceivers/set-rtx/package.json +1 -4
- package/transceivers/set-rtx/src/set-rtx.ts +5 -5
- package/data/dist/index.cjs +0 -953
- package/dist/chunk-BF4MVQF6.js +0 -44
- package/dist/chunk-S4N6XNPH.js +0 -38
- package/dist/index.cjs +0 -215
- package/ephemeral/dist/index.cjs +0 -11
- package/eslint-plugin/dist/index.cjs +0 -388
- package/immortal/dist/index.cjs +0 -14
- package/internal/dist/index.cjs +0 -3405
- package/internal/src/mutable/is-mutable.ts +0 -16
- package/introspection/dist/index.cjs +0 -449
- package/json/dist/index.cjs +0 -128
- package/react/dist/index.cjs +0 -118
- package/react-devtools/dist/index.cjs +0 -2191
- package/realtime/dist/index.cjs +0 -120
- package/realtime-client/dist/index.cjs +0 -569
- package/realtime-react/dist/index.cjs +0 -189
- package/realtime-server/dist/index.cjs +0 -965
- package/realtime-testing/dist/index.cjs +0 -201
- package/transceivers/set-rtx/dist/index.cjs +0 -215
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../../dist/chunk-XWL6SNVU.js';
|
|
2
2
|
import * as Internal from 'atom.io/internal';
|
|
3
3
|
import { createRegularAtom, deposit, createStandaloneSelector, IMPLICIT, createRegularAtomFamily, Subject, createSelectorFamily } from 'atom.io/internal';
|
|
4
4
|
import { getState } from 'atom.io';
|
|
@@ -177,27 +177,24 @@ var attachTimelineFamily = (store = IMPLICIT.STORE) => {
|
|
|
177
177
|
const findTimelineLogState__INTERNAL = createRegularAtomFamily(
|
|
178
178
|
{
|
|
179
179
|
key: `\u{1F441}\u200D\u{1F5E8} Timeline Update Log (Internal)`,
|
|
180
|
-
default: (key) => {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
subject: new Subject(),
|
|
193
|
-
subscriptions: /* @__PURE__ */ new Map()
|
|
194
|
-
};
|
|
180
|
+
default: (key) => store.timelines.get(key) ?? {
|
|
181
|
+
type: `timeline`,
|
|
182
|
+
key: ``,
|
|
183
|
+
at: 0,
|
|
184
|
+
timeTraveling: null,
|
|
185
|
+
history: [],
|
|
186
|
+
selectorTime: null,
|
|
187
|
+
transactionKey: null,
|
|
188
|
+
install: () => {
|
|
189
|
+
},
|
|
190
|
+
subject: new Subject(),
|
|
191
|
+
subscriptions: /* @__PURE__ */ new Map()
|
|
195
192
|
},
|
|
196
193
|
effects: (key) => [
|
|
197
194
|
({ setSelf }) => {
|
|
198
195
|
const tl = store.timelines.get(key);
|
|
199
|
-
tl
|
|
200
|
-
setSelf(
|
|
196
|
+
tl?.subject.subscribe(`introspection`, (_) => {
|
|
197
|
+
setSelf({ ...tl });
|
|
201
198
|
});
|
|
202
199
|
}
|
|
203
200
|
]
|
|
@@ -281,7 +278,7 @@ var attachTransactionLogs = (store = IMPLICIT.STORE) => {
|
|
|
281
278
|
effects: (key) => [
|
|
282
279
|
({ setSelf }) => {
|
|
283
280
|
const tx = store.transactions.get(key);
|
|
284
|
-
tx
|
|
281
|
+
tx?.subject.subscribe(`introspection`, (transactionUpdate) => {
|
|
285
282
|
if (transactionUpdate.key === key) {
|
|
286
283
|
setSelf((state) => [...state, transactionUpdate]);
|
|
287
284
|
}
|
|
@@ -312,15 +309,12 @@ var attachIntrospectionStates = (store = Internal.IMPLICIT.STORE) => {
|
|
|
312
309
|
findTimelineState: attachTimelineFamily(store)
|
|
313
310
|
};
|
|
314
311
|
};
|
|
315
|
-
var
|
|
312
|
+
var Auditor = class _Auditor {
|
|
316
313
|
/**
|
|
317
314
|
* @param {Store} store - The store to audit.
|
|
318
315
|
*/
|
|
319
316
|
constructor(store = Internal.IMPLICIT.STORE) {
|
|
320
317
|
this.store = store;
|
|
321
|
-
this.auditorCreatedAt = performance.now();
|
|
322
|
-
this.statesCreatedAt = /* @__PURE__ */ new Map();
|
|
323
|
-
this.disposed = false;
|
|
324
318
|
this.atomIndex = attachAtomIndex(this.store);
|
|
325
319
|
this.selectorIndex = attachSelectorIndex(this.store);
|
|
326
320
|
this.unsubscribeFromAtomCreation = this.store.on.atomCreation.subscribe(
|
|
@@ -351,6 +345,19 @@ var _Auditor = class _Auditor {
|
|
|
351
345
|
}
|
|
352
346
|
);
|
|
353
347
|
}
|
|
348
|
+
auditorCreatedAt = performance.now();
|
|
349
|
+
statesCreatedAt = /* @__PURE__ */ new Map();
|
|
350
|
+
atomIndex;
|
|
351
|
+
selectorIndex;
|
|
352
|
+
disposed = false;
|
|
353
|
+
unsubscribeFromAtomCreation;
|
|
354
|
+
unsubscribeFromAtomDisposal;
|
|
355
|
+
unsubscribeFromSelectorCreation;
|
|
356
|
+
unsubscribeFromSelectorDisposal;
|
|
357
|
+
static DEFAULT_LIST_RESOURCES_PARAM = {
|
|
358
|
+
atomFamilies: true,
|
|
359
|
+
selectorFamilies: true
|
|
360
|
+
};
|
|
354
361
|
/**
|
|
355
362
|
* Lists all resources in the store, along with their creation time.
|
|
356
363
|
*
|
|
@@ -376,7 +383,7 @@ var _Auditor = class _Auditor {
|
|
|
376
383
|
const tokens = familyNode.familyMembers.values();
|
|
377
384
|
for (const token of tokens) {
|
|
378
385
|
const storedTime = this.statesCreatedAt.get(token.key);
|
|
379
|
-
const creationTime = storedTime
|
|
386
|
+
const creationTime = storedTime ?? this.auditorCreatedAt;
|
|
380
387
|
const age = currentTime - creationTime;
|
|
381
388
|
resources.push([token, age]);
|
|
382
389
|
}
|
|
@@ -387,7 +394,7 @@ var _Auditor = class _Auditor {
|
|
|
387
394
|
const tokens = familyNode.familyMembers.values();
|
|
388
395
|
for (const token of tokens) {
|
|
389
396
|
const storedTime = this.statesCreatedAt.get(token.key);
|
|
390
|
-
const creationTime = storedTime
|
|
397
|
+
const creationTime = storedTime ?? this.auditorCreatedAt;
|
|
391
398
|
const age = currentTime - creationTime;
|
|
392
399
|
resources.push([token, age]);
|
|
393
400
|
}
|
|
@@ -403,10 +410,5 @@ var _Auditor = class _Auditor {
|
|
|
403
410
|
this.disposed = true;
|
|
404
411
|
}
|
|
405
412
|
};
|
|
406
|
-
_Auditor.DEFAULT_LIST_RESOURCES_PARAM = {
|
|
407
|
-
atomFamilies: true,
|
|
408
|
-
selectorFamilies: true
|
|
409
|
-
};
|
|
410
|
-
var Auditor = _Auditor;
|
|
411
413
|
|
|
412
414
|
export { Auditor, attachIntrospectionStates };
|
|
@@ -2,14 +2,11 @@
|
|
|
2
2
|
"name": "atom.io-introspection",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"private": true,
|
|
5
|
-
"main": "dist/index.
|
|
6
|
-
"module": "dist/index.js",
|
|
5
|
+
"main": "dist/index.js",
|
|
7
6
|
"types": "dist/index.d.ts",
|
|
8
7
|
"exports": {
|
|
9
8
|
".": {
|
|
10
9
|
"import": "./dist/index.js",
|
|
11
|
-
"browser": "./dist/index.js",
|
|
12
|
-
"require": "./dist/index.cjs",
|
|
13
10
|
"types": "./dist/index.d.ts"
|
|
14
11
|
}
|
|
15
12
|
}
|
package/json/dist/index.d.ts
CHANGED
|
@@ -1,23 +1,12 @@
|
|
|
1
1
|
import * as AtomIO from 'atom.io';
|
|
2
2
|
import { Store, Transceiver } from 'atom.io/internal';
|
|
3
3
|
|
|
4
|
-
declare const selectJson: <T, J extends Serializable>(atom: AtomIO.AtomToken<T>, transform: JsonInterface<T, J>, store?: Store) => AtomIO.WritableSelectorToken<J>;
|
|
5
|
-
|
|
6
|
-
declare function selectJsonFamily<T extends Transceiver<any>, J extends Serializable, K extends Serializable>(atomFamily: AtomIO.MutableAtomFamily<T, J, K>, transform: JsonInterface<T, J>, store: Store): AtomIO.WritableSelectorFamily<J, K>;
|
|
7
|
-
declare function selectJsonFamily<T, J extends Serializable, K extends Serializable>(atomFamily: AtomIO.RegularAtomFamily<T, K>, transform: JsonInterface<T, J>, store: Store): AtomIO.WritableSelectorFamily<J, K>;
|
|
8
|
-
|
|
9
4
|
type JsonInterface<T, J extends Serializable = Serializable> = {
|
|
10
5
|
toJson: (t: T) => J;
|
|
11
6
|
fromJson: (json: J) => T;
|
|
12
7
|
};
|
|
13
|
-
declare const stringSetJsonInterface: JsonInterface<Set<string>, Array<string>>;
|
|
14
8
|
|
|
15
9
|
type primitive = boolean | number | string | null;
|
|
16
|
-
declare const isString: (input: unknown) => input is string;
|
|
17
|
-
declare const isNumber: (input: unknown) => input is number;
|
|
18
|
-
declare const isBoolean: (input: unknown) => input is boolean;
|
|
19
|
-
declare const isNull: (input: unknown) => input is null;
|
|
20
|
-
declare const isPrimitive: (input: unknown) => input is primitive;
|
|
21
10
|
|
|
22
11
|
type Serializable = primitive | Readonly<{
|
|
23
12
|
[key: string]: Serializable;
|
|
@@ -31,24 +20,18 @@ declare namespace json {
|
|
|
31
20
|
export type { json_Array as Array, Object$1 as Object, json_Serializable as Serializable };
|
|
32
21
|
}
|
|
33
22
|
|
|
34
|
-
declare const parseJson: <S extends
|
|
35
|
-
type
|
|
23
|
+
declare const parseJson: <S extends stringified<Serializable>>(str: S | string) => S extends stringified<infer J> ? J : Serializable;
|
|
24
|
+
type stringified<J extends Serializable> = string & {
|
|
36
25
|
__json: J;
|
|
37
26
|
};
|
|
38
|
-
declare const stringifyJson: <J extends Serializable>(json: J) =>
|
|
39
|
-
|
|
40
|
-
declare const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
boolean: boolean;
|
|
45
|
-
null: null;
|
|
46
|
-
number: number;
|
|
47
|
-
object: Object$1;
|
|
48
|
-
string: string;
|
|
49
|
-
}
|
|
50
|
-
declare const JSON_DEFAULTS: JsonTypes;
|
|
27
|
+
declare const stringifyJson: <J extends Serializable>(json: J) => stringified<J>;
|
|
28
|
+
|
|
29
|
+
declare const selectJson: <T, J extends Serializable>(atom: AtomIO.AtomToken<T>, transform: JsonInterface<T, J>, store?: Store) => AtomIO.WritableSelectorToken<J>;
|
|
30
|
+
|
|
31
|
+
declare function selectJsonFamily<T extends Transceiver<any>, J extends Serializable, K extends Canonical>(atomFamily: AtomIO.MutableAtomFamily<T, J, K>, transform: JsonInterface<T, J>, store: Store): AtomIO.WritableSelectorFamily<J, K>;
|
|
32
|
+
declare function selectJsonFamily<T, J extends Serializable, K extends Canonical>(atomFamily: AtomIO.RegularAtomFamily<T, K>, transform: JsonInterface<T, J>, store: Store): AtomIO.WritableSelectorFamily<J, K>;
|
|
51
33
|
|
|
34
|
+
type Canonical = primitive | ReadonlyArray<Canonical>;
|
|
52
35
|
type JsonIO = (...params: Serializable[]) => Serializable | void;
|
|
53
36
|
|
|
54
|
-
export { type
|
|
37
|
+
export { type Canonical, json as Json, type JsonIO, type JsonInterface, parseJson, type primitive, selectJson, selectJsonFamily, type stringified, stringifyJson };
|
package/json/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { stringifyJson, parseJson } from '../../dist/chunk-
|
|
2
|
-
export {
|
|
3
|
-
import '../../dist/chunk-
|
|
1
|
+
import { stringifyJson, parseJson } from '../../dist/chunk-AK23DRMD.js';
|
|
2
|
+
export { parseJson, stringifyJson } from '../../dist/chunk-AK23DRMD.js';
|
|
3
|
+
import '../../dist/chunk-XWL6SNVU.js';
|
|
4
4
|
import { createStandaloneSelector, IMPLICIT, createSelectorFamily, growMoleculeInStore, initFamilyMemberInStore, seekInStore } from 'atom.io/internal';
|
|
5
5
|
|
|
6
6
|
var selectJson = (atom, transform, store = IMPLICIT.STORE) => {
|
package/json/package.json
CHANGED
|
@@ -2,14 +2,11 @@
|
|
|
2
2
|
"name": "atom.io-json",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"private": true,
|
|
5
|
-
"main": "dist/index.
|
|
6
|
-
"module": "dist/index.js",
|
|
5
|
+
"main": "dist/index.js",
|
|
7
6
|
"types": "dist/index.d.ts",
|
|
8
7
|
"exports": {
|
|
9
8
|
".": {
|
|
10
9
|
"import": "./dist/index.js",
|
|
11
|
-
"browser": "./dist/index.js",
|
|
12
|
-
"require": "./dist/index.cjs",
|
|
13
10
|
"types": "./dist/index.d.ts"
|
|
14
11
|
}
|
|
15
12
|
}
|
package/json/src/index.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
import type { Json, JsonInterface, stringified } from "~/packages/anvl/src/json"
|
|
2
|
+
import { parseJson, stringifyJson } from "~/packages/anvl/src/json"
|
|
3
|
+
import type { primitive } from "~/packages/anvl/src/primitive"
|
|
4
|
+
|
|
1
5
|
export * from "./select-json"
|
|
2
6
|
export * from "./select-json-family"
|
|
3
|
-
export * from "~/packages/anvl/src/json"
|
|
4
|
-
export * from "~/packages/anvl/src/primitive"
|
|
5
7
|
|
|
6
|
-
|
|
8
|
+
export type { Json, JsonInterface, primitive, stringified }
|
|
9
|
+
export { parseJson, stringifyJson }
|
|
10
|
+
|
|
11
|
+
export type Canonical = primitive | ReadonlyArray<Canonical>
|
|
7
12
|
|
|
8
13
|
export type JsonIO = (...params: Json.Serializable[]) => Json.Serializable | void
|
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
seekInStore,
|
|
9
9
|
} from "atom.io/internal"
|
|
10
10
|
|
|
11
|
-
import type { Json, JsonInterface } from "."
|
|
11
|
+
import type { Canonical, Json, JsonInterface } from "."
|
|
12
12
|
import { parseJson, stringifyJson } from "."
|
|
13
13
|
|
|
14
14
|
export function selectJsonFamily<
|
|
15
15
|
T extends Transceiver<any>,
|
|
16
16
|
J extends Json.Serializable,
|
|
17
|
-
K extends
|
|
17
|
+
K extends Canonical,
|
|
18
18
|
>(
|
|
19
19
|
atomFamily: AtomIO.MutableAtomFamily<T, J, K>,
|
|
20
20
|
transform: JsonInterface<T, J>,
|
|
@@ -23,7 +23,7 @@ export function selectJsonFamily<
|
|
|
23
23
|
export function selectJsonFamily<
|
|
24
24
|
T,
|
|
25
25
|
J extends Json.Serializable,
|
|
26
|
-
K extends
|
|
26
|
+
K extends Canonical,
|
|
27
27
|
>(
|
|
28
28
|
atomFamily: AtomIO.RegularAtomFamily<T, K>,
|
|
29
29
|
transform: JsonInterface<T, J>,
|
|
@@ -32,7 +32,7 @@ export function selectJsonFamily<
|
|
|
32
32
|
export function selectJsonFamily<
|
|
33
33
|
T,
|
|
34
34
|
J extends Json.Serializable,
|
|
35
|
-
K extends
|
|
35
|
+
K extends Canonical,
|
|
36
36
|
>(
|
|
37
37
|
family:
|
|
38
38
|
| AtomIO.MutableAtomFamily<T extends Transceiver<any> ? T : never, J, K>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "atom.io",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"description": "Composable and testable reactive data library.",
|
|
5
5
|
"homepage": "https://atom.io.fyi",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"@floating-ui/react": ">=0.25.0",
|
|
20
20
|
"@floating-ui/react-dom": ">=2.0.0",
|
|
21
21
|
"@testing-library/react": ">=14.0.0",
|
|
22
|
+
"eslint": ">=9.0.0",
|
|
22
23
|
"framer-motion": ">=10.0.0",
|
|
23
24
|
"react": ">=18.0.0",
|
|
24
25
|
"socket.io": ">=4.0.0",
|
|
@@ -37,6 +38,9 @@
|
|
|
37
38
|
"@floating-ui/react-dom": {
|
|
38
39
|
"optional": true
|
|
39
40
|
},
|
|
41
|
+
"eslint": {
|
|
42
|
+
"optional": true
|
|
43
|
+
},
|
|
40
44
|
"framer-motion": {
|
|
41
45
|
"optional": true
|
|
42
46
|
},
|
|
@@ -49,23 +53,21 @@
|
|
|
49
53
|
},
|
|
50
54
|
"devDependencies": {
|
|
51
55
|
"@testing-library/react": "16.0.0",
|
|
52
|
-
"@types/eslint": "
|
|
53
|
-
"@types/eslint-v9": "npm:@types/eslint@9.6.0",
|
|
56
|
+
"@types/eslint": "9.6.0",
|
|
54
57
|
"@types/estree": "1.0.5",
|
|
55
|
-
"@types/http-proxy": "1.17.
|
|
58
|
+
"@types/http-proxy": "1.17.15",
|
|
56
59
|
"@types/npmlog": "7.0.0",
|
|
57
60
|
"@types/react": "18.3.3",
|
|
58
61
|
"@types/tmp": "0.2.6",
|
|
59
|
-
"@typescript-eslint/parser": "8.0.
|
|
60
|
-
"@typescript-eslint/rule-tester": "8.0.
|
|
62
|
+
"@typescript-eslint/parser": "8.0.1",
|
|
63
|
+
"@typescript-eslint/rule-tester": "8.0.1",
|
|
61
64
|
"@vitest/coverage-v8": "2.0.5",
|
|
62
65
|
"@vitest/ui": "2.0.5",
|
|
63
66
|
"concurrently": "8.2.2",
|
|
64
|
-
"drizzle-kit": "0.
|
|
65
|
-
"drizzle-orm": "0.
|
|
66
|
-
"eslint": "
|
|
67
|
-
"
|
|
68
|
-
"framer-motion": "11.3.19",
|
|
67
|
+
"drizzle-kit": "0.24.0",
|
|
68
|
+
"drizzle-orm": "0.33.0",
|
|
69
|
+
"eslint": "9.9.0",
|
|
70
|
+
"framer-motion": "11.3.24",
|
|
69
71
|
"happy-dom": "14.12.3",
|
|
70
72
|
"http-proxy": "1.18.1",
|
|
71
73
|
"npmlog": "7.0.1",
|
|
@@ -73,15 +75,15 @@
|
|
|
73
75
|
"preact": "10.23.1",
|
|
74
76
|
"react": "18.3.1",
|
|
75
77
|
"react-dom": "18.3.1",
|
|
76
|
-
"react-router-dom": "6.
|
|
78
|
+
"react-router-dom": "6.26.0",
|
|
77
79
|
"socket.io": "4.7.5",
|
|
78
80
|
"socket.io-client": "4.7.5",
|
|
79
81
|
"tmp": "0.2.3",
|
|
80
|
-
"tsup": "8.2.
|
|
81
|
-
"tsx": "4.
|
|
82
|
+
"tsup": "8.2.4",
|
|
83
|
+
"tsx": "4.17.0",
|
|
82
84
|
"typescript": "5.5.4",
|
|
83
|
-
"vite": "5.
|
|
84
|
-
"vite-tsconfig-paths": "
|
|
85
|
+
"vite": "5.4.0",
|
|
86
|
+
"vite-tsconfig-paths": "5.0.1",
|
|
85
87
|
"vitest": "2.0.5"
|
|
86
88
|
},
|
|
87
89
|
"main": "dist/index.js",
|
|
@@ -138,115 +140,83 @@
|
|
|
138
140
|
"exports": {
|
|
139
141
|
"./package.json": "./package.json",
|
|
140
142
|
".": {
|
|
141
|
-
"types": "./dist/index.d.ts",
|
|
142
|
-
"browser": "./dist/index.js",
|
|
143
143
|
"import": "./dist/index.js",
|
|
144
|
-
"
|
|
144
|
+
"types": "./dist/index.d.ts"
|
|
145
145
|
},
|
|
146
146
|
"./data/package.json": "./data/package.json",
|
|
147
147
|
"./data": {
|
|
148
|
-
"types": "./data/dist/index.d.ts",
|
|
149
|
-
"browser": "./data/dist/index.js",
|
|
150
148
|
"import": "./data/dist/index.js",
|
|
151
|
-
"
|
|
149
|
+
"types": "./data/dist/index.d.ts"
|
|
152
150
|
},
|
|
153
151
|
"./ephemeral/package.json": "./ephemeral/package.json",
|
|
154
152
|
"./ephemeral": {
|
|
155
|
-
"types": "./ephemeral/dist/index.d.ts",
|
|
156
|
-
"browser": "./ephemeral/dist/index.js",
|
|
157
153
|
"import": "./ephemeral/dist/index.js",
|
|
158
|
-
"
|
|
154
|
+
"types": "./ephemeral/dist/index.d.ts"
|
|
159
155
|
},
|
|
160
156
|
"./eslint-plugin/package.json": "./eslint-plugin/package.json",
|
|
161
157
|
"./eslint-plugin": {
|
|
162
|
-
"types": "./eslint-plugin/dist/index.d.ts",
|
|
163
|
-
"browser": "./eslint-plugin/dist/index.js",
|
|
164
158
|
"import": "./eslint-plugin/dist/index.js",
|
|
165
|
-
"
|
|
159
|
+
"types": "./eslint-plugin/dist/index.d.ts"
|
|
166
160
|
},
|
|
167
161
|
"./immortal/package.json": "./immortal/package.json",
|
|
168
162
|
"./immortal": {
|
|
169
|
-
"types": "./immortal/dist/index.d.ts",
|
|
170
|
-
"browser": "./immortal/dist/index.js",
|
|
171
163
|
"import": "./immortal/dist/index.js",
|
|
172
|
-
"
|
|
164
|
+
"types": "./immortal/dist/index.d.ts"
|
|
173
165
|
},
|
|
174
166
|
"./internal/package.json": "./internal/package.json",
|
|
175
167
|
"./internal": {
|
|
176
|
-
"types": "./internal/dist/index.d.ts",
|
|
177
|
-
"browser": "./internal/dist/index.js",
|
|
178
168
|
"import": "./internal/dist/index.js",
|
|
179
|
-
"
|
|
169
|
+
"types": "./internal/dist/index.d.ts"
|
|
180
170
|
},
|
|
181
171
|
"./introspection/package.json": "./introspection/package.json",
|
|
182
172
|
"./introspection": {
|
|
183
|
-
"types": "./introspection/dist/index.d.ts",
|
|
184
|
-
"browser": "./introspection/dist/index.js",
|
|
185
173
|
"import": "./introspection/dist/index.js",
|
|
186
|
-
"
|
|
174
|
+
"types": "./introspection/dist/index.d.ts"
|
|
187
175
|
},
|
|
188
176
|
"./json/package.json": "./json/package.json",
|
|
189
177
|
"./json": {
|
|
190
|
-
"types": "./json/dist/index.d.ts",
|
|
191
|
-
"browser": "./json/dist/index.js",
|
|
192
178
|
"import": "./json/dist/index.js",
|
|
193
|
-
"
|
|
179
|
+
"types": "./json/dist/index.d.ts"
|
|
194
180
|
},
|
|
195
181
|
"./react/package.json": "./react/package.json",
|
|
196
182
|
"./react": {
|
|
197
|
-
"types": "./react/dist/index.d.ts",
|
|
198
|
-
"browser": "./react/dist/index.js",
|
|
199
183
|
"import": "./react/dist/index.js",
|
|
200
|
-
"
|
|
184
|
+
"types": "./react/dist/index.d.ts"
|
|
201
185
|
},
|
|
202
186
|
"./react-devtools/package.json": "./react-devtools/package.json",
|
|
203
187
|
"./react-devtools": {
|
|
204
|
-
"types": "./react-devtools/dist/index.d.ts",
|
|
205
|
-
"browser": "./react-devtools/dist/index.js",
|
|
206
188
|
"import": "./react-devtools/dist/index.js",
|
|
207
|
-
"
|
|
189
|
+
"types": "./react-devtools/dist/index.d.ts"
|
|
208
190
|
},
|
|
209
191
|
"./realtime/package.json": "./realtime/package.json",
|
|
210
192
|
"./realtime": {
|
|
211
|
-
"types": "./realtime/dist/index.d.ts",
|
|
212
|
-
"browser": "./realtime/dist/index.js",
|
|
213
193
|
"import": "./realtime/dist/index.js",
|
|
214
|
-
"
|
|
194
|
+
"types": "./realtime/dist/index.d.ts"
|
|
215
195
|
},
|
|
216
196
|
"./realtime-client/package.json": "./realtime-client/package.json",
|
|
217
197
|
"./realtime-client": {
|
|
218
|
-
"types": "./realtime-client/dist/index.d.ts",
|
|
219
|
-
"browser": "./realtime-client/dist/index.js",
|
|
220
198
|
"import": "./realtime-client/dist/index.js",
|
|
221
|
-
"
|
|
199
|
+
"types": "./realtime-client/dist/index.d.ts"
|
|
222
200
|
},
|
|
223
201
|
"./realtime-react/package.json": "./realtime-react/package.json",
|
|
224
202
|
"./realtime-react": {
|
|
225
|
-
"types": "./realtime-react/dist/index.d.ts",
|
|
226
|
-
"browser": "./realtime-react/dist/index.js",
|
|
227
203
|
"import": "./realtime-react/dist/index.js",
|
|
228
|
-
"
|
|
204
|
+
"types": "./realtime-react/dist/index.d.ts"
|
|
229
205
|
},
|
|
230
206
|
"./realtime-server/package.json": "./realtime-server/package.json",
|
|
231
207
|
"./realtime-server": {
|
|
232
|
-
"types": "./realtime-server/dist/index.d.ts",
|
|
233
|
-
"browser": "./realtime-server/dist/index.js",
|
|
234
208
|
"import": "./realtime-server/dist/index.js",
|
|
235
|
-
"
|
|
209
|
+
"types": "./realtime-server/dist/index.d.ts"
|
|
236
210
|
},
|
|
237
211
|
"./realtime-testing/package.json": "./realtime-testing/package.json",
|
|
238
212
|
"./realtime-testing": {
|
|
239
|
-
"types": "./realtime-testing/dist/index.d.ts",
|
|
240
|
-
"browser": "./realtime-testing/dist/index.js",
|
|
241
213
|
"import": "./realtime-testing/dist/index.js",
|
|
242
|
-
"
|
|
214
|
+
"types": "./realtime-testing/dist/index.d.ts"
|
|
243
215
|
},
|
|
244
216
|
"./transceivers/set-rtx/package.json": "./transceivers/set-rtx/package.json",
|
|
245
217
|
"./transceivers/set-rtx": {
|
|
246
|
-
"types": "./transceivers/set-rtx/dist/index.d.ts",
|
|
247
|
-
"browser": "./transceivers/set-rtx/dist/index.js",
|
|
248
218
|
"import": "./transceivers/set-rtx/dist/index.js",
|
|
249
|
-
"
|
|
219
|
+
"types": "./transceivers/set-rtx/dist/index.d.ts"
|
|
250
220
|
}
|
|
251
221
|
},
|
|
252
222
|
"scripts": {
|
|
@@ -271,9 +241,10 @@
|
|
|
271
241
|
"build:realtime-testing": "cd realtime-testing && tsup",
|
|
272
242
|
"build:transceivers:set-rtx": "cd transceivers/set-rtx && tsup",
|
|
273
243
|
"lint:biome": "biome check -- .",
|
|
274
|
-
"lint:eslint": "eslint .",
|
|
244
|
+
"lint:eslint": "eslint --flag unstable_ts_config -- .",
|
|
275
245
|
"lint:eslint:build": "bun run build:main",
|
|
276
246
|
"lint:types": "tsc --noEmit",
|
|
247
|
+
"lint:types:watch": "tsc --watch --noEmit",
|
|
277
248
|
"lint": "bun run lint:biome && bun run lint:eslint && bun run lint:types",
|
|
278
249
|
"test": "vitest",
|
|
279
250
|
"test:coverage": "vitest run --coverage",
|
package/react/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Store } from 'atom.io/internal';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { WritableToken, WritableFamilyToken, MutableAtomToken, MutableAtomFamilyToken, ReadableToken, ReadableFamilyToken, TimelineToken } from 'atom.io';
|
|
4
|
-
import { Json } from 'atom.io/json';
|
|
4
|
+
import { Canonical, Json } from 'atom.io/json';
|
|
5
5
|
|
|
6
6
|
declare const StoreContext: React.Context<Store>;
|
|
7
7
|
declare const StoreProvider: React.FC<{
|
|
@@ -10,13 +10,13 @@ declare const StoreProvider: React.FC<{
|
|
|
10
10
|
}>;
|
|
11
11
|
|
|
12
12
|
declare function useI<T>(token: WritableToken<T>): <New extends T>(next: New | ((old: T) => New)) => void;
|
|
13
|
-
declare function useI<T, K extends
|
|
13
|
+
declare function useI<T, K extends Canonical>(token: WritableFamilyToken<T, K>, key: K): <New extends T>(next: New | ((old: T) => New)) => void;
|
|
14
14
|
|
|
15
15
|
declare function useJSON<Serializable extends Json.Serializable>(token: MutableAtomToken<any, Serializable>): Serializable;
|
|
16
|
-
declare function useJSON<Serializable extends Json.Serializable, Key extends
|
|
16
|
+
declare function useJSON<Serializable extends Json.Serializable, Key extends Canonical>(token: MutableAtomFamilyToken<any, Serializable, Key>, key: Key): Serializable;
|
|
17
17
|
|
|
18
18
|
declare function useO<T>(token: ReadableToken<T>): T;
|
|
19
|
-
declare function useO<T, K extends
|
|
19
|
+
declare function useO<T, K extends Canonical>(token: ReadableFamilyToken<T, K>, key: K): T;
|
|
20
20
|
|
|
21
21
|
type TimelineMeta = {
|
|
22
22
|
at: number;
|
package/react/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '../../dist/chunk-
|
|
1
|
+
import '../../dist/chunk-XWL6SNVU.js';
|
|
2
2
|
import { IMPLICIT, setIntoStore, subscribeToState, getFromStore, findInStore, getJsonToken, withdraw, subscribeToTimeline, seekInStore, NotFoundError } from 'atom.io/internal';
|
|
3
3
|
import * as React5 from 'react';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
@@ -75,7 +75,7 @@ function useTL(token) {
|
|
|
75
75
|
};
|
|
76
76
|
const meta = React5.useRef(rebuildMeta());
|
|
77
77
|
const retrieve = () => {
|
|
78
|
-
if (meta.current.at !==
|
|
78
|
+
if (meta.current.at !== timeline?.at || meta.current.length !== timeline?.history.length || tokenRef.current !== token) {
|
|
79
79
|
tokenRef.current = token;
|
|
80
80
|
meta.current = rebuildMeta();
|
|
81
81
|
}
|
package/react/package.json
CHANGED
|
@@ -2,14 +2,11 @@
|
|
|
2
2
|
"name": "atom.io-react",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"private": true,
|
|
5
|
-
"main": "dist/index.
|
|
6
|
-
"module": "dist/index.js",
|
|
5
|
+
"main": "dist/index.js",
|
|
7
6
|
"types": "dist/index.d.ts",
|
|
8
7
|
"exports": {
|
|
9
8
|
".": {
|
|
10
9
|
"import": "./dist/index.js",
|
|
11
|
-
"browser": "./dist/index.js",
|
|
12
|
-
"require": "./dist/index.cjs",
|
|
13
10
|
"types": "./dist/index.d.ts"
|
|
14
11
|
}
|
|
15
12
|
}
|
|
@@ -6,19 +6,19 @@ import type {
|
|
|
6
6
|
} from "atom.io"
|
|
7
7
|
import type { Store } from "atom.io/internal"
|
|
8
8
|
import { findInStore, NotFoundError, seekInStore } from "atom.io/internal"
|
|
9
|
-
import type { Json } from "atom.io/json"
|
|
9
|
+
import type { Canonical, Json } from "atom.io/json"
|
|
10
10
|
|
|
11
|
-
export function parseStateOverloads<T, K extends
|
|
11
|
+
export function parseStateOverloads<T, K extends Canonical>(
|
|
12
12
|
store: Store,
|
|
13
13
|
...rest: [WritableFamilyToken<T, K>, K] | [WritableToken<T>]
|
|
14
14
|
): WritableToken<T>
|
|
15
15
|
|
|
16
|
-
export function parseStateOverloads<T, K extends
|
|
16
|
+
export function parseStateOverloads<T, K extends Canonical>(
|
|
17
17
|
store: Store,
|
|
18
18
|
...rest: [ReadableFamilyToken<T, K>, K] | [ReadableToken<T>]
|
|
19
19
|
): ReadableToken<T>
|
|
20
20
|
|
|
21
|
-
export function parseStateOverloads<T, K extends
|
|
21
|
+
export function parseStateOverloads<T, K extends Canonical>(
|
|
22
22
|
store: Store,
|
|
23
23
|
...rest: [ReadableFamilyToken<T, K>, K] | [ReadableToken<T>]
|
|
24
24
|
): ReadableToken<T> {
|
package/react/src/use-i.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { WritableFamilyToken, WritableToken } from "atom.io"
|
|
2
2
|
import { setIntoStore } from "atom.io/internal"
|
|
3
|
-
import type {
|
|
3
|
+
import type { Canonical } from "atom.io/json"
|
|
4
4
|
import * as React from "react"
|
|
5
5
|
|
|
6
6
|
import { parseStateOverloads } from "./parse-state-overloads"
|
|
@@ -10,12 +10,12 @@ export function useI<T>(
|
|
|
10
10
|
token: WritableToken<T>,
|
|
11
11
|
): <New extends T>(next: New | ((old: T) => New)) => void
|
|
12
12
|
|
|
13
|
-
export function useI<T, K extends
|
|
13
|
+
export function useI<T, K extends Canonical>(
|
|
14
14
|
token: WritableFamilyToken<T, K>,
|
|
15
15
|
key: K,
|
|
16
16
|
): <New extends T>(next: New | ((old: T) => New)) => void
|
|
17
17
|
|
|
18
|
-
export function useI<T, K extends
|
|
18
|
+
export function useI<T, K extends Canonical>(
|
|
19
19
|
...params: [WritableFamilyToken<T, K>, K] | [WritableToken<T>]
|
|
20
20
|
): <New extends T>(next: New | ((old: T) => New)) => void {
|
|
21
21
|
const store = React.useContext(StoreContext)
|
package/react/src/use-json.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type {
|
|
|
4
4
|
ReadableToken,
|
|
5
5
|
} from "atom.io"
|
|
6
6
|
import { findInStore, getJsonToken } from "atom.io/internal"
|
|
7
|
-
import type { Json } from "atom.io/json"
|
|
7
|
+
import type { Canonical, Json } from "atom.io/json"
|
|
8
8
|
import * as React from "react"
|
|
9
9
|
|
|
10
10
|
import { StoreContext } from "./store-context"
|
|
@@ -16,12 +16,12 @@ export function useJSON<Serializable extends Json.Serializable>(
|
|
|
16
16
|
|
|
17
17
|
export function useJSON<
|
|
18
18
|
Serializable extends Json.Serializable,
|
|
19
|
-
Key extends
|
|
19
|
+
Key extends Canonical,
|
|
20
20
|
>(token: MutableAtomFamilyToken<any, Serializable, Key>, key: Key): Serializable
|
|
21
21
|
|
|
22
22
|
export function useJSON<
|
|
23
23
|
Serializable extends Json.Serializable,
|
|
24
|
-
Key extends
|
|
24
|
+
Key extends Canonical,
|
|
25
25
|
>(
|
|
26
26
|
token:
|
|
27
27
|
| MutableAtomFamilyToken<any, Serializable, Key>
|