atom.io 0.12.0 â 0.13.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/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.js.map +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/internal/dist/index.cjs +1579 -1498
- package/internal/dist/index.cjs.map +1 -1
- package/internal/dist/index.d.cts +34 -14
- package/internal/dist/index.d.ts +34 -14
- package/internal/dist/index.js +1577 -1499
- package/internal/dist/index.js.map +1 -1
- package/internal/dist/metafile-cjs.json +1 -1
- package/internal/dist/metafile-esm.json +1 -1
- package/internal/src/atom/create-atom.ts +4 -4
- package/internal/src/atom/delete-atom.ts +11 -11
- package/internal/src/atom/is-default.ts +5 -5
- package/internal/src/caching.ts +12 -10
- package/internal/src/families/create-atom-family.ts +3 -3
- package/internal/src/families/create-readonly-selector-family.ts +3 -3
- package/internal/src/families/create-selector-family.ts +4 -4
- package/internal/src/index.ts +4 -2
- package/internal/src/keys.ts +4 -4
- package/internal/src/lazy-map.ts +37 -0
- package/internal/src/lineage.ts +18 -0
- package/internal/src/mutable/create-mutable-atom.ts +5 -4
- package/internal/src/mutable/get-json-family.ts +3 -3
- package/internal/src/mutable/tracker.ts +13 -10
- package/internal/src/operation.ts +19 -19
- package/internal/src/selector/create-read-write-selector.ts +5 -4
- package/internal/src/selector/create-readonly-selector.ts +4 -3
- package/internal/src/selector/create-selector.ts +6 -6
- package/internal/src/selector/delete-selector.ts +10 -10
- package/internal/src/selector/get-selector-dependency-keys.ts +2 -2
- package/internal/src/selector/register-selector.ts +4 -4
- package/internal/src/selector/update-selector-atoms.ts +2 -2
- package/internal/src/set-state/copy-mutable-if-needed.ts +4 -3
- package/internal/src/set-state/copy-mutable-in-transaction.ts +10 -16
- package/internal/src/set-state/copy-mutable-into-new-store.ts +1 -1
- package/internal/src/set-state/evict-downstream.ts +5 -5
- package/internal/src/set-state/set-atom.ts +6 -1
- package/internal/src/set-state/stow-update.ts +7 -2
- package/internal/src/store/store.ts +31 -24
- package/internal/src/store/withdraw-new-family-member.ts +3 -4
- package/internal/src/store/withdraw.ts +58 -59
- package/internal/src/subject.ts +14 -0
- package/internal/src/subscribe/recall-state.ts +5 -5
- package/internal/src/timeline/add-atom-to-timeline.ts +37 -27
- package/internal/src/timeline/create-timeline.ts +6 -8
- package/internal/src/timeline/time-travel.ts +22 -4
- package/internal/src/transaction/abort-transaction.ts +5 -3
- package/internal/src/transaction/apply-transaction.ts +80 -58
- package/internal/src/transaction/build-transaction.ts +34 -23
- package/internal/src/transaction/create-transaction.ts +6 -9
- package/internal/src/transaction/index.ts +2 -10
- package/internal/src/transaction/redo-transaction.ts +15 -10
- package/internal/src/transaction/undo-transaction.ts +15 -16
- package/introspection/dist/index.cjs +2 -2
- package/introspection/dist/index.cjs.map +1 -1
- package/introspection/dist/index.js +3 -3
- package/introspection/dist/index.js.map +1 -1
- package/introspection/src/attach-atom-index.ts +2 -2
- package/introspection/src/attach-selector-index.ts +2 -2
- package/package.json +3 -3
- package/react-devtools/dist/index.cjs +22 -8
- package/react-devtools/dist/index.cjs.map +1 -1
- package/react-devtools/dist/index.d.cts +17 -9
- package/react-devtools/dist/index.d.ts +17 -9
- package/react-devtools/dist/index.js +22 -8
- package/react-devtools/dist/index.js.map +1 -1
- package/react-devtools/dist/metafile-cjs.json +1 -1
- package/react-devtools/dist/metafile-esm.json +1 -1
- package/react-devtools/src/Updates.tsx +22 -10
- package/src/transaction.ts +7 -2
- package/transceivers/set-rtx/dist/index.cjs.map +1 -1
- package/transceivers/set-rtx/dist/index.d.cts +2 -2
- package/transceivers/set-rtx/dist/index.d.ts +2 -2
- package/transceivers/set-rtx/dist/index.js.map +1 -1
- package/transceivers/set-rtx/dist/metafile-cjs.json +1 -1
- package/transceivers/set-rtx/dist/metafile-esm.json +1 -1
- package/transceivers/set-rtx/src/set-rtx.ts +3 -3
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { newest } from "../lineage"
|
|
1
2
|
import type { Store } from "../store"
|
|
2
3
|
|
|
3
4
|
export const abortTransaction = (store: Store): void => {
|
|
4
|
-
|
|
5
|
+
const target = newest(store)
|
|
6
|
+
if (target.transactionMeta === null || target.parent === null) {
|
|
5
7
|
store.logger.warn(
|
|
6
8
|
`ð`,
|
|
7
9
|
`transaction`,
|
|
@@ -13,8 +15,8 @@ export const abortTransaction = (store: Store): void => {
|
|
|
13
15
|
store.logger.info(
|
|
14
16
|
`ðª`,
|
|
15
17
|
`transaction`,
|
|
16
|
-
|
|
18
|
+
target.transactionMeta.update.key,
|
|
17
19
|
`Aborting transaction`,
|
|
18
20
|
)
|
|
19
|
-
|
|
21
|
+
target.parent.child = null
|
|
20
22
|
}
|
|
@@ -1,14 +1,67 @@
|
|
|
1
|
-
import type { AtomToken, Æn } from "atom.io"
|
|
2
|
-
import { setState
|
|
1
|
+
import type { AtomToken, KeyedStateUpdate, TransactionUpdate, Æn } from "atom.io"
|
|
2
|
+
import { setState } from "atom.io"
|
|
3
3
|
|
|
4
|
+
import { newest } from "../lineage"
|
|
4
5
|
import { withdraw } from "../store"
|
|
5
6
|
import type { Store } from "../store"
|
|
6
7
|
|
|
8
|
+
function ingestAtomUpdate(
|
|
9
|
+
update: KeyedStateUpdate<any>,
|
|
10
|
+
parent: Store,
|
|
11
|
+
child: Store,
|
|
12
|
+
): void {
|
|
13
|
+
const { key, newValue } = update
|
|
14
|
+
const token: AtomToken<unknown> = { key, type: `atom` }
|
|
15
|
+
if (!parent.valueMap.has(token.key)) {
|
|
16
|
+
if (token.family) {
|
|
17
|
+
const family = parent.families.get(token.family.key)
|
|
18
|
+
if (family) {
|
|
19
|
+
family(token.family.subKey)
|
|
20
|
+
}
|
|
21
|
+
} else {
|
|
22
|
+
const newAtom = child.atoms.get(token.key)
|
|
23
|
+
if (!newAtom) {
|
|
24
|
+
throw new Error(
|
|
25
|
+
`Absurd Error: Atom "${token.key}" not found while copying updates from transaction "${child.transactionMeta?.update.key}" to store "${parent.config.name}"`,
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
parent.atoms.set(newAtom.key, newAtom)
|
|
29
|
+
parent.valueMap.set(newAtom.key, newAtom.default)
|
|
30
|
+
parent.logger.info(
|
|
31
|
+
`ðš`,
|
|
32
|
+
`transaction`,
|
|
33
|
+
child.transactionMeta?.update.key ?? `???`,
|
|
34
|
+
`Adding atom "${newAtom.key}"`,
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
setState(token, newValue, parent)
|
|
39
|
+
}
|
|
40
|
+
function ingestTransactionUpdate(
|
|
41
|
+
transactionUpdate: TransactionUpdate<any>,
|
|
42
|
+
parent: Store,
|
|
43
|
+
child: Store,
|
|
44
|
+
): void {
|
|
45
|
+
for (const update of transactionUpdate.updates) {
|
|
46
|
+
if (`newValue` in update) {
|
|
47
|
+
ingestAtomUpdate(update, parent, child)
|
|
48
|
+
} else {
|
|
49
|
+
ingestTransactionUpdate(update, parent, child)
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
7
54
|
export const applyTransaction = <Æ extends Æn>(
|
|
8
55
|
output: ReturnType<Æ>,
|
|
9
56
|
store: Store,
|
|
10
57
|
): void => {
|
|
11
|
-
|
|
58
|
+
const child = newest(store)
|
|
59
|
+
const { parent } = child
|
|
60
|
+
if (
|
|
61
|
+
parent === null ||
|
|
62
|
+
child.transactionMeta === null ||
|
|
63
|
+
child.transactionMeta?.phase !== `building`
|
|
64
|
+
) {
|
|
12
65
|
store.logger.warn(
|
|
13
66
|
`ð`,
|
|
14
67
|
`transaction`,
|
|
@@ -17,65 +70,34 @@ export const applyTransaction = <Æ extends Æn>(
|
|
|
17
70
|
)
|
|
18
71
|
return
|
|
19
72
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
73
|
+
child.transactionMeta.phase = `applying`
|
|
74
|
+
child.transactionMeta.update.output = output
|
|
75
|
+
parent.child = null
|
|
76
|
+
parent.subject.transactionApplying.next(child.transactionMeta)
|
|
77
|
+
const { updates } = child.transactionMeta.update
|
|
23
78
|
store.logger.info(
|
|
24
79
|
`ð`,
|
|
25
80
|
`transaction`,
|
|
26
|
-
|
|
27
|
-
`Applying transaction with ${
|
|
28
|
-
|
|
81
|
+
child.transactionMeta.update.key,
|
|
82
|
+
`Applying transaction with ${updates.length} updates:`,
|
|
83
|
+
updates,
|
|
29
84
|
)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const family = store.families.get(token.family.key)
|
|
36
|
-
if (family) {
|
|
37
|
-
family(token.family.subKey)
|
|
38
|
-
}
|
|
39
|
-
} else {
|
|
40
|
-
const newAtom = store.transactionStatus.core.atoms.get(token.key)
|
|
41
|
-
if (!newAtom) {
|
|
42
|
-
throw new Error(
|
|
43
|
-
`Absurd Error: Atom "${token.key}" not found while copying updates from transaction "${store.transactionStatus.key}" to store "${store.config.name}"`,
|
|
44
|
-
)
|
|
45
|
-
}
|
|
46
|
-
store.atoms.set(newAtom.key, newAtom)
|
|
47
|
-
store.valueMap.set(newAtom.key, newAtom.default)
|
|
48
|
-
store.logger.info(
|
|
49
|
-
`ðš`,
|
|
50
|
-
`transaction`,
|
|
51
|
-
store.transactionStatus.key,
|
|
52
|
-
`Adding atom "${newAtom.key}"`,
|
|
53
|
-
)
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
// if (store.transactionStatus.key === `dealCards`) debugger
|
|
57
|
-
setState(token, newValue, store)
|
|
58
|
-
}
|
|
59
|
-
const myTransaction = withdraw<Æ>(
|
|
60
|
-
{ key: store.transactionStatus.key, type: `transaction` },
|
|
61
|
-
store,
|
|
62
|
-
)
|
|
63
|
-
if (myTransaction === undefined) {
|
|
64
|
-
throw new Error(
|
|
65
|
-
`Transaction "${store.transactionStatus.key}" not found. Absurd. How is this running?`,
|
|
85
|
+
if (parent.transactionMeta === null) {
|
|
86
|
+
ingestTransactionUpdate(child.transactionMeta.update, parent, child)
|
|
87
|
+
const myTransaction = withdraw<Æ>(
|
|
88
|
+
{ key: child.transactionMeta.update.key, type: `transaction` },
|
|
89
|
+
store,
|
|
66
90
|
)
|
|
91
|
+
myTransaction?.subject.next(child.transactionMeta.update)
|
|
92
|
+
store.logger.info(
|
|
93
|
+
`ð¬`,
|
|
94
|
+
`transaction`,
|
|
95
|
+
child.transactionMeta.update.key,
|
|
96
|
+
`Finished applying transaction.`,
|
|
97
|
+
)
|
|
98
|
+
} else {
|
|
99
|
+
ingestTransactionUpdate(child.transactionMeta.update, parent, child)
|
|
100
|
+
parent.transactionMeta.update.updates.push(child.transactionMeta.update)
|
|
67
101
|
}
|
|
68
|
-
|
|
69
|
-
key: store.transactionStatus.key,
|
|
70
|
-
atomUpdates,
|
|
71
|
-
output,
|
|
72
|
-
params: store.transactionStatus.params as Parameters<Æ>,
|
|
73
|
-
})
|
|
74
|
-
store.logger.info(
|
|
75
|
-
`ð¬`,
|
|
76
|
-
`transaction`,
|
|
77
|
-
store.transactionStatus.key,
|
|
78
|
-
`Finished applying transaction.`,
|
|
79
|
-
)
|
|
80
|
-
store.transactionStatus = { phase: `idle` }
|
|
102
|
+
parent.subject.transactionApplying.next(null)
|
|
81
103
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Junction } from "~/packages/rel8/junction/src"
|
|
2
2
|
|
|
3
|
+
import { LazyMap } from "../lazy-map"
|
|
4
|
+
import { newest } from "../lineage"
|
|
3
5
|
import type { Store } from "../store"
|
|
4
6
|
|
|
5
7
|
export const buildTransaction = (
|
|
@@ -7,30 +9,39 @@ export const buildTransaction = (
|
|
|
7
9
|
params: any[],
|
|
8
10
|
store: Store,
|
|
9
11
|
): void => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}),
|
|
28
|
-
selectors: new Map(store.selectors),
|
|
29
|
-
valueMap: new Map(store.valueMap),
|
|
12
|
+
const parent = newest(store)
|
|
13
|
+
parent.child = {
|
|
14
|
+
parent,
|
|
15
|
+
child: null,
|
|
16
|
+
subject: parent.subject,
|
|
17
|
+
loggers: parent.loggers,
|
|
18
|
+
logger: parent.logger,
|
|
19
|
+
config: parent.config,
|
|
20
|
+
transactionMeta: {
|
|
21
|
+
phase: `building`,
|
|
22
|
+
time: Date.now(),
|
|
23
|
+
update: {
|
|
24
|
+
key,
|
|
25
|
+
updates: [],
|
|
26
|
+
params,
|
|
27
|
+
output: undefined,
|
|
28
|
+
},
|
|
30
29
|
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
atoms: new LazyMap(parent.atoms),
|
|
31
|
+
atomsThatAreDefault: new Set(parent.atomsThatAreDefault),
|
|
32
|
+
families: new LazyMap(parent.families),
|
|
33
|
+
operation: { open: false },
|
|
34
|
+
readonlySelectors: new LazyMap(parent.readonlySelectors),
|
|
35
|
+
timelines: new LazyMap(parent.timelines),
|
|
36
|
+
timelineAtoms: new Junction(parent.timelineAtoms.toJSON()),
|
|
37
|
+
trackers: new Map(),
|
|
38
|
+
transactions: new LazyMap(parent.transactions),
|
|
39
|
+
selectorAtoms: new Junction(parent.selectorAtoms.toJSON()),
|
|
40
|
+
selectorGraph: new Junction(parent.selectorGraph.toJSON(), {
|
|
41
|
+
makeContentKey: (...keys) => keys.sort().join(`:`),
|
|
42
|
+
}),
|
|
43
|
+
selectors: new LazyMap(parent.selectors),
|
|
44
|
+
valueMap: new LazyMap(parent.valueMap),
|
|
34
45
|
}
|
|
35
46
|
store.logger.info(
|
|
36
47
|
`ð«`,
|
|
@@ -4,10 +4,11 @@ import type {
|
|
|
4
4
|
TransactionUpdate,
|
|
5
5
|
Æn,
|
|
6
6
|
} from "atom.io"
|
|
7
|
-
import { getState, setState } from "atom.io"
|
|
7
|
+
import { getState, runTransaction, setState } from "atom.io"
|
|
8
8
|
|
|
9
|
+
import { newest } from "../lineage"
|
|
9
10
|
import { deposit } from "../store"
|
|
10
|
-
import type { Store
|
|
11
|
+
import type { Store } from "../store"
|
|
11
12
|
import { Subject } from "../subject"
|
|
12
13
|
import { abortTransaction } from "./abort-transaction"
|
|
13
14
|
import { applyTransaction } from "./apply-transaction"
|
|
@@ -35,6 +36,7 @@ export function createTransaction<Æ extends Æn>(
|
|
|
35
36
|
{
|
|
36
37
|
get: (token) => getState(token, store),
|
|
37
38
|
set: (token, value) => setState(token, value, store),
|
|
39
|
+
run: (token) => runTransaction(token, store),
|
|
38
40
|
},
|
|
39
41
|
...params,
|
|
40
42
|
)
|
|
@@ -49,14 +51,9 @@ export function createTransaction<Æ extends Æn>(
|
|
|
49
51
|
install: (store) => createTransaction(options, store),
|
|
50
52
|
subject: new Subject(),
|
|
51
53
|
}
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
+
const target = newest(store)
|
|
55
|
+
target.transactions.set(newTransaction.key, newTransaction)
|
|
54
56
|
const token = deposit(newTransaction)
|
|
55
57
|
store.subject.transactionCreation.next(token)
|
|
56
58
|
return token
|
|
57
59
|
}
|
|
58
|
-
|
|
59
|
-
export const target = (store: Store): StoreCore =>
|
|
60
|
-
store.transactionStatus.phase === `building`
|
|
61
|
-
? store.transactionStatus.core
|
|
62
|
-
: store
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { TransactionUpdate, Æn } from "atom.io"
|
|
2
2
|
|
|
3
|
-
import type { StoreCore } from ".."
|
|
4
|
-
|
|
5
3
|
export * from "./abort-transaction"
|
|
6
4
|
export * from "./apply-transaction"
|
|
7
5
|
export * from "./build-transaction"
|
|
@@ -12,14 +10,8 @@ export * from "./undo-transaction"
|
|
|
12
10
|
export const TRANSACTION_PHASES = [`idle`, `building`, `applying`] as const
|
|
13
11
|
export type TransactionPhase = (typeof TRANSACTION_PHASES)[number]
|
|
14
12
|
|
|
15
|
-
export type
|
|
13
|
+
export type TransactionMeta<Æ extends Æn> = {
|
|
16
14
|
phase: `applying` | `building`
|
|
17
15
|
time: number
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
export type TransactionIdle = {
|
|
21
|
-
phase: `idle`
|
|
16
|
+
update: TransactionUpdate<Æ>
|
|
22
17
|
}
|
|
23
|
-
export type TransactionStatus<Æ extends Æn> =
|
|
24
|
-
| TransactionIdle
|
|
25
|
-
| TransactionUpdateInProgress<Æ>
|
|
@@ -5,18 +5,23 @@ import { withdraw } from "../store"
|
|
|
5
5
|
import type { Store } from "../store"
|
|
6
6
|
|
|
7
7
|
export const redoTransactionUpdate = <Æ extends Æn>(
|
|
8
|
-
|
|
8
|
+
transactionUpdate: TransactionUpdate<Æ>,
|
|
9
9
|
store: Store,
|
|
10
10
|
): void => {
|
|
11
|
-
store.logger.info(`âïž`, `transaction`,
|
|
12
|
-
for (const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
store.logger.info(`âïž`, `transaction`, transactionUpdate.key, `Redo`)
|
|
12
|
+
for (const update of transactionUpdate.updates) {
|
|
13
|
+
if (`newValue` in update) {
|
|
14
|
+
const { key, newValue } = update
|
|
15
|
+
const token: AtomToken<unknown> = { key, type: `atom` }
|
|
16
|
+
const state = withdraw(token, store)
|
|
17
|
+
if (state === undefined) {
|
|
18
|
+
throw new Error(
|
|
19
|
+
`State "${token.key}" not found in this store. This is surprising, because we are navigating the history of the store.`,
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
setState(state, newValue, store)
|
|
23
|
+
} else {
|
|
24
|
+
redoTransactionUpdate(update, store)
|
|
19
25
|
}
|
|
20
|
-
setState(state, newValue, store)
|
|
21
26
|
}
|
|
22
27
|
}
|
|
@@ -5,24 +5,23 @@ import { withdraw } from "../store"
|
|
|
5
5
|
import type { Store } from "../store"
|
|
6
6
|
|
|
7
7
|
export const undoTransactionUpdate = <Æ extends Æn>(
|
|
8
|
-
|
|
8
|
+
transactionUpdate: TransactionUpdate<Æ>,
|
|
9
9
|
store: Store,
|
|
10
10
|
): void => {
|
|
11
|
-
store.logger.info(
|
|
12
|
-
|
|
13
|
-
`
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
)
|
|
11
|
+
store.logger.info(`â®ïž`, `transaction`, transactionUpdate.key, `Undo`)
|
|
12
|
+
for (const update of transactionUpdate.updates.reverse()) {
|
|
13
|
+
if (`newValue` in update) {
|
|
14
|
+
const { key, newValue } = update
|
|
15
|
+
const token: AtomToken<unknown> = { key, type: `atom` }
|
|
16
|
+
const state = withdraw(token, store)
|
|
17
|
+
if (state === undefined) {
|
|
18
|
+
throw new Error(
|
|
19
|
+
`State "${token.key}" not found in this store. This is surprising, because we are navigating the history of the store.`,
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
setState(state, newValue, store)
|
|
23
|
+
} else {
|
|
24
|
+
undoTransactionUpdate(update, store)
|
|
25
25
|
}
|
|
26
|
-
setState(state, oldValue, store)
|
|
27
26
|
}
|
|
28
27
|
}
|
|
@@ -81,7 +81,7 @@ var attachAtomIndex = (store = Internal.IMPLICIT.STORE) => {
|
|
|
81
81
|
[key]: atomToken
|
|
82
82
|
});
|
|
83
83
|
});
|
|
84
|
-
if (Internal.
|
|
84
|
+
if (Internal.newest(store).operation.open) {
|
|
85
85
|
const unsubscribe = store.subject.operationStatus.subscribe(
|
|
86
86
|
`introspection: waiting to update atom index`,
|
|
87
87
|
() => {
|
|
@@ -153,7 +153,7 @@ var attachSelectorIndex = (store = Internal.IMPLICIT.STORE) => {
|
|
|
153
153
|
[key]: selectorToken
|
|
154
154
|
});
|
|
155
155
|
});
|
|
156
|
-
if (Internal.
|
|
156
|
+
if (Internal.newest(store).operation.open) {
|
|
157
157
|
const unsubscribe = store.subject.operationStatus.subscribe(
|
|
158
158
|
`introspection: waiting to update selector index`,
|
|
159
159
|
() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/attach-introspection-states.ts","../src/attach-atom-index.ts","../src/attach-selector-index.ts","../src/attach-timeline-family.ts","../src/attach-timeline-index.ts","../src/attach-transaction-index.ts","../src/attach-transaction-logs.ts"],"names":["IMPLICIT","createAtom","createSelector","target","createAtomFamily","createSelectorFamily"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAQA,YAAY,cAAc;;;ACN1B,SAAS,UAAU,YAAY,gBAAgB,cAAc;AAMtD,IAAM,kBAAkB,CAC9B,QAAe,SAAS,UACmB;AAC3C,QAAM,gCAAgC;AAAA,IACrC;AAAA,MACC,KAAK;AAAA,MACL,SAAS,MAAM;AACd,cAAM,mBAAmB,CAAC,GAAG,MAAM,KAAK,EACtC,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,SAAS,0BAAO,CAAC,EACxC,OAAuB,CAAC,KAAK,CAAC,GAAG,MAAM;AACvC,cAAI,GAAG,IAAI,EAAE,KAAK,MAAM,OAAO;AAC/B,iBAAO;AAAA,QACR,GAAG,CAAC,CAAC;AACN,eAAO;AAAA,MACR;AAAA,MACA,SAAS;AAAA,QACR,CAAC,EAAE,QAAQ,MAAM;AAChB,gBAAM,QAAQ,aAAa,UAAU,iBAAiB,CAAC,cAAc;AACpE,gBAAI,UAAU,IAAI,SAAS,0BAAO,GAAG;AACpC;AAAA,YACD;AACA,kBAAM,MAAM,MACX,QAAQ,CAAC,UAAU;AAClB,oBAAM,EAAE,KAAK,OAAO,IAAI;AACxB,kBAAI,QAAQ;AACX,sBAAM,EAAE,KAAK,WAAW,OAAO,IAAI;AACnC,sBAAM,UAAU,MAAM,SAAS;AAC/B,oBAAI,YAAY,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Ae,oBAAoB,KAAK;AAAA,IACxC,mBAAmB,qBAAqB,KAAK;AAAA,EAC9C;AACD","sourcesContent":["import type {\n\tReadonlySelectorFamily,\n\tReadonlySelectorToken,\n\tTimelineToken,\n\tTransactionToken,\n\tTransactionUpdate,\n\tÆn,\n} from \"atom.io\"\nimport * as Internal from \"atom.io/internal\"\nimport type { Timeline } from \"atom.io/internal\"\n\nimport { type AtomTokenIndex, attachAtomIndex } from \"./attach-atom-index\"\nimport type { SelectorTokenIndex } from \"./attach-selector-index\"\nimport { attachSelectorIndex } from \"./attach-selector-index\"\nimport { attachTimelineFamily } from \"./attach-timeline-family\"\nimport { attachTimelineIndex } from \"./attach-timeline-index\"\nimport { attachTransactionIndex } from \"./attach-transaction-index\"\nimport { attachTransactionLogs } from \"./attach-transaction-logs\"\n\nexport const attachIntrospectionStates = (\n\tstore: Internal.Store = Internal.IMPLICIT.STORE,\n): {\n\tatomIndex: ReadonlySelectorToken<AtomTokenIndex>\n\tselectorIndex: ReadonlySelectorToken<SelectorTokenIndex>\n\ttransactionIndex: ReadonlySelectorToken<TransactionToken<Æn>[]>\n\tfindTransactionLogState: ReadonlySelectorFamily<TransactionUpdate<Æn>[]>\n\ttimelineIndex: ReadonlySelectorToken<TimelineToken[]>\n\tfindTimelineState: ReadonlySelectorFamily<Timeline>\n} => {\n\treturn {\n\t\tatomIndex: attachAtomIndex(store),\n\t\tselectorIndex: attachSelectorIndex(store),\n\t\ttransactionIndex: attachTransactionIndex(store),\n\t\tfindTransactionLogState: attachTransactionLogs(store),\n\t\ttimelineIndex: attachTimelineIndex(store),\n\t\tfindTimelineState: attachTimelineFamily(store),\n\t}\n}\n","import type { AtomToken, ReadonlySelectorToken } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createAtom, createSelector, target } from \"atom.io/internal\"\n\nimport type { StateTokenIndex } from \".\"\n\nexport type AtomTokenIndex = StateTokenIndex<AtomToken<unknown>>\n\nexport const attachAtomIndex = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorToken<AtomTokenIndex> => {\n\tconst atomTokenIndexState__INTERNAL = createAtom<AtomTokenIndex>(\n\t\t{\n\t\t\tkey: `ðâðš Atom Token Index (Internal)`,\n\t\t\tdefault: () => {\n\t\t\t\tconst defaultAtomIndex = [...store.atoms]\n\t\t\t\t\t.filter(([key]) => !key.includes(`ðâðš`))\n\t\t\t\t\t.reduce<AtomTokenIndex>((acc, [key]) => {\n\t\t\t\t\t\tacc[key] = { key, type: `atom` }\n\t\t\t\t\t\treturn acc\n\t\t\t\t\t}, {})\n\t\t\t\treturn defaultAtomIndex\n\t\t\t},\n\t\t\teffects: [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tstore.subject.atomCreation.subscribe(`introspection`, (atomToken) => {\n\t\t\t\t\t\tif (atomToken.key.includes(`ðâðš`)) {\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst set = () =>\n\t\t\t\t\t\t\tsetSelf((state) => {\n\t\t\t\t\t\t\t\tconst { key, family } = atomToken\n\t\t\t\t\t\t\t\tif (family) {\n\t\t\t\t\t\t\t\t\tconst { key: familyKey, subKey } = family\n\t\t\t\t\t\t\t\t\tconst current = state[familyKey]\n\t\t\t\t\t\t\t\t\tif (current === undefined || `familyMembers` in current) {\n\t\t\t\t\t\t\t\t\t\tconst familyKeyState = current || {\n\t\t\t\t\t\t\t\t\t\t\tkey: familyKey,\n\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {},\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t\t\t[familyKey]: {\n\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState,\n\t\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState.familyMembers,\n\t\t\t\t\t\t\t\t\t\t\t\t\t[subKey]: atomToken,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t[key]: atomToken,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\tif (target(store).operation.open) {\n\t\t\t\t\t\t\tconst unsubscribe = store.subject.operationStatus.subscribe(\n\t\t\t\t\t\t\t\t`introspection: waiting to update atom index`,\n\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\tunsubscribe()\n\t\t\t\t\t\t\t\t\tset()\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tset()\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\treturn createSelector(\n\t\t{\n\t\t\tkey: `ðâðš Atom Token Index`,\n\t\t\tget: ({ get }) => get(atomTokenIndexState__INTERNAL),\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n}\n","import type { ReadonlySelectorToken, SelectorToken } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createAtom, createSelector, target } from \"atom.io/internal\"\n\nimport type { StateTokenIndex } from \".\"\n\nexport type SelectorTokenIndex = StateTokenIndex<\n\tReadonlySelectorToken<unknown> | SelectorToken<unknown>\n>\n\nexport const attachSelectorIndex = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorToken<SelectorTokenIndex> => {\n\tconst readonlySelectorTokenIndexState__INTERNAL =\n\t\tcreateAtom<SelectorTokenIndex>(\n\t\t\t{\n\t\t\t\tkey: `ðâðš Selector Token Index (Internal)`,\n\t\t\t\tdefault: () =>\n\t\t\t\t\tObject.assign(\n\t\t\t\t\t\t[...store.readonlySelectors]\n\t\t\t\t\t\t\t.filter(([key]) => !key.includes(`ðâðš`))\n\t\t\t\t\t\t\t.reduce<SelectorTokenIndex>((acc, [key]) => {\n\t\t\t\t\t\t\t\tacc[key] = { key, type: `readonly_selector` }\n\t\t\t\t\t\t\t\treturn acc\n\t\t\t\t\t\t\t}, {}),\n\t\t\t\t\t\t[...store.selectors].reduce<SelectorTokenIndex>((acc, [key]) => {\n\t\t\t\t\t\t\tacc[key] = { key, type: `selector` }\n\t\t\t\t\t\t\treturn acc\n\t\t\t\t\t\t}, {}),\n\t\t\t\t\t),\n\t\t\t\teffects: [\n\t\t\t\t\t({ setSelf }) => {\n\t\t\t\t\t\tstore.subject.selectorCreation.subscribe(\n\t\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t\t(selectorToken) => {\n\t\t\t\t\t\t\t\tif (selectorToken.key.includes(`ðâðš`)) {\n\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tconst set = () =>\n\t\t\t\t\t\t\t\t\tsetSelf((state) => {\n\t\t\t\t\t\t\t\t\t\tconst { key, family } = selectorToken\n\t\t\t\t\t\t\t\t\t\tif (family) {\n\t\t\t\t\t\t\t\t\t\t\tconst { key: familyKey, subKey } = family\n\t\t\t\t\t\t\t\t\t\t\tconst current = state[familyKey]\n\t\t\t\t\t\t\t\t\t\t\tif (current === undefined || `familyMembers` in current) {\n\t\t\t\t\t\t\t\t\t\t\t\tconst familyKeyState = current || {\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey: familyKey,\n\t\t\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {},\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t\t\t\t\t[familyKey]: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState.familyMembers,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t[subKey]: selectorToken,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t\t\t[key]: selectorToken,\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\tif (target(store).operation.open) {\n\t\t\t\t\t\t\t\t\tconst unsubscribe = store.subject.operationStatus.subscribe(\n\t\t\t\t\t\t\t\t\t\t`introspection: waiting to update selector index`,\n\t\t\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\t\t\tunsubscribe()\n\t\t\t\t\t\t\t\t\t\t\tset()\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tset()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t)\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\tundefined,\n\t\t\tstore,\n\t\t)\n\treturn createSelector(\n\t\t{\n\t\t\tkey: `ðâðš Selector Token Index`,\n\t\t\tget: ({ get }) => get(readonlySelectorTokenIndexState__INTERNAL),\n\t\t},\n\t\tundefined,\n\t\tIMPLICIT.STORE,\n\t)\n}\n","import type { ReadonlySelectorFamily } from \"atom.io\"\nimport type { Store, Timeline } from \"atom.io/internal\"\nimport {\n\tIMPLICIT,\n\tSubject,\n\tcreateAtomFamily,\n\tcreateSelectorFamily,\n} from \"atom.io/internal\"\n\nexport const attachTimelineFamily = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorFamily<Timeline> => {\n\tconst findTimelineLogState__INTERNAL = createAtomFamily<Timeline, string>(\n\t\t{\n\t\t\tkey: `ðâðš Timeline Update Log (Internal)`,\n\t\t\tdefault: (key) =>\n\t\t\t\tstore.timelines.get(key) ?? {\n\t\t\t\t\ttype: `timeline`,\n\t\t\t\t\tkey: ``,\n\t\t\t\t\tat: 0,\n\t\t\t\t\ttimeTraveling: null,\n\t\t\t\t\thistory: [],\n\t\t\t\t\tselectorTime: null,\n\t\t\t\t\ttransactionKey: null,\n\t\t\t\t\tinstall: () => {},\n\t\t\t\t\tsubject: new Subject(),\n\t\t\t\t},\n\t\t\teffects: (key) => [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tconst tl = store.timelines.get(key)\n\t\t\t\t\ttl?.subject.subscribe(`introspection`, (_) => {\n\t\t\t\t\t\tif (store.operation.open === true) {\n\t\t\t\t\t\t\tconst unsubscribe = store.subject.operationStatus.subscribe(\n\t\t\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t\t\t(operationStatus) => {\n\t\t\t\t\t\t\t\t\tif (operationStatus.open === false) {\n\t\t\t\t\t\t\t\t\t\tunsubscribe()\n\t\t\t\t\t\t\t\t\t\tsetSelf({ ...tl })\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsetSelf({ ...tl })\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tstore,\n\t)\n\tconst findTimelineLogState = createSelectorFamily<Timeline, string>(\n\t\t{\n\t\t\tkey: `ðâðš Timeline Update Log`,\n\t\t\tget:\n\t\t\t\t(key) =>\n\t\t\t\t({ get }) =>\n\t\t\t\t\tget(findTimelineLogState__INTERNAL(key)),\n\t\t},\n\t\tstore,\n\t)\n\treturn findTimelineLogState\n}\n","import type { ReadonlySelectorToken, TimelineToken } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createAtom, createSelector } from \"atom.io/internal\"\n\nexport const attachTimelineIndex = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorToken<TimelineToken[]> => {\n\tconst timelineTokenIndexState__INTERNAL = createAtom<TimelineToken[]>(\n\t\t{\n\t\t\tkey: `ðâðš Timeline Token Index (Internal)`,\n\t\t\tdefault: () =>\n\t\t\t\t[...store.timelines].map(([key]): TimelineToken => {\n\t\t\t\t\treturn { key, type: `timeline` }\n\t\t\t\t}),\n\t\t\teffects: [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tstore.subject.timelineCreation.subscribe(\n\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t(timelineToken) => {\n\t\t\t\t\t\t\tsetSelf((state) => [...state, timelineToken])\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\tconst timelineTokenIndex = createSelector(\n\t\t{\n\t\t\tkey: `ðâðš Timeline Token Index`,\n\t\t\tget: ({ get }) => get(timelineTokenIndexState__INTERNAL),\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\treturn timelineTokenIndex\n}\n","import type { ReadonlySelectorToken, TransactionToken, Æn } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createAtom, createSelector } from \"atom.io/internal\"\n\nexport const attachTransactionIndex = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorToken<TransactionToken<Æn>[]> => {\n\tconst transactionTokenIndexState__INTERNAL = createAtom<\n\t\tTransactionToken<Æn>[]\n\t>(\n\t\t{\n\t\t\tkey: `ðâðš Transaction Token Index (Internal)`,\n\t\t\tdefault: () =>\n\t\t\t\t[...store.transactions].map(([key]): TransactionToken<Æn> => {\n\t\t\t\t\treturn { key, type: `transaction` }\n\t\t\t\t}),\n\t\t\teffects: [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tstore.subject.transactionCreation.subscribe(\n\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t(transactionToken) => {\n\t\t\t\t\t\t\tsetSelf((state) => [...state, transactionToken])\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\tconst transactionTokenIndex = createSelector(\n\t\t{\n\t\t\tkey: `ðâðš Transaction Token Index`,\n\t\t\tget: ({ get }) => get(transactionTokenIndexState__INTERNAL),\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\treturn transactionTokenIndex\n}\n","import type { ReadonlySelectorFamily, TransactionUpdate, Æn } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport {\n\tIMPLICIT,\n\tcreateAtomFamily,\n\tcreateSelectorFamily,\n} from \"atom.io/internal\"\n\nexport const attachTransactionLogs = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorFamily<TransactionUpdate<Æn>[]> => {\n\tconst findTransactionUpdateLog = createAtomFamily<\n\t\tTransactionUpdate<Æn>[],\n\t\tstring\n\t>(\n\t\t{\n\t\t\tkey: `ðâðš Transaction Update Log (Internal)`,\n\t\t\tdefault: () => [],\n\t\t\teffects: (key) => [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tconst tx = store.transactions.get(key)\n\t\t\t\t\ttx?.subject.subscribe(`introspection`, (transactionUpdate) => {\n\t\t\t\t\t\tif (transactionUpdate.key === key) {\n\t\t\t\t\t\t\tsetSelf((state) => [...state, transactionUpdate])\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tstore,\n\t)\n\tconst findTransactionUpdateLogState = createSelectorFamily<\n\t\tTransactionUpdate<Æn>[],\n\t\tstring\n\t>(\n\t\t{\n\t\t\tkey: `ðâðš Transaction Update Log`,\n\t\t\tget:\n\t\t\t\t(key) =>\n\t\t\t\t({ get }) =>\n\t\t\t\t\tget(findTransactionUpdateLog(key)),\n\t\t},\n\t\tstore,\n\t)\n\treturn findTransactionUpdateLogState\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/attach-introspection-states.ts","../src/attach-atom-index.ts","../src/attach-selector-index.ts","../src/attach-timeline-family.ts","../src/attach-timeline-index.ts","../src/attach-transaction-index.ts","../src/attach-transaction-logs.ts"],"names":["IMPLICIT","createAtom","createSelector","newest","createAtomFamily","createSelectorFamily"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAQA,YAAY,cAAc;;;ACN1B,SAAS,UAAU,YAAY,gBAAgB,cAAc;AAMtD,IAAM,kBAAkB,CAC9B,QAAe,SAAS,UACmB;AAC3C,QAAM,gCAAgC;AAAA,IACrC;AAAA,MACC,KAAK;AAAA,MACL,SAAS,MAAM;AACd,cAAM,mBAAmB,CAAC,GAAG,MAAM,KAAK,EACtC,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,SAAS,0BAAO,CAAC,EACxC,OAAuB,CAAC,KAAK,CAAC,GAAG,MAAM;AACvC,cAAI,GAAG,IAAI,EAAE,KAAK,MAAM,OAAO;AAC/B,iBAAO;AAAA,QACR,GAAG,CAAC,CAAC;AACN,eAAO;AAAA,MACR;AAAA,MACA,SAAS;AAAA,QACR,CAAC,EAAE,QAAQ,MAAM;AAChB,gBAAM,QAAQ,aAAa,UAAU,iBAAiB,CAAC,cAAc;AACpE,gBAAI,UAAU,IAAI,SAAS,0BAAO,GAAG;AACpC;AAAA,YACD;AACA,kBAAM,MAAM,MACX,QAAQ,CAAC,UAAU;AAClB,oBAAM,EAAE,KAAK,OAAO,IAAI;AACxB,kBAAI,QAAQ;AACX,sBAAM,EAAE,KAAK,WAAW,OAAO,IAAI;AACnC,sBAAM,UAAU,MAAM,SAAS;AAC/B,oBAAI,YAAY,UAAa,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AAoB,KAAK;AAAA,IACxC,mBAAmB,qBAAqB,KAAK;AAAA,EAC9C;AACD","sourcesContent":["import type {\n\tReadonlySelectorFamily,\n\tReadonlySelectorToken,\n\tTimelineToken,\n\tTransactionToken,\n\tTransactionUpdate,\n\tÆn,\n} from \"atom.io\"\nimport * as Internal from \"atom.io/internal\"\nimport type { Timeline } from \"atom.io/internal\"\n\nimport { type AtomTokenIndex, attachAtomIndex } from \"./attach-atom-index\"\nimport type { SelectorTokenIndex } from \"./attach-selector-index\"\nimport { attachSelectorIndex } from \"./attach-selector-index\"\nimport { attachTimelineFamily } from \"./attach-timeline-family\"\nimport { attachTimelineIndex } from \"./attach-timeline-index\"\nimport { attachTransactionIndex } from \"./attach-transaction-index\"\nimport { attachTransactionLogs } from \"./attach-transaction-logs\"\n\nexport const attachIntrospectionStates = (\n\tstore: Internal.Store = Internal.IMPLICIT.STORE,\n): {\n\tatomIndex: ReadonlySelectorToken<AtomTokenIndex>\n\tselectorIndex: ReadonlySelectorToken<SelectorTokenIndex>\n\ttransactionIndex: ReadonlySelectorToken<TransactionToken<Æn>[]>\n\tfindTransactionLogState: ReadonlySelectorFamily<TransactionUpdate<Æn>[]>\n\ttimelineIndex: ReadonlySelectorToken<TimelineToken[]>\n\tfindTimelineState: ReadonlySelectorFamily<Timeline>\n} => {\n\treturn {\n\t\tatomIndex: attachAtomIndex(store),\n\t\tselectorIndex: attachSelectorIndex(store),\n\t\ttransactionIndex: attachTransactionIndex(store),\n\t\tfindTransactionLogState: attachTransactionLogs(store),\n\t\ttimelineIndex: attachTimelineIndex(store),\n\t\tfindTimelineState: attachTimelineFamily(store),\n\t}\n}\n","import type { AtomToken, ReadonlySelectorToken } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createAtom, createSelector, newest } from \"atom.io/internal\"\n\nimport type { StateTokenIndex } from \".\"\n\nexport type AtomTokenIndex = StateTokenIndex<AtomToken<unknown>>\n\nexport const attachAtomIndex = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorToken<AtomTokenIndex> => {\n\tconst atomTokenIndexState__INTERNAL = createAtom<AtomTokenIndex>(\n\t\t{\n\t\t\tkey: `ðâðš Atom Token Index (Internal)`,\n\t\t\tdefault: () => {\n\t\t\t\tconst defaultAtomIndex = [...store.atoms]\n\t\t\t\t\t.filter(([key]) => !key.includes(`ðâðš`))\n\t\t\t\t\t.reduce<AtomTokenIndex>((acc, [key]) => {\n\t\t\t\t\t\tacc[key] = { key, type: `atom` }\n\t\t\t\t\t\treturn acc\n\t\t\t\t\t}, {})\n\t\t\t\treturn defaultAtomIndex\n\t\t\t},\n\t\t\teffects: [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tstore.subject.atomCreation.subscribe(`introspection`, (atomToken) => {\n\t\t\t\t\t\tif (atomToken.key.includes(`ðâðš`)) {\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst set = () =>\n\t\t\t\t\t\t\tsetSelf((state) => {\n\t\t\t\t\t\t\t\tconst { key, family } = atomToken\n\t\t\t\t\t\t\t\tif (family) {\n\t\t\t\t\t\t\t\t\tconst { key: familyKey, subKey } = family\n\t\t\t\t\t\t\t\t\tconst current = state[familyKey]\n\t\t\t\t\t\t\t\t\tif (current === undefined || `familyMembers` in current) {\n\t\t\t\t\t\t\t\t\t\tconst familyKeyState = current || {\n\t\t\t\t\t\t\t\t\t\t\tkey: familyKey,\n\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {},\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t\t\t[familyKey]: {\n\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState,\n\t\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState.familyMembers,\n\t\t\t\t\t\t\t\t\t\t\t\t\t[subKey]: atomToken,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t[key]: atomToken,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\tif (newest(store).operation.open) {\n\t\t\t\t\t\t\tconst unsubscribe = store.subject.operationStatus.subscribe(\n\t\t\t\t\t\t\t\t`introspection: waiting to update atom index`,\n\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\tunsubscribe()\n\t\t\t\t\t\t\t\t\tset()\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tset()\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\treturn createSelector(\n\t\t{\n\t\t\tkey: `ðâðš Atom Token Index`,\n\t\t\tget: ({ get }) => get(atomTokenIndexState__INTERNAL),\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n}\n","import type { ReadonlySelectorToken, SelectorToken } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createAtom, createSelector, newest } from \"atom.io/internal\"\n\nimport type { StateTokenIndex } from \".\"\n\nexport type SelectorTokenIndex = StateTokenIndex<\n\tReadonlySelectorToken<unknown> | SelectorToken<unknown>\n>\n\nexport const attachSelectorIndex = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorToken<SelectorTokenIndex> => {\n\tconst readonlySelectorTokenIndexState__INTERNAL =\n\t\tcreateAtom<SelectorTokenIndex>(\n\t\t\t{\n\t\t\t\tkey: `ðâðš Selector Token Index (Internal)`,\n\t\t\t\tdefault: () =>\n\t\t\t\t\tObject.assign(\n\t\t\t\t\t\t[...store.readonlySelectors]\n\t\t\t\t\t\t\t.filter(([key]) => !key.includes(`ðâðš`))\n\t\t\t\t\t\t\t.reduce<SelectorTokenIndex>((acc, [key]) => {\n\t\t\t\t\t\t\t\tacc[key] = { key, type: `readonly_selector` }\n\t\t\t\t\t\t\t\treturn acc\n\t\t\t\t\t\t\t}, {}),\n\t\t\t\t\t\t[...store.selectors].reduce<SelectorTokenIndex>((acc, [key]) => {\n\t\t\t\t\t\t\tacc[key] = { key, type: `selector` }\n\t\t\t\t\t\t\treturn acc\n\t\t\t\t\t\t}, {}),\n\t\t\t\t\t),\n\t\t\t\teffects: [\n\t\t\t\t\t({ setSelf }) => {\n\t\t\t\t\t\tstore.subject.selectorCreation.subscribe(\n\t\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t\t(selectorToken) => {\n\t\t\t\t\t\t\t\tif (selectorToken.key.includes(`ðâðš`)) {\n\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tconst set = () =>\n\t\t\t\t\t\t\t\t\tsetSelf((state) => {\n\t\t\t\t\t\t\t\t\t\tconst { key, family } = selectorToken\n\t\t\t\t\t\t\t\t\t\tif (family) {\n\t\t\t\t\t\t\t\t\t\t\tconst { key: familyKey, subKey } = family\n\t\t\t\t\t\t\t\t\t\t\tconst current = state[familyKey]\n\t\t\t\t\t\t\t\t\t\t\tif (current === undefined || `familyMembers` in current) {\n\t\t\t\t\t\t\t\t\t\t\t\tconst familyKeyState = current || {\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey: familyKey,\n\t\t\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {},\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t\t\t\t\t[familyKey]: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState.familyMembers,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t[subKey]: selectorToken,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t\t\t[key]: selectorToken,\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\tif (newest(store).operation.open) {\n\t\t\t\t\t\t\t\t\tconst unsubscribe = store.subject.operationStatus.subscribe(\n\t\t\t\t\t\t\t\t\t\t`introspection: waiting to update selector index`,\n\t\t\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\t\t\tunsubscribe()\n\t\t\t\t\t\t\t\t\t\t\tset()\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tset()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t)\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\tundefined,\n\t\t\tstore,\n\t\t)\n\treturn createSelector(\n\t\t{\n\t\t\tkey: `ðâðš Selector Token Index`,\n\t\t\tget: ({ get }) => get(readonlySelectorTokenIndexState__INTERNAL),\n\t\t},\n\t\tundefined,\n\t\tIMPLICIT.STORE,\n\t)\n}\n","import type { ReadonlySelectorFamily } from \"atom.io\"\nimport type { Store, Timeline } from \"atom.io/internal\"\nimport {\n\tIMPLICIT,\n\tSubject,\n\tcreateAtomFamily,\n\tcreateSelectorFamily,\n} from \"atom.io/internal\"\n\nexport const attachTimelineFamily = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorFamily<Timeline> => {\n\tconst findTimelineLogState__INTERNAL = createAtomFamily<Timeline, string>(\n\t\t{\n\t\t\tkey: `ðâðš Timeline Update Log (Internal)`,\n\t\t\tdefault: (key) =>\n\t\t\t\tstore.timelines.get(key) ?? {\n\t\t\t\t\ttype: `timeline`,\n\t\t\t\t\tkey: ``,\n\t\t\t\t\tat: 0,\n\t\t\t\t\ttimeTraveling: null,\n\t\t\t\t\thistory: [],\n\t\t\t\t\tselectorTime: null,\n\t\t\t\t\ttransactionKey: null,\n\t\t\t\t\tinstall: () => {},\n\t\t\t\t\tsubject: new Subject(),\n\t\t\t\t},\n\t\t\teffects: (key) => [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tconst tl = store.timelines.get(key)\n\t\t\t\t\ttl?.subject.subscribe(`introspection`, (_) => {\n\t\t\t\t\t\tif (store.operation.open === true) {\n\t\t\t\t\t\t\tconst unsubscribe = store.subject.operationStatus.subscribe(\n\t\t\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t\t\t(operationStatus) => {\n\t\t\t\t\t\t\t\t\tif (operationStatus.open === false) {\n\t\t\t\t\t\t\t\t\t\tunsubscribe()\n\t\t\t\t\t\t\t\t\t\tsetSelf({ ...tl })\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsetSelf({ ...tl })\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tstore,\n\t)\n\tconst findTimelineLogState = createSelectorFamily<Timeline, string>(\n\t\t{\n\t\t\tkey: `ðâðš Timeline Update Log`,\n\t\t\tget:\n\t\t\t\t(key) =>\n\t\t\t\t({ get }) =>\n\t\t\t\t\tget(findTimelineLogState__INTERNAL(key)),\n\t\t},\n\t\tstore,\n\t)\n\treturn findTimelineLogState\n}\n","import type { ReadonlySelectorToken, TimelineToken } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createAtom, createSelector } from \"atom.io/internal\"\n\nexport const attachTimelineIndex = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorToken<TimelineToken[]> => {\n\tconst timelineTokenIndexState__INTERNAL = createAtom<TimelineToken[]>(\n\t\t{\n\t\t\tkey: `ðâðš Timeline Token Index (Internal)`,\n\t\t\tdefault: () =>\n\t\t\t\t[...store.timelines].map(([key]): TimelineToken => {\n\t\t\t\t\treturn { key, type: `timeline` }\n\t\t\t\t}),\n\t\t\teffects: [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tstore.subject.timelineCreation.subscribe(\n\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t(timelineToken) => {\n\t\t\t\t\t\t\tsetSelf((state) => [...state, timelineToken])\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\tconst timelineTokenIndex = createSelector(\n\t\t{\n\t\t\tkey: `ðâðš Timeline Token Index`,\n\t\t\tget: ({ get }) => get(timelineTokenIndexState__INTERNAL),\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\treturn timelineTokenIndex\n}\n","import type { ReadonlySelectorToken, TransactionToken, Æn } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createAtom, createSelector } from \"atom.io/internal\"\n\nexport const attachTransactionIndex = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorToken<TransactionToken<Æn>[]> => {\n\tconst transactionTokenIndexState__INTERNAL = createAtom<\n\t\tTransactionToken<Æn>[]\n\t>(\n\t\t{\n\t\t\tkey: `ðâðš Transaction Token Index (Internal)`,\n\t\t\tdefault: () =>\n\t\t\t\t[...store.transactions].map(([key]): TransactionToken<Æn> => {\n\t\t\t\t\treturn { key, type: `transaction` }\n\t\t\t\t}),\n\t\t\teffects: [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tstore.subject.transactionCreation.subscribe(\n\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t(transactionToken) => {\n\t\t\t\t\t\t\tsetSelf((state) => [...state, transactionToken])\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\tconst transactionTokenIndex = createSelector(\n\t\t{\n\t\t\tkey: `ðâðš Transaction Token Index`,\n\t\t\tget: ({ get }) => get(transactionTokenIndexState__INTERNAL),\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\treturn transactionTokenIndex\n}\n","import type { ReadonlySelectorFamily, TransactionUpdate, Æn } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport {\n\tIMPLICIT,\n\tcreateAtomFamily,\n\tcreateSelectorFamily,\n} from \"atom.io/internal\"\n\nexport const attachTransactionLogs = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorFamily<TransactionUpdate<Æn>[]> => {\n\tconst findTransactionUpdateLog = createAtomFamily<\n\t\tTransactionUpdate<Æn>[],\n\t\tstring\n\t>(\n\t\t{\n\t\t\tkey: `ðâðš Transaction Update Log (Internal)`,\n\t\t\tdefault: () => [],\n\t\t\teffects: (key) => [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tconst tx = store.transactions.get(key)\n\t\t\t\t\ttx?.subject.subscribe(`introspection`, (transactionUpdate) => {\n\t\t\t\t\t\tif (transactionUpdate.key === key) {\n\t\t\t\t\t\t\tsetSelf((state) => [...state, transactionUpdate])\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tstore,\n\t)\n\tconst findTransactionUpdateLogState = createSelectorFamily<\n\t\tTransactionUpdate<Æn>[],\n\t\tstring\n\t>(\n\t\t{\n\t\t\tkey: `ðâðš Transaction Update Log`,\n\t\t\tget:\n\t\t\t\t(key) =>\n\t\t\t\t({ get }) =>\n\t\t\t\t\tget(findTransactionUpdateLog(key)),\n\t\t},\n\t\tstore,\n\t)\n\treturn findTransactionUpdateLogState\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Internal from 'atom.io/internal';
|
|
2
|
-
import { createAtom,
|
|
2
|
+
import { createAtom, newest, createSelector, IMPLICIT, createAtomFamily, Subject, createSelectorFamily } from 'atom.io/internal';
|
|
3
3
|
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __defProps = Object.defineProperties;
|
|
@@ -60,7 +60,7 @@ var attachAtomIndex = (store = IMPLICIT.STORE) => {
|
|
|
60
60
|
[key]: atomToken
|
|
61
61
|
});
|
|
62
62
|
});
|
|
63
|
-
if (
|
|
63
|
+
if (newest(store).operation.open) {
|
|
64
64
|
const unsubscribe = store.subject.operationStatus.subscribe(
|
|
65
65
|
`introspection: waiting to update atom index`,
|
|
66
66
|
() => {
|
|
@@ -132,7 +132,7 @@ var attachSelectorIndex = (store = IMPLICIT.STORE) => {
|
|
|
132
132
|
[key]: selectorToken
|
|
133
133
|
});
|
|
134
134
|
});
|
|
135
|
-
if (
|
|
135
|
+
if (newest(store).operation.open) {
|
|
136
136
|
const unsubscribe = store.subject.operationStatus.subscribe(
|
|
137
137
|
`introspection: waiting to update selector index`,
|
|
138
138
|
() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/attach-introspection-states.ts","../src/attach-atom-index.ts","../src/attach-selector-index.ts","../src/attach-timeline-family.ts","../src/attach-timeline-index.ts","../src/attach-transaction-index.ts","../src/attach-transaction-logs.ts"],"names":["IMPLICIT","createAtom","createSelector","target","createAtomFamily","createSelectorFamily"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAQA,YAAY,cAAc;;;ACN1B,SAAS,UAAU,YAAY,gBAAgB,cAAc;AAM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MACL,SAAS,MAAM,CAAC;AAAA,MAChB,SAAS,CAAC,QAAQ;AAAA,QACjB,CAAC,EAAE,QAAQ,MAAM;AAChB,gBAAM,KAAK,MAAM,aAAa,IAAI,GAAG;AACrC,mCAAI,QAAQ,UAAU,iBAAiB,CAAC,sBAAsB;AAC7D,gBAAI,kBAAkB,QAAQ,KAAK;AAClC,sBAAQ,CAAC,UAAU,CAAC,GAAG,OAAO,iBAAiB,CAAC;AAAA,YACjD;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,IACA;AAAA,EACD;AACA,QAAM,gCAAgCC;AAAA,IAIrC;AAAA,MACC,KAAK;AAAA,MACL,KACC,CAAC,QACD,CAAC,EAAE,IAAI,MACN,IAAI,yBAAyB,GAAG,CAAC;AAAA,IACpC;AAAA,IACA;AAAA,EACD;AACA,SAAO;AACR;;;AN1BO,IAAM,4BAA4B,CACxC,QAAiC,kBAAS,UAQtC;AACJ,SAAO;AAAA,IACN,WAAW,gBAAgB,KAAK;AAAA,IAChC,eAAe,oBAAoB,KAAK;AAAA,IACxC,kBAAkB,uBAAuB,KAAK;AAAA,IAC9C,yBAAyB,sBAAsB,KAAK;AAAA,IACpD,eAAe,oBAAoB,KAAK;AAAA,IACxC,mBAAmB,qBAAqB,KAAK;AAAA,EAC9C;AACD","sourcesContent":["import type {\n\tReadonlySelectorFamily,\n\tReadonlySelectorToken,\n\tTimelineToken,\n\tTransactionToken,\n\tTransactionUpdate,\n\tÆn,\n} from \"atom.io\"\nimport * as Internal from \"atom.io/internal\"\nimport type { Timeline } from \"atom.io/internal\"\n\nimport { type AtomTokenIndex, attachAtomIndex } from \"./attach-atom-index\"\nimport type { SelectorTokenIndex } from \"./attach-selector-index\"\nimport { attachSelectorIndex } from \"./attach-selector-index\"\nimport { attachTimelineFamily } from \"./attach-timeline-family\"\nimport { attachTimelineIndex } from \"./attach-timeline-index\"\nimport { attachTransactionIndex } from \"./attach-transaction-index\"\nimport { attachTransactionLogs } from \"./attach-transaction-logs\"\n\nexport const attachIntrospectionStates = (\n\tstore: Internal.Store = Internal.IMPLICIT.STORE,\n): {\n\tatomIndex: ReadonlySelectorToken<AtomTokenIndex>\n\tselectorIndex: ReadonlySelectorToken<SelectorTokenIndex>\n\ttransactionIndex: ReadonlySelectorToken<TransactionToken<Æn>[]>\n\tfindTransactionLogState: ReadonlySelectorFamily<TransactionUpdate<Æn>[]>\n\ttimelineIndex: ReadonlySelectorToken<TimelineToken[]>\n\tfindTimelineState: ReadonlySelectorFamily<Timeline>\n} => {\n\treturn {\n\t\tatomIndex: attachAtomIndex(store),\n\t\tselectorIndex: attachSelectorIndex(store),\n\t\ttransactionIndex: attachTransactionIndex(store),\n\t\tfindTransactionLogState: attachTransactionLogs(store),\n\t\ttimelineIndex: attachTimelineIndex(store),\n\t\tfindTimelineState: attachTimelineFamily(store),\n\t}\n}\n","import type { AtomToken, ReadonlySelectorToken } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createAtom, createSelector, target } from \"atom.io/internal\"\n\nimport type { StateTokenIndex } from \".\"\n\nexport type AtomTokenIndex = StateTokenIndex<AtomToken<unknown>>\n\nexport const attachAtomIndex = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorToken<AtomTokenIndex> => {\n\tconst atomTokenIndexState__INTERNAL = createAtom<AtomTokenIndex>(\n\t\t{\n\t\t\tkey: `ðâðš Atom Token Index (Internal)`,\n\t\t\tdefault: () => {\n\t\t\t\tconst defaultAtomIndex = [...store.atoms]\n\t\t\t\t\t.filter(([key]) => !key.includes(`ðâðš`))\n\t\t\t\t\t.reduce<AtomTokenIndex>((acc, [key]) => {\n\t\t\t\t\t\tacc[key] = { key, type: `atom` }\n\t\t\t\t\t\treturn acc\n\t\t\t\t\t}, {})\n\t\t\t\treturn defaultAtomIndex\n\t\t\t},\n\t\t\teffects: [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tstore.subject.atomCreation.subscribe(`introspection`, (atomToken) => {\n\t\t\t\t\t\tif (atomToken.key.includes(`ðâðš`)) {\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst set = () =>\n\t\t\t\t\t\t\tsetSelf((state) => {\n\t\t\t\t\t\t\t\tconst { key, family } = atomToken\n\t\t\t\t\t\t\t\tif (family) {\n\t\t\t\t\t\t\t\t\tconst { key: familyKey, subKey } = family\n\t\t\t\t\t\t\t\t\tconst current = state[familyKey]\n\t\t\t\t\t\t\t\t\tif (current === undefined || `familyMembers` in current) {\n\t\t\t\t\t\t\t\t\t\tconst familyKeyState = current || {\n\t\t\t\t\t\t\t\t\t\t\tkey: familyKey,\n\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {},\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t\t\t[familyKey]: {\n\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState,\n\t\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState.familyMembers,\n\t\t\t\t\t\t\t\t\t\t\t\t\t[subKey]: atomToken,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t[key]: atomToken,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\tif (target(store).operation.open) {\n\t\t\t\t\t\t\tconst unsubscribe = store.subject.operationStatus.subscribe(\n\t\t\t\t\t\t\t\t`introspection: waiting to update atom index`,\n\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\tunsubscribe()\n\t\t\t\t\t\t\t\t\tset()\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tset()\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\treturn createSelector(\n\t\t{\n\t\t\tkey: `ðâðš Atom Token Index`,\n\t\t\tget: ({ get }) => get(atomTokenIndexState__INTERNAL),\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n}\n","import type { ReadonlySelectorToken, SelectorToken } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createAtom, createSelector, target } from \"atom.io/internal\"\n\nimport type { StateTokenIndex } from \".\"\n\nexport type SelectorTokenIndex = StateTokenIndex<\n\tReadonlySelectorToken<unknown> | SelectorToken<unknown>\n>\n\nexport const attachSelectorIndex = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorToken<SelectorTokenIndex> => {\n\tconst readonlySelectorTokenIndexState__INTERNAL =\n\t\tcreateAtom<SelectorTokenIndex>(\n\t\t\t{\n\t\t\t\tkey: `ðâðš Selector Token Index (Internal)`,\n\t\t\t\tdefault: () =>\n\t\t\t\t\tObject.assign(\n\t\t\t\t\t\t[...store.readonlySelectors]\n\t\t\t\t\t\t\t.filter(([key]) => !key.includes(`ðâðš`))\n\t\t\t\t\t\t\t.reduce<SelectorTokenIndex>((acc, [key]) => {\n\t\t\t\t\t\t\t\tacc[key] = { key, type: `readonly_selector` }\n\t\t\t\t\t\t\t\treturn acc\n\t\t\t\t\t\t\t}, {}),\n\t\t\t\t\t\t[...store.selectors].reduce<SelectorTokenIndex>((acc, [key]) => {\n\t\t\t\t\t\t\tacc[key] = { key, type: `selector` }\n\t\t\t\t\t\t\treturn acc\n\t\t\t\t\t\t}, {}),\n\t\t\t\t\t),\n\t\t\t\teffects: [\n\t\t\t\t\t({ setSelf }) => {\n\t\t\t\t\t\tstore.subject.selectorCreation.subscribe(\n\t\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t\t(selectorToken) => {\n\t\t\t\t\t\t\t\tif (selectorToken.key.includes(`ðâðš`)) {\n\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tconst set = () =>\n\t\t\t\t\t\t\t\t\tsetSelf((state) => {\n\t\t\t\t\t\t\t\t\t\tconst { key, family } = selectorToken\n\t\t\t\t\t\t\t\t\t\tif (family) {\n\t\t\t\t\t\t\t\t\t\t\tconst { key: familyKey, subKey } = family\n\t\t\t\t\t\t\t\t\t\t\tconst current = state[familyKey]\n\t\t\t\t\t\t\t\t\t\t\tif (current === undefined || `familyMembers` in current) {\n\t\t\t\t\t\t\t\t\t\t\t\tconst familyKeyState = current || {\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey: familyKey,\n\t\t\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {},\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t\t\t\t\t[familyKey]: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState.familyMembers,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t[subKey]: selectorToken,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t\t\t[key]: selectorToken,\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\tif (target(store).operation.open) {\n\t\t\t\t\t\t\t\t\tconst unsubscribe = store.subject.operationStatus.subscribe(\n\t\t\t\t\t\t\t\t\t\t`introspection: waiting to update selector index`,\n\t\t\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\t\t\tunsubscribe()\n\t\t\t\t\t\t\t\t\t\t\tset()\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tset()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t)\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\tundefined,\n\t\t\tstore,\n\t\t)\n\treturn createSelector(\n\t\t{\n\t\t\tkey: `ðâðš Selector Token Index`,\n\t\t\tget: ({ get }) => get(readonlySelectorTokenIndexState__INTERNAL),\n\t\t},\n\t\tundefined,\n\t\tIMPLICIT.STORE,\n\t)\n}\n","import type { ReadonlySelectorFamily } from \"atom.io\"\nimport type { Store, Timeline } from \"atom.io/internal\"\nimport {\n\tIMPLICIT,\n\tSubject,\n\tcreateAtomFamily,\n\tcreateSelectorFamily,\n} from \"atom.io/internal\"\n\nexport const attachTimelineFamily = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorFamily<Timeline> => {\n\tconst findTimelineLogState__INTERNAL = createAtomFamily<Timeline, string>(\n\t\t{\n\t\t\tkey: `ðâðš Timeline Update Log (Internal)`,\n\t\t\tdefault: (key) =>\n\t\t\t\tstore.timelines.get(key) ?? {\n\t\t\t\t\ttype: `timeline`,\n\t\t\t\t\tkey: ``,\n\t\t\t\t\tat: 0,\n\t\t\t\t\ttimeTraveling: null,\n\t\t\t\t\thistory: [],\n\t\t\t\t\tselectorTime: null,\n\t\t\t\t\ttransactionKey: null,\n\t\t\t\t\tinstall: () => {},\n\t\t\t\t\tsubject: new Subject(),\n\t\t\t\t},\n\t\t\teffects: (key) => [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tconst tl = store.timelines.get(key)\n\t\t\t\t\ttl?.subject.subscribe(`introspection`, (_) => {\n\t\t\t\t\t\tif (store.operation.open === true) {\n\t\t\t\t\t\t\tconst unsubscribe = store.subject.operationStatus.subscribe(\n\t\t\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t\t\t(operationStatus) => {\n\t\t\t\t\t\t\t\t\tif (operationStatus.open === false) {\n\t\t\t\t\t\t\t\t\t\tunsubscribe()\n\t\t\t\t\t\t\t\t\t\tsetSelf({ ...tl })\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsetSelf({ ...tl })\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tstore,\n\t)\n\tconst findTimelineLogState = createSelectorFamily<Timeline, string>(\n\t\t{\n\t\t\tkey: `ðâðš Timeline Update Log`,\n\t\t\tget:\n\t\t\t\t(key) =>\n\t\t\t\t({ get }) =>\n\t\t\t\t\tget(findTimelineLogState__INTERNAL(key)),\n\t\t},\n\t\tstore,\n\t)\n\treturn findTimelineLogState\n}\n","import type { ReadonlySelectorToken, TimelineToken } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createAtom, createSelector } from \"atom.io/internal\"\n\nexport const attachTimelineIndex = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorToken<TimelineToken[]> => {\n\tconst timelineTokenIndexState__INTERNAL = createAtom<TimelineToken[]>(\n\t\t{\n\t\t\tkey: `ðâðš Timeline Token Index (Internal)`,\n\t\t\tdefault: () =>\n\t\t\t\t[...store.timelines].map(([key]): TimelineToken => {\n\t\t\t\t\treturn { key, type: `timeline` }\n\t\t\t\t}),\n\t\t\teffects: [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tstore.subject.timelineCreation.subscribe(\n\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t(timelineToken) => {\n\t\t\t\t\t\t\tsetSelf((state) => [...state, timelineToken])\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\tconst timelineTokenIndex = createSelector(\n\t\t{\n\t\t\tkey: `ðâðš Timeline Token Index`,\n\t\t\tget: ({ get }) => get(timelineTokenIndexState__INTERNAL),\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\treturn timelineTokenIndex\n}\n","import type { ReadonlySelectorToken, TransactionToken, Æn } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createAtom, createSelector } from \"atom.io/internal\"\n\nexport const attachTransactionIndex = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorToken<TransactionToken<Æn>[]> => {\n\tconst transactionTokenIndexState__INTERNAL = createAtom<\n\t\tTransactionToken<Æn>[]\n\t>(\n\t\t{\n\t\t\tkey: `ðâðš Transaction Token Index (Internal)`,\n\t\t\tdefault: () =>\n\t\t\t\t[...store.transactions].map(([key]): TransactionToken<Æn> => {\n\t\t\t\t\treturn { key, type: `transaction` }\n\t\t\t\t}),\n\t\t\teffects: [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tstore.subject.transactionCreation.subscribe(\n\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t(transactionToken) => {\n\t\t\t\t\t\t\tsetSelf((state) => [...state, transactionToken])\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\tconst transactionTokenIndex = createSelector(\n\t\t{\n\t\t\tkey: `ðâðš Transaction Token Index`,\n\t\t\tget: ({ get }) => get(transactionTokenIndexState__INTERNAL),\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\treturn transactionTokenIndex\n}\n","import type { ReadonlySelectorFamily, TransactionUpdate, Æn } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport {\n\tIMPLICIT,\n\tcreateAtomFamily,\n\tcreateSelectorFamily,\n} from \"atom.io/internal\"\n\nexport const attachTransactionLogs = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorFamily<TransactionUpdate<Æn>[]> => {\n\tconst findTransactionUpdateLog = createAtomFamily<\n\t\tTransactionUpdate<Æn>[],\n\t\tstring\n\t>(\n\t\t{\n\t\t\tkey: `ðâðš Transaction Update Log (Internal)`,\n\t\t\tdefault: () => [],\n\t\t\teffects: (key) => [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tconst tx = store.transactions.get(key)\n\t\t\t\t\ttx?.subject.subscribe(`introspection`, (transactionUpdate) => {\n\t\t\t\t\t\tif (transactionUpdate.key === key) {\n\t\t\t\t\t\t\tsetSelf((state) => [...state, transactionUpdate])\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tstore,\n\t)\n\tconst findTransactionUpdateLogState = createSelectorFamily<\n\t\tTransactionUpdate<Æn>[],\n\t\tstring\n\t>(\n\t\t{\n\t\t\tkey: `ðâðš Transaction Update Log`,\n\t\t\tget:\n\t\t\t\t(key) =>\n\t\t\t\t({ get }) =>\n\t\t\t\t\tget(findTransactionUpdateLog(key)),\n\t\t},\n\t\tstore,\n\t)\n\treturn findTransactionUpdateLogState\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/attach-introspection-states.ts","../src/attach-atom-index.ts","../src/attach-selector-index.ts","../src/attach-timeline-family.ts","../src/attach-timeline-index.ts","../src/attach-transaction-index.ts","../src/attach-transaction-logs.ts"],"names":["IMPLICIT","createAtom","createSelector","newest","createAtomFamily","createSelectorFamily"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAQA,YAAY,cAAc;;;ACN1B,SAAS,UAAU,YAAY,gBAAgB,cAAc;AAMtD,IA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AAS,MAAM,CAAC;AAAA,MAChB,SAAS,CAAC,QAAQ;AAAA,QACjB,CAAC,EAAE,QAAQ,MAAM;AAChB,gBAAM,KAAK,MAAM,aAAa,IAAI,GAAG;AACrC,mCAAI,QAAQ,UAAU,iBAAiB,CAAC,sBAAsB;AAC7D,gBAAI,kBAAkB,QAAQ,KAAK;AAClC,sBAAQ,CAAC,UAAU,CAAC,GAAG,OAAO,iBAAiB,CAAC;AAAA,YACjD;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,IACA;AAAA,EACD;AACA,QAAM,gCAAgCC;AAAA,IAIrC;AAAA,MACC,KAAK;AAAA,MACL,KACC,CAAC,QACD,CAAC,EAAE,IAAI,MACN,IAAI,yBAAyB,GAAG,CAAC;AAAA,IACpC;AAAA,IACA;AAAA,EACD;AACA,SAAO;AACR;;;AN1BO,IAAM,4BAA4B,CACxC,QAAiC,kBAAS,UAQtC;AACJ,SAAO;AAAA,IACN,WAAW,gBAAgB,KAAK;AAAA,IAChC,eAAe,oBAAoB,KAAK;AAAA,IACxC,kBAAkB,uBAAuB,KAAK;AAAA,IAC9C,yBAAyB,sBAAsB,KAAK;AAAA,IACpD,eAAe,oBAAoB,KAAK;AAAA,IACxC,mBAAmB,qBAAqB,KAAK;AAAA,EAC9C;AACD","sourcesContent":["import type {\n\tReadonlySelectorFamily,\n\tReadonlySelectorToken,\n\tTimelineToken,\n\tTransactionToken,\n\tTransactionUpdate,\n\tÆn,\n} from \"atom.io\"\nimport * as Internal from \"atom.io/internal\"\nimport type { Timeline } from \"atom.io/internal\"\n\nimport { type AtomTokenIndex, attachAtomIndex } from \"./attach-atom-index\"\nimport type { SelectorTokenIndex } from \"./attach-selector-index\"\nimport { attachSelectorIndex } from \"./attach-selector-index\"\nimport { attachTimelineFamily } from \"./attach-timeline-family\"\nimport { attachTimelineIndex } from \"./attach-timeline-index\"\nimport { attachTransactionIndex } from \"./attach-transaction-index\"\nimport { attachTransactionLogs } from \"./attach-transaction-logs\"\n\nexport const attachIntrospectionStates = (\n\tstore: Internal.Store = Internal.IMPLICIT.STORE,\n): {\n\tatomIndex: ReadonlySelectorToken<AtomTokenIndex>\n\tselectorIndex: ReadonlySelectorToken<SelectorTokenIndex>\n\ttransactionIndex: ReadonlySelectorToken<TransactionToken<Æn>[]>\n\tfindTransactionLogState: ReadonlySelectorFamily<TransactionUpdate<Æn>[]>\n\ttimelineIndex: ReadonlySelectorToken<TimelineToken[]>\n\tfindTimelineState: ReadonlySelectorFamily<Timeline>\n} => {\n\treturn {\n\t\tatomIndex: attachAtomIndex(store),\n\t\tselectorIndex: attachSelectorIndex(store),\n\t\ttransactionIndex: attachTransactionIndex(store),\n\t\tfindTransactionLogState: attachTransactionLogs(store),\n\t\ttimelineIndex: attachTimelineIndex(store),\n\t\tfindTimelineState: attachTimelineFamily(store),\n\t}\n}\n","import type { AtomToken, ReadonlySelectorToken } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createAtom, createSelector, newest } from \"atom.io/internal\"\n\nimport type { StateTokenIndex } from \".\"\n\nexport type AtomTokenIndex = StateTokenIndex<AtomToken<unknown>>\n\nexport const attachAtomIndex = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorToken<AtomTokenIndex> => {\n\tconst atomTokenIndexState__INTERNAL = createAtom<AtomTokenIndex>(\n\t\t{\n\t\t\tkey: `ðâðš Atom Token Index (Internal)`,\n\t\t\tdefault: () => {\n\t\t\t\tconst defaultAtomIndex = [...store.atoms]\n\t\t\t\t\t.filter(([key]) => !key.includes(`ðâðš`))\n\t\t\t\t\t.reduce<AtomTokenIndex>((acc, [key]) => {\n\t\t\t\t\t\tacc[key] = { key, type: `atom` }\n\t\t\t\t\t\treturn acc\n\t\t\t\t\t}, {})\n\t\t\t\treturn defaultAtomIndex\n\t\t\t},\n\t\t\teffects: [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tstore.subject.atomCreation.subscribe(`introspection`, (atomToken) => {\n\t\t\t\t\t\tif (atomToken.key.includes(`ðâðš`)) {\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst set = () =>\n\t\t\t\t\t\t\tsetSelf((state) => {\n\t\t\t\t\t\t\t\tconst { key, family } = atomToken\n\t\t\t\t\t\t\t\tif (family) {\n\t\t\t\t\t\t\t\t\tconst { key: familyKey, subKey } = family\n\t\t\t\t\t\t\t\t\tconst current = state[familyKey]\n\t\t\t\t\t\t\t\t\tif (current === undefined || `familyMembers` in current) {\n\t\t\t\t\t\t\t\t\t\tconst familyKeyState = current || {\n\t\t\t\t\t\t\t\t\t\t\tkey: familyKey,\n\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {},\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t\t\t[familyKey]: {\n\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState,\n\t\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState.familyMembers,\n\t\t\t\t\t\t\t\t\t\t\t\t\t[subKey]: atomToken,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t[key]: atomToken,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\tif (newest(store).operation.open) {\n\t\t\t\t\t\t\tconst unsubscribe = store.subject.operationStatus.subscribe(\n\t\t\t\t\t\t\t\t`introspection: waiting to update atom index`,\n\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\tunsubscribe()\n\t\t\t\t\t\t\t\t\tset()\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tset()\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\treturn createSelector(\n\t\t{\n\t\t\tkey: `ðâðš Atom Token Index`,\n\t\t\tget: ({ get }) => get(atomTokenIndexState__INTERNAL),\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n}\n","import type { ReadonlySelectorToken, SelectorToken } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createAtom, createSelector, newest } from \"atom.io/internal\"\n\nimport type { StateTokenIndex } from \".\"\n\nexport type SelectorTokenIndex = StateTokenIndex<\n\tReadonlySelectorToken<unknown> | SelectorToken<unknown>\n>\n\nexport const attachSelectorIndex = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorToken<SelectorTokenIndex> => {\n\tconst readonlySelectorTokenIndexState__INTERNAL =\n\t\tcreateAtom<SelectorTokenIndex>(\n\t\t\t{\n\t\t\t\tkey: `ðâðš Selector Token Index (Internal)`,\n\t\t\t\tdefault: () =>\n\t\t\t\t\tObject.assign(\n\t\t\t\t\t\t[...store.readonlySelectors]\n\t\t\t\t\t\t\t.filter(([key]) => !key.includes(`ðâðš`))\n\t\t\t\t\t\t\t.reduce<SelectorTokenIndex>((acc, [key]) => {\n\t\t\t\t\t\t\t\tacc[key] = { key, type: `readonly_selector` }\n\t\t\t\t\t\t\t\treturn acc\n\t\t\t\t\t\t\t}, {}),\n\t\t\t\t\t\t[...store.selectors].reduce<SelectorTokenIndex>((acc, [key]) => {\n\t\t\t\t\t\t\tacc[key] = { key, type: `selector` }\n\t\t\t\t\t\t\treturn acc\n\t\t\t\t\t\t}, {}),\n\t\t\t\t\t),\n\t\t\t\teffects: [\n\t\t\t\t\t({ setSelf }) => {\n\t\t\t\t\t\tstore.subject.selectorCreation.subscribe(\n\t\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t\t(selectorToken) => {\n\t\t\t\t\t\t\t\tif (selectorToken.key.includes(`ðâðš`)) {\n\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tconst set = () =>\n\t\t\t\t\t\t\t\t\tsetSelf((state) => {\n\t\t\t\t\t\t\t\t\t\tconst { key, family } = selectorToken\n\t\t\t\t\t\t\t\t\t\tif (family) {\n\t\t\t\t\t\t\t\t\t\t\tconst { key: familyKey, subKey } = family\n\t\t\t\t\t\t\t\t\t\t\tconst current = state[familyKey]\n\t\t\t\t\t\t\t\t\t\t\tif (current === undefined || `familyMembers` in current) {\n\t\t\t\t\t\t\t\t\t\t\t\tconst familyKeyState = current || {\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey: familyKey,\n\t\t\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {},\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t\t\t\t\t[familyKey]: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState.familyMembers,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t[subKey]: selectorToken,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t\t\t[key]: selectorToken,\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\tif (newest(store).operation.open) {\n\t\t\t\t\t\t\t\t\tconst unsubscribe = store.subject.operationStatus.subscribe(\n\t\t\t\t\t\t\t\t\t\t`introspection: waiting to update selector index`,\n\t\t\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\t\t\tunsubscribe()\n\t\t\t\t\t\t\t\t\t\t\tset()\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tset()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t)\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\tundefined,\n\t\t\tstore,\n\t\t)\n\treturn createSelector(\n\t\t{\n\t\t\tkey: `ðâðš Selector Token Index`,\n\t\t\tget: ({ get }) => get(readonlySelectorTokenIndexState__INTERNAL),\n\t\t},\n\t\tundefined,\n\t\tIMPLICIT.STORE,\n\t)\n}\n","import type { ReadonlySelectorFamily } from \"atom.io\"\nimport type { Store, Timeline } from \"atom.io/internal\"\nimport {\n\tIMPLICIT,\n\tSubject,\n\tcreateAtomFamily,\n\tcreateSelectorFamily,\n} from \"atom.io/internal\"\n\nexport const attachTimelineFamily = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorFamily<Timeline> => {\n\tconst findTimelineLogState__INTERNAL = createAtomFamily<Timeline, string>(\n\t\t{\n\t\t\tkey: `ðâðš Timeline Update Log (Internal)`,\n\t\t\tdefault: (key) =>\n\t\t\t\tstore.timelines.get(key) ?? {\n\t\t\t\t\ttype: `timeline`,\n\t\t\t\t\tkey: ``,\n\t\t\t\t\tat: 0,\n\t\t\t\t\ttimeTraveling: null,\n\t\t\t\t\thistory: [],\n\t\t\t\t\tselectorTime: null,\n\t\t\t\t\ttransactionKey: null,\n\t\t\t\t\tinstall: () => {},\n\t\t\t\t\tsubject: new Subject(),\n\t\t\t\t},\n\t\t\teffects: (key) => [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tconst tl = store.timelines.get(key)\n\t\t\t\t\ttl?.subject.subscribe(`introspection`, (_) => {\n\t\t\t\t\t\tif (store.operation.open === true) {\n\t\t\t\t\t\t\tconst unsubscribe = store.subject.operationStatus.subscribe(\n\t\t\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t\t\t(operationStatus) => {\n\t\t\t\t\t\t\t\t\tif (operationStatus.open === false) {\n\t\t\t\t\t\t\t\t\t\tunsubscribe()\n\t\t\t\t\t\t\t\t\t\tsetSelf({ ...tl })\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsetSelf({ ...tl })\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tstore,\n\t)\n\tconst findTimelineLogState = createSelectorFamily<Timeline, string>(\n\t\t{\n\t\t\tkey: `ðâðš Timeline Update Log`,\n\t\t\tget:\n\t\t\t\t(key) =>\n\t\t\t\t({ get }) =>\n\t\t\t\t\tget(findTimelineLogState__INTERNAL(key)),\n\t\t},\n\t\tstore,\n\t)\n\treturn findTimelineLogState\n}\n","import type { ReadonlySelectorToken, TimelineToken } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createAtom, createSelector } from \"atom.io/internal\"\n\nexport const attachTimelineIndex = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorToken<TimelineToken[]> => {\n\tconst timelineTokenIndexState__INTERNAL = createAtom<TimelineToken[]>(\n\t\t{\n\t\t\tkey: `ðâðš Timeline Token Index (Internal)`,\n\t\t\tdefault: () =>\n\t\t\t\t[...store.timelines].map(([key]): TimelineToken => {\n\t\t\t\t\treturn { key, type: `timeline` }\n\t\t\t\t}),\n\t\t\teffects: [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tstore.subject.timelineCreation.subscribe(\n\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t(timelineToken) => {\n\t\t\t\t\t\t\tsetSelf((state) => [...state, timelineToken])\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\tconst timelineTokenIndex = createSelector(\n\t\t{\n\t\t\tkey: `ðâðš Timeline Token Index`,\n\t\t\tget: ({ get }) => get(timelineTokenIndexState__INTERNAL),\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\treturn timelineTokenIndex\n}\n","import type { ReadonlySelectorToken, TransactionToken, Æn } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createAtom, createSelector } from \"atom.io/internal\"\n\nexport const attachTransactionIndex = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorToken<TransactionToken<Æn>[]> => {\n\tconst transactionTokenIndexState__INTERNAL = createAtom<\n\t\tTransactionToken<Æn>[]\n\t>(\n\t\t{\n\t\t\tkey: `ðâðš Transaction Token Index (Internal)`,\n\t\t\tdefault: () =>\n\t\t\t\t[...store.transactions].map(([key]): TransactionToken<Æn> => {\n\t\t\t\t\treturn { key, type: `transaction` }\n\t\t\t\t}),\n\t\t\teffects: [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tstore.subject.transactionCreation.subscribe(\n\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t(transactionToken) => {\n\t\t\t\t\t\t\tsetSelf((state) => [...state, transactionToken])\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\tconst transactionTokenIndex = createSelector(\n\t\t{\n\t\t\tkey: `ðâðš Transaction Token Index`,\n\t\t\tget: ({ get }) => get(transactionTokenIndexState__INTERNAL),\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\treturn transactionTokenIndex\n}\n","import type { ReadonlySelectorFamily, TransactionUpdate, Æn } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport {\n\tIMPLICIT,\n\tcreateAtomFamily,\n\tcreateSelectorFamily,\n} from \"atom.io/internal\"\n\nexport const attachTransactionLogs = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorFamily<TransactionUpdate<Æn>[]> => {\n\tconst findTransactionUpdateLog = createAtomFamily<\n\t\tTransactionUpdate<Æn>[],\n\t\tstring\n\t>(\n\t\t{\n\t\t\tkey: `ðâðš Transaction Update Log (Internal)`,\n\t\t\tdefault: () => [],\n\t\t\teffects: (key) => [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tconst tx = store.transactions.get(key)\n\t\t\t\t\ttx?.subject.subscribe(`introspection`, (transactionUpdate) => {\n\t\t\t\t\t\tif (transactionUpdate.key === key) {\n\t\t\t\t\t\t\tsetSelf((state) => [...state, transactionUpdate])\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tstore,\n\t)\n\tconst findTransactionUpdateLogState = createSelectorFamily<\n\t\tTransactionUpdate<Æn>[],\n\t\tstring\n\t>(\n\t\t{\n\t\t\tkey: `ðâðš Transaction Update Log`,\n\t\t\tget:\n\t\t\t\t(key) =>\n\t\t\t\t({ get }) =>\n\t\t\t\t\tget(findTransactionUpdateLog(key)),\n\t\t},\n\t\tstore,\n\t)\n\treturn findTransactionUpdateLogState\n}\n"]}
|