atom.io 0.21.1 → 0.22.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.cjs +136 -63
- package/data/dist/index.d.ts +6 -0
- package/data/dist/index.js +3 -3
- package/data/src/join.ts +135 -51
- package/data/src/struct-family.ts +2 -2
- package/dist/{chunk-RT43TVKP.js → chunk-GVHKIJ3G.js} +1 -1
- package/dist/{chunk-HITX3MO4.js → chunk-JA4V7TJY.js} +135 -62
- package/dist/index.cjs +2 -7
- package/dist/index.d.ts +29 -14
- package/dist/index.js +4 -8
- package/ephemeral/dist/index.cjs +11 -0
- package/ephemeral/dist/index.js +9 -0
- package/ephemeral/package.json +16 -0
- package/ephemeral/src/index.ts +1 -0
- package/eslint-plugin/dist/index.cjs +156 -1
- package/eslint-plugin/dist/index.js +156 -1
- package/eslint-plugin/src/rules/index.ts +1 -0
- package/eslint-plugin/src/rules/lifespan.ts +204 -0
- package/eslint-plugin/src/rules/synchronous-selector-dependencies.ts +1 -65
- package/eslint-plugin/src/walk.ts +73 -0
- package/immortal/dist/index.cjs +100 -0
- package/immortal/dist/index.js +97 -0
- package/immortal/package.json +16 -0
- package/immortal/src/index.ts +2 -0
- package/immortal/src/molecule.ts +134 -0
- package/immortal/src/seek-state.ts +60 -0
- package/internal/dist/index.cjs +186 -146
- package/internal/dist/index.d.ts +29 -13
- package/internal/dist/index.js +185 -146
- package/internal/src/atom/dispose-atom.ts +4 -1
- package/internal/src/families/create-readonly-selector-family.ts +9 -9
- package/internal/src/families/create-regular-atom-family.ts +15 -20
- package/internal/src/families/create-writable-selector-family.ts +6 -7
- package/internal/src/families/find-in-store.ts +11 -5
- package/internal/src/families/index.ts +2 -0
- package/internal/src/families/init-family-member.ts +91 -0
- package/internal/src/families/seek-in-store.ts +106 -0
- package/internal/src/get-state/get-from-store.ts +2 -2
- package/internal/src/mutable/create-mutable-atom-family.ts +17 -23
- package/internal/src/mutable/create-mutable-atom.ts +3 -1
- package/internal/src/mutable/get-json-family.ts +2 -2
- package/internal/src/mutable/get-json-token.ts +27 -12
- package/internal/src/mutable/tracker-family.ts +14 -12
- package/internal/src/not-found-error.ts +11 -3
- package/internal/src/selector/create-readonly-selector.ts +2 -2
- package/internal/src/selector/create-writable-selector.ts +2 -2
- package/internal/src/selector/dispose-selector.ts +40 -23
- package/internal/src/selector/register-selector.ts +8 -5
- package/internal/src/set-state/set-into-store.ts +2 -2
- package/internal/src/store/index.ts +0 -1
- package/internal/src/store/store.ts +18 -5
- package/internal/src/subscribe/subscribe-to-state.ts +2 -2
- package/internal/src/transaction/build-transaction.ts +7 -2
- package/introspection/dist/index.cjs +38 -52
- package/introspection/dist/index.js +38 -52
- package/introspection/src/attach-atom-index.ts +38 -48
- package/introspection/src/attach-selector-index.ts +45 -50
- package/json/dist/index.cjs +38 -4
- package/json/dist/index.js +40 -6
- package/json/src/select-json-family.ts +46 -7
- package/package.json +30 -10
- package/react/dist/index.cjs +1 -1
- package/react/dist/index.js +1 -1
- package/react/src/use-json.ts +1 -1
- package/react-devtools/dist/index.cjs +11 -10
- package/react-devtools/dist/index.js +2 -1
- package/react-devtools/src/StateIndex.tsx +2 -1
- package/react-devtools/src/TimelineIndex.tsx +2 -1
- package/react-devtools/src/TransactionIndex.tsx +7 -7
- package/realtime-client/dist/index.cjs +3 -3
- package/realtime-client/dist/index.js +3 -3
- package/realtime-client/src/pull-mutable-atom-family-member.ts +1 -1
- package/realtime-client/src/pull-mutable-atom.ts +1 -1
- package/realtime-client/src/sync-continuity.ts +1 -2
- package/realtime-react/dist/index.cjs +1 -1
- package/realtime-react/dist/index.js +1 -1
- package/realtime-server/dist/index.cjs +18 -17
- package/realtime-server/dist/index.js +7 -6
- package/realtime-server/src/realtime-continuity-synchronizer.ts +5 -3
- package/realtime-server/src/realtime-mutable-family-provider.ts +2 -1
- package/realtime-server/src/realtime-mutable-provider.ts +1 -1
- package/realtime-testing/dist/index.cjs +6 -2
- package/realtime-testing/dist/index.js +8 -5
- package/realtime-testing/src/setup-realtime-test.tsx +5 -2
- package/src/atom.ts +10 -4
- package/src/index.ts +1 -2
- package/src/selector.ts +10 -4
- package/src/silo.ts +3 -3
- package/src/transaction.ts +5 -2
- package/internal/src/store/withdraw-new-family-member.ts +0 -69
- /package/{src → ephemeral/src}/find-state.ts +0 -0
- /package/src/{dispose.ts → dispose-state.ts} +0 -0
package/json/dist/index.cjs
CHANGED
|
@@ -19,9 +19,43 @@ function selectJsonFamily(family, transform, store = internal.IMPLICIT.STORE) {
|
|
|
19
19
|
const jsonFamily = internal.createSelectorFamily(
|
|
20
20
|
{
|
|
21
21
|
key: `${family.key}:JSON`,
|
|
22
|
-
get: (key) => ({ get }) =>
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
get: (key) => ({ seek, get }) => {
|
|
23
|
+
const existingState = seek(family, key);
|
|
24
|
+
if (existingState) {
|
|
25
|
+
return transform.toJson(get(existingState));
|
|
26
|
+
}
|
|
27
|
+
const stringKey = stringifyJson(key);
|
|
28
|
+
const molecule = store.molecules.get(stringKey);
|
|
29
|
+
if (molecule) {
|
|
30
|
+
const atom = molecule.bond(family);
|
|
31
|
+
return transform.toJson(get(atom));
|
|
32
|
+
}
|
|
33
|
+
if (store.config.lifespan === `immortal`) {
|
|
34
|
+
throw new Error(`No molecule found for key "${stringKey}"`);
|
|
35
|
+
}
|
|
36
|
+
const newToken = internal.initFamilyMember(family, key, store);
|
|
37
|
+
return transform.toJson(get(newToken));
|
|
38
|
+
},
|
|
39
|
+
set: (key) => ({ seek, set }, newValue) => {
|
|
40
|
+
const existingState = seek(family, key);
|
|
41
|
+
if (existingState) {
|
|
42
|
+
set(existingState, transform.fromJson(newValue));
|
|
43
|
+
} else {
|
|
44
|
+
const stringKey = stringifyJson(key);
|
|
45
|
+
const molecule = store.molecules.get(stringKey);
|
|
46
|
+
if (molecule) {
|
|
47
|
+
const atom = molecule.bond(family);
|
|
48
|
+
set(atom, transform.fromJson(newValue));
|
|
49
|
+
} else {
|
|
50
|
+
if (store.config.lifespan === `immortal`) {
|
|
51
|
+
throw new Error(`No molecule found for key "${stringKey}"`);
|
|
52
|
+
}
|
|
53
|
+
set(
|
|
54
|
+
internal.initFamilyMember(family, key, store),
|
|
55
|
+
transform.fromJson(newValue)
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
25
59
|
}
|
|
26
60
|
},
|
|
27
61
|
store
|
|
@@ -30,7 +64,7 @@ function selectJsonFamily(family, transform, store = internal.IMPLICIT.STORE) {
|
|
|
30
64
|
`store=${store.config.name}::json-selector-family`,
|
|
31
65
|
(token) => {
|
|
32
66
|
if (token.family) {
|
|
33
|
-
jsonFamily
|
|
67
|
+
internal.seekInStore(jsonFamily, parseJson(token.family.subKey), store);
|
|
34
68
|
}
|
|
35
69
|
}
|
|
36
70
|
);
|
package/json/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { parseJson } from '../../dist/chunk-BF4MVQF6.js';
|
|
1
|
+
import { stringifyJson, parseJson } from '../../dist/chunk-BF4MVQF6.js';
|
|
2
2
|
export { JSON_DEFAULTS, JSON_TYPE_NAMES, isBoolean, isNull, isNumber, isPrimitive, isString, parseJson, stringSetJsonInterface, stringifyJson } from '../../dist/chunk-BF4MVQF6.js';
|
|
3
3
|
import '../../dist/chunk-F2X4B4VY.js';
|
|
4
|
-
import { createStandaloneSelector, IMPLICIT, createSelectorFamily } from 'atom.io/internal';
|
|
4
|
+
import { createStandaloneSelector, IMPLICIT, createSelectorFamily, initFamilyMember, seekInStore } from 'atom.io/internal';
|
|
5
5
|
|
|
6
6
|
var selectJson = (atom, transform, store = IMPLICIT.STORE) => {
|
|
7
7
|
return createStandaloneSelector(
|
|
@@ -19,9 +19,43 @@ function selectJsonFamily(family, transform, store = IMPLICIT.STORE) {
|
|
|
19
19
|
const jsonFamily = createSelectorFamily(
|
|
20
20
|
{
|
|
21
21
|
key: `${family.key}:JSON`,
|
|
22
|
-
get: (key) => ({ get }) =>
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
get: (key) => ({ seek, get }) => {
|
|
23
|
+
const existingState = seek(family, key);
|
|
24
|
+
if (existingState) {
|
|
25
|
+
return transform.toJson(get(existingState));
|
|
26
|
+
}
|
|
27
|
+
const stringKey = stringifyJson(key);
|
|
28
|
+
const molecule = store.molecules.get(stringKey);
|
|
29
|
+
if (molecule) {
|
|
30
|
+
const atom = molecule.bond(family);
|
|
31
|
+
return transform.toJson(get(atom));
|
|
32
|
+
}
|
|
33
|
+
if (store.config.lifespan === `immortal`) {
|
|
34
|
+
throw new Error(`No molecule found for key "${stringKey}"`);
|
|
35
|
+
}
|
|
36
|
+
const newToken = initFamilyMember(family, key, store);
|
|
37
|
+
return transform.toJson(get(newToken));
|
|
38
|
+
},
|
|
39
|
+
set: (key) => ({ seek, set }, newValue) => {
|
|
40
|
+
const existingState = seek(family, key);
|
|
41
|
+
if (existingState) {
|
|
42
|
+
set(existingState, transform.fromJson(newValue));
|
|
43
|
+
} else {
|
|
44
|
+
const stringKey = stringifyJson(key);
|
|
45
|
+
const molecule = store.molecules.get(stringKey);
|
|
46
|
+
if (molecule) {
|
|
47
|
+
const atom = molecule.bond(family);
|
|
48
|
+
set(atom, transform.fromJson(newValue));
|
|
49
|
+
} else {
|
|
50
|
+
if (store.config.lifespan === `immortal`) {
|
|
51
|
+
throw new Error(`No molecule found for key "${stringKey}"`);
|
|
52
|
+
}
|
|
53
|
+
set(
|
|
54
|
+
initFamilyMember(family, key, store),
|
|
55
|
+
transform.fromJson(newValue)
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
25
59
|
}
|
|
26
60
|
},
|
|
27
61
|
store
|
|
@@ -30,7 +64,7 @@ function selectJsonFamily(family, transform, store = IMPLICIT.STORE) {
|
|
|
30
64
|
`store=${store.config.name}::json-selector-family`,
|
|
31
65
|
(token) => {
|
|
32
66
|
if (token.family) {
|
|
33
|
-
jsonFamily
|
|
67
|
+
seekInStore(jsonFamily, parseJson(token.family.subKey), store);
|
|
34
68
|
}
|
|
35
69
|
}
|
|
36
70
|
);
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import type * as AtomIO from "atom.io"
|
|
2
2
|
import type { Store, Transceiver } from "atom.io/internal"
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
createSelectorFamily,
|
|
5
|
+
IMPLICIT,
|
|
6
|
+
initFamilyMember,
|
|
7
|
+
seekInStore,
|
|
8
|
+
} from "atom.io/internal"
|
|
4
9
|
|
|
5
10
|
import type { Json, JsonInterface } from "."
|
|
6
|
-
import { parseJson } from "."
|
|
11
|
+
import { parseJson, stringifyJson } from "."
|
|
7
12
|
|
|
8
13
|
export function selectJsonFamily<
|
|
9
14
|
T extends Transceiver<any>,
|
|
@@ -39,12 +44,46 @@ export function selectJsonFamily<
|
|
|
39
44
|
key: `${family.key}:JSON`,
|
|
40
45
|
get:
|
|
41
46
|
(key) =>
|
|
42
|
-
({ get }) =>
|
|
43
|
-
|
|
47
|
+
({ seek, get }) => {
|
|
48
|
+
const existingState = seek(family, key)
|
|
49
|
+
if (existingState) {
|
|
50
|
+
return transform.toJson(get(existingState))
|
|
51
|
+
}
|
|
52
|
+
const stringKey = stringifyJson(key)
|
|
53
|
+
const molecule = store.molecules.get(stringKey)
|
|
54
|
+
if (molecule) {
|
|
55
|
+
const atom = molecule.bond(family)
|
|
56
|
+
return transform.toJson(get(atom))
|
|
57
|
+
}
|
|
58
|
+
if (store.config.lifespan === `immortal`) {
|
|
59
|
+
throw new Error(`No molecule found for key "${stringKey}"`)
|
|
60
|
+
}
|
|
61
|
+
const newToken = initFamilyMember(family, key, store)
|
|
62
|
+
return transform.toJson(get(newToken))
|
|
63
|
+
},
|
|
44
64
|
set:
|
|
45
65
|
(key) =>
|
|
46
|
-
({ set }, newValue) => {
|
|
47
|
-
set(family
|
|
66
|
+
({ seek, set }, newValue) => {
|
|
67
|
+
// set(seek(family, key), transform.fromJson(newValue))
|
|
68
|
+
const existingState = seek(family, key)
|
|
69
|
+
if (existingState) {
|
|
70
|
+
set(existingState, transform.fromJson(newValue))
|
|
71
|
+
} else {
|
|
72
|
+
const stringKey = stringifyJson(key)
|
|
73
|
+
const molecule = store.molecules.get(stringKey)
|
|
74
|
+
if (molecule) {
|
|
75
|
+
const atom = molecule.bond(family)
|
|
76
|
+
set(atom, transform.fromJson(newValue))
|
|
77
|
+
} else {
|
|
78
|
+
if (store.config.lifespan === `immortal`) {
|
|
79
|
+
throw new Error(`No molecule found for key "${stringKey}"`)
|
|
80
|
+
}
|
|
81
|
+
set(
|
|
82
|
+
initFamilyMember(family, key, store),
|
|
83
|
+
transform.fromJson(newValue),
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
}
|
|
48
87
|
},
|
|
49
88
|
},
|
|
50
89
|
store,
|
|
@@ -53,7 +92,7 @@ export function selectJsonFamily<
|
|
|
53
92
|
`store=${store.config.name}::json-selector-family`,
|
|
54
93
|
(token) => {
|
|
55
94
|
if (token.family) {
|
|
56
|
-
jsonFamily
|
|
95
|
+
seekInStore(jsonFamily, parseJson(token.family.subKey) as K, store)
|
|
57
96
|
}
|
|
58
97
|
},
|
|
59
98
|
)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "atom.io",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "Composable and testable reactive data library.",
|
|
5
5
|
"homepage": "https://atom.io.fyi",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -54,26 +54,26 @@
|
|
|
54
54
|
"@types/estree": "1.0.5",
|
|
55
55
|
"@types/http-proxy": "1.17.14",
|
|
56
56
|
"@types/npmlog": "7.0.0",
|
|
57
|
-
"@types/react": "18.3.
|
|
57
|
+
"@types/react": "18.3.2",
|
|
58
58
|
"@types/tmp": "0.2.6",
|
|
59
|
-
"@typescript-eslint/parser": "7.
|
|
60
|
-
"@typescript-eslint/rule-tester": "7.
|
|
59
|
+
"@typescript-eslint/parser": "7.9.0",
|
|
60
|
+
"@typescript-eslint/rule-tester": "7.9.0",
|
|
61
61
|
"@vitest/coverage-v8": "1.6.0",
|
|
62
62
|
"@vitest/ui": "1.6.0",
|
|
63
63
|
"concurrently": "8.2.2",
|
|
64
|
-
"drizzle-kit": "0.
|
|
64
|
+
"drizzle-kit": "0.21.2",
|
|
65
65
|
"drizzle-orm": "0.30.10",
|
|
66
66
|
"eslint": "npm:eslint@8.57.0",
|
|
67
|
-
"eslint-v9": "npm:eslint@9.
|
|
68
|
-
"framer-motion": "11.
|
|
69
|
-
"happy-dom": "14.
|
|
67
|
+
"eslint-v9": "npm:eslint@9.3.0",
|
|
68
|
+
"framer-motion": "11.2.4",
|
|
69
|
+
"happy-dom": "14.11.0",
|
|
70
70
|
"http-proxy": "1.18.1",
|
|
71
71
|
"npmlog": "7.0.1",
|
|
72
72
|
"postgres": "3.4.4",
|
|
73
|
-
"preact": "10.
|
|
73
|
+
"preact": "10.22.0",
|
|
74
74
|
"react": "18.3.1",
|
|
75
75
|
"react-dom": "18.3.1",
|
|
76
|
-
"react-router-dom": "6.23.
|
|
76
|
+
"react-router-dom": "6.23.1",
|
|
77
77
|
"socket.io": "4.7.5",
|
|
78
78
|
"socket.io-client": "4.7.5",
|
|
79
79
|
"tmp": "0.2.3",
|
|
@@ -92,9 +92,15 @@
|
|
|
92
92
|
"data/dist",
|
|
93
93
|
"data/package.json",
|
|
94
94
|
"data/src",
|
|
95
|
+
"ephemeral/dist",
|
|
96
|
+
"ephemeral/package.json",
|
|
97
|
+
"ephemeral/src",
|
|
95
98
|
"eslint-plugin/dist",
|
|
96
99
|
"eslint-plugin/package.json",
|
|
97
100
|
"eslint-plugin/src",
|
|
101
|
+
"immortal/dist",
|
|
102
|
+
"immortal/package.json",
|
|
103
|
+
"immortal/src",
|
|
98
104
|
"internal/dist",
|
|
99
105
|
"internal/package.json",
|
|
100
106
|
"internal/src",
|
|
@@ -144,6 +150,13 @@
|
|
|
144
150
|
"import": "./data/dist/index.js",
|
|
145
151
|
"require": "./data/dist/index.cjs"
|
|
146
152
|
},
|
|
153
|
+
"./ephemeral/package.json": "./ephemeral/package.json",
|
|
154
|
+
"./ephemeral": {
|
|
155
|
+
"types": "./ephemeral/dist/index.d.ts",
|
|
156
|
+
"browser": "./ephemeral/dist/index.js",
|
|
157
|
+
"import": "./ephemeral/dist/index.js",
|
|
158
|
+
"require": "./ephemeral/dist/index.cjs"
|
|
159
|
+
},
|
|
147
160
|
"./eslint-plugin/package.json": "./eslint-plugin/package.json",
|
|
148
161
|
"./eslint-plugin": {
|
|
149
162
|
"types": "./eslint-plugin/dist/index.d.ts",
|
|
@@ -151,6 +164,13 @@
|
|
|
151
164
|
"import": "./eslint-plugin/dist/index.js",
|
|
152
165
|
"require": "./eslint-plugin/dist/index.cjs"
|
|
153
166
|
},
|
|
167
|
+
"./immortal/package.json": "./immortal/package.json",
|
|
168
|
+
"./immortal": {
|
|
169
|
+
"types": "./immortal/dist/index.d.ts",
|
|
170
|
+
"browser": "./immortal/dist/index.js",
|
|
171
|
+
"import": "./immortal/dist/index.js",
|
|
172
|
+
"require": "./immortal/dist/index.cjs"
|
|
173
|
+
},
|
|
154
174
|
"./internal/package.json": "./internal/package.json",
|
|
155
175
|
"./internal": {
|
|
156
176
|
"types": "./internal/dist/index.d.ts",
|
package/react/dist/index.cjs
CHANGED
|
@@ -54,7 +54,7 @@ function useO(token, key) {
|
|
|
54
54
|
function useJSON(token, key) {
|
|
55
55
|
const store = React5__namespace.useContext(StoreContext);
|
|
56
56
|
const stateToken = token.type === `mutable_atom_family` ? internal.findInStore(token, key, store) : token;
|
|
57
|
-
const jsonToken = internal.getJsonToken(stateToken);
|
|
57
|
+
const jsonToken = internal.getJsonToken(stateToken, store);
|
|
58
58
|
return useO(jsonToken);
|
|
59
59
|
}
|
|
60
60
|
function useTL(token) {
|
package/react/dist/index.js
CHANGED
|
@@ -32,7 +32,7 @@ function useO(token, key) {
|
|
|
32
32
|
function useJSON(token, key) {
|
|
33
33
|
const store = React5.useContext(StoreContext);
|
|
34
34
|
const stateToken = token.type === `mutable_atom_family` ? findInStore(token, key, store) : token;
|
|
35
|
-
const jsonToken = getJsonToken(stateToken);
|
|
35
|
+
const jsonToken = getJsonToken(stateToken, store);
|
|
36
36
|
return useO(jsonToken);
|
|
37
37
|
}
|
|
38
38
|
function useTL(token) {
|
package/react/src/use-json.ts
CHANGED
|
@@ -5,6 +5,7 @@ var introspection = require('atom.io/introspection');
|
|
|
5
5
|
var react$1 = require('atom.io/react');
|
|
6
6
|
var framerMotion = require('framer-motion');
|
|
7
7
|
var react = require('react');
|
|
8
|
+
var ephemeral = require('atom.io/ephemeral');
|
|
8
9
|
var jsxRuntime = require('react/jsx-runtime');
|
|
9
10
|
|
|
10
11
|
var __defProp = Object.defineProperty;
|
|
@@ -1718,8 +1719,8 @@ var StateIndexTreeNode = ({ node, isOpenState }) => {
|
|
|
1718
1719
|
const setIsOpen = react$1.useI(isOpenState);
|
|
1719
1720
|
const isOpen = react$1.useO(isOpenState);
|
|
1720
1721
|
for (const [key, childNode] of node.familyMembers) {
|
|
1721
|
-
|
|
1722
|
-
|
|
1722
|
+
ephemeral.findState(findViewIsOpenState, key);
|
|
1723
|
+
ephemeral.findState(findStateTypeState, childNode);
|
|
1723
1724
|
}
|
|
1724
1725
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1725
1726
|
/* @__PURE__ */ jsxRuntime.jsxs("header", { children: [
|
|
@@ -1740,8 +1741,8 @@ var StateIndexTreeNode = ({ node, isOpenState }) => {
|
|
|
1740
1741
|
StateIndexNode,
|
|
1741
1742
|
{
|
|
1742
1743
|
node: childNode,
|
|
1743
|
-
isOpenState:
|
|
1744
|
-
typeState:
|
|
1744
|
+
isOpenState: ephemeral.findState(findViewIsOpenState, childNode.key),
|
|
1745
|
+
typeState: ephemeral.findState(findStateTypeState, childNode)
|
|
1745
1746
|
},
|
|
1746
1747
|
key
|
|
1747
1748
|
)) : null
|
|
@@ -1764,8 +1765,8 @@ var StateIndex = ({ tokenIndex }) => {
|
|
|
1764
1765
|
StateIndexNode,
|
|
1765
1766
|
{
|
|
1766
1767
|
node,
|
|
1767
|
-
isOpenState:
|
|
1768
|
-
typeState:
|
|
1768
|
+
isOpenState: ephemeral.findState(findViewIsOpenState, node.key),
|
|
1769
|
+
typeState: ephemeral.findState(findStateTypeState, node)
|
|
1769
1770
|
},
|
|
1770
1771
|
key
|
|
1771
1772
|
);
|
|
@@ -1992,8 +1993,8 @@ var TimelineIndex = () => {
|
|
|
1992
1993
|
TimelineLog,
|
|
1993
1994
|
{
|
|
1994
1995
|
token,
|
|
1995
|
-
isOpenState:
|
|
1996
|
-
timelineState:
|
|
1996
|
+
isOpenState: ephemeral.findState(findViewIsOpenState, token.key),
|
|
1997
|
+
timelineState: ephemeral.findState(findTimelineState, token.key)
|
|
1997
1998
|
},
|
|
1998
1999
|
token.key
|
|
1999
2000
|
);
|
|
@@ -2046,8 +2047,8 @@ var TransactionIndex = () => {
|
|
|
2046
2047
|
TransactionLog,
|
|
2047
2048
|
{
|
|
2048
2049
|
token,
|
|
2049
|
-
isOpenState:
|
|
2050
|
-
logState:
|
|
2050
|
+
isOpenState: ephemeral.findState(findViewIsOpenState, token.key),
|
|
2051
|
+
logState: ephemeral.findState(findTransactionLogState, token.key)
|
|
2051
2052
|
},
|
|
2052
2053
|
token.key
|
|
2053
2054
|
);
|
|
@@ -2,11 +2,12 @@ import { pipe, ifDefined, isArray, isRecord, doesExtend, isPlainObject, raiseErr
|
|
|
2
2
|
import { lazyLocalStorageEffect } from '../../dist/chunk-BWWVY5O5.js';
|
|
3
3
|
import { JSON_TYPE_NAMES, isString, isNumber, isBoolean, stringifyJson, JSON_DEFAULTS } from '../../dist/chunk-BF4MVQF6.js';
|
|
4
4
|
import { __spreadProps, __spreadValues, __objRest, __restKey } from '../../dist/chunk-F2X4B4VY.js';
|
|
5
|
-
import { selectorFamily, atom, atomFamily,
|
|
5
|
+
import { selectorFamily, atom, atomFamily, undo, redo, getState } from 'atom.io';
|
|
6
6
|
import { attachIntrospectionStates } from 'atom.io/introspection';
|
|
7
7
|
import { useI, useO } from 'atom.io/react';
|
|
8
8
|
import { motion, spring, LayoutGroup } from 'framer-motion';
|
|
9
9
|
import { forwardRef, useRef, useState, useImperativeHandle, useLayoutEffect, Fragment as Fragment$1, Component, useId } from 'react';
|
|
10
|
+
import { findState } from 'atom.io/ephemeral';
|
|
10
11
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
11
12
|
|
|
12
13
|
// ../anvl/src/refinement/can-exist.ts
|
|
@@ -3,7 +3,8 @@ import type {
|
|
|
3
3
|
ReadonlySelectorToken,
|
|
4
4
|
RegularAtomToken,
|
|
5
5
|
} from "atom.io"
|
|
6
|
-
import {
|
|
6
|
+
import { getState, selectorFamily } from "atom.io"
|
|
7
|
+
import { findState } from "atom.io/ephemeral"
|
|
7
8
|
import type { FamilyNode, WritableTokenIndex } from "atom.io/introspection"
|
|
8
9
|
import { useI, useO } from "atom.io/react"
|
|
9
10
|
import type { FC } from "react"
|
|
@@ -3,7 +3,8 @@ import type {
|
|
|
3
3
|
RegularAtomToken,
|
|
4
4
|
TimelineToken,
|
|
5
5
|
} from "atom.io"
|
|
6
|
-
import {
|
|
6
|
+
import { redo, undo } from "atom.io"
|
|
7
|
+
import { findState } from "atom.io/ephemeral"
|
|
7
8
|
import type { Timeline } from "atom.io/internal"
|
|
8
9
|
import { useI, useO } from "atom.io/react"
|
|
9
10
|
import { type FC, Fragment } from "react"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
type TransactionUpdate,
|
|
1
|
+
import type {
|
|
2
|
+
Func,
|
|
3
|
+
ReadonlySelectorToken,
|
|
4
|
+
RegularAtomToken,
|
|
5
|
+
TransactionToken,
|
|
6
|
+
TransactionUpdate,
|
|
8
7
|
} from "atom.io"
|
|
8
|
+
import { findState } from "atom.io/ephemeral"
|
|
9
9
|
import { useI, useO } from "atom.io/react"
|
|
10
10
|
import type { FC } from "react"
|
|
11
11
|
|
|
@@ -56,7 +56,7 @@ function pullAtomFamilyMember(token, socket, store) {
|
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
58
|
function pullMutableAtom(token, socket, store) {
|
|
59
|
-
const jsonToken = Internal.getJsonToken(token);
|
|
59
|
+
const jsonToken = Internal.getJsonToken(token, store);
|
|
60
60
|
const updateToken = Internal.getUpdateToken(token);
|
|
61
61
|
socket.on(`init:${token.key}`, (data) => {
|
|
62
62
|
Internal.setIntoStore(jsonToken, data, store);
|
|
@@ -83,7 +83,7 @@ function pullMutableAtomFamilyMember(token, socket, store) {
|
|
|
83
83
|
const { key: familyKey, subKey: serializedSubKey } = token.family;
|
|
84
84
|
const subKey = json.parseJson(serializedSubKey);
|
|
85
85
|
socket.on(`init:${token.key}`, (data) => {
|
|
86
|
-
const jsonToken = Internal.getJsonToken(token);
|
|
86
|
+
const jsonToken = Internal.getJsonToken(token, store);
|
|
87
87
|
Internal.setIntoStore(jsonToken, data, store);
|
|
88
88
|
});
|
|
89
89
|
socket.on(
|
|
@@ -246,7 +246,7 @@ function syncContinuity(continuity, socket, store) {
|
|
|
246
246
|
} else {
|
|
247
247
|
v = x;
|
|
248
248
|
if (`type` in k && k.type === `mutable_atom`) {
|
|
249
|
-
k = Internal.getJsonToken(k);
|
|
249
|
+
k = Internal.getJsonToken(k, store);
|
|
250
250
|
}
|
|
251
251
|
Internal.setIntoStore(k, v, store);
|
|
252
252
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { syncContinuity } from '../../dist/chunk-
|
|
1
|
+
export { syncContinuity } from '../../dist/chunk-GVHKIJ3G.js';
|
|
2
2
|
export { confirmedUpdateQueue, myIdState, myIdState__INTERNAL, myUsernameState, optimisticUpdateQueue } from '../../dist/chunk-O47EQUM6.js';
|
|
3
3
|
import '../../dist/chunk-BWWVY5O5.js';
|
|
4
4
|
import '../../dist/chunk-F2X4B4VY.js';
|
|
@@ -35,7 +35,7 @@ function pullAtomFamilyMember(token, socket, store) {
|
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
function pullMutableAtom(token, socket, store) {
|
|
38
|
-
const jsonToken = getJsonToken(token);
|
|
38
|
+
const jsonToken = getJsonToken(token, store);
|
|
39
39
|
const updateToken = getUpdateToken(token);
|
|
40
40
|
socket.on(`init:${token.key}`, (data) => {
|
|
41
41
|
setIntoStore(jsonToken, data, store);
|
|
@@ -62,7 +62,7 @@ function pullMutableAtomFamilyMember(token, socket, store) {
|
|
|
62
62
|
const { key: familyKey, subKey: serializedSubKey } = token.family;
|
|
63
63
|
const subKey = parseJson(serializedSubKey);
|
|
64
64
|
socket.on(`init:${token.key}`, (data) => {
|
|
65
|
-
const jsonToken = getJsonToken(token);
|
|
65
|
+
const jsonToken = getJsonToken(token, store);
|
|
66
66
|
setIntoStore(jsonToken, data, store);
|
|
67
67
|
});
|
|
68
68
|
socket.on(
|
|
@@ -20,7 +20,7 @@ export function pullMutableAtomFamilyMember<
|
|
|
20
20
|
const { key: familyKey, subKey: serializedSubKey } = token.family
|
|
21
21
|
const subKey = parseJson(serializedSubKey)
|
|
22
22
|
socket.on(`init:${token.key}`, (data: J) => {
|
|
23
|
-
const jsonToken = getJsonToken(token)
|
|
23
|
+
const jsonToken = getJsonToken(token, store)
|
|
24
24
|
setIntoStore(jsonToken, data, store)
|
|
25
25
|
})
|
|
26
26
|
socket.on(
|
|
@@ -12,7 +12,7 @@ export function pullMutableAtom<
|
|
|
12
12
|
socket: Socket,
|
|
13
13
|
store: Store,
|
|
14
14
|
): () => void {
|
|
15
|
-
const jsonToken = getJsonToken(token)
|
|
15
|
+
const jsonToken = getJsonToken(token, store)
|
|
16
16
|
const updateToken = getUpdateToken(token)
|
|
17
17
|
socket.on(`init:${token.key}`, (data: J) => {
|
|
18
18
|
setIntoStore(jsonToken, data, store)
|
|
@@ -40,9 +40,8 @@ export function syncContinuity<F extends AtomIO.Func>(
|
|
|
40
40
|
k = x
|
|
41
41
|
} else {
|
|
42
42
|
v = x
|
|
43
|
-
// console.log(`❗❗❗❗❗`, k, v)
|
|
44
43
|
if (`type` in k && k.type === `mutable_atom`) {
|
|
45
|
-
k = getJsonToken(k)
|
|
44
|
+
k = getJsonToken(k, store)
|
|
46
45
|
}
|
|
47
46
|
setIntoStore(k, v, store)
|
|
48
47
|
}
|
|
@@ -184,7 +184,7 @@ function syncContinuity(continuity, socket, store) {
|
|
|
184
184
|
} else {
|
|
185
185
|
v = x;
|
|
186
186
|
if (`type` in k && k.type === `mutable_atom`) {
|
|
187
|
-
k = internal.getJsonToken(k);
|
|
187
|
+
k = internal.getJsonToken(k, store);
|
|
188
188
|
}
|
|
189
189
|
internal.setIntoStore(k, v, store);
|
|
190
190
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { syncContinuity } from '../../dist/chunk-
|
|
1
|
+
import { syncContinuity } from '../../dist/chunk-GVHKIJ3G.js';
|
|
2
2
|
import '../../dist/chunk-F2X4B4VY.js';
|
|
3
3
|
import { useI, StoreContext, useO } from 'atom.io/react';
|
|
4
4
|
import * as RTC from 'atom.io/realtime-client';
|