atom.io 0.19.4 → 0.20.1
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.js +1 -1
- package/data/src/dict.ts +1 -1
- package/data/src/join.ts +1 -1
- package/data/src/struct-family.ts +1 -1
- package/data/src/struct.ts +5 -3
- package/dist/index.d.ts +1 -0
- package/internal/dist/index.cjs +137 -95
- package/internal/dist/index.d.ts +13 -9
- package/internal/dist/index.js +137 -95
- package/internal/src/atom/index.ts +1 -1
- package/internal/src/caching.ts +13 -9
- package/internal/src/families/create-atom-family.ts +1 -1
- package/internal/src/families/find-in-store.ts +2 -2
- package/internal/src/families/index.ts +1 -1
- package/internal/src/future.ts +52 -15
- package/internal/src/index.ts +2 -2
- package/internal/src/mutable/create-mutable-atom-family.ts +2 -3
- package/internal/src/mutable/create-mutable-atom.ts +3 -3
- package/internal/src/mutable/get-update-token.ts +1 -0
- package/internal/src/operation.ts +3 -3
- package/internal/src/selector/delete-selector.ts +1 -1
- package/internal/src/selector/register-selector.ts +1 -1
- package/internal/src/set-state/set-into-store.ts +7 -1
- package/internal/src/store/deposit.ts +1 -1
- package/internal/src/store/store.ts +2 -2
- package/internal/src/store/withdraw-new-family-member.ts +1 -1
- package/internal/src/store/withdraw.ts +2 -3
- package/internal/src/subscribe/subscribe-to-state.ts +1 -0
- package/internal/src/subscribe/subscribe-to-timeline.ts +1 -0
- package/internal/src/subscribe/subscribe-to-transaction.ts +2 -1
- package/internal/src/timeline/add-atom-to-timeline.ts +2 -2
- package/internal/src/timeline/create-timeline.ts +1 -1
- package/internal/src/transaction/act-upon-store.ts +1 -1
- package/internal/src/transaction/apply-transaction.ts +1 -1
- package/internal/src/transaction/build-transaction.ts +2 -2
- package/internal/src/transaction/create-transaction.ts +2 -2
- package/internal/src/transaction/index.ts +1 -1
- package/internal/src/transaction/is-root-store.ts +1 -1
- package/introspection/src/attach-atom-index.ts +1 -1
- package/introspection/src/attach-introspection-states.ts +2 -2
- package/introspection/src/attach-selector-index.ts +1 -1
- package/introspection/src/attach-timeline-family.ts +2 -2
- package/introspection/src/attach-timeline-index.ts +1 -1
- package/introspection/src/attach-transaction-index.ts +2 -2
- package/introspection/src/attach-transaction-logs.ts +2 -2
- package/json/dist/index.cjs +35 -33
- package/json/dist/index.d.ts +5 -5
- package/json/src/index.ts +2 -3
- package/json/src/select-json-family.ts +1 -1
- package/json/src/select-json.ts +1 -2
- package/package.json +15 -15
- package/react/src/use-tl.ts +1 -1
- package/react-devtools/dist/index.cjs +99 -99
- package/react-devtools/dist/index.d.ts +2 -2
- package/react-devtools/dist/index.js +77 -77
- package/react-devtools/src/AtomIODevtools.tsx +2 -2
- package/react-devtools/src/TransactionIndex.tsx +2 -2
- package/react-devtools/src/Updates.tsx +1 -1
- package/react-devtools/src/index.ts +1 -1
- package/realtime/src/realtime-continuity.ts +1 -1
- package/realtime-client/dist/index.js +1 -1
- package/realtime-client/src/pull-atom-family-member.ts +1 -1
- package/realtime-client/src/pull-atom.ts +1 -1
- package/realtime-client/src/pull-mutable-atom-family-member.ts +2 -2
- package/realtime-client/src/sync-continuity.ts +1 -1
- package/realtime-react/dist/index.js +1 -1
- package/realtime-react/src/use-realtime-service.ts +1 -0
- package/realtime-react/src/use-sync-continuity.ts +2 -1
- package/realtime-server/dist/index.cjs +98 -98
- package/realtime-server/dist/index.d.ts +14 -14
- package/realtime-server/dist/index.js +100 -100
- package/realtime-server/src/index.ts +5 -5
- package/realtime-server/src/ipc-sockets/parent-socket.ts +3 -3
- package/realtime-server/src/realtime-action-receiver.ts +1 -1
- package/realtime-server/src/realtime-continuity-synchronizer.ts +2 -3
- package/realtime-server/src/realtime-family-provider.ts +1 -1
- package/realtime-server/src/realtime-mutable-family-provider.ts +1 -1
- package/realtime-server/src/realtime-mutable-provider.ts +2 -2
- package/realtime-server/src/realtime-server-stores/realtime-continuity-store.ts +2 -2
- package/realtime-server/src/realtime-server-stores/server-room-external-actions.ts +1 -1
- package/realtime-server/src/realtime-server-stores/server-room-external-store.ts +1 -0
- package/realtime-server/src/realtime-state-provider.ts +1 -1
- package/realtime-server/src/realtime-state-synchronizer.ts +1 -1
- package/realtime-testing/dist/index.js +2 -2
- package/realtime-testing/src/setup-realtime-test.tsx +3 -2
- package/src/atom.ts +1 -1
- package/src/find-state.ts +1 -1
- package/src/index.ts +1 -0
- package/src/logger.ts +1 -0
- package/src/selector.ts +1 -1
- package/src/silo.ts +4 -4
- package/src/subscribe.ts +2 -2
- package/src/timeline.ts +1 -1
- package/src/transaction.ts +3 -3
- package/transceivers/set-rtx/src/set-rtx.ts +1 -1
- package/dist/{chunk-ATKDGVTV.js → chunk-2AIFLP2B.js} +0 -0
- package/dist/{chunk-CC7IF7QF.js → chunk-3V3VWQ7X.js} +6 -6
- /package/dist/{chunk-MSCJWACE.js → chunk-SMZRGPN6.js} +0 -0
package/json/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
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
|
+
|
|
4
9
|
type JsonInterface<T, J extends Serializable = Serializable> = {
|
|
5
10
|
toJson: (t: T) => J;
|
|
6
11
|
fromJson: (json: J) => T;
|
|
@@ -44,11 +49,6 @@ interface JsonTypes extends Record<JsonTypeName, Serializable> {
|
|
|
44
49
|
}
|
|
45
50
|
declare const JSON_DEFAULTS: JsonTypes;
|
|
46
51
|
|
|
47
|
-
declare const selectJson: <T, J extends Serializable>(atom: AtomIO.AtomToken<T>, transform: JsonInterface<T, J>, store?: Store) => AtomIO.WritableSelectorToken<J>;
|
|
48
|
-
|
|
49
|
-
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>;
|
|
50
|
-
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>;
|
|
51
|
-
|
|
52
52
|
type JsonIO = (...params: Serializable[]) => Serializable | void;
|
|
53
53
|
|
|
54
54
|
export { type Empty, JSON_DEFAULTS, JSON_TYPE_NAMES, json as Json, type JsonIO, type JsonInterface, type JsonTypeName, type JsonTypes, type Stringified, isBoolean, isNull, isNumber, isPrimitive, isString, parseJson, type primitive, selectJson, selectJsonFamily, stringSetJsonInterface, stringifyJson };
|
package/json/src/index.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
export * from "~/packages/anvl/src/json"
|
|
2
|
-
export * from "~/packages/anvl/src/primitive"
|
|
3
|
-
|
|
4
1
|
export * from "./select-json"
|
|
5
2
|
export * from "./select-json-family"
|
|
3
|
+
export * from "~/packages/anvl/src/json"
|
|
4
|
+
export * from "~/packages/anvl/src/primitive"
|
|
6
5
|
|
|
7
6
|
import type { Json } from "~/packages/anvl/src/json"
|
|
8
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type * as AtomIO from "atom.io"
|
|
2
2
|
import type { Store, Transceiver } from "atom.io/internal"
|
|
3
|
-
import {
|
|
3
|
+
import { createSelectorFamily, IMPLICIT } from "atom.io/internal"
|
|
4
4
|
|
|
5
5
|
import type { Json, JsonInterface } from "."
|
|
6
6
|
import { parseJson } from "."
|
package/json/src/select-json.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type * as AtomIO from "atom.io"
|
|
2
2
|
import type { Store } from "atom.io/internal"
|
|
3
|
-
import { IMPLICIT } from "atom.io/internal"
|
|
3
|
+
import { createStandaloneSelector, IMPLICIT } from "atom.io/internal"
|
|
4
4
|
|
|
5
|
-
import { createStandaloneSelector } from "atom.io/internal"
|
|
6
5
|
import type { Json, JsonInterface } from "."
|
|
7
6
|
|
|
8
7
|
export const selectJson = <T, J extends Json.Serializable>(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "atom.io",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.1",
|
|
4
4
|
"description": "Composable and testable reactive data library.",
|
|
5
5
|
"homepage": "https://atom.io.fyi",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -48,24 +48,24 @@
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@testing-library/react": "15.0.
|
|
52
|
-
"@types/eslint": "npm:@types/eslint@8.56.
|
|
53
|
-
"@types/eslint-
|
|
51
|
+
"@testing-library/react": "15.0.4",
|
|
52
|
+
"@types/eslint": "npm:@types/eslint@8.56.10",
|
|
53
|
+
"@types/eslint-v9": "npm:@types/eslint@8.56.10",
|
|
54
54
|
"@types/estree": "1.0.5",
|
|
55
55
|
"@types/http-proxy": "1.17.14",
|
|
56
56
|
"@types/npmlog": "7.0.0",
|
|
57
57
|
"@types/react": "18.2.79",
|
|
58
58
|
"@types/tmp": "0.2.6",
|
|
59
|
-
"@typescript-eslint/parser": "7.7.
|
|
60
|
-
"@typescript-eslint/rule-tester": "7.7.
|
|
61
|
-
"@vitest/coverage-v8": "1.5.
|
|
62
|
-
"@vitest/ui": "1.5.
|
|
59
|
+
"@typescript-eslint/parser": "7.7.1",
|
|
60
|
+
"@typescript-eslint/rule-tester": "7.7.1",
|
|
61
|
+
"@vitest/coverage-v8": "1.5.2",
|
|
62
|
+
"@vitest/ui": "1.5.2",
|
|
63
63
|
"concurrently": "8.2.2",
|
|
64
|
-
"drizzle-kit": "0.20.
|
|
65
|
-
"drizzle-orm": "0.30.
|
|
64
|
+
"drizzle-kit": "0.20.17",
|
|
65
|
+
"drizzle-orm": "0.30.9",
|
|
66
66
|
"eslint": "npm:eslint@8.57.0",
|
|
67
|
-
"eslint-v9": "npm:eslint@9.
|
|
68
|
-
"framer-motion": "11.1.
|
|
67
|
+
"eslint-v9": "npm:eslint@9.1.1",
|
|
68
|
+
"framer-motion": "11.1.7",
|
|
69
69
|
"happy-dom": "14.7.1",
|
|
70
70
|
"http-proxy": "1.18.1",
|
|
71
71
|
"npmlog": "7.0.1",
|
|
@@ -73,15 +73,15 @@
|
|
|
73
73
|
"preact": "10.20.2",
|
|
74
74
|
"react": "18.2.0",
|
|
75
75
|
"react-dom": "18.2.0",
|
|
76
|
-
"react-router-dom": "6.
|
|
76
|
+
"react-router-dom": "6.23.0",
|
|
77
77
|
"socket.io": "4.7.5",
|
|
78
78
|
"socket.io-client": "4.7.5",
|
|
79
79
|
"tmp": "0.2.3",
|
|
80
80
|
"tsup": "8.0.2",
|
|
81
81
|
"typescript": "5.4.5",
|
|
82
|
-
"vite": "5.2.
|
|
82
|
+
"vite": "5.2.10",
|
|
83
83
|
"vite-tsconfig-paths": "4.3.2",
|
|
84
|
-
"vitest": "1.5.
|
|
84
|
+
"vitest": "1.5.2"
|
|
85
85
|
},
|
|
86
86
|
"main": "dist/index.js",
|
|
87
87
|
"types": "dist/index.d.ts",
|
package/react/src/use-tl.ts
CHANGED
|
@@ -40,6 +40,12 @@ var __objRest = (source, exclude) => {
|
|
|
40
40
|
return target;
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
+
// ../anvl/src/array/index.ts
|
|
44
|
+
var isArray = (isType) => (input) => Array.isArray(input) && input.every((item) => isType(item));
|
|
45
|
+
var map = (f) => (a) => a.map(f);
|
|
46
|
+
var every = (f = Boolean) => (a) => a.every(f);
|
|
47
|
+
var allTrue = every((x) => x === true);
|
|
48
|
+
|
|
43
49
|
// ../anvl/src/function/pipe.ts
|
|
44
50
|
function pipe(a, ab, bc, cd, de, ef, fg, gh, hi) {
|
|
45
51
|
switch (arguments.length) {
|
|
@@ -88,12 +94,6 @@ var fallback = (fn, fallbackValue) => {
|
|
|
88
94
|
}
|
|
89
95
|
};
|
|
90
96
|
|
|
91
|
-
// ../anvl/src/array/index.ts
|
|
92
|
-
var isArray = (isType) => (input) => Array.isArray(input) && input.every((item) => isType(item));
|
|
93
|
-
var map = (f) => (a) => a.map(f);
|
|
94
|
-
var every = (f = Boolean) => (a) => a.every(f);
|
|
95
|
-
var allTrue = every((x) => x === true);
|
|
96
|
-
|
|
97
97
|
// ../anvl/src/nullish/index.ts
|
|
98
98
|
var isUndefined = (input) => input === void 0;
|
|
99
99
|
var ifDefined = (validate) => (input) => isUndefined(input) || validate(input);
|
|
@@ -181,50 +181,59 @@ var delve = (obj, path) => {
|
|
|
181
181
|
return found === void 0 ? new Error(`Not found`) : { found };
|
|
182
182
|
};
|
|
183
183
|
|
|
184
|
-
// ../anvl/src/refinement/
|
|
185
|
-
var
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
184
|
+
// ../anvl/src/refinement/can-exist.ts
|
|
185
|
+
var canExist = (_) => true;
|
|
186
|
+
|
|
187
|
+
// ../anvl/src/refinement/cannot-exist.ts
|
|
188
|
+
var cannotExist = (_) => false;
|
|
189
|
+
|
|
190
|
+
// ../anvl/src/refinement/is-intersection.ts
|
|
191
|
+
function mustSatisfyAllOfTheFollowing(isTypeA, logging = false, refinements = [isTypeA]) {
|
|
192
|
+
const name = `(${refinements.map((r) => (r == null ? void 0 : r.name) || `anon`).join(` & `)})`;
|
|
193
|
+
const _ = {
|
|
194
|
+
[name]: (input) => refinements.every(
|
|
195
|
+
(refinement) => (logging && console.log(
|
|
196
|
+
refinements.map((r) => r.name || `anon`).join(` & `),
|
|
197
|
+
`>`,
|
|
198
|
+
refinement.name || `anon`,
|
|
199
|
+
`:`,
|
|
200
|
+
refinement(input)
|
|
201
|
+
), refinement(input))
|
|
202
|
+
)
|
|
203
|
+
};
|
|
204
|
+
const checkTypes = Object.assign(_[name], {
|
|
205
|
+
and: (isTypeB) => mustSatisfyAllOfTheFollowing(isTypeB, logging, [
|
|
206
|
+
...refinements,
|
|
207
|
+
isTypeB
|
|
208
|
+
])
|
|
209
|
+
});
|
|
210
|
+
return checkTypes;
|
|
211
|
+
}
|
|
212
|
+
var isIntersection = mustSatisfyAllOfTheFollowing(canExist);
|
|
213
|
+
|
|
214
|
+
// ../anvl/src/refinement/is-union.ts
|
|
215
|
+
var mustSatisfyOneOfTheFollowing = (isTypeA, logging = false, refinements = [isTypeA]) => {
|
|
216
|
+
const name = `(${refinements.map((r) => (r == null ? void 0 : r.name) || `anon`).join(` | `)})`;
|
|
217
|
+
const _ = {
|
|
218
|
+
[name]: (input) => refinements.some(
|
|
219
|
+
(refinement) => {
|
|
220
|
+
var _a;
|
|
221
|
+
return logging && console.log(
|
|
222
|
+
refinements.map((r) => r.name || `anon`).join(` | `),
|
|
223
|
+
`>`,
|
|
224
|
+
(_a = refinement.name) != null ? _a : `anon`,
|
|
225
|
+
`:`,
|
|
226
|
+
refinement(input)
|
|
227
|
+
), refinement(input);
|
|
205
228
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
string: (input) => typeof input === `string`,
|
|
213
|
-
boolean: (input) => typeof input === `boolean`,
|
|
214
|
-
object: isPlainObject,
|
|
215
|
-
array: (input) => Array.isArray(input),
|
|
216
|
-
null: (input) => input === null
|
|
217
|
-
});
|
|
218
|
-
var discoverType = (input) => {
|
|
219
|
-
if (input === void 0) {
|
|
220
|
-
return `undefined`;
|
|
221
|
-
}
|
|
222
|
-
const refined = jsonRefinery.refine(input);
|
|
223
|
-
if (refined) {
|
|
224
|
-
return refined.type;
|
|
225
|
-
}
|
|
226
|
-
return Object.getPrototypeOf(input).constructor.name;
|
|
229
|
+
)
|
|
230
|
+
};
|
|
231
|
+
const checkTypes = Object.assign(_[name], {
|
|
232
|
+
or: (isTypeB) => mustSatisfyOneOfTheFollowing(isTypeB, logging, [...refinements, isTypeB])
|
|
233
|
+
});
|
|
234
|
+
return checkTypes;
|
|
227
235
|
};
|
|
236
|
+
var isUnion = mustSatisfyOneOfTheFollowing(cannotExist);
|
|
228
237
|
|
|
229
238
|
// ../anvl/src/json/index.ts
|
|
230
239
|
var stringifyJson = (json) => JSON.stringify(json);
|
|
@@ -278,59 +287,50 @@ var isJson = (input) => {
|
|
|
278
287
|
return refine;
|
|
279
288
|
};
|
|
280
289
|
|
|
281
|
-
// ../anvl/src/refinement/
|
|
282
|
-
var
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
(
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
290
|
+
// ../anvl/src/refinement/refinery.ts
|
|
291
|
+
var Refinery = class {
|
|
292
|
+
constructor(supported) {
|
|
293
|
+
this.supported = supported;
|
|
294
|
+
}
|
|
295
|
+
refine(input) {
|
|
296
|
+
for (const [key, refiner] of Object.entries(this.supported)) {
|
|
297
|
+
try {
|
|
298
|
+
if (
|
|
299
|
+
// @ts-expect-error that's the point
|
|
300
|
+
refiner(input) === true && refiner !== Boolean
|
|
301
|
+
) {
|
|
302
|
+
return { type: key, data: input };
|
|
303
|
+
}
|
|
304
|
+
} catch (e) {
|
|
305
|
+
try {
|
|
306
|
+
if (input instanceof refiner) {
|
|
307
|
+
return { type: key, data: input };
|
|
308
|
+
}
|
|
309
|
+
} catch (_) {
|
|
310
|
+
}
|
|
301
311
|
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
312
|
+
}
|
|
313
|
+
return null;
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
var jsonRefinery = new Refinery({
|
|
317
|
+
number: (input) => typeof input === `number`,
|
|
318
|
+
string: (input) => typeof input === `string`,
|
|
319
|
+
boolean: (input) => typeof input === `boolean`,
|
|
320
|
+
object: isPlainObject,
|
|
321
|
+
array: (input) => Array.isArray(input),
|
|
322
|
+
null: (input) => input === null
|
|
323
|
+
});
|
|
324
|
+
var discoverType = (input) => {
|
|
325
|
+
if (input === void 0) {
|
|
326
|
+
return `undefined`;
|
|
327
|
+
}
|
|
328
|
+
const refined = jsonRefinery.refine(input);
|
|
329
|
+
if (refined) {
|
|
330
|
+
return refined.type;
|
|
331
|
+
}
|
|
332
|
+
return Object.getPrototypeOf(input).constructor.name;
|
|
308
333
|
};
|
|
309
|
-
var isUnion = mustSatisfyOneOfTheFollowing(cannotExist);
|
|
310
|
-
|
|
311
|
-
// ../anvl/src/refinement/is-intersection.ts
|
|
312
|
-
function mustSatisfyAllOfTheFollowing(isTypeA, logging = false, refinements = [isTypeA]) {
|
|
313
|
-
const name = `(${refinements.map((r) => (r == null ? void 0 : r.name) || `anon`).join(` & `)})`;
|
|
314
|
-
const _ = {
|
|
315
|
-
[name]: (input) => refinements.every(
|
|
316
|
-
(refinement) => (logging && console.log(
|
|
317
|
-
refinements.map((r) => r.name || `anon`).join(` & `),
|
|
318
|
-
`>`,
|
|
319
|
-
refinement.name || `anon`,
|
|
320
|
-
`:`,
|
|
321
|
-
refinement(input)
|
|
322
|
-
), refinement(input))
|
|
323
|
-
)
|
|
324
|
-
};
|
|
325
|
-
const checkTypes = Object.assign(_[name], {
|
|
326
|
-
and: (isTypeB) => mustSatisfyAllOfTheFollowing(isTypeB, logging, [
|
|
327
|
-
...refinements,
|
|
328
|
-
isTypeB
|
|
329
|
-
])
|
|
330
|
-
});
|
|
331
|
-
return checkTypes;
|
|
332
|
-
}
|
|
333
|
-
var isIntersection = mustSatisfyAllOfTheFollowing(canExist);
|
|
334
334
|
|
|
335
335
|
// ../anvl/src/refinement/index.ts
|
|
336
336
|
var isLiteral = (value) => (input) => input === value;
|
|
@@ -4,6 +4,8 @@ import { AtomToken, ReadonlySelectorToken, WritableSelectorToken } from 'atom.io
|
|
|
4
4
|
|
|
5
5
|
type ClassSignature = abstract new (...args: any) => any;
|
|
6
6
|
|
|
7
|
+
type Refinement<A, B extends A> = (a: A) => a is B;
|
|
8
|
+
|
|
7
9
|
type RefinementStrategy = ClassSignature | Refinement<unknown, any>;
|
|
8
10
|
type Supported<Refine extends RefinementStrategy> = Refine extends Refinement<unknown, infer T> ? T : Refine extends ClassSignature ? InstanceType<Refine> : never;
|
|
9
11
|
type RefinementSupport = Record<string, RefinementStrategy>;
|
|
@@ -18,8 +20,6 @@ declare class Refinery<SupportedTypes extends RefinementSupport> {
|
|
|
18
20
|
}[keyof SupportedTypes] | null;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
|
-
type Refinement<A, B extends A> = (a: A) => a is B;
|
|
22
|
-
|
|
23
23
|
type PlainObject = Record<keyof any, unknown>;
|
|
24
24
|
|
|
25
25
|
type AtomTokenIndex = WritableTokenIndex<AtomToken<unknown>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { pipe, ifDefined, isArray, isRecord, doesExtend, isPlainObject, raiseError, sprawl, recordToEntries, fallback, doNothing, become, mapObject, delve } from '../../dist/chunk-
|
|
1
|
+
import { pipe, ifDefined, isArray, isRecord, doesExtend, isPlainObject, raiseError, sprawl, recordToEntries, fallback, doNothing, become, mapObject, delve } from '../../dist/chunk-3V3VWQ7X.js';
|
|
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';
|
|
@@ -9,6 +9,82 @@ import { motion, spring, LayoutGroup } from 'framer-motion';
|
|
|
9
9
|
import { forwardRef, useRef, useState, useImperativeHandle, useLayoutEffect, Fragment as Fragment$1, Component, useId } from 'react';
|
|
10
10
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
11
11
|
|
|
12
|
+
// ../anvl/src/refinement/can-exist.ts
|
|
13
|
+
var canExist = (_) => true;
|
|
14
|
+
|
|
15
|
+
// ../anvl/src/refinement/cannot-exist.ts
|
|
16
|
+
var cannotExist = (_) => false;
|
|
17
|
+
|
|
18
|
+
// ../anvl/src/refinement/is-intersection.ts
|
|
19
|
+
function mustSatisfyAllOfTheFollowing(isTypeA, logging = false, refinements = [isTypeA]) {
|
|
20
|
+
const name = `(${refinements.map((r) => (r == null ? void 0 : r.name) || `anon`).join(` & `)})`;
|
|
21
|
+
const _ = {
|
|
22
|
+
[name]: (input) => refinements.every(
|
|
23
|
+
(refinement) => (logging && console.log(
|
|
24
|
+
refinements.map((r) => r.name || `anon`).join(` & `),
|
|
25
|
+
`>`,
|
|
26
|
+
refinement.name || `anon`,
|
|
27
|
+
`:`,
|
|
28
|
+
refinement(input)
|
|
29
|
+
), refinement(input))
|
|
30
|
+
)
|
|
31
|
+
};
|
|
32
|
+
const checkTypes = Object.assign(_[name], {
|
|
33
|
+
and: (isTypeB) => mustSatisfyAllOfTheFollowing(isTypeB, logging, [
|
|
34
|
+
...refinements,
|
|
35
|
+
isTypeB
|
|
36
|
+
])
|
|
37
|
+
});
|
|
38
|
+
return checkTypes;
|
|
39
|
+
}
|
|
40
|
+
var isIntersection = mustSatisfyAllOfTheFollowing(canExist);
|
|
41
|
+
|
|
42
|
+
// ../anvl/src/refinement/is-union.ts
|
|
43
|
+
var mustSatisfyOneOfTheFollowing = (isTypeA, logging = false, refinements = [isTypeA]) => {
|
|
44
|
+
const name = `(${refinements.map((r) => (r == null ? void 0 : r.name) || `anon`).join(` | `)})`;
|
|
45
|
+
const _ = {
|
|
46
|
+
[name]: (input) => refinements.some(
|
|
47
|
+
(refinement) => {
|
|
48
|
+
var _a;
|
|
49
|
+
return logging && console.log(
|
|
50
|
+
refinements.map((r) => r.name || `anon`).join(` | `),
|
|
51
|
+
`>`,
|
|
52
|
+
(_a = refinement.name) != null ? _a : `anon`,
|
|
53
|
+
`:`,
|
|
54
|
+
refinement(input)
|
|
55
|
+
), refinement(input);
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
};
|
|
59
|
+
const checkTypes = Object.assign(_[name], {
|
|
60
|
+
or: (isTypeB) => mustSatisfyOneOfTheFollowing(isTypeB, logging, [...refinements, isTypeB])
|
|
61
|
+
});
|
|
62
|
+
return checkTypes;
|
|
63
|
+
};
|
|
64
|
+
var isUnion = mustSatisfyOneOfTheFollowing(cannotExist);
|
|
65
|
+
|
|
66
|
+
// ../anvl/src/refinement/refine-json.ts
|
|
67
|
+
var JSON_PROTOTYPES = [
|
|
68
|
+
`Array`,
|
|
69
|
+
`Boolean`,
|
|
70
|
+
`Number`,
|
|
71
|
+
`Object`,
|
|
72
|
+
`String`
|
|
73
|
+
];
|
|
74
|
+
var refineJsonType = (data) => data === null ? { type: `null`, data: null } : isBoolean(data) ? { type: `boolean`, data } : isNumber(data) ? { type: `number`, data } : isString(data) ? { type: `string`, data } : Array.isArray(data) ? { type: `array`, data } : isPlainObject(data) ? { type: `object`, data } : raiseError(
|
|
75
|
+
data === void 0 ? `undefined passed to refineJsonType. This is not valid JSON.` : `${stringifyJson(data)} with prototype "${Object.getPrototypeOf(data).constructor.name}" passed to refineJsonType. This is not valid JSON.`
|
|
76
|
+
);
|
|
77
|
+
var isJson = (input) => {
|
|
78
|
+
var _a;
|
|
79
|
+
if (input === null)
|
|
80
|
+
return true;
|
|
81
|
+
if (input === void 0)
|
|
82
|
+
return false;
|
|
83
|
+
const prototype = (_a = Object.getPrototypeOf(input)) == null ? void 0 : _a.constructor.name;
|
|
84
|
+
const refine = JSON_PROTOTYPES.includes(prototype);
|
|
85
|
+
return refine;
|
|
86
|
+
};
|
|
87
|
+
|
|
12
88
|
// ../anvl/src/refinement/refinery.ts
|
|
13
89
|
var Refinery = class {
|
|
14
90
|
constructor(supported) {
|
|
@@ -54,82 +130,6 @@ var discoverType = (input) => {
|
|
|
54
130
|
return Object.getPrototypeOf(input).constructor.name;
|
|
55
131
|
};
|
|
56
132
|
|
|
57
|
-
// ../anvl/src/refinement/refine-json.ts
|
|
58
|
-
var JSON_PROTOTYPES = [
|
|
59
|
-
`Array`,
|
|
60
|
-
`Boolean`,
|
|
61
|
-
`Number`,
|
|
62
|
-
`Object`,
|
|
63
|
-
`String`
|
|
64
|
-
];
|
|
65
|
-
var refineJsonType = (data) => data === null ? { type: `null`, data: null } : isBoolean(data) ? { type: `boolean`, data } : isNumber(data) ? { type: `number`, data } : isString(data) ? { type: `string`, data } : Array.isArray(data) ? { type: `array`, data } : isPlainObject(data) ? { type: `object`, data } : raiseError(
|
|
66
|
-
data === void 0 ? `undefined passed to refineJsonType. This is not valid JSON.` : `${stringifyJson(data)} with prototype "${Object.getPrototypeOf(data).constructor.name}" passed to refineJsonType. This is not valid JSON.`
|
|
67
|
-
);
|
|
68
|
-
var isJson = (input) => {
|
|
69
|
-
var _a;
|
|
70
|
-
if (input === null)
|
|
71
|
-
return true;
|
|
72
|
-
if (input === void 0)
|
|
73
|
-
return false;
|
|
74
|
-
const prototype = (_a = Object.getPrototypeOf(input)) == null ? void 0 : _a.constructor.name;
|
|
75
|
-
const refine = JSON_PROTOTYPES.includes(prototype);
|
|
76
|
-
return refine;
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
// ../anvl/src/refinement/can-exist.ts
|
|
80
|
-
var canExist = (_) => true;
|
|
81
|
-
|
|
82
|
-
// ../anvl/src/refinement/cannot-exist.ts
|
|
83
|
-
var cannotExist = (_) => false;
|
|
84
|
-
|
|
85
|
-
// ../anvl/src/refinement/is-union.ts
|
|
86
|
-
var mustSatisfyOneOfTheFollowing = (isTypeA, logging = false, refinements = [isTypeA]) => {
|
|
87
|
-
const name = `(${refinements.map((r) => (r == null ? void 0 : r.name) || `anon`).join(` | `)})`;
|
|
88
|
-
const _ = {
|
|
89
|
-
[name]: (input) => refinements.some(
|
|
90
|
-
(refinement) => {
|
|
91
|
-
var _a;
|
|
92
|
-
return logging && console.log(
|
|
93
|
-
refinements.map((r) => r.name || `anon`).join(` | `),
|
|
94
|
-
`>`,
|
|
95
|
-
(_a = refinement.name) != null ? _a : `anon`,
|
|
96
|
-
`:`,
|
|
97
|
-
refinement(input)
|
|
98
|
-
), refinement(input);
|
|
99
|
-
}
|
|
100
|
-
)
|
|
101
|
-
};
|
|
102
|
-
const checkTypes = Object.assign(_[name], {
|
|
103
|
-
or: (isTypeB) => mustSatisfyOneOfTheFollowing(isTypeB, logging, [...refinements, isTypeB])
|
|
104
|
-
});
|
|
105
|
-
return checkTypes;
|
|
106
|
-
};
|
|
107
|
-
var isUnion = mustSatisfyOneOfTheFollowing(cannotExist);
|
|
108
|
-
|
|
109
|
-
// ../anvl/src/refinement/is-intersection.ts
|
|
110
|
-
function mustSatisfyAllOfTheFollowing(isTypeA, logging = false, refinements = [isTypeA]) {
|
|
111
|
-
const name = `(${refinements.map((r) => (r == null ? void 0 : r.name) || `anon`).join(` & `)})`;
|
|
112
|
-
const _ = {
|
|
113
|
-
[name]: (input) => refinements.every(
|
|
114
|
-
(refinement) => (logging && console.log(
|
|
115
|
-
refinements.map((r) => r.name || `anon`).join(` & `),
|
|
116
|
-
`>`,
|
|
117
|
-
refinement.name || `anon`,
|
|
118
|
-
`:`,
|
|
119
|
-
refinement(input)
|
|
120
|
-
), refinement(input))
|
|
121
|
-
)
|
|
122
|
-
};
|
|
123
|
-
const checkTypes = Object.assign(_[name], {
|
|
124
|
-
and: (isTypeB) => mustSatisfyAllOfTheFollowing(isTypeB, logging, [
|
|
125
|
-
...refinements,
|
|
126
|
-
isTypeB
|
|
127
|
-
])
|
|
128
|
-
});
|
|
129
|
-
return checkTypes;
|
|
130
|
-
}
|
|
131
|
-
var isIntersection = mustSatisfyAllOfTheFollowing(canExist);
|
|
132
|
-
|
|
133
133
|
// ../anvl/src/refinement/index.ts
|
|
134
134
|
var isLiteral = (value) => (input) => input === value;
|
|
135
135
|
var isWithin = (args) => (input) => args.includes(input);
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import "./devtools.scss"
|
|
2
|
+
|
|
1
3
|
import { useI, useO } from "atom.io/react"
|
|
2
4
|
import { LayoutGroup, motion, spring } from "framer-motion"
|
|
3
5
|
import { useRef } from "react"
|
|
@@ -13,8 +15,6 @@ import { StateIndex } from "./StateIndex"
|
|
|
13
15
|
import { TimelineIndex } from "./TimelineIndex"
|
|
14
16
|
import { TransactionIndex } from "./TransactionIndex"
|
|
15
17
|
|
|
16
|
-
import "./devtools.scss"
|
|
17
|
-
|
|
18
18
|
export const AtomIODevtools = (): JSX.Element => {
|
|
19
19
|
const constraintsRef = useRef(null)
|
|
20
20
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
+
findState,
|
|
3
|
+
type Func,
|
|
2
4
|
type ReadonlySelectorToken,
|
|
3
5
|
type RegularAtomToken,
|
|
4
6
|
type TransactionToken,
|
|
5
7
|
type TransactionUpdate,
|
|
6
|
-
findState,
|
|
7
|
-
type Func,
|
|
8
8
|
} from "atom.io"
|
|
9
9
|
import { useI, useO } from "atom.io/react"
|
|
10
10
|
import type { FC } from "react"
|
|
@@ -4,9 +4,9 @@ import { attachIntrospectionStates } from "atom.io/introspection"
|
|
|
4
4
|
import { isPlainObject } from "~/packages/anvl/src/object"
|
|
5
5
|
import { Refinery } from "~/packages/anvl/src/refinement"
|
|
6
6
|
import {
|
|
7
|
-
Differ,
|
|
8
7
|
diffArray,
|
|
9
8
|
diffBoolean,
|
|
9
|
+
Differ,
|
|
10
10
|
diffNumber,
|
|
11
11
|
diffObject,
|
|
12
12
|
diffString,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { syncContinuity } from '../../dist/chunk-
|
|
1
|
+
export { syncContinuity } from '../../dist/chunk-2AIFLP2B.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';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as AtomIO from "atom.io"
|
|
2
|
-
import { type Store
|
|
2
|
+
import { setIntoStore, type Store } from "atom.io/internal"
|
|
3
3
|
import type { Json } from "atom.io/json"
|
|
4
4
|
import { parseJson } from "atom.io/json"
|
|
5
5
|
import type { Socket } from "socket.io-client"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type * as AtomIO from "atom.io"
|
|
2
|
-
import { getJsonToken, getUpdateToken, setIntoStore } from "atom.io/internal"
|
|
3
2
|
import type { Store, Transceiver } from "atom.io/internal"
|
|
4
|
-
import {
|
|
3
|
+
import { getJsonToken, getUpdateToken, setIntoStore } from "atom.io/internal"
|
|
5
4
|
import type { Json } from "atom.io/json"
|
|
5
|
+
import { parseJson } from "atom.io/json"
|
|
6
6
|
import type { Socket } from "socket.io-client"
|
|
7
7
|
|
|
8
8
|
export function pullMutableAtomFamilyMember<
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type * as AtomIO from "atom.io"
|
|
2
2
|
import type { Store } from "atom.io/internal"
|
|
3
|
-
import { deleteAtom } from "atom.io/internal"
|
|
4
3
|
import {
|
|
5
4
|
actUponStore,
|
|
6
5
|
assignTransactionToContinuity,
|
|
6
|
+
deleteAtom,
|
|
7
7
|
getEpochNumberOfContinuity,
|
|
8
8
|
getFromStore,
|
|
9
9
|
getJsonToken,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { syncContinuity } from '../../dist/chunk-
|
|
1
|
+
import { syncContinuity } from '../../dist/chunk-2AIFLP2B.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';
|