@tinyactors/scxmljs 0.1.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/LICENSE +21 -0
- package/README.md +174 -0
- package/THIRD_PARTY_NOTICES +63 -0
- package/dist/bridge.d.ts +44 -0
- package/dist/bridge.js +254 -0
- package/dist/bridge.js.map +1 -0
- package/dist/clock.d.ts +113 -0
- package/dist/clock.js +310 -0
- package/dist/clock.js.map +1 -0
- package/dist/common.d.ts +15 -0
- package/dist/common.js +14 -0
- package/dist/common.js.map +1 -0
- package/dist/datamodel-base.d.ts +122 -0
- package/dist/datamodel-base.js +268 -0
- package/dist/datamodel-base.js.map +1 -0
- package/dist/datamodel-quickjs.d.ts +21 -0
- package/dist/datamodel-quickjs.js +286 -0
- package/dist/datamodel-quickjs.js.map +1 -0
- package/dist/datamodel-trusted.d.ts +1 -0
- package/dist/datamodel-trusted.js +149 -0
- package/dist/datamodel-trusted.js.map +1 -0
- package/dist/diagnostics.d.ts +39 -0
- package/dist/diagnostics.js +154 -0
- package/dist/diagnostics.js.map +1 -0
- package/dist/element-events.d.ts +85 -0
- package/dist/element-events.js +129 -0
- package/dist/element-events.js.map +1 -0
- package/dist/events.d.ts +31 -0
- package/dist/events.js +33 -0
- package/dist/events.js.map +1 -0
- package/dist/explorer/element.d.ts +150 -0
- package/dist/explorer/element.js +1791 -0
- package/dist/explorer/element.js.map +1 -0
- package/dist/explorer/layout.d.ts +43 -0
- package/dist/explorer/layout.js +50 -0
- package/dist/explorer/layout.js.map +1 -0
- package/dist/explorer/strings.d.ts +275 -0
- package/dist/explorer/strings.js +135 -0
- package/dist/explorer/strings.js.map +1 -0
- package/dist/explorer/styles.d.ts +10 -0
- package/dist/explorer/styles.js +265 -0
- package/dist/explorer/styles.js.map +1 -0
- package/dist/explorer/viewmodel.d.ts +284 -0
- package/dist/explorer/viewmodel.js +481 -0
- package/dist/explorer/viewmodel.js.map +1 -0
- package/dist/explorer.d.ts +21 -0
- package/dist/explorer.js +22 -0
- package/dist/explorer.js.map +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -0
- package/dist/model.d.ts +157 -0
- package/dist/model.js +485 -0
- package/dist/model.js.map +1 -0
- package/dist/session-events.d.ts +136 -0
- package/dist/session-events.js +114 -0
- package/dist/session-events.js.map +1 -0
- package/dist/session.d.ts +412 -0
- package/dist/session.js +1399 -0
- package/dist/session.js.map +1 -0
- package/dist/themes/tinyactors.css +44 -0
- package/dist/trusted.d.ts +15 -0
- package/dist/trusted.js +30 -0
- package/dist/trusted.js.map +1 -0
- package/dist/ui/announcer.d.ts +22 -0
- package/dist/ui/announcer.js +31 -0
- package/dist/ui/announcer.js.map +1 -0
- package/dist/ui/svg.d.ts +8 -0
- package/dist/ui/svg.js +29 -0
- package/dist/ui/svg.js.map +1 -0
- package/dist/ui/theme.d.ts +34 -0
- package/dist/ui/theme.js +151 -0
- package/dist/ui/theme.js.map +1 -0
- package/dist/view/element.d.ts +172 -0
- package/dist/view/element.js +1045 -0
- package/dist/view/element.js.map +1 -0
- package/dist/view/layout.d.ts +154 -0
- package/dist/view/layout.js +1122 -0
- package/dist/view/layout.js.map +1 -0
- package/dist/view/strings.d.ts +72 -0
- package/dist/view/strings.js +48 -0
- package/dist/view/strings.js.map +1 -0
- package/dist/view/styles.d.ts +1 -0
- package/dist/view/styles.js +115 -0
- package/dist/view/styles.js.map +1 -0
- package/dist/view.d.ts +20 -0
- package/dist/view.js +21 -0
- package/dist/view.js.map +1 -0
- package/package.json +87 -0
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layout and component styles of <scxml-explorer>. Colours, type and shape
|
|
3
|
+
* come from the shared theme (src/ui/theme.ts): the `--scxml-*` token
|
|
4
|
+
* contract with neutral defaults, adopted before this sheet. Below
|
|
5
|
+
* NARROW_WIDTH (shared with the element and `<scxml-view>`) the explorer
|
|
6
|
+
* shows one pane with tabs.
|
|
7
|
+
*/
|
|
8
|
+
import { NARROW_WIDTH } from "../ui/theme.js";
|
|
9
|
+
export { NARROW_WIDTH };
|
|
10
|
+
export const EXPLORER_CSS = /* css */ `
|
|
11
|
+
:host {
|
|
12
|
+
display: block; container-type: inline-size; container-name: explorer;
|
|
13
|
+
background: var(--x-bg);
|
|
14
|
+
border: 1px solid var(--x-b2); border-radius: var(--x-r); overflow: hidden;
|
|
15
|
+
height: var(--scxml-height, min(860px, calc(100dvh - 32px)));
|
|
16
|
+
}
|
|
17
|
+
/* ── shell ─────────────────────────────────────────────── */
|
|
18
|
+
.shell { display: grid; grid-template-rows: auto auto 1fr; grid-template-columns: minmax(0, 1fr); height: 100%; }
|
|
19
|
+
.shell > .playback[hidden] { display: none; }
|
|
20
|
+
.playback {
|
|
21
|
+
display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; padding: 6px 12px;
|
|
22
|
+
background: var(--x-s2); border-bottom: 1px solid var(--x-b2); font: 12px var(--x-sans); color: var(--x-fg2);
|
|
23
|
+
}
|
|
24
|
+
.playback .play, .playback .step {
|
|
25
|
+
height: 28px; padding: 0 12px; border-radius: var(--x-r); cursor: pointer; font: 500 12.5px var(--x-sans);
|
|
26
|
+
border: 1px solid var(--x-b2); background: var(--x-s1); color: var(--x-fg1);
|
|
27
|
+
}
|
|
28
|
+
.playback .play { min-width: 86px; background: var(--x-accent); border-color: var(--x-accent); color: var(--x-on-accent); }
|
|
29
|
+
.playback .play[aria-pressed="true"] { background: var(--x-s1); color: var(--x-fg1); border-color: var(--x-b2); }
|
|
30
|
+
.playback .step:hover:not(:disabled) { border-color: var(--x-accent); color: var(--x-accent-fg); }
|
|
31
|
+
.playback .step:disabled { opacity: .45; cursor: default; }
|
|
32
|
+
.playback .clock-time { font: 500 12px var(--x-mono); color: var(--x-fg1); font-variant-numeric: tabular-nums; min-width: 8ch; }
|
|
33
|
+
.playback .clock-queue { font: 11.5px var(--x-mono); color: var(--x-fg3); }
|
|
34
|
+
.playback .last-step { flex: 1 1 200px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 11.5px var(--x-mono); color: var(--x-accent-fg); text-align: right; }
|
|
35
|
+
@container explorer (max-width: ${NARROW_WIDTH}px) {
|
|
36
|
+
.playback { gap: 6px 8px; padding: 6px 10px; }
|
|
37
|
+
.playback .last-step { flex-basis: 100%; text-align: left; }
|
|
38
|
+
.playback .clock-queue { display: none; }
|
|
39
|
+
}
|
|
40
|
+
.top {
|
|
41
|
+
display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 12px;
|
|
42
|
+
background: var(--x-s1); border-bottom: 1px solid var(--x-b2);
|
|
43
|
+
}
|
|
44
|
+
.levels { display: inline-flex; border: 1px solid var(--x-b2); border-radius: var(--x-r); overflow: hidden; flex: none; }
|
|
45
|
+
.levels button { border: 0; background: none; padding: 4px 10px; cursor: pointer; font: 500 11px/1.4 var(--x-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--x-fg3); }
|
|
46
|
+
.levels button[aria-pressed="true"] { background: var(--x-accent); color: var(--x-on-accent); }
|
|
47
|
+
.crumbs { display: flex; align-items: center; gap: 2px; min-width: 0; flex: 1; overflow: hidden; }
|
|
48
|
+
.crumbs button { border: 0; background: none; padding: 3px 5px; border-radius: var(--x-r); cursor: pointer; color: var(--x-fg2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 22ch; }
|
|
49
|
+
.crumbs button:hover { background: var(--x-s2); color: var(--x-fg1); }
|
|
50
|
+
.crumbs button[aria-current] { color: var(--x-fg1); font-weight: 600; }
|
|
51
|
+
.crumbs .sep { color: var(--x-fg4); flex: none; }
|
|
52
|
+
.follow { display: inline-flex; align-items: center; gap: 6px; flex: none; cursor: pointer; color: var(--x-fg2); font: 500 11px var(--x-mono); letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--x-b2); border-radius: 999px; padding: 3px 10px; background: none; }
|
|
53
|
+
/* off: a hollow ring; on: a filled dot (shape, not only colour) */
|
|
54
|
+
.follow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; box-sizing: border-box; border: 1.5px solid var(--x-fg3); background: transparent; }
|
|
55
|
+
.follow[aria-pressed="true"] { color: var(--x-run); border-color: color-mix(in srgb, var(--x-run) 40%, transparent); }
|
|
56
|
+
.follow[aria-pressed="true"]::before { border-color: var(--x-run); background: var(--x-run); box-shadow: 0 0 0 3px color-mix(in srgb, var(--x-run) 20%, transparent); }
|
|
57
|
+
|
|
58
|
+
.body { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(280px, 360px); min-height: 0; }
|
|
59
|
+
.pane { min-height: 0; min-width: 0; display: flex; flex-direction: column; }
|
|
60
|
+
.pane + .pane { border-left: 1px solid var(--x-b2); }
|
|
61
|
+
.pane-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 8px; flex: none; }
|
|
62
|
+
.pane-title { font: 500 10.5px/1 var(--x-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--x-fg3); flex: 1; }
|
|
63
|
+
.pane-scroll { overflow: auto; min-height: 0; flex: 1; overscroll-behavior: contain; }
|
|
64
|
+
.center { background: var(--x-bg); }
|
|
65
|
+
.center .pane-scroll { padding: 4px 16px 24px; }
|
|
66
|
+
.inspector { background: var(--x-s1); }
|
|
67
|
+
.tree-pane { background: var(--x-s1); }
|
|
68
|
+
.tabs { display: none; }
|
|
69
|
+
.events-strip { display: none; }
|
|
70
|
+
|
|
71
|
+
/* narrow container: one pane at a time, bottom tabs, sticky events strip */
|
|
72
|
+
@container explorer (max-width: ${NARROW_WIDTH}px) {
|
|
73
|
+
.body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto auto; }
|
|
74
|
+
.pane { display: none; }
|
|
75
|
+
.pane + .pane { border-left: 0; }
|
|
76
|
+
.pane[data-tab-active] { display: flex; }
|
|
77
|
+
.tabs { display: flex; border-top: 1px solid var(--x-b2); background: var(--x-s1); }
|
|
78
|
+
.tabs button { flex: 1; border: 0; background: none; padding: 9px 4px 10px; cursor: pointer; font: 500 10.5px var(--x-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--x-fg3); }
|
|
79
|
+
.tabs button[aria-selected="true"] { color: var(--x-accent-fg); box-shadow: inset 0 2px 0 var(--x-accent); }
|
|
80
|
+
.events-strip { display: flex; gap: 6px; padding: 8px 12px; min-width: 0; overflow-x: auto; background: var(--x-s1); border-top: 1px solid var(--x-b1); scrollbar-width: none; }
|
|
81
|
+
.events-strip > * { flex: none; max-width: 70vw; }
|
|
82
|
+
.crumbs { overflow-x: auto; scrollbar-width: none; }
|
|
83
|
+
.crumbs button { max-width: 14ch; }
|
|
84
|
+
.levels { display: none; }
|
|
85
|
+
.center .pane-scroll { padding: 4px 12px 20px; }
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* ── tree (windowed) ───────────────────────────────────── */
|
|
89
|
+
.tree-viewport { position: relative; }
|
|
90
|
+
.tree-row {
|
|
91
|
+
position: absolute; left: 0; right: 0; height: var(--x-row); display: flex; align-items: center; gap: 2px;
|
|
92
|
+
padding-right: 8px; cursor: pointer; white-space: nowrap; border-left: 2px solid transparent;
|
|
93
|
+
}
|
|
94
|
+
.tree-row:hover { background: var(--x-s2); }
|
|
95
|
+
.tree-row[aria-selected="true"] { background: var(--x-accent-subtle); border-left-color: var(--x-accent); }
|
|
96
|
+
.tree-row .twisty { width: 18px; height: 18px; flex: none; border: 0; background: none; padding: 0; cursor: pointer; color: var(--x-fg3); font-size: 10px; }
|
|
97
|
+
.tree-row .twisty[hidden] { visibility: hidden; display: inline-block; }
|
|
98
|
+
.tree-row .name { overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
|
|
99
|
+
.tree-row.path .name { font-weight: 600; }
|
|
100
|
+
.tree-row.active .name { color: var(--x-run); font-weight: 600; }
|
|
101
|
+
.tree-row.match .name { text-decoration: underline; text-decoration-color: var(--x-accent); text-underline-offset: 3px; }
|
|
102
|
+
.tree-row .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--x-run); flex: none; margin-left: 4px; }
|
|
103
|
+
.tree-row:focus-visible { outline-offset: -2px; }
|
|
104
|
+
|
|
105
|
+
/* ── focus ─────────────────────────────────────────────── */
|
|
106
|
+
.mode { display: inline-flex; border: 1px solid var(--x-b2); border-radius: var(--x-r); overflow: hidden; }
|
|
107
|
+
.mode button { border: 0; background: none; padding: 3px 8px; cursor: pointer; font: 11px var(--x-sans); color: var(--x-fg3); }
|
|
108
|
+
.mode button[aria-pressed="true"] { background: var(--x-s3); color: var(--x-fg1); }
|
|
109
|
+
.diagram { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 230px); justify-content: start; gap: 22px 128px; align-items: start; padding: 6px 2px 10px 16px; }
|
|
110
|
+
.rank { display: flex; flex-direction: column; gap: 14px; }
|
|
111
|
+
.edges { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
|
|
112
|
+
.edges path { fill: none; stroke: var(--x-fg4); stroke-width: 1.25; }
|
|
113
|
+
.edges path.live { stroke: var(--x-accent); stroke-width: 1.75; }
|
|
114
|
+
.edges path.back { stroke-dasharray: 4 3; }
|
|
115
|
+
.edges marker path { fill: context-stroke; stroke: none; }
|
|
116
|
+
.edge-label {
|
|
117
|
+
position: absolute; transform: translate(-50%, -50%); z-index: 1; pointer-events: auto;
|
|
118
|
+
font: 11px/1.3 var(--x-mono); background: var(--x-bg); color: var(--x-fg2); padding: 1px 6px; border: 1px solid var(--x-b1); border-radius: 999px; white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; cursor: help;
|
|
119
|
+
}
|
|
120
|
+
.edge-label.live { color: var(--x-accent-fg); border-color: color-mix(in srgb, var(--x-accent) 40%, transparent); }
|
|
121
|
+
/* labels that found no free spot collapse to their event count and open on hover / focus */
|
|
122
|
+
.edge-label .short { display: none; }
|
|
123
|
+
.edge-label.collapsed .full { display: none; }
|
|
124
|
+
.edge-label.collapsed .short { display: inline; }
|
|
125
|
+
.edge-label.collapsed:is(:hover, :focus-visible) { z-index: 3; max-width: 240px; }
|
|
126
|
+
.edge-label.collapsed:is(:hover, :focus-visible) .full { display: inline; }
|
|
127
|
+
.edge-label.collapsed:is(:hover, :focus-visible) .short { display: none; }
|
|
128
|
+
|
|
129
|
+
.card {
|
|
130
|
+
position: relative; background: var(--x-s1); border: 1px solid var(--x-strong); border-radius: var(--x-r);
|
|
131
|
+
padding: 8px 10px 9px; display: grid; gap: 5px; cursor: pointer; transition: border-color var(--x-dur), background var(--x-dur), box-shadow var(--x-dur);
|
|
132
|
+
}
|
|
133
|
+
.card:hover { box-shadow: 0 1px 0 var(--x-b2), 0 4px 14px rgba(40, 30, 20, .08); }
|
|
134
|
+
.card.path { border-color: var(--x-run); box-shadow: inset 0 0 0 1px var(--x-run); }
|
|
135
|
+
.card.active { background: var(--x-run-bg); }
|
|
136
|
+
.card.waiting { border-color: var(--x-wait); box-shadow: inset 0 0 0 1px var(--x-wait); background: var(--x-wait-bg); }
|
|
137
|
+
.card.final { border-radius: 999px; border-style: double; border-width: 3px; padding: 5px 14px; }
|
|
138
|
+
.card.selected { outline: 2px solid var(--x-accent); outline-offset: 2px; }
|
|
139
|
+
.card-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
|
|
140
|
+
.card-head .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
|
|
141
|
+
.card.path .card-head .name { color: var(--x-run); }
|
|
142
|
+
.card.waiting .card-head .name { color: var(--x-wait); }
|
|
143
|
+
.card .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--x-fg3); font-size: 11.5px; }
|
|
144
|
+
.card .events { display: flex; gap: 4px; flex-wrap: wrap; }
|
|
145
|
+
.card .events .chip { font-size: 10.5px; padding: 1px 6px; }
|
|
146
|
+
.drill { border: 0; background: none; padding: 0; cursor: pointer; color: var(--x-accent-fg); font: 500 11.5px var(--x-sans); }
|
|
147
|
+
.drill:hover { text-decoration: underline; }
|
|
148
|
+
.initial-mark { position: absolute; left: -13px; top: 13px; width: 8px; height: 8px; border-radius: 50%; background: var(--x-fg1); }
|
|
149
|
+
.initial-mark::after { content: ""; position: absolute; left: 8px; top: 3.5px; width: 5px; border-top: 1.5px solid var(--x-fg1); }
|
|
150
|
+
|
|
151
|
+
.lanes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
|
|
152
|
+
.lane { border: 1px dashed var(--x-strong); border-radius: var(--x-r); background: var(--x-s1); padding: 8px 10px; min-width: 0; }
|
|
153
|
+
.lane.path { border-color: var(--x-run); border-style: solid; }
|
|
154
|
+
.lane-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
|
|
155
|
+
.lane-head .name { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
|
|
156
|
+
.lane.path .lane-head .name { color: var(--x-run); }
|
|
157
|
+
.lane-row { display: flex; align-items: center; gap: 6px; padding: 3px 6px; margin: 0 -6px; border-radius: var(--x-r); cursor: pointer; }
|
|
158
|
+
.lane-row:hover { background: var(--x-s2); }
|
|
159
|
+
.lane-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
160
|
+
.lane-row.active .name { color: var(--x-run); font-weight: 600; }
|
|
161
|
+
|
|
162
|
+
.list { display: grid; gap: 1px; background: var(--x-b1); border: 1px solid var(--x-b1); border-radius: var(--x-r); overflow: hidden; }
|
|
163
|
+
.list-row { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 4px 8px; align-items: center; padding: 7px 10px; background: var(--x-s1); cursor: pointer; }
|
|
164
|
+
.list-row:hover { background: var(--x-s2); }
|
|
165
|
+
.list-row.path { background: color-mix(in srgb, var(--x-run-bg) 55%, var(--x-s1)); }
|
|
166
|
+
.list-row .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
167
|
+
.list-row.path .name { color: var(--x-run); font-weight: 600; }
|
|
168
|
+
.list-row .sub { grid-column: 2 / -1; display: flex; gap: 4px; flex-wrap: wrap; color: var(--x-fg3); font-size: 11.5px; }
|
|
169
|
+
.list-group { font: 500 10.5px var(--x-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--x-fg3); padding: 8px 10px 4px; background: var(--x-bg); }
|
|
170
|
+
|
|
171
|
+
.doors { display: grid; gap: 6px; }
|
|
172
|
+
.door { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: baseline; padding: 6px 10px; border: 1px solid var(--x-b1); border-left: 3px solid var(--x-strong); border-radius: var(--x-r); background: var(--x-s1); cursor: pointer; }
|
|
173
|
+
.door:hover { border-color: var(--x-b2); border-left-color: var(--x-accent); }
|
|
174
|
+
.door .arrow { font: 13px var(--x-mono); color: var(--x-fg3); }
|
|
175
|
+
.door .where { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
176
|
+
.door .where small { font-weight: 400; color: var(--x-fg3); }
|
|
177
|
+
.door .events { grid-column: 2; display: flex; gap: 4px; flex-wrap: wrap; }
|
|
178
|
+
.door.live { border-left-color: var(--x-accent); }
|
|
179
|
+
|
|
180
|
+
/* ── events ────────────────────────────────────────────── */
|
|
181
|
+
.scopes { display: flex; gap: 4px; padding: 0 12px 8px; flex-wrap: wrap; }
|
|
182
|
+
.scopes button { border: 1px solid var(--x-b2); background: none; border-radius: 999px; padding: 2px 9px; cursor: pointer; font: 11.5px var(--x-sans); color: var(--x-fg2); }
|
|
183
|
+
.scopes button[aria-pressed="true"] { background: var(--x-fg1); color: var(--x-s1); border-color: var(--x-fg1); }
|
|
184
|
+
.ev-group > summary { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; padding: 7px 12px; font: 500 11px var(--x-mono); letter-spacing: .06em; color: var(--x-fg2); border-top: 1px solid var(--x-b1); }
|
|
185
|
+
.ev-group > summary::-webkit-details-marker { display: none; }
|
|
186
|
+
.ev-group > summary::before { content: "▸"; font-size: 9px; color: var(--x-fg4); transition: transform var(--x-dur); }
|
|
187
|
+
.ev-group[open] > summary::before { transform: rotate(90deg); }
|
|
188
|
+
.ev-group > summary .count { margin-left: auto; }
|
|
189
|
+
.ev-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding: 6px 12px 7px 26px; align-items: center; }
|
|
190
|
+
.ev-row:hover { background: var(--x-s2); }
|
|
191
|
+
.ev-row .ev { font: 500 12px var(--x-mono); color: var(--x-accent-fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
192
|
+
.ev-row .how { grid-column: 1; color: var(--x-fg3); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
193
|
+
.ev-row .how .guard { font: 11px var(--x-mono); color: var(--x-wait); }
|
|
194
|
+
.ev-row .send { grid-row: 1 / span 2; grid-column: 2; border: 1px solid var(--x-b2); background: var(--x-s1); border-radius: var(--x-r); height: 26px; padding: 0 9px; cursor: pointer; font: 500 12px var(--x-sans); }
|
|
195
|
+
.ev-row .send:hover { border-color: var(--x-accent); color: var(--x-accent-fg); }
|
|
196
|
+
.ev-row .send:disabled { opacity: .45; cursor: default; }
|
|
197
|
+
.ev-row .scope-tag { font: 500 10px var(--x-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--x-fg3); border: 1px solid var(--x-b2); border-radius: var(--x-r); padding: 0 4px; margin-right: 4px; }
|
|
198
|
+
.ev-row.scope-inherited .ev { color: var(--x-fg2); }
|
|
199
|
+
.ev-row.scope-elsewhere .ev { color: var(--x-fg3); }
|
|
200
|
+
.data-field { display: flex; gap: 6px; align-items: center; padding: 0 12px 8px; }
|
|
201
|
+
.data-field span { font: 500 10px var(--x-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--x-fg3); }
|
|
202
|
+
.data-field input { flex: 1; min-width: 0; height: 26px; padding: 0 8px; font: 11.5px var(--x-mono); border: 1px solid var(--x-b2); border-radius: var(--x-r); background: var(--x-s1); color: var(--x-fg1); }
|
|
203
|
+
|
|
204
|
+
/* ── detail ────────────────────────────────────────────── */
|
|
205
|
+
.detail { padding: 0 12px 16px; }
|
|
206
|
+
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; font-size: 12.5px; margin: 0; }
|
|
207
|
+
.kv dt { color: var(--x-fg3); }
|
|
208
|
+
.kv dd { margin: 0; font-family: var(--x-mono); font-size: 12px; overflow-wrap: anywhere; }
|
|
209
|
+
table.tx { width: 100%; border-collapse: collapse; font-size: 12px; }
|
|
210
|
+
table.tx th { text-align: left; font: 500 10px var(--x-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--x-fg3); padding: 4px 6px; border-bottom: 1px solid var(--x-b2); position: sticky; top: 0; background: var(--x-s1); }
|
|
211
|
+
table.tx td { padding: 5px 6px; border-bottom: 1px solid var(--x-b1); vertical-align: top; }
|
|
212
|
+
table.tx td.ev { font-family: var(--x-mono); color: var(--x-accent-fg); overflow-wrap: anywhere; }
|
|
213
|
+
table.tx td.cond { font-family: var(--x-mono); color: var(--x-wait); font-size: 11px; overflow-wrap: anywhere; }
|
|
214
|
+
table.tx td.to { overflow-wrap: anywhere; }
|
|
215
|
+
.actions { margin: 0; padding: 0; list-style: none; font: 12px var(--x-mono); color: var(--x-fg2); display: grid; gap: 2px; }
|
|
216
|
+
.actions b { font: 500 10px var(--x-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--x-fg3); margin-right: 6px; }
|
|
217
|
+
|
|
218
|
+
/* ── system ────────────────────────────────────────────── */
|
|
219
|
+
.system { position: relative; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px 72px; align-items: start; }
|
|
220
|
+
.system .col { display: grid; gap: 10px; align-content: start; min-width: 0; }
|
|
221
|
+
.system .col-title { font: 500 10.5px var(--x-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--x-fg3); display: flex; gap: 8px; align-items: center; }
|
|
222
|
+
.machine { margin-left: calc(var(--depth, 0) * 18px); }
|
|
223
|
+
.machine.compact { grid-template-columns: minmax(0, 1fr) minmax(0, 40%); align-items: center; padding: 5px 10px; }
|
|
224
|
+
.machine.compact .leaves { text-align: right; }
|
|
225
|
+
.machine .leaves { font: 11.5px var(--x-mono); color: var(--x-run); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
226
|
+
.machine .from { color: var(--x-fg3); font-size: 11.5px; }
|
|
227
|
+
.service .type { font: 11px var(--x-mono); color: var(--x-fg3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
228
|
+
.links { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
|
|
229
|
+
.links path { fill: none; stroke: var(--x-b2); stroke-width: 1.25; }
|
|
230
|
+
.links path.invoke { stroke: var(--x-fg4); stroke-dasharray: 3 3; }
|
|
231
|
+
.links path.hot { stroke: var(--x-accent); stroke-width: 2; }
|
|
232
|
+
.talks { display: flex; gap: 4px; flex-wrap: wrap; }
|
|
233
|
+
.pulse { animation: pulse 1.2s ease-out; }
|
|
234
|
+
@keyframes pulse { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--x-accent) 45%, transparent); } to { box-shadow: 0 0 0 8px transparent; } }
|
|
235
|
+
.traffic { list-style: none; margin: 0; padding: 0; font: 11.5px/1.4 var(--x-mono); }
|
|
236
|
+
.traffic li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 6px; padding: 4px 0; border-bottom: 1px solid var(--x-b1); }
|
|
237
|
+
.traffic .dir { color: var(--x-fg3); }
|
|
238
|
+
|
|
239
|
+
/* ── accessibility ─────────────────────────────────────── */
|
|
240
|
+
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
|
|
241
|
+
.card:focus-visible, .list-row:focus-visible, .lane-row:focus-visible, .door:focus-visible { outline: 2px solid var(--x-accent); outline-offset: 2px; }
|
|
242
|
+
.lane-head .name { border: 0; background: none; padding: 0; text-align: left; font: inherit; font-weight: 600; }
|
|
243
|
+
|
|
244
|
+
@container explorer (max-width: ${NARROW_WIDTH}px) {
|
|
245
|
+
.system { grid-template-columns: 1fr; gap: 12px; }
|
|
246
|
+
.links { display: none; }
|
|
247
|
+
.diagram { grid-auto-flow: row; grid-auto-columns: auto; }
|
|
248
|
+
}
|
|
249
|
+
.detail ul.warnings { margin: 0; padding: 0 0 0 16px; display: grid; gap: 4px; font: 12px/1.45 var(--x-sans); color: var(--x-fg1); }
|
|
250
|
+
.detail ul.warnings li::marker { color: var(--x-wait); content: "⚠ "; }
|
|
251
|
+
|
|
252
|
+
/* WCAG 2.2 target size: every control is at least 24px tall */
|
|
253
|
+
.chip, .drill, .more { min-height: 24px; }
|
|
254
|
+
.drill, .more { min-width: 24px; }
|
|
255
|
+
/* the state name is the card's / row's primary button: it looks like text */
|
|
256
|
+
button.select {
|
|
257
|
+
all: unset; box-sizing: border-box; cursor: pointer; min-height: 24px; display: inline-flex; align-items: center;
|
|
258
|
+
overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1;
|
|
259
|
+
}
|
|
260
|
+
button.select:focus-visible { outline: 2px solid var(--x-accent); outline-offset: 2px; border-radius: var(--x-r); }
|
|
261
|
+
|
|
262
|
+
/* right-to-left pages: disclosure triangles point the other way */
|
|
263
|
+
:host(:dir(rtl)) .twisty { transform: scaleX(-1); }
|
|
264
|
+
`;
|
|
265
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/explorer/styles.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;kCAyBJ,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAqCZ,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCA4KZ,YAAY;;;;;;;;;;;;;;;;;;;;CAoB7C,CAAC","sourcesContent":["/**\n * Layout and component styles of <scxml-explorer>. Colours, type and shape\n * come from the shared theme (src/ui/theme.ts): the `--scxml-*` token\n * contract with neutral defaults, adopted before this sheet. Below\n * NARROW_WIDTH (shared with the element and `<scxml-view>`) the explorer\n * shows one pane with tabs.\n */\nimport { NARROW_WIDTH } from \"../ui/theme.ts\";\n\nexport { NARROW_WIDTH };\nexport const EXPLORER_CSS = /* css */ `\n:host {\n display: block; container-type: inline-size; container-name: explorer;\n background: var(--x-bg);\n border: 1px solid var(--x-b2); border-radius: var(--x-r); overflow: hidden;\n height: var(--scxml-height, min(860px, calc(100dvh - 32px)));\n}\n/* ── shell ─────────────────────────────────────────────── */\n.shell { display: grid; grid-template-rows: auto auto 1fr; grid-template-columns: minmax(0, 1fr); height: 100%; }\n.shell > .playback[hidden] { display: none; }\n.playback {\n display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; padding: 6px 12px;\n background: var(--x-s2); border-bottom: 1px solid var(--x-b2); font: 12px var(--x-sans); color: var(--x-fg2);\n}\n.playback .play, .playback .step {\n height: 28px; padding: 0 12px; border-radius: var(--x-r); cursor: pointer; font: 500 12.5px var(--x-sans);\n border: 1px solid var(--x-b2); background: var(--x-s1); color: var(--x-fg1);\n}\n.playback .play { min-width: 86px; background: var(--x-accent); border-color: var(--x-accent); color: var(--x-on-accent); }\n.playback .play[aria-pressed=\"true\"] { background: var(--x-s1); color: var(--x-fg1); border-color: var(--x-b2); }\n.playback .step:hover:not(:disabled) { border-color: var(--x-accent); color: var(--x-accent-fg); }\n.playback .step:disabled { opacity: .45; cursor: default; }\n.playback .clock-time { font: 500 12px var(--x-mono); color: var(--x-fg1); font-variant-numeric: tabular-nums; min-width: 8ch; }\n.playback .clock-queue { font: 11.5px var(--x-mono); color: var(--x-fg3); }\n.playback .last-step { flex: 1 1 200px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 11.5px var(--x-mono); color: var(--x-accent-fg); text-align: right; }\n@container explorer (max-width: ${NARROW_WIDTH}px) {\n .playback { gap: 6px 8px; padding: 6px 10px; }\n .playback .last-step { flex-basis: 100%; text-align: left; }\n .playback .clock-queue { display: none; }\n}\n.top {\n display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 12px;\n background: var(--x-s1); border-bottom: 1px solid var(--x-b2);\n}\n.levels { display: inline-flex; border: 1px solid var(--x-b2); border-radius: var(--x-r); overflow: hidden; flex: none; }\n.levels button { border: 0; background: none; padding: 4px 10px; cursor: pointer; font: 500 11px/1.4 var(--x-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--x-fg3); }\n.levels button[aria-pressed=\"true\"] { background: var(--x-accent); color: var(--x-on-accent); }\n.crumbs { display: flex; align-items: center; gap: 2px; min-width: 0; flex: 1; overflow: hidden; }\n.crumbs button { border: 0; background: none; padding: 3px 5px; border-radius: var(--x-r); cursor: pointer; color: var(--x-fg2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 22ch; }\n.crumbs button:hover { background: var(--x-s2); color: var(--x-fg1); }\n.crumbs button[aria-current] { color: var(--x-fg1); font-weight: 600; }\n.crumbs .sep { color: var(--x-fg4); flex: none; }\n.follow { display: inline-flex; align-items: center; gap: 6px; flex: none; cursor: pointer; color: var(--x-fg2); font: 500 11px var(--x-mono); letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--x-b2); border-radius: 999px; padding: 3px 10px; background: none; }\n/* off: a hollow ring; on: a filled dot (shape, not only colour) */\n.follow::before { content: \"\"; width: 7px; height: 7px; border-radius: 50%; box-sizing: border-box; border: 1.5px solid var(--x-fg3); background: transparent; }\n.follow[aria-pressed=\"true\"] { color: var(--x-run); border-color: color-mix(in srgb, var(--x-run) 40%, transparent); }\n.follow[aria-pressed=\"true\"]::before { border-color: var(--x-run); background: var(--x-run); box-shadow: 0 0 0 3px color-mix(in srgb, var(--x-run) 20%, transparent); }\n\n.body { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(280px, 360px); min-height: 0; }\n.pane { min-height: 0; min-width: 0; display: flex; flex-direction: column; }\n.pane + .pane { border-left: 1px solid var(--x-b2); }\n.pane-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 8px; flex: none; }\n.pane-title { font: 500 10.5px/1 var(--x-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--x-fg3); flex: 1; }\n.pane-scroll { overflow: auto; min-height: 0; flex: 1; overscroll-behavior: contain; }\n.center { background: var(--x-bg); }\n.center .pane-scroll { padding: 4px 16px 24px; }\n.inspector { background: var(--x-s1); }\n.tree-pane { background: var(--x-s1); }\n.tabs { display: none; }\n.events-strip { display: none; }\n\n/* narrow container: one pane at a time, bottom tabs, sticky events strip */\n@container explorer (max-width: ${NARROW_WIDTH}px) {\n .body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto auto; }\n .pane { display: none; }\n .pane + .pane { border-left: 0; }\n .pane[data-tab-active] { display: flex; }\n .tabs { display: flex; border-top: 1px solid var(--x-b2); background: var(--x-s1); }\n .tabs button { flex: 1; border: 0; background: none; padding: 9px 4px 10px; cursor: pointer; font: 500 10.5px var(--x-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--x-fg3); }\n .tabs button[aria-selected=\"true\"] { color: var(--x-accent-fg); box-shadow: inset 0 2px 0 var(--x-accent); }\n .events-strip { display: flex; gap: 6px; padding: 8px 12px; min-width: 0; overflow-x: auto; background: var(--x-s1); border-top: 1px solid var(--x-b1); scrollbar-width: none; }\n .events-strip > * { flex: none; max-width: 70vw; }\n .crumbs { overflow-x: auto; scrollbar-width: none; }\n .crumbs button { max-width: 14ch; }\n .levels { display: none; }\n .center .pane-scroll { padding: 4px 12px 20px; }\n}\n\n/* ── tree (windowed) ───────────────────────────────────── */\n.tree-viewport { position: relative; }\n.tree-row {\n position: absolute; left: 0; right: 0; height: var(--x-row); display: flex; align-items: center; gap: 2px;\n padding-right: 8px; cursor: pointer; white-space: nowrap; border-left: 2px solid transparent;\n}\n.tree-row:hover { background: var(--x-s2); }\n.tree-row[aria-selected=\"true\"] { background: var(--x-accent-subtle); border-left-color: var(--x-accent); }\n.tree-row .twisty { width: 18px; height: 18px; flex: none; border: 0; background: none; padding: 0; cursor: pointer; color: var(--x-fg3); font-size: 10px; }\n.tree-row .twisty[hidden] { visibility: hidden; display: inline-block; }\n.tree-row .name { overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }\n.tree-row.path .name { font-weight: 600; }\n.tree-row.active .name { color: var(--x-run); font-weight: 600; }\n.tree-row.match .name { text-decoration: underline; text-decoration-color: var(--x-accent); text-underline-offset: 3px; }\n.tree-row .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--x-run); flex: none; margin-left: 4px; }\n.tree-row:focus-visible { outline-offset: -2px; }\n\n/* ── focus ─────────────────────────────────────────────── */\n.mode { display: inline-flex; border: 1px solid var(--x-b2); border-radius: var(--x-r); overflow: hidden; }\n.mode button { border: 0; background: none; padding: 3px 8px; cursor: pointer; font: 11px var(--x-sans); color: var(--x-fg3); }\n.mode button[aria-pressed=\"true\"] { background: var(--x-s3); color: var(--x-fg1); }\n.diagram { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 230px); justify-content: start; gap: 22px 128px; align-items: start; padding: 6px 2px 10px 16px; }\n.rank { display: flex; flex-direction: column; gap: 14px; }\n.edges { position: absolute; inset: 0; pointer-events: none; overflow: visible; }\n.edges path { fill: none; stroke: var(--x-fg4); stroke-width: 1.25; }\n.edges path.live { stroke: var(--x-accent); stroke-width: 1.75; }\n.edges path.back { stroke-dasharray: 4 3; }\n.edges marker path { fill: context-stroke; stroke: none; }\n.edge-label {\n position: absolute; transform: translate(-50%, -50%); z-index: 1; pointer-events: auto;\n font: 11px/1.3 var(--x-mono); background: var(--x-bg); color: var(--x-fg2); padding: 1px 6px; border: 1px solid var(--x-b1); border-radius: 999px; white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; cursor: help;\n}\n.edge-label.live { color: var(--x-accent-fg); border-color: color-mix(in srgb, var(--x-accent) 40%, transparent); }\n/* labels that found no free spot collapse to their event count and open on hover / focus */\n.edge-label .short { display: none; }\n.edge-label.collapsed .full { display: none; }\n.edge-label.collapsed .short { display: inline; }\n.edge-label.collapsed:is(:hover, :focus-visible) { z-index: 3; max-width: 240px; }\n.edge-label.collapsed:is(:hover, :focus-visible) .full { display: inline; }\n.edge-label.collapsed:is(:hover, :focus-visible) .short { display: none; }\n\n.card {\n position: relative; background: var(--x-s1); border: 1px solid var(--x-strong); border-radius: var(--x-r);\n padding: 8px 10px 9px; display: grid; gap: 5px; cursor: pointer; transition: border-color var(--x-dur), background var(--x-dur), box-shadow var(--x-dur);\n}\n.card:hover { box-shadow: 0 1px 0 var(--x-b2), 0 4px 14px rgba(40, 30, 20, .08); }\n.card.path { border-color: var(--x-run); box-shadow: inset 0 0 0 1px var(--x-run); }\n.card.active { background: var(--x-run-bg); }\n.card.waiting { border-color: var(--x-wait); box-shadow: inset 0 0 0 1px var(--x-wait); background: var(--x-wait-bg); }\n.card.final { border-radius: 999px; border-style: double; border-width: 3px; padding: 5px 14px; }\n.card.selected { outline: 2px solid var(--x-accent); outline-offset: 2px; }\n.card-head { display: flex; align-items: center; gap: 6px; min-width: 0; }\n.card-head .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }\n.card.path .card-head .name { color: var(--x-run); }\n.card.waiting .card-head .name { color: var(--x-wait); }\n.card .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--x-fg3); font-size: 11.5px; }\n.card .events { display: flex; gap: 4px; flex-wrap: wrap; }\n.card .events .chip { font-size: 10.5px; padding: 1px 6px; }\n.drill { border: 0; background: none; padding: 0; cursor: pointer; color: var(--x-accent-fg); font: 500 11.5px var(--x-sans); }\n.drill:hover { text-decoration: underline; }\n.initial-mark { position: absolute; left: -13px; top: 13px; width: 8px; height: 8px; border-radius: 50%; background: var(--x-fg1); }\n.initial-mark::after { content: \"\"; position: absolute; left: 8px; top: 3.5px; width: 5px; border-top: 1.5px solid var(--x-fg1); }\n\n.lanes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }\n.lane { border: 1px dashed var(--x-strong); border-radius: var(--x-r); background: var(--x-s1); padding: 8px 10px; min-width: 0; }\n.lane.path { border-color: var(--x-run); border-style: solid; }\n.lane-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }\n.lane-head .name { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }\n.lane.path .lane-head .name { color: var(--x-run); }\n.lane-row { display: flex; align-items: center; gap: 6px; padding: 3px 6px; margin: 0 -6px; border-radius: var(--x-r); cursor: pointer; }\n.lane-row:hover { background: var(--x-s2); }\n.lane-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.lane-row.active .name { color: var(--x-run); font-weight: 600; }\n\n.list { display: grid; gap: 1px; background: var(--x-b1); border: 1px solid var(--x-b1); border-radius: var(--x-r); overflow: hidden; }\n.list-row { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 4px 8px; align-items: center; padding: 7px 10px; background: var(--x-s1); cursor: pointer; }\n.list-row:hover { background: var(--x-s2); }\n.list-row.path { background: color-mix(in srgb, var(--x-run-bg) 55%, var(--x-s1)); }\n.list-row .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.list-row.path .name { color: var(--x-run); font-weight: 600; }\n.list-row .sub { grid-column: 2 / -1; display: flex; gap: 4px; flex-wrap: wrap; color: var(--x-fg3); font-size: 11.5px; }\n.list-group { font: 500 10.5px var(--x-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--x-fg3); padding: 8px 10px 4px; background: var(--x-bg); }\n\n.doors { display: grid; gap: 6px; }\n.door { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: baseline; padding: 6px 10px; border: 1px solid var(--x-b1); border-left: 3px solid var(--x-strong); border-radius: var(--x-r); background: var(--x-s1); cursor: pointer; }\n.door:hover { border-color: var(--x-b2); border-left-color: var(--x-accent); }\n.door .arrow { font: 13px var(--x-mono); color: var(--x-fg3); }\n.door .where { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.door .where small { font-weight: 400; color: var(--x-fg3); }\n.door .events { grid-column: 2; display: flex; gap: 4px; flex-wrap: wrap; }\n.door.live { border-left-color: var(--x-accent); }\n\n/* ── events ────────────────────────────────────────────── */\n.scopes { display: flex; gap: 4px; padding: 0 12px 8px; flex-wrap: wrap; }\n.scopes button { border: 1px solid var(--x-b2); background: none; border-radius: 999px; padding: 2px 9px; cursor: pointer; font: 11.5px var(--x-sans); color: var(--x-fg2); }\n.scopes button[aria-pressed=\"true\"] { background: var(--x-fg1); color: var(--x-s1); border-color: var(--x-fg1); }\n.ev-group > summary { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; padding: 7px 12px; font: 500 11px var(--x-mono); letter-spacing: .06em; color: var(--x-fg2); border-top: 1px solid var(--x-b1); }\n.ev-group > summary::-webkit-details-marker { display: none; }\n.ev-group > summary::before { content: \"▸\"; font-size: 9px; color: var(--x-fg4); transition: transform var(--x-dur); }\n.ev-group[open] > summary::before { transform: rotate(90deg); }\n.ev-group > summary .count { margin-left: auto; }\n.ev-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding: 6px 12px 7px 26px; align-items: center; }\n.ev-row:hover { background: var(--x-s2); }\n.ev-row .ev { font: 500 12px var(--x-mono); color: var(--x-accent-fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.ev-row .how { grid-column: 1; color: var(--x-fg3); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.ev-row .how .guard { font: 11px var(--x-mono); color: var(--x-wait); }\n.ev-row .send { grid-row: 1 / span 2; grid-column: 2; border: 1px solid var(--x-b2); background: var(--x-s1); border-radius: var(--x-r); height: 26px; padding: 0 9px; cursor: pointer; font: 500 12px var(--x-sans); }\n.ev-row .send:hover { border-color: var(--x-accent); color: var(--x-accent-fg); }\n.ev-row .send:disabled { opacity: .45; cursor: default; }\n.ev-row .scope-tag { font: 500 10px var(--x-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--x-fg3); border: 1px solid var(--x-b2); border-radius: var(--x-r); padding: 0 4px; margin-right: 4px; }\n.ev-row.scope-inherited .ev { color: var(--x-fg2); }\n.ev-row.scope-elsewhere .ev { color: var(--x-fg3); }\n.data-field { display: flex; gap: 6px; align-items: center; padding: 0 12px 8px; }\n.data-field span { font: 500 10px var(--x-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--x-fg3); }\n.data-field input { flex: 1; min-width: 0; height: 26px; padding: 0 8px; font: 11.5px var(--x-mono); border: 1px solid var(--x-b2); border-radius: var(--x-r); background: var(--x-s1); color: var(--x-fg1); }\n\n/* ── detail ────────────────────────────────────────────── */\n.detail { padding: 0 12px 16px; }\n.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; font-size: 12.5px; margin: 0; }\n.kv dt { color: var(--x-fg3); }\n.kv dd { margin: 0; font-family: var(--x-mono); font-size: 12px; overflow-wrap: anywhere; }\ntable.tx { width: 100%; border-collapse: collapse; font-size: 12px; }\ntable.tx th { text-align: left; font: 500 10px var(--x-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--x-fg3); padding: 4px 6px; border-bottom: 1px solid var(--x-b2); position: sticky; top: 0; background: var(--x-s1); }\ntable.tx td { padding: 5px 6px; border-bottom: 1px solid var(--x-b1); vertical-align: top; }\ntable.tx td.ev { font-family: var(--x-mono); color: var(--x-accent-fg); overflow-wrap: anywhere; }\ntable.tx td.cond { font-family: var(--x-mono); color: var(--x-wait); font-size: 11px; overflow-wrap: anywhere; }\ntable.tx td.to { overflow-wrap: anywhere; }\n.actions { margin: 0; padding: 0; list-style: none; font: 12px var(--x-mono); color: var(--x-fg2); display: grid; gap: 2px; }\n.actions b { font: 500 10px var(--x-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--x-fg3); margin-right: 6px; }\n\n/* ── system ────────────────────────────────────────────── */\n.system { position: relative; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px 72px; align-items: start; }\n.system .col { display: grid; gap: 10px; align-content: start; min-width: 0; }\n.system .col-title { font: 500 10.5px var(--x-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--x-fg3); display: flex; gap: 8px; align-items: center; }\n.machine { margin-left: calc(var(--depth, 0) * 18px); }\n.machine.compact { grid-template-columns: minmax(0, 1fr) minmax(0, 40%); align-items: center; padding: 5px 10px; }\n.machine.compact .leaves { text-align: right; }\n.machine .leaves { font: 11.5px var(--x-mono); color: var(--x-run); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.machine .from { color: var(--x-fg3); font-size: 11.5px; }\n.service .type { font: 11px var(--x-mono); color: var(--x-fg3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.links { position: absolute; inset: 0; pointer-events: none; overflow: visible; }\n.links path { fill: none; stroke: var(--x-b2); stroke-width: 1.25; }\n.links path.invoke { stroke: var(--x-fg4); stroke-dasharray: 3 3; }\n.links path.hot { stroke: var(--x-accent); stroke-width: 2; }\n.talks { display: flex; gap: 4px; flex-wrap: wrap; }\n.pulse { animation: pulse 1.2s ease-out; }\n@keyframes pulse { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--x-accent) 45%, transparent); } to { box-shadow: 0 0 0 8px transparent; } }\n.traffic { list-style: none; margin: 0; padding: 0; font: 11.5px/1.4 var(--x-mono); }\n.traffic li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 6px; padding: 4px 0; border-bottom: 1px solid var(--x-b1); }\n.traffic .dir { color: var(--x-fg3); }\n\n/* ── accessibility ─────────────────────────────────────── */\n.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }\n.card:focus-visible, .list-row:focus-visible, .lane-row:focus-visible, .door:focus-visible { outline: 2px solid var(--x-accent); outline-offset: 2px; }\n.lane-head .name { border: 0; background: none; padding: 0; text-align: left; font: inherit; font-weight: 600; }\n\n@container explorer (max-width: ${NARROW_WIDTH}px) {\n .system { grid-template-columns: 1fr; gap: 12px; }\n .links { display: none; }\n .diagram { grid-auto-flow: row; grid-auto-columns: auto; }\n}\n.detail ul.warnings { margin: 0; padding: 0 0 0 16px; display: grid; gap: 4px; font: 12px/1.45 var(--x-sans); color: var(--x-fg1); }\n.detail ul.warnings li::marker { color: var(--x-wait); content: \"⚠ \"; }\n\n/* WCAG 2.2 target size: every control is at least 24px tall */\n.chip, .drill, .more { min-height: 24px; }\n.drill, .more { min-width: 24px; }\n/* the state name is the card's / row's primary button: it looks like text */\nbutton.select {\n all: unset; box-sizing: border-box; cursor: pointer; min-height: 24px; display: inline-flex; align-items: center;\n overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1;\n}\nbutton.select:focus-visible { outline: 2px solid var(--x-accent); outline-offset: 2px; border-radius: var(--x-r); }\n\n/* right-to-left pages: disclosure triangles point the other way */\n:host(:dir(rtl)) .twisty { transform: scaleX(-1); }\n`;\n"]}
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Explorer view-model: everything the explorer shows, computed as plain data
|
|
3
|
+
* from compiled models and live sessions. No DOM, no rendering — so it is
|
|
4
|
+
* testable, and any renderer (this prototype, a React one…) can use it.
|
|
5
|
+
*
|
|
6
|
+
* System — machines (the root session and its invoked children, recursively),
|
|
7
|
+
* external services (I/O processors), and who talks to whom.
|
|
8
|
+
* Tree — the state hierarchy of one machine, flattened to visible rows.
|
|
9
|
+
* Focus — one compound state: its children, the transitions between them
|
|
10
|
+
* (merged per pair), and "doors" in and out of the focus.
|
|
11
|
+
* Events — what the machine accepts right now, scoped to the focus.
|
|
12
|
+
*
|
|
13
|
+
* Everything is built for large charts: lists are flattened / grouped so a UI
|
|
14
|
+
* can window or collapse them, and nothing is O(n²) in the chart size.
|
|
15
|
+
*/
|
|
16
|
+
import { type Clock } from "../clock.js";
|
|
17
|
+
import { type Model, type StateNode, type TransitionNode } from "../model.js";
|
|
18
|
+
import type { IOProcessor, SCXMLSession as Session } from "../session.js";
|
|
19
|
+
/** Is `s` the state `ancestor` or inside it? */
|
|
20
|
+
export declare function within(s: StateNode, ancestor: StateNode): boolean;
|
|
21
|
+
/** The child of `focus` that contains `s` (or undefined if `s` is not strictly inside `focus`). */
|
|
22
|
+
export declare function childContaining(focus: StateNode, s: StateNode): StateNode | undefined;
|
|
23
|
+
/** A display label: anonymous states get a readable stand-in. */
|
|
24
|
+
export declare function label(s: StateNode): string;
|
|
25
|
+
/** Ancestors from the root down to `s` (inclusive), for breadcrumbs. */
|
|
26
|
+
export declare function pathTo(s: StateNode): StateNode[];
|
|
27
|
+
/** How many states are nested inside `s`, at any depth. */
|
|
28
|
+
export declare function descendantCount(s: StateNode): number;
|
|
29
|
+
/** States that can be a focus: the root, compound states and parallel states. */
|
|
30
|
+
export declare function isContainer(s: StateNode): boolean;
|
|
31
|
+
/** One machine of the system: the root session or an invoked child. */
|
|
32
|
+
export interface MachineInfo {
|
|
33
|
+
/** The session id (the key in `SystemTracker.machines`). */
|
|
34
|
+
key: string;
|
|
35
|
+
/** The session. */
|
|
36
|
+
session: Session;
|
|
37
|
+
/** The chart's `name` (or a fallback). */
|
|
38
|
+
name: string;
|
|
39
|
+
/** Invoke nesting: 0 for the root. */
|
|
40
|
+
depth: number;
|
|
41
|
+
/** The invoking machine's key, for children. */
|
|
42
|
+
parentKey?: string;
|
|
43
|
+
/** The invocation's id, for children. */
|
|
44
|
+
invokeid?: string;
|
|
45
|
+
/** the state that invoked it */
|
|
46
|
+
invokedFrom?: string;
|
|
47
|
+
/** The session's status. */
|
|
48
|
+
status: "idle" | "running" | "done";
|
|
49
|
+
/** Labels of the active atomic states. */
|
|
50
|
+
activeLeaves: string[];
|
|
51
|
+
}
|
|
52
|
+
/** An external service: an I/O processor the system talks to. */
|
|
53
|
+
export interface ServiceInfo {
|
|
54
|
+
/** The processor's type URI (the key in `SystemTracker.services`). */
|
|
55
|
+
key: string;
|
|
56
|
+
/** Its first alias, or the URI. */
|
|
57
|
+
label: string;
|
|
58
|
+
/** The processor. */
|
|
59
|
+
processor: IOProcessor;
|
|
60
|
+
}
|
|
61
|
+
/** A connection between two machines, or a machine and a service. */
|
|
62
|
+
export interface SystemLink {
|
|
63
|
+
/** Key of the sending side. */
|
|
64
|
+
from: string;
|
|
65
|
+
/** Key of the receiving side. */
|
|
66
|
+
to: string;
|
|
67
|
+
/** `invoke`: parent to child; `message`: events sent along it. */
|
|
68
|
+
kind: "invoke" | "message";
|
|
69
|
+
/** event name → count observed at run time */
|
|
70
|
+
observed: Map<string, number>;
|
|
71
|
+
/** event names declared in the charts (`<send>` with this target/type) */
|
|
72
|
+
declared: Set<string>;
|
|
73
|
+
/** Session-clock time of the last observed message (0 = never). */
|
|
74
|
+
lastAt: number;
|
|
75
|
+
}
|
|
76
|
+
/** What the last macrostep of any machine did (for a playback bar). */
|
|
77
|
+
export interface StepInfo {
|
|
78
|
+
/** The name of the machine that stepped. */
|
|
79
|
+
machine: string;
|
|
80
|
+
/** the event that triggered the macrostep (undefined for the initial step) */
|
|
81
|
+
event?: string;
|
|
82
|
+
/** "source → target" per transition taken */
|
|
83
|
+
moves: string[];
|
|
84
|
+
}
|
|
85
|
+
/** Options for `SystemTracker`. */
|
|
86
|
+
export interface SystemTrackerOptions {
|
|
87
|
+
/** Time source for traffic timestamps; defaults to the root session's clock. */
|
|
88
|
+
clock?: Clock;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Tracks the whole system of one root session: invoked children (recursively,
|
|
92
|
+
* as they appear), external services, and message traffic between them.
|
|
93
|
+
* Fires "change" (debounced to one per task) whenever something changes.
|
|
94
|
+
* Timestamps come from the session clock, so "recent" stays right when a
|
|
95
|
+
* PlaybackClock is paused, stepped or sped up.
|
|
96
|
+
*/
|
|
97
|
+
export declare class SystemTracker extends EventTarget {
|
|
98
|
+
/** The root session. */
|
|
99
|
+
readonly root: Session;
|
|
100
|
+
/** Macrosteps taken by any machine in the system (for stepping). */
|
|
101
|
+
stepCount: number;
|
|
102
|
+
/** What the most recent macrostep of any machine did. */
|
|
103
|
+
lastStep?: StepInfo;
|
|
104
|
+
/** Every machine seen so far, by session id (terminated ones stay, with status `done`). */
|
|
105
|
+
readonly machines: Map<string, MachineInfo>;
|
|
106
|
+
/** The external services, by type URI. */
|
|
107
|
+
readonly services: Map<string, ServiceInfo>;
|
|
108
|
+
/** Links by `from→to` key. */
|
|
109
|
+
readonly links: Map<string, SystemLink>;
|
|
110
|
+
private byAlias;
|
|
111
|
+
/** The time source for traffic timestamps. */
|
|
112
|
+
readonly clock: Clock;
|
|
113
|
+
private pending;
|
|
114
|
+
private stops;
|
|
115
|
+
/**
|
|
116
|
+
* @param root the root session; children are tracked as they're invoked
|
|
117
|
+
* @param processors the I/O processors the session was created with
|
|
118
|
+
*/
|
|
119
|
+
constructor(
|
|
120
|
+
/** The root session. */
|
|
121
|
+
root: Session, processors?: IOProcessor[], opts?: SystemTrackerOptions);
|
|
122
|
+
/** Stop listening to every tracked session. */
|
|
123
|
+
dispose(): void;
|
|
124
|
+
/** Machines in invoke-tree order (parents before children). */
|
|
125
|
+
machineList(): MachineInfo[];
|
|
126
|
+
/** Did messages flow over this link within the last `windowMs` of session time? */
|
|
127
|
+
isHot(link: SystemLink, windowMs?: number): boolean;
|
|
128
|
+
/** Links touching a node, busiest first. */
|
|
129
|
+
linksOf(key: string): SystemLink[];
|
|
130
|
+
private track;
|
|
131
|
+
/** Static knowledge: which services / parents a chart sends to, before anything happened. */
|
|
132
|
+
private declareSends;
|
|
133
|
+
private link;
|
|
134
|
+
private changed;
|
|
135
|
+
}
|
|
136
|
+
/** The number of messages observed on a link. */
|
|
137
|
+
export declare function total(l: SystemLink): number;
|
|
138
|
+
/** One visible row of the state tree. */
|
|
139
|
+
export interface TreeRow {
|
|
140
|
+
/** the state */
|
|
141
|
+
node: StateNode;
|
|
142
|
+
/** indentation level (children of the root are 0) */
|
|
143
|
+
depth: number;
|
|
144
|
+
/** the state itself is active */
|
|
145
|
+
active: boolean;
|
|
146
|
+
/** some descendant is active */
|
|
147
|
+
onActivePath: boolean;
|
|
148
|
+
/** it has child states */
|
|
149
|
+
expandable: boolean;
|
|
150
|
+
/** its children are shown */
|
|
151
|
+
expanded: boolean;
|
|
152
|
+
/** number of direct child states */
|
|
153
|
+
childCount: number;
|
|
154
|
+
/** matches the search text */
|
|
155
|
+
match: boolean;
|
|
156
|
+
}
|
|
157
|
+
/** Input to `treeRows`. */
|
|
158
|
+
export interface TreeOptions {
|
|
159
|
+
/** containers whose children are shown */
|
|
160
|
+
expanded: Set<StateNode>;
|
|
161
|
+
/** whether a state is active (usually `session.isActiveNode`) */
|
|
162
|
+
isActive: (s: StateNode) => boolean;
|
|
163
|
+
/** case-insensitive substring over ids; shows matches and their ancestors */
|
|
164
|
+
filter?: string;
|
|
165
|
+
/** only rows on the active path (and their direct children) */
|
|
166
|
+
activeOnly?: boolean;
|
|
167
|
+
}
|
|
168
|
+
/** Flatten the hierarchy into the rows currently visible (for a windowed list). */
|
|
169
|
+
export declare function treeRows(model: Model, opts: TreeOptions): TreeRow[];
|
|
170
|
+
/** The expansion that shows the active configuration and nothing else ("follow"). */
|
|
171
|
+
export declare function activeExpansion(model: Model, isActive: (s: StateNode) => boolean): Set<StateNode>;
|
|
172
|
+
/** The transitions between two children of the focus, merged into one arrow. */
|
|
173
|
+
export interface FocusEdge {
|
|
174
|
+
/** the child the transitions start in */
|
|
175
|
+
from: StateNode;
|
|
176
|
+
/** the child they lead into */
|
|
177
|
+
to: StateNode;
|
|
178
|
+
/** every transition merged into this edge */
|
|
179
|
+
transitions: TransitionNode[];
|
|
180
|
+
/** their distinct event descriptors (`ε` for eventless) */
|
|
181
|
+
events: string[];
|
|
182
|
+
}
|
|
183
|
+
/** Transitions crossing the focus boundary, grouped by the state outside. */
|
|
184
|
+
export interface Door {
|
|
185
|
+
/** outside state (exits: target; entries: source) */
|
|
186
|
+
other: StateNode;
|
|
187
|
+
/** the child of the focus involved (exits: source child or the focus itself; entries: target child) */
|
|
188
|
+
child: StateNode;
|
|
189
|
+
/** every transition through this door */
|
|
190
|
+
transitions: TransitionNode[];
|
|
191
|
+
/** their distinct event descriptors */
|
|
192
|
+
events: string[];
|
|
193
|
+
}
|
|
194
|
+
/** A child of the focus, as the focus view shows it. */
|
|
195
|
+
export interface ChildSummary {
|
|
196
|
+
/** the child state */
|
|
197
|
+
node: StateNode;
|
|
198
|
+
/** the child itself is active */
|
|
199
|
+
active: boolean;
|
|
200
|
+
/** it or a descendant is active */
|
|
201
|
+
onActivePath: boolean;
|
|
202
|
+
/** it is (or contains) the focus's initial state */
|
|
203
|
+
initial: boolean;
|
|
204
|
+
/** number of states nested inside it */
|
|
205
|
+
descendants: number;
|
|
206
|
+
/** transitions whose source is inside this child and that stay inside it */
|
|
207
|
+
internal: number;
|
|
208
|
+
/** distinct events this child reacts to (anywhere inside it) */
|
|
209
|
+
events: string[];
|
|
210
|
+
/** `<invoke>`s inside it, at any depth */
|
|
211
|
+
invokes: number;
|
|
212
|
+
}
|
|
213
|
+
/** Everything the focus view shows for one container state. */
|
|
214
|
+
export interface FocusScope {
|
|
215
|
+
/** the focused container (`<scxml>`, compound or parallel) */
|
|
216
|
+
focus: StateNode;
|
|
217
|
+
/** its children, document order */
|
|
218
|
+
children: ChildSummary[];
|
|
219
|
+
/** transitions between children, merged per pair */
|
|
220
|
+
edges: FocusEdge[];
|
|
221
|
+
/** transitions leaving the focus, by target */
|
|
222
|
+
exits: Door[];
|
|
223
|
+
/** transitions entering the focus from outside, by source and target child */
|
|
224
|
+
entries: Door[];
|
|
225
|
+
/** transitions on the focus state itself that keep us inside (targetless or to a child) */
|
|
226
|
+
frame: TransitionNode[];
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* One level of the chart around a container: its children, the transitions
|
|
230
|
+
* between them (merged per pair of children, so the view never shows more
|
|
231
|
+
* than one arrow between two boxes), and "doors" for transitions crossing
|
|
232
|
+
* the boundary. Linear in the size of the chart.
|
|
233
|
+
*/
|
|
234
|
+
export declare function focusScope(model: Model, focus: StateNode, isActive: (s: StateNode) => boolean): FocusScope;
|
|
235
|
+
/**
|
|
236
|
+
* Where "follow" should look: the lowest container that holds every active
|
|
237
|
+
* leaf. One active leaf → its parent; parallel regions → the parallel state,
|
|
238
|
+
* whose lanes show all of them at once instead of jumping between regions.
|
|
239
|
+
*/
|
|
240
|
+
export declare function followTarget(configuration: StateNode[], current: StateNode): StateNode;
|
|
241
|
+
/** Where an accepted event's transition is, relative to the focus: inside it, on an ancestor, or elsewhere. */
|
|
242
|
+
export type EventScope = "here" | "inherited" | "elsewhere";
|
|
243
|
+
/** A transition that would handle an accepted event. */
|
|
244
|
+
export interface AcceptedTransition {
|
|
245
|
+
/** the transition */
|
|
246
|
+
transition: TransitionNode;
|
|
247
|
+
/** its (active) source state */
|
|
248
|
+
source: StateNode;
|
|
249
|
+
/** it has a `cond` (shown, not evaluated) */
|
|
250
|
+
guarded: boolean;
|
|
251
|
+
/** where it leads (empty: targetless) */
|
|
252
|
+
targets: StateNode[];
|
|
253
|
+
}
|
|
254
|
+
/** An event descriptor the machine accepts right now. */
|
|
255
|
+
export interface AcceptedEvent {
|
|
256
|
+
/** the descriptor as written (may end in `.*`) */
|
|
257
|
+
descriptor: string;
|
|
258
|
+
/** the closest scope any of its transitions has */
|
|
259
|
+
scope: EventScope;
|
|
260
|
+
/** in priority order: innermost source first */
|
|
261
|
+
transitions: AcceptedTransition[];
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Events the machine accepts in its current configuration: descriptors on
|
|
265
|
+
* transitions of active states (conditions are shown, not evaluated — that
|
|
266
|
+
* could have side effects). Scoped relative to the focus:
|
|
267
|
+
* here — the source is inside the focus
|
|
268
|
+
* inherited — the source is an ancestor of the focus (it applies here too)
|
|
269
|
+
* elsewhere — other active parts (e.g. parallel regions outside the focus)
|
|
270
|
+
*/
|
|
271
|
+
export declare function acceptedEvents(session: Session, focus: StateNode): AcceptedEvent[];
|
|
272
|
+
/** Accepted events sharing a first dotted token. */
|
|
273
|
+
export interface EventGroup {
|
|
274
|
+
/** the first token (`github` for `github.comment.*`), or `·` for names without a dot */
|
|
275
|
+
prefix: string;
|
|
276
|
+
/** the events, in their original order */
|
|
277
|
+
events: AcceptedEvent[];
|
|
278
|
+
}
|
|
279
|
+
/** Group by the first dotted token ("github.comment.*" → "github"), keeping order. */
|
|
280
|
+
export declare function groupEvents(events: AcceptedEvent[]): EventGroup[];
|
|
281
|
+
/** The concrete name to send for a descriptor ("github.comment.*" → "github.comment.done"; "*" → null). */
|
|
282
|
+
export declare function sendableName(descriptor: string): string | null;
|
|
283
|
+
/** Would sending `name` be handled by some active state? (ignores conditions) */
|
|
284
|
+
export declare function wouldAccept(session: Session, name: string): boolean;
|