atom.io 0.6.5 → 0.6.7
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/README.md +32 -78
- package/dist/index.d.mts +11 -43
- package/dist/index.d.ts +11 -43
- package/dist/index.js +111 -291
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +108 -278
- package/dist/index.mjs.map +1 -1
- package/introspection/dist/index.d.mts +273 -0
- package/introspection/dist/index.d.ts +273 -0
- package/introspection/dist/index.js +350 -0
- package/introspection/dist/index.js.map +1 -0
- package/introspection/dist/index.mjs +327 -0
- package/introspection/dist/index.mjs.map +1 -0
- package/introspection/package.json +15 -0
- package/package.json +22 -12
- package/react-devtools/dist/index.css +22 -5
- package/react-devtools/dist/index.css.map +1 -1
- package/react-devtools/dist/index.d.mts +347 -10
- package/react-devtools/dist/index.d.ts +347 -10
- package/react-devtools/dist/index.js +2743 -696
- package/react-devtools/dist/index.js.map +1 -1
- package/react-devtools/dist/index.mjs +2739 -701
- package/react-devtools/dist/index.mjs.map +1 -1
- package/src/internal/atom-internal.ts +5 -6
- package/src/internal/get.ts +7 -9
- package/src/internal/index.ts +0 -1
- package/src/internal/operation.ts +15 -21
- package/src/internal/selector/create-read-write-selector.ts +8 -4
- package/src/internal/selector/create-readonly-selector.ts +1 -7
- package/src/internal/selector-internal.ts +1 -3
- package/src/internal/set.ts +1 -4
- package/src/internal/store.ts +22 -24
- package/src/internal/subscribe-internal.ts +7 -1
- package/src/internal/time-travel-internal.ts +2 -0
- package/src/internal/timeline/add-atom-to-timeline.ts +11 -12
- package/src/internal/timeline-internal.ts +6 -4
- package/src/internal/transaction/apply-transaction.ts +9 -6
- package/src/internal/transaction/build-transaction.ts +6 -6
- package/src/internal/transaction-internal.ts +1 -7
- package/src/introspection/attach-atom-index.ts +73 -0
- package/src/introspection/attach-introspection-states.ts +42 -0
- package/src/introspection/attach-selector-index.ts +77 -0
- package/src/introspection/attach-timeline-family.ts +59 -0
- package/src/introspection/attach-timeline-index.ts +36 -0
- package/src/introspection/attach-transaction-index.ts +38 -0
- package/src/introspection/attach-transaction-logs.ts +40 -0
- package/src/introspection/index.ts +20 -0
- package/src/react-devtools/AtomIODevtools.tsx +97 -97
- package/src/react-devtools/Button.tsx +24 -0
- package/src/react-devtools/StateEditor.tsx +14 -16
- package/src/react-devtools/StateIndex.tsx +153 -0
- package/src/react-devtools/TimelineIndex.tsx +92 -0
- package/src/react-devtools/TransactionIndex.tsx +70 -0
- package/src/react-devtools/Updates.tsx +145 -0
- package/src/react-devtools/devtools.scss +196 -15
- package/src/react-devtools/index.ts +71 -0
- package/src/react-explorer/AtomIOExplorer.tsx +3 -4
- package/src/react-explorer/explorer-states.ts +1 -1
- package/src/react-explorer/space-states.ts +3 -1
- package/src/react-explorer/view-states.ts +0 -2
- package/realtime-testing/dist/index.d.mts +0 -49
- package/realtime-testing/dist/index.d.ts +0 -49
- package/realtime-testing/dist/index.js +0 -165
- package/realtime-testing/dist/index.js.map +0 -1
- package/realtime-testing/dist/index.mjs +0 -129
- package/realtime-testing/dist/index.mjs.map +0 -1
- package/src/internal/meta/attach-meta.ts +0 -17
- package/src/internal/meta/index.ts +0 -4
- package/src/internal/meta/meta-state.ts +0 -135
- package/src/internal/meta/meta-timelines.ts +0 -1
- package/src/internal/meta/meta-transactions.ts +0 -1
- package/src/react-devtools/TokenList.tsx +0 -61
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import type { AtomToken, ReadonlySelectorToken, SelectorToken } from "atom.io"
|
|
2
|
+
import { getState, selectorFamily } from "atom.io"
|
|
3
|
+
import { useO, useIO } from "atom.io/react"
|
|
4
|
+
import type { FC } from "react"
|
|
5
|
+
|
|
6
|
+
import { isJson, refineJsonType } from "~/packages/anvl/src/json"
|
|
7
|
+
|
|
8
|
+
import { findViewIsOpenState, primitiveRefinery } from "."
|
|
9
|
+
import { button } from "./Button"
|
|
10
|
+
import { StoreEditor } from "./StateEditor"
|
|
11
|
+
import type { FamilyNode, StateTokenIndex } from "../introspection"
|
|
12
|
+
|
|
13
|
+
const findStateTypeState = selectorFamily<string, { key: string }>({
|
|
14
|
+
key: `👁🗨 State Type`,
|
|
15
|
+
get: (token) => ({ get }) => {
|
|
16
|
+
let state: unknown
|
|
17
|
+
try {
|
|
18
|
+
state = get(token as any)
|
|
19
|
+
} catch (error) {
|
|
20
|
+
return `error`
|
|
21
|
+
}
|
|
22
|
+
if (state === undefined) return `undefined`
|
|
23
|
+
if (isJson(state)) return refineJsonType(state).type
|
|
24
|
+
return Object.getPrototypeOf(state).constructor.name
|
|
25
|
+
},
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
export const StateIndexLeafNode: FC<{
|
|
29
|
+
node:
|
|
30
|
+
| AtomToken<unknown>
|
|
31
|
+
| ReadonlySelectorToken<unknown>
|
|
32
|
+
| SelectorToken<unknown>
|
|
33
|
+
isOpenState: AtomToken<boolean>
|
|
34
|
+
typeState: ReadonlySelectorToken<string>
|
|
35
|
+
}> = ({ node, isOpenState, typeState }) => {
|
|
36
|
+
const [isOpen, setIsOpen] = useIO(isOpenState)
|
|
37
|
+
const state = useO(node)
|
|
38
|
+
const stateType = useO(typeState)
|
|
39
|
+
|
|
40
|
+
const isPrimitive = Boolean(primitiveRefinery.refine(state))
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<>
|
|
44
|
+
<header>
|
|
45
|
+
<button.OpenClose
|
|
46
|
+
isOpen={isOpen && !isPrimitive}
|
|
47
|
+
setIsOpen={setIsOpen}
|
|
48
|
+
disabled={isPrimitive}
|
|
49
|
+
/>
|
|
50
|
+
<label
|
|
51
|
+
onClick={() => console.log(node, getState(node))}
|
|
52
|
+
onKeyUp={() => console.log(node, getState(node))}
|
|
53
|
+
>
|
|
54
|
+
<h2>{node.family?.subKey ?? node.key}</h2>
|
|
55
|
+
<span className="type detail">({stateType})</span>
|
|
56
|
+
</label>
|
|
57
|
+
{isPrimitive ? <StoreEditor token={node} /> : null}
|
|
58
|
+
</header>
|
|
59
|
+
{isOpen && !isPrimitive ? (
|
|
60
|
+
<main>
|
|
61
|
+
<StoreEditor token={node} />
|
|
62
|
+
</main>
|
|
63
|
+
) : null}
|
|
64
|
+
</>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
export const StateIndexTreeNode: FC<{
|
|
68
|
+
node: FamilyNode<
|
|
69
|
+
AtomToken<unknown> | ReadonlySelectorToken<unknown> | SelectorToken<unknown>
|
|
70
|
+
>
|
|
71
|
+
isOpenState: AtomToken<boolean>
|
|
72
|
+
}> = ({ node, isOpenState }) => {
|
|
73
|
+
const [isOpen, setIsOpen] = useIO(isOpenState)
|
|
74
|
+
Object.entries(node.familyMembers).forEach(([key, childNode]) => {
|
|
75
|
+
findViewIsOpenState(key)
|
|
76
|
+
findStateTypeState(childNode)
|
|
77
|
+
})
|
|
78
|
+
return (
|
|
79
|
+
<>
|
|
80
|
+
<header>
|
|
81
|
+
<button.OpenClose isOpen={isOpen} setIsOpen={setIsOpen} />
|
|
82
|
+
<label>
|
|
83
|
+
<h2>{node.key}</h2>
|
|
84
|
+
<span className="type detail"> (family)</span>
|
|
85
|
+
</label>
|
|
86
|
+
</header>
|
|
87
|
+
{isOpen
|
|
88
|
+
? Object.entries(node.familyMembers).map(([key, childNode]) => (
|
|
89
|
+
<StateIndexNode
|
|
90
|
+
key={key}
|
|
91
|
+
node={childNode}
|
|
92
|
+
isOpenState={findViewIsOpenState(childNode.key)}
|
|
93
|
+
typeState={findStateTypeState(childNode)}
|
|
94
|
+
/>
|
|
95
|
+
))
|
|
96
|
+
: null}
|
|
97
|
+
</>
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export const StateIndexNode: FC<{
|
|
102
|
+
node: StateTokenIndex<
|
|
103
|
+
AtomToken<unknown> | ReadonlySelectorToken<unknown> | SelectorToken<unknown>
|
|
104
|
+
>[string]
|
|
105
|
+
isOpenState: AtomToken<boolean>
|
|
106
|
+
typeState: ReadonlySelectorToken<string>
|
|
107
|
+
}> = ({ node, isOpenState, typeState }) => {
|
|
108
|
+
if (node.key.startsWith(`👁🗨`)) {
|
|
109
|
+
return null
|
|
110
|
+
}
|
|
111
|
+
return (
|
|
112
|
+
<section className="node state">
|
|
113
|
+
{`type` in node ? (
|
|
114
|
+
<StateIndexLeafNode
|
|
115
|
+
node={node}
|
|
116
|
+
isOpenState={isOpenState}
|
|
117
|
+
typeState={typeState}
|
|
118
|
+
/>
|
|
119
|
+
) : (
|
|
120
|
+
<StateIndexTreeNode node={node} isOpenState={isOpenState} />
|
|
121
|
+
)}
|
|
122
|
+
</section>
|
|
123
|
+
)
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export const StateIndex: FC<{
|
|
127
|
+
tokenIndex: ReadonlySelectorToken<
|
|
128
|
+
StateTokenIndex<
|
|
129
|
+
| AtomToken<unknown>
|
|
130
|
+
| ReadonlySelectorToken<unknown>
|
|
131
|
+
| SelectorToken<unknown>
|
|
132
|
+
>
|
|
133
|
+
>
|
|
134
|
+
}> = ({ tokenIndex }) => {
|
|
135
|
+
const tokenIds = useO(tokenIndex)
|
|
136
|
+
return (
|
|
137
|
+
<article className="index state_index">
|
|
138
|
+
{Object.entries(tokenIds)
|
|
139
|
+
.filter(([key]) => !key.startsWith(`👁🗨`))
|
|
140
|
+
.sort()
|
|
141
|
+
.map(([key, node]) => {
|
|
142
|
+
return (
|
|
143
|
+
<StateIndexNode
|
|
144
|
+
key={key}
|
|
145
|
+
node={node}
|
|
146
|
+
isOpenState={findViewIsOpenState(node.key)}
|
|
147
|
+
typeState={findStateTypeState(node)}
|
|
148
|
+
/>
|
|
149
|
+
)
|
|
150
|
+
})}
|
|
151
|
+
</article>
|
|
152
|
+
)
|
|
153
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import {
|
|
2
|
+
undo,
|
|
3
|
+
type AtomToken,
|
|
4
|
+
type ReadonlySelectorToken,
|
|
5
|
+
type TimelineToken,
|
|
6
|
+
redo,
|
|
7
|
+
} from "atom.io"
|
|
8
|
+
import { useIO, useO } from "atom.io/react"
|
|
9
|
+
import { Fragment, type FC } from "react"
|
|
10
|
+
|
|
11
|
+
import { findTimelineState, findViewIsOpenState, timelineIndex } from "."
|
|
12
|
+
import { button } from "./Button"
|
|
13
|
+
import { article } from "./Updates"
|
|
14
|
+
import type { Timeline } from "../internal"
|
|
15
|
+
|
|
16
|
+
export const YouAreHere: FC = () => {
|
|
17
|
+
return <span className="you_are_here">you are here</span>
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const TimelineLog: FC<{
|
|
21
|
+
token: TimelineToken
|
|
22
|
+
isOpenState: AtomToken<boolean>
|
|
23
|
+
timelineState: ReadonlySelectorToken<Timeline>
|
|
24
|
+
}> = ({ token, isOpenState, timelineState }) => {
|
|
25
|
+
const timeline = useO(timelineState)
|
|
26
|
+
const [isOpen, setIsOpen] = useIO(isOpenState)
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<section className="node timeline_log">
|
|
30
|
+
<header>
|
|
31
|
+
<button.OpenClose isOpen={isOpen} setIsOpen={setIsOpen} />
|
|
32
|
+
<label>
|
|
33
|
+
<h2>{token.key}</h2>
|
|
34
|
+
<span className="detail length">
|
|
35
|
+
({timeline.at}/{timeline.history.length})
|
|
36
|
+
</span>
|
|
37
|
+
<span className="gap" />
|
|
38
|
+
<nav>
|
|
39
|
+
<button
|
|
40
|
+
type="button"
|
|
41
|
+
onClick={() => undo(token)}
|
|
42
|
+
disabled={timeline.at === 0}
|
|
43
|
+
>
|
|
44
|
+
undo
|
|
45
|
+
</button>
|
|
46
|
+
<button
|
|
47
|
+
type="button"
|
|
48
|
+
onClick={() => redo(token)}
|
|
49
|
+
disabled={timeline.at === timeline.history.length}
|
|
50
|
+
>
|
|
51
|
+
redo
|
|
52
|
+
</button>
|
|
53
|
+
</nav>
|
|
54
|
+
</label>
|
|
55
|
+
</header>
|
|
56
|
+
{isOpen ? (
|
|
57
|
+
<main>
|
|
58
|
+
{timeline.history.map((update, index) => (
|
|
59
|
+
<Fragment key={update.key + index + timeline.at}>
|
|
60
|
+
{index === timeline.at ? <YouAreHere /> : null}
|
|
61
|
+
<article.TimelineUpdate timelineUpdate={update} />
|
|
62
|
+
{index === timeline.history.length - 1 &&
|
|
63
|
+
timeline.at === timeline.history.length ? (
|
|
64
|
+
<YouAreHere />
|
|
65
|
+
) : null}
|
|
66
|
+
</Fragment>
|
|
67
|
+
))}
|
|
68
|
+
</main>
|
|
69
|
+
) : null}
|
|
70
|
+
</section>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export const TimelineIndex: FC = () => {
|
|
75
|
+
const tokenIds = useO(timelineIndex)
|
|
76
|
+
return (
|
|
77
|
+
<article className="index timeline_index">
|
|
78
|
+
{tokenIds
|
|
79
|
+
.filter((token) => !token.key.startsWith(`👁🗨`))
|
|
80
|
+
.map((token) => {
|
|
81
|
+
return (
|
|
82
|
+
<TimelineLog
|
|
83
|
+
key={token.key}
|
|
84
|
+
token={token}
|
|
85
|
+
isOpenState={findViewIsOpenState(token.key)}
|
|
86
|
+
timelineState={findTimelineState(token.key)}
|
|
87
|
+
/>
|
|
88
|
+
)
|
|
89
|
+
})}
|
|
90
|
+
</article>
|
|
91
|
+
)
|
|
92
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AtomToken,
|
|
3
|
+
ReadonlySelectorToken,
|
|
4
|
+
TransactionToken,
|
|
5
|
+
TransactionUpdate,
|
|
6
|
+
} from "atom.io"
|
|
7
|
+
import { useIO, useO } from "atom.io/react"
|
|
8
|
+
import type { FC } from "react"
|
|
9
|
+
|
|
10
|
+
import type { ƒn } from "~/packages/anvl/src/function"
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
findTransactionLogState,
|
|
14
|
+
findViewIsOpenState,
|
|
15
|
+
transactionIndex,
|
|
16
|
+
} from "."
|
|
17
|
+
import { button } from "./Button"
|
|
18
|
+
import { article } from "./Updates"
|
|
19
|
+
|
|
20
|
+
export const TransactionLog: FC<{
|
|
21
|
+
token: TransactionToken<ƒn>
|
|
22
|
+
isOpenState: AtomToken<boolean>
|
|
23
|
+
logState: ReadonlySelectorToken<TransactionUpdate<ƒn>[]>
|
|
24
|
+
}> = ({ token, isOpenState, logState }) => {
|
|
25
|
+
const log = useO(logState)
|
|
26
|
+
const [isOpen, setIsOpen] = useIO(isOpenState)
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<section className="node transaction_log">
|
|
30
|
+
<header>
|
|
31
|
+
<button.OpenClose isOpen={isOpen} setIsOpen={setIsOpen} />
|
|
32
|
+
<label>
|
|
33
|
+
<h2>{token.key}</h2>
|
|
34
|
+
<span className="detail length">({log.length})</span>
|
|
35
|
+
</label>
|
|
36
|
+
</header>
|
|
37
|
+
{isOpen ? (
|
|
38
|
+
<main>
|
|
39
|
+
{log.map((update, index) => (
|
|
40
|
+
<article.TransactionUpdate
|
|
41
|
+
key={update.key + index}
|
|
42
|
+
serialNumber={index}
|
|
43
|
+
transactionUpdate={update}
|
|
44
|
+
/>
|
|
45
|
+
))}
|
|
46
|
+
</main>
|
|
47
|
+
) : null}
|
|
48
|
+
</section>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const TransactionIndex: FC = () => {
|
|
53
|
+
const tokenIds = useO(transactionIndex)
|
|
54
|
+
return (
|
|
55
|
+
<article className="index transaction_index">
|
|
56
|
+
{tokenIds
|
|
57
|
+
.filter((token) => !token.key.startsWith(`👁🗨`))
|
|
58
|
+
.map((token) => {
|
|
59
|
+
return (
|
|
60
|
+
<TransactionLog
|
|
61
|
+
key={token.key}
|
|
62
|
+
token={token}
|
|
63
|
+
isOpenState={findViewIsOpenState(token.key)}
|
|
64
|
+
logState={findTransactionLogState(token.key)}
|
|
65
|
+
/>
|
|
66
|
+
)
|
|
67
|
+
})}
|
|
68
|
+
</article>
|
|
69
|
+
)
|
|
70
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import type { ƒn } from "~/packages/anvl/src/function"
|
|
2
|
+
import { discoverType } from "~/packages/anvl/src/refinement/refinery"
|
|
3
|
+
|
|
4
|
+
import { prettyJson } from "."
|
|
5
|
+
import type { KeyedStateUpdate } from "../subscribe"
|
|
6
|
+
import type { TimelineUpdate } from "../timeline"
|
|
7
|
+
import type { TransactionUpdate } from "../transaction"
|
|
8
|
+
|
|
9
|
+
const AtomUpdateFC: React.FC<{
|
|
10
|
+
serialNumber: number
|
|
11
|
+
atomUpdate: KeyedStateUpdate<unknown>
|
|
12
|
+
}> = ({ atomUpdate }) => {
|
|
13
|
+
return (
|
|
14
|
+
<article
|
|
15
|
+
key={atomUpdate.key}
|
|
16
|
+
className="node atom_update"
|
|
17
|
+
onClick={() => console.log(atomUpdate)}
|
|
18
|
+
onKeyUp={() => console.log(atomUpdate)}
|
|
19
|
+
>
|
|
20
|
+
<span className="detail">{atomUpdate.key}: </span>
|
|
21
|
+
<span>
|
|
22
|
+
<span className="summary">
|
|
23
|
+
{prettyJson.diff(atomUpdate.oldValue, atomUpdate.newValue).summary}
|
|
24
|
+
</span>
|
|
25
|
+
</span>
|
|
26
|
+
</article>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const TransactionUpdateFC: React.FC<{
|
|
31
|
+
serialNumber: number
|
|
32
|
+
transactionUpdate: TransactionUpdate<ƒn>
|
|
33
|
+
}> = ({ serialNumber, transactionUpdate }) => {
|
|
34
|
+
return (
|
|
35
|
+
<article className="node transaction_update">
|
|
36
|
+
<header>
|
|
37
|
+
<h4>{serialNumber}</h4>
|
|
38
|
+
</header>
|
|
39
|
+
<main>
|
|
40
|
+
<section className="transaction_params">
|
|
41
|
+
<span className="detail">params: </span>
|
|
42
|
+
{transactionUpdate.params.map((param, index) => {
|
|
43
|
+
return (
|
|
44
|
+
<article
|
|
45
|
+
key={`param` + index}
|
|
46
|
+
className="node transaction_param"
|
|
47
|
+
onClick={() => console.log(transactionUpdate)}
|
|
48
|
+
onKeyUp={() => console.log(transactionUpdate)}
|
|
49
|
+
>
|
|
50
|
+
<span className="detail">{discoverType(param)}: </span>
|
|
51
|
+
<span className="summary">
|
|
52
|
+
{typeof param === `object` &&
|
|
53
|
+
`type` in param &&
|
|
54
|
+
`target` in param ? (
|
|
55
|
+
<>{JSON.stringify(param.type)}</>
|
|
56
|
+
) : (
|
|
57
|
+
<>{JSON.stringify(param)}</>
|
|
58
|
+
)}
|
|
59
|
+
</span>
|
|
60
|
+
</article>
|
|
61
|
+
)
|
|
62
|
+
})}
|
|
63
|
+
</section>
|
|
64
|
+
<section className="node transaction_output">
|
|
65
|
+
<span className="detail">output: </span>
|
|
66
|
+
<span className="detail">
|
|
67
|
+
{discoverType(transactionUpdate.output)}
|
|
68
|
+
</span>
|
|
69
|
+
{transactionUpdate.output ? (
|
|
70
|
+
<span className="summary">
|
|
71
|
+
: {JSON.stringify(transactionUpdate.output)}
|
|
72
|
+
</span>
|
|
73
|
+
) : null}
|
|
74
|
+
</section>
|
|
75
|
+
<section className="transaction_impact">
|
|
76
|
+
<span className="detail">impact: </span>
|
|
77
|
+
{transactionUpdate.atomUpdates
|
|
78
|
+
.filter((token) => !token.key.startsWith(`👁🗨`))
|
|
79
|
+
.map((atomUpdate, index) => {
|
|
80
|
+
return (
|
|
81
|
+
<article.AtomUpdate
|
|
82
|
+
key={`${transactionUpdate.key}:${index}:${atomUpdate.key}`}
|
|
83
|
+
serialNumber={index}
|
|
84
|
+
atomUpdate={atomUpdate}
|
|
85
|
+
/>
|
|
86
|
+
)
|
|
87
|
+
})}
|
|
88
|
+
</section>
|
|
89
|
+
</main>
|
|
90
|
+
</article>
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export const TimelineUpdateFC: React.FC<{
|
|
95
|
+
timelineUpdate: TimelineUpdate
|
|
96
|
+
}> = ({ timelineUpdate }) => {
|
|
97
|
+
return (
|
|
98
|
+
<article className="node timeline_update">
|
|
99
|
+
<header>
|
|
100
|
+
<h4>
|
|
101
|
+
{timelineUpdate.timestamp}: {timelineUpdate.type} ({timelineUpdate.key}
|
|
102
|
+
)
|
|
103
|
+
</h4>
|
|
104
|
+
</header>
|
|
105
|
+
<main>
|
|
106
|
+
{timelineUpdate.type === `transaction_update` ? (
|
|
107
|
+
timelineUpdate.atomUpdates
|
|
108
|
+
.filter((token) => !token.key.startsWith(`👁🗨`))
|
|
109
|
+
.map((atomUpdate, index) => {
|
|
110
|
+
return (
|
|
111
|
+
<article.AtomUpdate
|
|
112
|
+
key={`${timelineUpdate.key}:${index}:${atomUpdate.key}`}
|
|
113
|
+
serialNumber={index}
|
|
114
|
+
atomUpdate={atomUpdate}
|
|
115
|
+
/>
|
|
116
|
+
)
|
|
117
|
+
})
|
|
118
|
+
) : timelineUpdate.type === `selector_update` ? (
|
|
119
|
+
timelineUpdate.atomUpdates
|
|
120
|
+
.filter((token) => !token.key.startsWith(`👁🗨`))
|
|
121
|
+
.map((atomUpdate, index) => {
|
|
122
|
+
return (
|
|
123
|
+
<article.AtomUpdate
|
|
124
|
+
key={`${timelineUpdate.key}:${index}:${atomUpdate.key}`}
|
|
125
|
+
serialNumber={index}
|
|
126
|
+
atomUpdate={atomUpdate}
|
|
127
|
+
/>
|
|
128
|
+
)
|
|
129
|
+
})
|
|
130
|
+
) : timelineUpdate.type === `atom_update` ? (
|
|
131
|
+
<article.AtomUpdate
|
|
132
|
+
serialNumber={timelineUpdate.timestamp}
|
|
133
|
+
atomUpdate={timelineUpdate}
|
|
134
|
+
/>
|
|
135
|
+
) : null}
|
|
136
|
+
</main>
|
|
137
|
+
</article>
|
|
138
|
+
)
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export const article = {
|
|
142
|
+
AtomUpdate: AtomUpdateFC,
|
|
143
|
+
TransactionUpdate: TransactionUpdateFC,
|
|
144
|
+
TimelineUpdate: TimelineUpdateFC,
|
|
145
|
+
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
main.atom_io_devtools {
|
|
2
2
|
--fg-color: #eee;
|
|
3
3
|
--bg-color: #111;
|
|
4
|
+
--bg-tint1: #222;
|
|
5
|
+
--fg-border: 1px solid var(--fg-color);
|
|
4
6
|
@media (prefers-color-scheme: light) {
|
|
5
|
-
--fg-color: #
|
|
6
|
-
--bg-color: #
|
|
7
|
+
--fg-color: #444;
|
|
8
|
+
--bg-color: #ddd;
|
|
9
|
+
--bg-tint1: #e3e3e3;
|
|
7
10
|
}
|
|
8
11
|
box-sizing: border-box;
|
|
9
12
|
color: var(--fg-color);
|
|
@@ -17,31 +20,208 @@ main.atom_io_devtools {
|
|
|
17
20
|
flex-flow: column;
|
|
18
21
|
max-height: 800px;
|
|
19
22
|
width: 100%;
|
|
20
|
-
max-width:
|
|
23
|
+
max-width: 500px;
|
|
21
24
|
overflow-y: scroll;
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
* {
|
|
26
|
+
font-size: 16px;
|
|
27
|
+
font-family: theia, monospace;
|
|
28
|
+
}
|
|
29
|
+
> header {
|
|
30
|
+
padding: 5px;
|
|
31
|
+
padding-left: 10px;
|
|
32
|
+
padding-bottom: 0;
|
|
24
33
|
display: flex;
|
|
25
34
|
justify-content: space-between;
|
|
26
35
|
h1 {
|
|
27
36
|
font-size: inherit;
|
|
28
37
|
margin: 0;
|
|
38
|
+
font-size: 24px;
|
|
39
|
+
font-family: charter;
|
|
40
|
+
}
|
|
41
|
+
nav {
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-flow: row nowrap;
|
|
44
|
+
button {
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
background: none;
|
|
47
|
+
border: none;
|
|
48
|
+
padding: none;
|
|
49
|
+
margin-bottom: -2px;
|
|
50
|
+
z-index: 1000;
|
|
51
|
+
&:disabled {
|
|
52
|
+
cursor: default;
|
|
53
|
+
background-color: var(--bg-tint1);
|
|
54
|
+
color: var(--fg-color);
|
|
55
|
+
border: var(--fg-border);
|
|
56
|
+
border-bottom: none;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
29
59
|
}
|
|
30
60
|
}
|
|
61
|
+
> main {
|
|
62
|
+
background: var(--bg-tint1);
|
|
63
|
+
}
|
|
31
64
|
main {
|
|
32
65
|
overflow-y: scroll;
|
|
33
66
|
flex-grow: 1;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
67
|
+
display: flex;
|
|
68
|
+
flex-flow: column;
|
|
69
|
+
gap: 0;
|
|
70
|
+
article.index {
|
|
71
|
+
.node .node {
|
|
72
|
+
border-right: var(--fg-border);
|
|
73
|
+
padding-right: 0;
|
|
74
|
+
background: #fff3;
|
|
75
|
+
}
|
|
76
|
+
.node > .node {
|
|
77
|
+
margin: 5px 0;
|
|
78
|
+
margin-left: 12px;
|
|
79
|
+
border-left: var(--fg-border);
|
|
39
80
|
}
|
|
40
81
|
.node {
|
|
41
|
-
border:
|
|
42
|
-
padding: 5px;
|
|
43
|
-
margin: 5px;
|
|
82
|
+
border-top: var(--fg-border);
|
|
44
83
|
overflow-x: scroll;
|
|
84
|
+
padding: 5px;
|
|
85
|
+
&:last-of-type {
|
|
86
|
+
border-bottom: var(--fg-border);
|
|
87
|
+
}
|
|
88
|
+
&.transaction_update {
|
|
89
|
+
padding: 0;
|
|
90
|
+
}
|
|
91
|
+
header {
|
|
92
|
+
display: flex;
|
|
93
|
+
flex-flow: row;
|
|
94
|
+
gap: 5px;
|
|
95
|
+
position: sticky;
|
|
96
|
+
z-index: 999;
|
|
97
|
+
top: 0;
|
|
98
|
+
button.carat {
|
|
99
|
+
cursor: pointer;
|
|
100
|
+
background: none;
|
|
101
|
+
border: none;
|
|
102
|
+
width: 20px;
|
|
103
|
+
&.open {
|
|
104
|
+
transform: rotate(90deg);
|
|
105
|
+
}
|
|
106
|
+
&:disabled {
|
|
107
|
+
cursor: default;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
label {
|
|
111
|
+
display: flex;
|
|
112
|
+
flex-flow: row;
|
|
113
|
+
gap: 5px;
|
|
114
|
+
cursor: help;
|
|
115
|
+
h2 {
|
|
116
|
+
display: inline-block;
|
|
117
|
+
margin: 0;
|
|
118
|
+
}
|
|
119
|
+
.detail {
|
|
120
|
+
color: #777;
|
|
121
|
+
@media (prefers-color-scheme: light) {
|
|
122
|
+
color: #999;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
main {
|
|
128
|
+
margin-left: 15px;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
section.transaction_log {
|
|
132
|
+
margin-top: 0;
|
|
133
|
+
header: {
|
|
134
|
+
padding: 5px;
|
|
135
|
+
}
|
|
136
|
+
main {
|
|
137
|
+
display: flex;
|
|
138
|
+
flex-flow: row wrap;
|
|
139
|
+
gap: 5px;
|
|
140
|
+
.transaction_update {
|
|
141
|
+
width: 100%;
|
|
142
|
+
display: flex;
|
|
143
|
+
flex-flow: row;
|
|
144
|
+
align-items: flex-start;
|
|
145
|
+
justify-content: flex-start;
|
|
146
|
+
justify-items: flex-start;
|
|
147
|
+
align-content: flex-start;
|
|
148
|
+
border-left: var(--fg-border);
|
|
149
|
+
border-top: var(--fg-border);
|
|
150
|
+
header {
|
|
151
|
+
padding: 5px;
|
|
152
|
+
h4 {
|
|
153
|
+
margin: 0;
|
|
154
|
+
padding: 0;
|
|
155
|
+
font-size: inherit;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
main {
|
|
159
|
+
margin-left: 0;
|
|
160
|
+
display: flex;
|
|
161
|
+
flex-flow: column;
|
|
162
|
+
gap: 0px;
|
|
163
|
+
border-left: 1px solid #333;
|
|
164
|
+
section ~ section {
|
|
165
|
+
border-top: 1px solid #333;
|
|
166
|
+
}
|
|
167
|
+
section {
|
|
168
|
+
padding: 5px;
|
|
169
|
+
&.transaction_output {
|
|
170
|
+
border-right: none;
|
|
171
|
+
}
|
|
172
|
+
&.transaction_impact {
|
|
173
|
+
padding: 5px;
|
|
174
|
+
}
|
|
175
|
+
margin: 0;
|
|
176
|
+
article {
|
|
177
|
+
border-left: var(--fg-border);
|
|
178
|
+
border-right: var(--fg-border);
|
|
179
|
+
.summary {
|
|
180
|
+
white-space: nowrap;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
section.timeline_log {
|
|
189
|
+
header {
|
|
190
|
+
display: flex;
|
|
191
|
+
label {
|
|
192
|
+
display: flex;
|
|
193
|
+
width: 100%;
|
|
194
|
+
flex-grow: 1;
|
|
195
|
+
.gap {
|
|
196
|
+
flex-grow: 1;
|
|
197
|
+
}
|
|
198
|
+
nav {
|
|
199
|
+
display: flex;
|
|
200
|
+
flex-flow: row nowrap;
|
|
201
|
+
gap: 5px;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
.timeline_update {
|
|
206
|
+
padding: 5px;
|
|
207
|
+
border-left: var(--fg-border);
|
|
208
|
+
h4 {
|
|
209
|
+
margin: 0;
|
|
210
|
+
padding: 0;
|
|
211
|
+
font-size: inherit;
|
|
212
|
+
}
|
|
213
|
+
main {
|
|
214
|
+
margin: 0;
|
|
215
|
+
.node.atom_update {
|
|
216
|
+
border-left: var(--fg-border);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
.you_are_here {
|
|
221
|
+
background: var(--fg-color);
|
|
222
|
+
color: var(--bg-color);
|
|
223
|
+
text-align: center;
|
|
224
|
+
}
|
|
45
225
|
}
|
|
46
226
|
}
|
|
47
227
|
}
|
|
@@ -61,7 +241,7 @@ main.atom_io_devtools {
|
|
|
61
241
|
|
|
62
242
|
.json_editor {
|
|
63
243
|
input {
|
|
64
|
-
font-size: 20px;
|
|
244
|
+
// font-size: 20px;
|
|
65
245
|
font-family: theia;
|
|
66
246
|
border: none;
|
|
67
247
|
border-bottom: 1px solid;
|
|
@@ -106,6 +286,7 @@ main.atom_io_devtools {
|
|
|
106
286
|
background-color: #f055;
|
|
107
287
|
}
|
|
108
288
|
.json_editor_key {
|
|
289
|
+
padding-right: 10px;
|
|
109
290
|
input {
|
|
110
291
|
color: #999;
|
|
111
292
|
@media (prefers-color-scheme: light) {
|
|
@@ -121,7 +302,7 @@ main.atom_io_devtools {
|
|
|
121
302
|
}
|
|
122
303
|
.json_editor_properties {
|
|
123
304
|
> * {
|
|
124
|
-
border-bottom:
|
|
305
|
+
border-bottom: var(--fg-border);
|
|
125
306
|
margin-bottom: 2px;
|
|
126
307
|
}
|
|
127
308
|
}
|