@popcorn245/cornfield 0.23.0 → 0.25.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/core/brand.js +182 -0
- package/core/config.js +5 -0
- package/core/validate.js +19 -0
- package/explorer/check.js +3 -0
- package/explorer/cloud-model.js +4 -4
- package/explorer/corn-state.js +34 -0
- package/explorer/flows.js +1 -1
- package/explorer/forge-panel.js +36 -31
- package/explorer/house.js +4 -0
- package/explorer/index.html +106 -104
- package/explorer/layers.js +1 -1
- package/explorer/live-model.js +1 -1
- package/explorer/live.js +1 -1
- package/explorer/mockups-model.js +4 -3
- package/explorer/mockups.js +4 -0
- package/explorer/panels.js +1 -1
- package/explorer/plugins.js +43 -4
- package/explorer/proposal-model.js +1 -1
- package/explorer/proposal.js +4 -4
- package/explorer/renderer.js +1 -0
- package/explorer/review-tokens.js +2 -1
- package/explorer/review.js +2 -1
- package/explorer/runs-map.js +1 -0
- package/explorer/runs-view.js +6 -5
- package/explorer/scenario-ui.js +4 -2
- package/explorer/sheets.js +1 -0
- package/explorer/whatif.js +22 -21
- package/package.json +1 -1
- package/server/server.js +63 -3
package/explorer/house.js
CHANGED
|
@@ -125,20 +125,24 @@ function mount() {
|
|
|
125
125
|
if (!stage || (els && els.stage === stage && stage.contains(els.under))) return;
|
|
126
126
|
const under = document.createElement('div');
|
|
127
127
|
under.className = 'hx-house-under';
|
|
128
|
+
under.dataset.corn = 'house-under';
|
|
128
129
|
under.setAttribute('aria-hidden', 'true');
|
|
129
130
|
under.inert = true;
|
|
130
131
|
under.hidden = true;
|
|
131
132
|
const map = document.createElement(hook && hook.element ? hook.element : 'div');
|
|
132
133
|
map.className = 'hx-house-plan';
|
|
134
|
+
map.dataset.corn = 'house-plan';
|
|
133
135
|
under.appendChild(map);
|
|
134
136
|
stage.insertBefore(under, stage.firstChild);
|
|
135
137
|
|
|
136
138
|
const over = document.createElement('div');
|
|
137
139
|
over.className = 'hx-house-over';
|
|
140
|
+
over.dataset.corn = 'house-over';
|
|
138
141
|
over.hidden = true;
|
|
139
142
|
|
|
140
143
|
const bar = document.createElement('div');
|
|
141
144
|
bar.className = 'hx-house-bar';
|
|
145
|
+
bar.dataset.corn = 'house-bar';
|
|
142
146
|
bar.hidden = true;
|
|
143
147
|
bar.innerHTML = '<div class="hx-house-floors glass" role="group" aria-label="Floor"></div><div class="hx-house-people" role="group" aria-label="People"></div>';
|
|
144
148
|
stage.appendChild(over);
|
package/explorer/index.html
CHANGED
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
<link rel="stylesheet" href="/explorer/tokens.css" />
|
|
12
12
|
<link rel="stylesheet" href="/explorer/explorer.css" />
|
|
13
13
|
<link rel="stylesheet" href="/explorer/house.css" />
|
|
14
|
+
<!-- The config's brand (server/server.js puts it here): the favicon, the web app manifest and the tab colour -->
|
|
15
|
+
<!--@brand-->
|
|
14
16
|
<!-- The config's theme (server/server.js puts it here, so it comes after cornfield's own CSS): font stylesheets, the repo's theme.css, a named theme -->
|
|
15
17
|
<!--@theme-->
|
|
16
18
|
<!-- Light or dark on <html data-theme>, and the named theme on <html data-theme-name>, before the first paint (theme-boot.js; theme.js
|
|
@@ -20,17 +22,17 @@
|
|
|
20
22
|
</head>
|
|
21
23
|
<body>
|
|
22
24
|
<!-- Top bar: layers, data-flow preset, search, layout mode, zoom, links -->
|
|
23
|
-
<header class="hx-header">
|
|
25
|
+
<header class="hx-header" data-corn="header">
|
|
24
26
|
<!-- The page's one heading, for a screen reader's list of headings (plugins.js puts the config's title in it) -->
|
|
25
27
|
<h1 id="cf-heading" class="hx-sr-only">cornfield: the map</h1>
|
|
26
28
|
<div class="hx-header-left">
|
|
27
|
-
<button type="button" class="hx-brand" data-action="reset-view" title="Reset View" aria-label="cornfield: reset the view">
|
|
28
|
-
<span class="hx-live-dot"></span>
|
|
29
|
+
<button type="button" id="cf-brand" class="hx-brand" data-corn="brand" data-action="reset-view" title="Reset View" aria-label="cornfield: reset the view">
|
|
30
|
+
<span id="cf-mark" class="hx-live-dot"></span>
|
|
29
31
|
<span id="cf-title" class="hx-title gradient-text">cornfield</span>
|
|
30
32
|
</button>
|
|
31
33
|
|
|
32
34
|
<div class="hx-menu-wrap">
|
|
33
|
-
<button type="button" id="legend-toggle-btn" class="hx-btn" data-action="toggle-layers-menu" aria-label="Layers" aria-expanded="false" aria-controls="legend-dropdown" title="Toggle Architecture Layers">
|
|
35
|
+
<button type="button" id="legend-toggle-btn" class="hx-btn" data-action="toggle-layers-menu" aria-label="Layers" aria-expanded="false" aria-controls="legend-dropdown" title="Toggle Architecture Layers" data-corn="layers-button">
|
|
34
36
|
<span class="hx-dots" aria-hidden="true">
|
|
35
37
|
<span style="background:#6366f1"></span><span style="background:#06b6d4"></span><span style="background:#38bdf8"></span><span style="background:#10b981"></span><span style="background:#a855f7"></span><span style="background:#ec4899"></span><span style="background:#fb923c"></span>
|
|
36
38
|
</span>
|
|
@@ -39,13 +41,13 @@
|
|
|
39
41
|
</button>
|
|
40
42
|
|
|
41
43
|
<!-- Interactive section toggles and the legend -->
|
|
42
|
-
<div id="legend-dropdown" class="hx-menu glass" hidden>
|
|
44
|
+
<div id="legend-dropdown" class="hx-menu glass" hidden data-corn="layers-menu">
|
|
43
45
|
<div class="hx-menu-title hx-menu-head">
|
|
44
46
|
<span>Section Toggles</span>
|
|
45
47
|
<span class="hx-menu-links">
|
|
46
|
-
<button type="button" class="hx-textbtn hx-textbtn--accent" data-action="layers-all">All</button>
|
|
48
|
+
<button type="button" class="hx-textbtn hx-textbtn--accent" data-action="layers-all" data-corn-kind="quiet">All</button>
|
|
47
49
|
<span class="hx-faint">•</span>
|
|
48
|
-
<button type="button" class="hx-textbtn" data-action="layers-none">None</button>
|
|
50
|
+
<button type="button" class="hx-textbtn" data-action="layers-none" data-corn-kind="quiet">None</button>
|
|
49
51
|
</span>
|
|
50
52
|
</div>
|
|
51
53
|
<p id="layers-preset-note" class="hx-note" hidden>The data-flow view shows its own tiers and ignores these toggles. Switch it off to use them.</p>
|
|
@@ -87,73 +89,73 @@
|
|
|
87
89
|
</div>
|
|
88
90
|
|
|
89
91
|
<!-- The data-flow preset: browser -> servers -> API -> tables -> services -> outside, animated -->
|
|
90
|
-
<button type="button" id="preset-dataflow-btn" class="hx-btn hx-btn--preset" data-action="preset-dataflow" aria-pressed="false" aria-label="Data flow" title="Show only how data moves: browser, app servers, API, tables, services, outside systems">
|
|
92
|
+
<button type="button" id="preset-dataflow-btn" class="hx-btn hx-btn--preset" data-action="preset-dataflow" aria-pressed="false" aria-label="Data flow" title="Show only how data moves: browser, app servers, API, tables, services, outside systems" data-corn="preset-dataflow">
|
|
91
93
|
<span aria-hidden="true">⇄</span>
|
|
92
94
|
<span class="hx-only-wide">Data flow</span>
|
|
93
95
|
</button>
|
|
94
96
|
|
|
95
97
|
<!-- The House preset (explorer/house.js, spec 0029): the floor plan with its devices, machines and people, the software around it -->
|
|
96
|
-
<button type="button" id="preset-house-btn" class="hx-btn hx-btn--preset" data-action="preset-house" aria-pressed="false" aria-label="House" title="Show the house: each floor's rooms with their devices and machines, the people beside it, the software around it">
|
|
98
|
+
<button type="button" id="preset-house-btn" class="hx-btn hx-btn--preset" data-action="preset-house" aria-pressed="false" aria-label="House" title="Show the house: each floor's rooms with their devices and machines, the people beside it, the software around it" data-corn="preset-house">
|
|
97
99
|
<span aria-hidden="true">⌂</span>
|
|
98
100
|
<span class="hx-only-wide">House</span>
|
|
99
101
|
</button>
|
|
100
102
|
|
|
101
103
|
<!-- Proposals: what a change would add, change and remove, drawn on the map (proposal.js) -->
|
|
102
104
|
<div id="proposal-wrap" class="hx-menu-wrap">
|
|
103
|
-
<button type="button" id="proposal-btn" class="hx-btn hx-btn--proposal" data-action="toggle-proposals-menu" aria-haspopup="true" aria-expanded="false" aria-label="Proposals" title="Open a proposal: what a change would add, change and remove">
|
|
105
|
+
<button type="button" id="proposal-btn" class="hx-btn hx-btn--proposal" data-action="toggle-proposals-menu" aria-haspopup="true" aria-expanded="false" aria-label="Proposals" title="Open a proposal: what a change would add, change and remove" data-corn="proposals-button">
|
|
104
106
|
<span aria-hidden="true">✎</span>
|
|
105
107
|
<span class="hx-only-wide">Proposals</span>
|
|
106
108
|
<span class="hx-faint">▾</span>
|
|
107
109
|
</button>
|
|
108
|
-
<div id="proposal-menu" class="hx-menu hx-menu--proposals glass" hidden></div>
|
|
110
|
+
<div id="proposal-menu" class="hx-menu hx-menu--proposals glass" hidden data-corn="proposals-menu"></div>
|
|
109
111
|
</div>
|
|
110
112
|
|
|
111
113
|
<!-- Issues and pull requests (explorer/forge-panel.js): shown only when the config names a forge -->
|
|
112
|
-
<button type="button" id="forge-btn" class="hx-btn hx-btn--forge" data-action="toggle-forge" aria-expanded="false" aria-controls="forge-panel" aria-label="Issues and pull requests" title="Issues, pull requests and deploys: a pull request lights the nodes it changes, a deploy the nodes it restarted" hidden>
|
|
114
|
+
<button type="button" id="forge-btn" class="hx-btn hx-btn--forge" data-action="toggle-forge" aria-expanded="false" aria-controls="forge-panel" aria-label="Issues and pull requests" title="Issues, pull requests and deploys: a pull request lights the nodes it changes, a deploy the nodes it restarted" hidden data-corn="forge-button">
|
|
113
115
|
<span aria-hidden="true">⎇</span>
|
|
114
116
|
<span class="hx-only-wide">Issues & PRs</span>
|
|
115
117
|
<span id="forge-btn-lit" class="hx-forge-lit" hidden></span>
|
|
116
118
|
</button>
|
|
117
119
|
|
|
118
120
|
<!-- Review tokens (explorer/review-tokens.js): shown only when somebody is signed in to a forge -->
|
|
119
|
-
<button type="button" id="tokens-btn" class="hx-btn" aria-haspopup="dialog" aria-expanded="false" aria-controls="tokens-dialog" aria-label="Review tokens" title="Review tokens: let a script or a chat bot approve or send back a proposal as you" hidden>
|
|
121
|
+
<button type="button" id="tokens-btn" class="hx-btn" aria-haspopup="dialog" aria-expanded="false" aria-controls="tokens-dialog" aria-label="Review tokens" title="Review tokens: let a script or a chat bot approve or send back a proposal as you" hidden data-corn="tokens-button">
|
|
120
122
|
<span aria-hidden="true">⚿</span>
|
|
121
123
|
<span class="hx-only-wide">Review tokens</span>
|
|
122
124
|
</button>
|
|
123
125
|
|
|
124
126
|
<!-- The live layer's chip (explorer/live.js, spec 0029): shown once a live layer is on; a dot on a phone, its line on tap -->
|
|
125
127
|
<div id="live-wrap" class="hx-menu-wrap hx-live" data-tone="idle" hidden>
|
|
126
|
-
<button type="button" id="live-chip" class="hx-btn hx-live-chip" aria-haspopup="true" aria-expanded="false" aria-label="Live layer">
|
|
128
|
+
<button type="button" id="live-chip" class="hx-btn hx-live-chip" aria-haspopup="true" aria-expanded="false" aria-label="Live layer" data-corn="live-chip">
|
|
127
129
|
<span class="hx-live-chip-dot" aria-hidden="true"></span>
|
|
128
130
|
<span id="live-chip-text" class="hx-only-wide hx-live-chip-text"></span>
|
|
129
131
|
</button>
|
|
130
|
-
<div id="live-menu" class="hx-menu hx-menu--live glass" role="status" hidden></div>
|
|
132
|
+
<div id="live-menu" class="hx-menu hx-menu--live glass" role="status" hidden data-corn="live-menu"></div>
|
|
131
133
|
</div>
|
|
132
134
|
</div>
|
|
133
135
|
|
|
134
136
|
<div class="hx-header-right">
|
|
135
|
-
<button type="button" id="mobile-search-toggle" class="hx-btn hx-btn--icon hx-only-mobile" data-action="toggle-mobile-search" aria-label="Open Search" title="Search nodes">⌕</button>
|
|
137
|
+
<button type="button" id="mobile-search-toggle" class="hx-btn hx-btn--icon hx-only-mobile" data-action="toggle-mobile-search" aria-label="Open Search" title="Search nodes" data-corn-kind="icon">⌕</button>
|
|
136
138
|
|
|
137
|
-
<div class="hx-search hx-only-desktop" role="search">
|
|
138
|
-
<input type="text" id="node-search" class="hx-input" placeholder="Search..." aria-label="Search nodes" />
|
|
139
|
+
<div class="hx-search hx-only-desktop" role="search" data-corn="search">
|
|
140
|
+
<input type="text" id="node-search" class="hx-input" placeholder="Search..." aria-label="Search nodes" data-corn="search-input" />
|
|
139
141
|
</div>
|
|
140
142
|
|
|
141
|
-
<button type="button" id="freeform-toggle-btn" class="hx-btn" data-action="toggle-freeform" title="Toggle between Orbit parent clustering and freeform node dragging">
|
|
143
|
+
<button type="button" id="freeform-toggle-btn" class="hx-btn" data-action="toggle-freeform" title="Toggle between Orbit parent clustering and freeform node dragging" data-corn="layout-toggle">
|
|
142
144
|
<span id="freeform-toggle-icon" aria-hidden="true">🔒</span>
|
|
143
145
|
<span class="hx-only-wide" id="freeform-toggle-label">Orbit</span>
|
|
144
146
|
</button>
|
|
145
147
|
|
|
146
|
-
<button type="button" id="reset-positions-btn" class="hx-btn hx-btn--quiet" data-action="reset-positions" title="Reset custom dragged positions back to orbit" hidden>Reset Layout</button>
|
|
148
|
+
<button type="button" id="reset-positions-btn" class="hx-btn hx-btn--quiet" data-action="reset-positions" title="Reset custom dragged positions back to orbit" hidden data-corn-kind="quiet">Reset Layout</button>
|
|
147
149
|
|
|
148
|
-
<div class="hx-zoom hx-only-desktop">
|
|
149
|
-
<button type="button" class="hx-zoom-btn" data-action="zoom-in" title="Zoom In" aria-label="Zoom in">+</button>
|
|
150
|
-
<button type="button" class="hx-zoom-btn" data-action="zoom-out" title="Zoom Out" aria-label="Zoom out">−</button>
|
|
151
|
-
<button type="button" class="hx-zoom-btn" data-action="reset-view" title="Reset View" aria-label="Reset the view">⟲</button>
|
|
152
|
-
<button type="button" class="hx-zoom-btn hx-zoom-btn--accent" data-action="fit" title="Fit to Screen" aria-label="Fit to the screen">⛶</button>
|
|
150
|
+
<div class="hx-zoom hx-only-desktop" data-corn="zoom">
|
|
151
|
+
<button type="button" class="hx-zoom-btn" data-action="zoom-in" title="Zoom In" aria-label="Zoom in" data-corn-kind="icon">+</button>
|
|
152
|
+
<button type="button" class="hx-zoom-btn" data-action="zoom-out" title="Zoom Out" aria-label="Zoom out" data-corn-kind="icon">−</button>
|
|
153
|
+
<button type="button" class="hx-zoom-btn" data-action="reset-view" title="Reset View" aria-label="Reset the view" data-corn-kind="icon">⟲</button>
|
|
154
|
+
<button type="button" class="hx-zoom-btn hx-zoom-btn--accent" data-action="fit" title="Fit to Screen" aria-label="Fit to the screen" data-corn-kind="icon">⛶</button>
|
|
153
155
|
</div>
|
|
154
156
|
|
|
155
157
|
<!-- Light, dark or the system's (theme.js): steps through them; its label says which is on -->
|
|
156
|
-
<button type="button" id="theme-toggle-btn" class="hx-btn hx-btn--icon" data-action="cycle-theme" aria-label="Theme: follows the system. Change theme" title="Theme: follows the system">
|
|
158
|
+
<button type="button" id="theme-toggle-btn" class="hx-btn hx-btn--icon" data-action="cycle-theme" aria-label="Theme: follows the system. Change theme" title="Theme: follows the system" data-corn="theme-toggle" data-corn-kind="icon">
|
|
157
159
|
<svg class="hx-theme-icon" viewBox="0 0 16 16" width="15" height="15" aria-hidden="true" focusable="false">
|
|
158
160
|
<!-- system: half a disc; light: a sun; dark: a moon (theme.js shows the one for the choice) -->
|
|
159
161
|
<g data-icon="system"><circle cx="8" cy="8" r="6" fill="none" stroke="currentColor" stroke-width="1.6" /><path d="M8 2a6 6 0 0 1 0 12z" fill="currentColor" /></g>
|
|
@@ -163,36 +165,36 @@
|
|
|
163
165
|
</button>
|
|
164
166
|
|
|
165
167
|
<!-- The named themes of the config (`theme.names`): filled and shown by explorer/theme-names.js; hidden when there are none -->
|
|
166
|
-
<select id="theme-name-select" class="hx-forge-select" style="width:auto;max-width:9rem" aria-label="Theme" title="Theme" hidden></select>
|
|
168
|
+
<select id="theme-name-select" class="hx-forge-select" style="width:auto;max-width:9rem" aria-label="Theme" title="Theme" data-corn="theme-picker" hidden></select>
|
|
167
169
|
|
|
168
170
|
<!-- The config's links (cornfield.config.js `links`), filled by explorer/plugins.js -->
|
|
169
|
-
<span id="cf-links" class="hx-links"></span>
|
|
171
|
+
<span id="cf-links" class="hx-links" data-corn="links"></span>
|
|
170
172
|
</div>
|
|
171
173
|
</header>
|
|
172
174
|
|
|
173
175
|
<!-- Mobile search bar -->
|
|
174
|
-
<div id="mobile-search-bar" class="hx-mobile-search glass-header" role="search" hidden>
|
|
175
|
-
<input type="text" id="mobile-node-search" class="hx-input hx-input--wide" placeholder="Search nodes, apps, components..." aria-label="Search nodes" />
|
|
176
|
-
<button type="button" class="hx-textbtn" data-action="clear-search" aria-label="Clear search">✕</button>
|
|
177
|
-
<button type="button" class="hx-textbtn" data-action="close-mobile-search">Cancel</button>
|
|
176
|
+
<div id="mobile-search-bar" class="hx-mobile-search glass-header" role="search" hidden data-corn="mobile-search">
|
|
177
|
+
<input type="text" id="mobile-node-search" class="hx-input hx-input--wide" placeholder="Search nodes, apps, components..." aria-label="Search nodes" data-corn="search-input" />
|
|
178
|
+
<button type="button" class="hx-textbtn" data-action="clear-search" aria-label="Clear search" data-corn-kind="quiet">✕</button>
|
|
179
|
+
<button type="button" class="hx-textbtn" data-action="close-mobile-search" data-corn-kind="quiet">Cancel</button>
|
|
178
180
|
</div>
|
|
179
181
|
|
|
180
182
|
<!-- The map -->
|
|
181
|
-
<div class="hx-stage" role="main">
|
|
183
|
+
<div class="hx-stage" role="main" data-corn="stage">
|
|
182
184
|
<!-- The map takes the keyboard when it has the focus (keyboard.js): its keys are below, read out with its name -->
|
|
183
|
-
<canvas id="graph-canvas" tabindex="0" role="application" aria-roledescription="map" aria-label="Topology map" aria-describedby="map-keys-help"></canvas>
|
|
185
|
+
<canvas id="graph-canvas" tabindex="0" role="application" aria-roledescription="map" aria-label="Topology map" aria-describedby="map-keys-help" data-corn="map-canvas"></canvas>
|
|
184
186
|
<p id="map-keys-help" class="hx-sr-only">Arrow keys pan, plus and minus zoom, 0 fits the map. N and P select the next and the previous node, Home and End the first and the last. Enter goes to the selected node's panel, Escape closes it. In Freeform, Alt and an arrow moves the selected node.</p>
|
|
185
187
|
<!-- What the keyboard landed on, said by a screen reader (keyboard.js) -->
|
|
186
188
|
<p id="map-announcer" class="hx-sr-only" role="status" aria-live="polite"></p>
|
|
187
189
|
<!-- Every label, drawn on its own transparent canvas over the map (explorer/labels.js); the map canvas still gets the pointer -->
|
|
188
|
-
<canvas id="label-canvas" aria-hidden="true"></canvas>
|
|
190
|
+
<canvas id="label-canvas" aria-hidden="true" data-corn="label-canvas"></canvas>
|
|
189
191
|
<!-- The nodes agent runs are changing, marked over the map (explorer/runs-map.js): a picture; the Runs view says the same in words -->
|
|
190
|
-
<div id="run-overlay" class="hx-run-overlay" aria-hidden="true" hidden></div>
|
|
192
|
+
<div id="run-overlay" class="hx-run-overlay" aria-hidden="true" hidden data-corn="run-overlay"></div>
|
|
191
193
|
|
|
192
194
|
<!-- Below 768px the proposal bar, the scenario player and the node panel stack here as bottom sheets (sheets.js); from 768px the dock is display: contents -->
|
|
193
|
-
<div id="sheet-dock" class="hx-dock">
|
|
195
|
+
<div id="sheet-dock" class="hx-dock" data-corn="dock">
|
|
194
196
|
<!-- The open proposal: counts, Before / Diff / After, problems, close (proposal.js) -->
|
|
195
|
-
<section id="proposal-bar" class="hx-proposal-bar glass" aria-label="Open proposal" hidden>
|
|
197
|
+
<section id="proposal-bar" class="hx-proposal-bar glass" aria-label="Open proposal" hidden data-corn="proposal-bar">
|
|
196
198
|
<p id="proposal-message" class="hx-proposal-message" role="status" hidden></p>
|
|
197
199
|
<div id="proposal-body">
|
|
198
200
|
<div class="hx-proposal-head">
|
|
@@ -203,7 +205,7 @@
|
|
|
203
205
|
<button type="button" class="hx-seg-btn" data-action="proposal-view" data-view="diff" aria-pressed="true">Diff</button>
|
|
204
206
|
<button type="button" class="hx-seg-btn" data-action="proposal-view" data-view="after" aria-pressed="false">After</button>
|
|
205
207
|
</div>
|
|
206
|
-
<button type="button" class="hx-btn hx-btn--quiet" data-action="close-proposal" title="Close the proposal and go back to the map">Close</button>
|
|
208
|
+
<button type="button" class="hx-btn hx-btn--quiet" data-action="close-proposal" title="Close the proposal and go back to the map" data-corn-kind="quiet">Close</button>
|
|
207
209
|
</div>
|
|
208
210
|
<p id="proposal-summary" class="hx-proposal-summary" hidden></p>
|
|
209
211
|
<details id="proposal-errors" class="hx-proposal-errors" hidden>
|
|
@@ -216,69 +218,69 @@
|
|
|
216
218
|
</section>
|
|
217
219
|
|
|
218
220
|
<!-- Issues and pull requests (forge-panel.js): a slide-over from the left on desktop, a bottom sheet on a phone; hidden and inert until the config names a forge -->
|
|
219
|
-
<aside id="forge-panel" class="hx-forge glass" aria-label="Issues and pull requests" inert hidden>
|
|
221
|
+
<aside id="forge-panel" class="hx-forge glass" aria-label="Issues and pull requests" inert hidden data-corn="forge-panel">
|
|
220
222
|
<div class="hx-forge-body">
|
|
221
223
|
<div class="hx-forge-head">
|
|
222
224
|
<h2 id="forge-title" class="hx-drawer-title" tabindex="-1">Issues and pull requests</h2>
|
|
223
|
-
<button type="button" class="hx-btn hx-btn--quiet" data-action="refresh-forge" title="Ask the forge again">Refresh</button>
|
|
224
|
-
<button type="button" class="hx-close" data-action="close-forge" aria-label="Close">✕</button>
|
|
225
|
+
<button type="button" class="hx-btn hx-btn--quiet" data-action="refresh-forge" title="Ask the forge again" data-corn-kind="quiet">Refresh</button>
|
|
226
|
+
<button type="button" class="hx-close" data-action="close-forge" aria-label="Close" data-corn-kind="icon">✕</button>
|
|
225
227
|
</div>
|
|
226
228
|
<p id="forge-status" class="hx-forge-status hx-faint"></p>
|
|
227
229
|
<div class="hx-forge-controls">
|
|
228
|
-
<div class="hx-forge-tabs" role="group" aria-label="Show">
|
|
229
|
-
<button type="button" class="hx-forge-tab" data-forge-kind="pulls" aria-pressed="true">Pull requests</button>
|
|
230
|
-
<button type="button" class="hx-forge-tab" data-forge-kind="issues" aria-pressed="false">Issues</button>
|
|
231
|
-
<button type="button" class="hx-forge-tab" data-forge-kind="threads" aria-pressed="false" title="Ideas and spec conversations, with the nodes they mention">Threads</button>
|
|
232
|
-
<button type="button" class="hx-forge-tab" data-forge-kind="deploys" aria-pressed="false">Deploys</button>
|
|
233
|
-
<button type="button" class="hx-forge-tab" data-forge-kind="work" aria-pressed="false" title="Work grouped by issue and proposal, agent-made work marked">Agents</button>
|
|
234
|
-
<button type="button" class="hx-forge-tab" data-forge-kind="notes" aria-pressed="false">Release notes</button>
|
|
230
|
+
<div class="hx-forge-tabs" role="group" aria-label="Show" data-corn="tabs">
|
|
231
|
+
<button type="button" class="hx-forge-tab" data-forge-kind="pulls" aria-pressed="true" data-corn="tab">Pull requests</button>
|
|
232
|
+
<button type="button" class="hx-forge-tab" data-forge-kind="issues" aria-pressed="false" data-corn="tab">Issues</button>
|
|
233
|
+
<button type="button" class="hx-forge-tab" data-forge-kind="threads" aria-pressed="false" title="Ideas and spec conversations, with the nodes they mention" data-corn="tab">Threads</button>
|
|
234
|
+
<button type="button" class="hx-forge-tab" data-forge-kind="deploys" aria-pressed="false" data-corn="tab">Deploys</button>
|
|
235
|
+
<button type="button" class="hx-forge-tab" data-forge-kind="work" aria-pressed="false" title="Work grouped by issue and proposal, agent-made work marked" data-corn="tab">Agents</button>
|
|
236
|
+
<button type="button" class="hx-forge-tab" data-forge-kind="notes" aria-pressed="false" data-corn="tab">Release notes</button>
|
|
235
237
|
</div>
|
|
236
238
|
<div id="forge-work-filters" class="hx-forge-work-filters" hidden>
|
|
237
239
|
<label class="hx-forge-toggle"><input type="checkbox" id="forge-work-agents" /> Agent-made only</label>
|
|
238
240
|
<label class="hx-forge-toggle"><input type="checkbox" id="forge-work-finished" /> Include merged and closed</label>
|
|
239
241
|
</div>
|
|
240
242
|
<div id="forge-filters" class="hx-forge-filters">
|
|
241
|
-
<label class="hx-forge-field">State<select id="forge-state" class="hx-forge-select"></select></label>
|
|
242
|
-
<label class="hx-forge-field">Label<select id="forge-label" class="hx-forge-select"></select></label>
|
|
243
|
-
<label class="hx-forge-field">Author<select id="forge-author" class="hx-forge-select"></select></label>
|
|
244
|
-
<label class="hx-forge-field hx-forge-field--text">Search<input type="search" id="forge-text" class="hx-forge-input" placeholder="Title, number, label" autocomplete="off" /></label>
|
|
243
|
+
<label class="hx-forge-field" data-corn="field">State<select id="forge-state" class="hx-forge-select"></select></label>
|
|
244
|
+
<label class="hx-forge-field" data-corn="field">Label<select id="forge-label" class="hx-forge-select"></select></label>
|
|
245
|
+
<label class="hx-forge-field" data-corn="field">Author<select id="forge-author" class="hx-forge-select"></select></label>
|
|
246
|
+
<label class="hx-forge-field hx-forge-field--text" data-corn="field">Search<input type="search" id="forge-text" class="hx-forge-input" placeholder="Title, number, label" autocomplete="off" /></label>
|
|
245
247
|
</div>
|
|
246
248
|
</div>
|
|
247
|
-
<p id="forge-notice" class="hx-forge-notice" hidden></p>
|
|
248
|
-
<p id="forge-act-note" class="hx-forge-notice" hidden></p>
|
|
249
|
+
<p id="forge-notice" class="hx-forge-notice" hidden data-corn="notice"></p>
|
|
250
|
+
<p id="forge-act-note" class="hx-forge-notice" hidden data-corn="notice"></p>
|
|
249
251
|
<!-- New idea (forge-panel.js): opens an issue with the threads label as you, on the forge; the thread itself lives there -->
|
|
250
252
|
<section id="forge-idea" class="hx-forge-notes" aria-label="New idea" hidden>
|
|
251
253
|
<div class="hx-forge-actions">
|
|
252
|
-
<button type="button" id="idea-open" class="hx-btn hx-btn--approve" data-action="idea-open" aria-expanded="false" aria-controls="idea-form">New idea …</button>
|
|
254
|
+
<button type="button" id="idea-open" class="hx-btn hx-btn--approve" data-action="idea-open" aria-expanded="false" aria-controls="idea-form" data-corn-kind="approve">New idea …</button>
|
|
253
255
|
</div>
|
|
254
|
-
<p id="idea-message" class="hx-forge-msg" role="status" hidden></p>
|
|
256
|
+
<p id="idea-message" class="hx-forge-msg" role="status" hidden data-corn="message"></p>
|
|
255
257
|
<div id="idea-form" class="hx-forge-confirm" role="group" aria-labelledby="idea-form-title" hidden>
|
|
256
258
|
<h3 id="idea-form-title" class="hx-forge-confirm-title">New idea</h3>
|
|
257
259
|
<p id="idea-words"></p>
|
|
258
|
-
<label class="hx-forge-field">Title<input type="text" id="idea-title" class="hx-forge-input" maxlength="256" autocomplete="off" /></label>
|
|
259
|
-
<label class="hx-forge-field">What is the idea?<textarea id="idea-body" class="hx-forge-preview hx-thread-compose" rows="6" maxlength="20000" spellcheck="true"></textarea></label>
|
|
260
|
+
<label class="hx-forge-field" data-corn="field">Title<input type="text" id="idea-title" class="hx-forge-input" maxlength="256" autocomplete="off" /></label>
|
|
261
|
+
<label class="hx-forge-field" data-corn="field">What is the idea?<textarea id="idea-body" class="hx-forge-preview hx-thread-compose" rows="6" maxlength="20000" spellcheck="true"></textarea></label>
|
|
260
262
|
<div class="hx-forge-actions">
|
|
261
|
-
<button type="button" id="idea-send" class="hx-btn hx-btn--approve" data-action="idea-send">Open the idea</button>
|
|
262
|
-
<button type="button" class="hx-btn hx-btn--quiet" data-action="idea-cancel">Cancel</button>
|
|
263
|
+
<button type="button" id="idea-send" class="hx-btn hx-btn--approve" data-action="idea-send" data-corn-kind="approve">Open the idea</button>
|
|
264
|
+
<button type="button" class="hx-btn hx-btn--quiet" data-action="idea-cancel" data-corn-kind="quiet">Cancel</button>
|
|
263
265
|
</div>
|
|
264
266
|
</div>
|
|
265
267
|
</section>
|
|
266
268
|
<!-- Release notes (forge-panel.js): the pull requests merged since a tag, grouped by the map; copy them, or have the forge keep them as a draft release -->
|
|
267
269
|
<section id="forge-notes" class="hx-forge-notes" aria-label="Release notes" hidden>
|
|
268
|
-
<label class="hx-forge-field">Since tag<select id="notes-since" class="hx-forge-select"></select></label>
|
|
269
|
-
<label class="hx-forge-field">Draft, in Markdown<textarea id="notes-preview" class="hx-forge-preview" rows="14" readonly spellcheck="false"></textarea></label>
|
|
270
|
+
<label class="hx-forge-field" data-corn="field">Since tag<select id="notes-since" class="hx-forge-select"></select></label>
|
|
271
|
+
<label class="hx-forge-field" data-corn="field">Draft, in Markdown<textarea id="notes-preview" class="hx-forge-preview" rows="14" readonly spellcheck="false"></textarea></label>
|
|
270
272
|
<div class="hx-forge-actions">
|
|
271
273
|
<button type="button" id="notes-copy" class="hx-btn" data-action="copy-notes">Copy</button>
|
|
272
|
-
<button type="button" id="notes-post" class="hx-btn hx-btn--approve" data-action="post-notes" aria-expanded="false" aria-controls="notes-confirm">Post as draft …</button>
|
|
274
|
+
<button type="button" id="notes-post" class="hx-btn hx-btn--approve" data-action="post-notes" aria-expanded="false" aria-controls="notes-confirm" data-corn-kind="approve">Post as draft …</button>
|
|
273
275
|
</div>
|
|
274
|
-
<p id="notes-message" class="hx-forge-msg" hidden></p>
|
|
276
|
+
<p id="notes-message" class="hx-forge-msg" hidden data-corn="message"></p>
|
|
275
277
|
<div id="notes-confirm" class="hx-forge-confirm" role="group" aria-labelledby="notes-confirm-title" hidden>
|
|
276
278
|
<h3 id="notes-confirm-title" class="hx-forge-confirm-title">Post as a draft release</h3>
|
|
277
279
|
<p id="notes-confirm-words"></p>
|
|
278
|
-
<label class="hx-forge-field">Tag for the draft<input type="text" id="notes-tag" class="hx-forge-input" autocomplete="off" spellcheck="false" /></label>
|
|
280
|
+
<label class="hx-forge-field" data-corn="field">Tag for the draft<input type="text" id="notes-tag" class="hx-forge-input" autocomplete="off" spellcheck="false" /></label>
|
|
279
281
|
<div class="hx-forge-actions">
|
|
280
|
-
<button type="button" id="notes-confirm-yes" class="hx-btn hx-btn--approve" data-action="confirm-notes">Create the draft</button>
|
|
281
|
-
<button type="button" class="hx-btn hx-btn--quiet" data-action="cancel-notes">Cancel</button>
|
|
282
|
+
<button type="button" id="notes-confirm-yes" class="hx-btn hx-btn--approve" data-action="confirm-notes" data-corn-kind="approve">Create the draft</button>
|
|
283
|
+
<button type="button" class="hx-btn hx-btn--quiet" data-action="cancel-notes" data-corn-kind="quiet">Cancel</button>
|
|
282
284
|
</div>
|
|
283
285
|
</div>
|
|
284
286
|
</section>
|
|
@@ -287,8 +289,8 @@
|
|
|
287
289
|
<h3 id="forge-runs-title" class="hx-forge-runs-title">Agent runs</h3>
|
|
288
290
|
<p id="forge-runs-status" class="hx-forge-meta hx-faint"></p>
|
|
289
291
|
<p id="forge-runs-runner" class="hx-forge-meta" hidden></p>
|
|
290
|
-
<p id="forge-runs-note" class="hx-forge-notice" hidden></p>
|
|
291
|
-
<p id="forge-runs-trigger" class="hx-forge-notice" hidden></p>
|
|
292
|
+
<p id="forge-runs-note" class="hx-forge-notice" hidden data-corn="notice"></p>
|
|
293
|
+
<p id="forge-runs-trigger" class="hx-forge-notice" hidden data-corn="notice"></p>
|
|
292
294
|
<div id="forge-runs-totals" role="group" aria-label="Tokens and cost the runners reported" hidden></div>
|
|
293
295
|
<ul id="forge-runs-hand" class="hx-forge-meta" aria-label="Requests written by hand that started nothing" hidden></ul>
|
|
294
296
|
<ul id="forge-runs-list" class="hx-forge-files" aria-label="Runs"></ul>
|
|
@@ -300,14 +302,14 @@
|
|
|
300
302
|
</aside>
|
|
301
303
|
|
|
302
304
|
<!-- Node panel: a slide-over on desktop, a bottom sheet on mobile -->
|
|
303
|
-
<aside id="spec-drawer" class="hx-drawer glass" aria-label="Node details" inert>
|
|
305
|
+
<aside id="spec-drawer" class="hx-drawer glass" aria-label="Node details" inert data-corn="node-panel">
|
|
304
306
|
<div class="hx-drawer-body">
|
|
305
307
|
<div class="hx-drawer-head">
|
|
306
308
|
<span class="hx-drawer-title-wrap">
|
|
307
|
-
<span id="drawer-badge" class="hx-badge">ATOM</span>
|
|
309
|
+
<span id="drawer-badge" class="hx-badge" data-corn="badge">ATOM</span>
|
|
308
310
|
<h2 id="drawer-title" class="hx-drawer-title"><pop-button></h2>
|
|
309
311
|
</span>
|
|
310
|
-
<button type="button" class="hx-close" data-action="close-drawer" aria-label="Close">✕</button>
|
|
312
|
+
<button type="button" class="hx-close" data-action="close-drawer" aria-label="Close" data-corn-kind="icon">✕</button>
|
|
311
313
|
</div>
|
|
312
314
|
|
|
313
315
|
<p id="drawer-description" class="hx-faint hx-lead"></p>
|
|
@@ -331,78 +333,78 @@
|
|
|
331
333
|
</div>
|
|
332
334
|
|
|
333
335
|
<!-- Mobile zoom and fit, within thumb reach -->
|
|
334
|
-
<div class="hx-mobile-zoom glass hx-only-mobile">
|
|
335
|
-
<button type="button" class="hx-zoom-btn" data-action="zoom-in" aria-label="Zoom In">+</button>
|
|
336
|
-
<button type="button" class="hx-zoom-btn" data-action="zoom-out" aria-label="Zoom Out">−</button>
|
|
337
|
-
<button type="button" class="hx-zoom-btn hx-zoom-btn--accent" data-action="fit" title="Fit to Screen" aria-label="Fit View">⛶</button>
|
|
336
|
+
<div class="hx-mobile-zoom glass hx-only-mobile" data-corn="zoom">
|
|
337
|
+
<button type="button" class="hx-zoom-btn" data-action="zoom-in" aria-label="Zoom In" data-corn-kind="icon">+</button>
|
|
338
|
+
<button type="button" class="hx-zoom-btn" data-action="zoom-out" aria-label="Zoom Out" data-corn-kind="icon">−</button>
|
|
339
|
+
<button type="button" class="hx-zoom-btn hx-zoom-btn--accent" data-action="fit" title="Fit to Screen" aria-label="Fit View" data-corn-kind="icon">⛶</button>
|
|
338
340
|
</div>
|
|
339
341
|
|
|
340
|
-
<div class="hx-hint glass">
|
|
342
|
+
<div class="hx-hint glass" data-corn="hint">
|
|
341
343
|
<span class="hx-accent" aria-hidden="true">👆</span>
|
|
342
344
|
<span id="instruction-badge-text">Tap node to inspect live spec</span>
|
|
343
345
|
</div>
|
|
344
346
|
|
|
345
347
|
<!-- Loading and error states: a failed load never leaves a blank canvas -->
|
|
346
|
-
<div id="loading-state" class="hx-state" role="status">Loading topology.json …</div>
|
|
347
|
-
<div id="error-state" class="hx-state hx-state--error glass" role="alert" hidden>
|
|
348
|
+
<div id="loading-state" class="hx-state" role="status" data-corn="loading">Loading topology.json …</div>
|
|
349
|
+
<div id="error-state" class="hx-state hx-state--error glass" role="alert" hidden data-corn="error">
|
|
348
350
|
<strong>The map could not be loaded</strong>
|
|
349
351
|
<p id="error-message"></p>
|
|
350
352
|
<p class="hx-faint">The explorer reads /topology.json from the cornfield server (cornfield serve). Run cornfield sync if the repo has no map yet, check that the server is up, then retry.</p>
|
|
351
|
-
<button type="button" class="hx-btn hx-btn--active" data-action="retry">Retry</button>
|
|
353
|
+
<button type="button" class="hx-btn hx-btn--active" data-action="retry" data-corn-kind="primary">Retry</button>
|
|
352
354
|
</div>
|
|
353
355
|
|
|
354
|
-
<div id="drawer-backdrop" class="hx-backdrop" data-action="close-drawer" hidden></div>
|
|
356
|
+
<div id="drawer-backdrop" class="hx-backdrop" data-action="close-drawer" hidden data-corn="backdrop"></div>
|
|
355
357
|
|
|
356
358
|
</div>
|
|
357
359
|
|
|
358
360
|
<!-- The confirm step of landing a pull request, starting a spec and opening a build issue (forge-panel.js): a modal dialog over a scrim; the focus stays in it while it is open -->
|
|
359
|
-
<div id="forge-confirm" class="hx-confirm-scrim" hidden>
|
|
360
|
-
<div class="hx-confirm glass" role="dialog" aria-modal="true" aria-labelledby="forge-confirm-title" aria-describedby="forge-confirm-body">
|
|
361
|
+
<div id="forge-confirm" class="hx-confirm-scrim" hidden data-corn="dialog-scrim">
|
|
362
|
+
<div class="hx-confirm glass" role="dialog" aria-modal="true" aria-labelledby="forge-confirm-title" aria-describedby="forge-confirm-body" data-corn="confirm-dialog">
|
|
361
363
|
<h2 id="forge-confirm-title" class="hx-confirm-title"></h2>
|
|
362
364
|
<div id="forge-confirm-body"></div>
|
|
363
365
|
<div class="hx-confirm-actions">
|
|
364
366
|
<button type="button" class="hx-btn" data-action="forge-confirm-cancel">Cancel</button>
|
|
365
|
-
<button type="button" class="hx-btn hx-btn--approve" data-action="forge-confirm-go">Land it</button>
|
|
367
|
+
<button type="button" class="hx-btn hx-btn--approve" data-action="forge-confirm-go" data-corn-kind="approve">Land it</button>
|
|
366
368
|
</div>
|
|
367
369
|
</div>
|
|
368
370
|
</div>
|
|
369
371
|
|
|
370
372
|
<!-- Start an agent (forge-panel.js): kind, profile, a brief, and a confirm step; a modal dialog over a scrim, the focus stays in it -->
|
|
371
|
-
<div id="agent-start" class="hx-confirm-scrim" hidden>
|
|
372
|
-
<div class="hx-confirm glass" role="dialog" aria-modal="true" aria-labelledby="agent-start-title" aria-describedby="agent-start-words">
|
|
373
|
+
<div id="agent-start" class="hx-confirm-scrim" hidden data-corn="dialog-scrim">
|
|
374
|
+
<div class="hx-confirm glass" role="dialog" aria-modal="true" aria-labelledby="agent-start-title" aria-describedby="agent-start-words" data-corn="agent-dialog">
|
|
373
375
|
<h2 id="agent-start-title" class="hx-confirm-title">Start an agent</h2>
|
|
374
376
|
<p id="agent-start-about" class="hx-forge-meta"></p>
|
|
375
377
|
<p id="agent-start-runner" class="hx-forge-meta" hidden></p>
|
|
376
378
|
<p id="agent-retry-note" class="hx-forge-meta" hidden></p>
|
|
377
379
|
<form id="agent-start-form" class="hx-forge-confirm" novalidate>
|
|
378
|
-
<label class="hx-forge-field">Kind of run<select id="agent-kind" class="hx-forge-select"></select></label>
|
|
379
|
-
<label id="agent-profile-field" class="hx-forge-field" hidden>Profile<select id="agent-profile" class="hx-forge-select"></select></label>
|
|
380
|
+
<label class="hx-forge-field" data-corn="field">Kind of run<select id="agent-kind" class="hx-forge-select"></select></label>
|
|
381
|
+
<label id="agent-profile-field" class="hx-forge-field" hidden data-corn="field">Profile<select id="agent-profile" class="hx-forge-select"></select></label>
|
|
380
382
|
<fieldset id="agent-limits-edit" class="hx-forge-field hx-forge-limits"><legend>Limits, hints for the runner (one left blank takes the config's, if any)</legend>
|
|
381
|
-
<label class="hx-forge-field">Minutes<input type="number" id="agent-limit-minutes" class="hx-forge-input" min="0" step="any" inputmode="decimal" /></label>
|
|
382
|
-
<label class="hx-forge-field">Turns<input type="number" id="agent-limit-turns" class="hx-forge-input" min="0" step="1" inputmode="numeric" /></label>
|
|
383
|
-
<label class="hx-forge-field">Cost<input type="number" id="agent-limit-cost" class="hx-forge-input" min="0" step="any" inputmode="decimal" /></label>
|
|
384
|
-
<label class="hx-forge-field">Tokens<input type="number" id="agent-limit-tokens" class="hx-forge-input" min="0" step="1" inputmode="numeric" /></label>
|
|
383
|
+
<label class="hx-forge-field" data-corn="field">Minutes<input type="number" id="agent-limit-minutes" class="hx-forge-input" min="0" step="any" inputmode="decimal" /></label>
|
|
384
|
+
<label class="hx-forge-field" data-corn="field">Turns<input type="number" id="agent-limit-turns" class="hx-forge-input" min="0" step="1" inputmode="numeric" /></label>
|
|
385
|
+
<label class="hx-forge-field" data-corn="field">Cost<input type="number" id="agent-limit-cost" class="hx-forge-input" min="0" step="any" inputmode="decimal" /></label>
|
|
386
|
+
<label class="hx-forge-field" data-corn="field">Tokens<input type="number" id="agent-limit-tokens" class="hx-forge-input" min="0" step="1" inputmode="numeric" /></label>
|
|
385
387
|
</fieldset>
|
|
386
|
-
<label class="hx-forge-field">Brief for the runner<textarea id="agent-brief" class="hx-forge-preview" rows="6" maxlength="20000" spellcheck="true"></textarea></label>
|
|
388
|
+
<label class="hx-forge-field" data-corn="field">Brief for the runner<textarea id="agent-brief" class="hx-forge-preview" rows="6" maxlength="20000" spellcheck="true"></textarea></label>
|
|
387
389
|
<label id="agent-force-field" class="hx-forge-toggle" hidden><input type="checkbox" id="agent-force" /> Ask for another run on purpose</label>
|
|
388
390
|
<p id="agent-start-words" class="hx-confirm-note"></p>
|
|
389
|
-
<p id="agent-start-msg" class="hx-forge-msg hx-forge-msg--bad" role="alert" hidden></p>
|
|
391
|
+
<p id="agent-start-msg" class="hx-forge-msg hx-forge-msg--bad" role="alert" hidden data-corn="message" data-corn-state="failure"></p>
|
|
390
392
|
<div class="hx-confirm-actions">
|
|
391
393
|
<button type="button" class="hx-btn" data-action="agent-start-cancel">Cancel</button>
|
|
392
|
-
<button type="submit" class="hx-btn hx-btn--approve" id="agent-start-go">Ask the runner</button>
|
|
394
|
+
<button type="submit" class="hx-btn hx-btn--approve" id="agent-start-go" data-corn-kind="approve">Ask the runner</button>
|
|
393
395
|
</div>
|
|
394
396
|
</form>
|
|
395
397
|
</div>
|
|
396
398
|
</div>
|
|
397
399
|
|
|
398
400
|
<!-- Review tokens (review-tokens.js): make one (shown once), list them, revoke; a modal dialog over a scrim, the focus stays in it -->
|
|
399
|
-
<div id="tokens-dialog" class="hx-confirm-scrim" hidden>
|
|
400
|
-
<div class="hx-confirm glass" role="dialog" aria-modal="true" aria-labelledby="tokens-title" aria-describedby="tokens-intro">
|
|
401
|
+
<div id="tokens-dialog" class="hx-confirm-scrim" hidden data-corn="dialog-scrim">
|
|
402
|
+
<div class="hx-confirm glass" role="dialog" aria-modal="true" aria-labelledby="tokens-title" aria-describedby="tokens-intro" data-corn="tokens-dialog">
|
|
401
403
|
<h2 id="tokens-title" class="hx-confirm-title" tabindex="-1">Review tokens</h2>
|
|
402
404
|
<p id="tokens-intro" class="hx-confirm-note">A review token lets a script or a chat bot approve or send back a proposal as you (<code class="hx-code">POST /api/reviews</code>). It works while you are signed in here and still maintain the repo; it expires, and you can revoke it below.</p>
|
|
403
|
-
<p id="tokens-msg" class="hx-forge-msg" role="status" hidden></p>
|
|
405
|
+
<p id="tokens-msg" class="hx-forge-msg" role="status" hidden data-corn="message"></p>
|
|
404
406
|
<div id="tokens-secret" class="hx-tokens-secret" hidden>
|
|
405
|
-
<label class="hx-forge-field" for="tokens-secret-value">Your new token (copy it now, it is not shown again)</label>
|
|
407
|
+
<label class="hx-forge-field" for="tokens-secret-value" data-corn="field">Your new token (copy it now, it is not shown again)</label>
|
|
406
408
|
<div class="hx-tokens-row">
|
|
407
409
|
<input id="tokens-secret-value" class="hx-forge-input hx-mono" type="text" readonly spellcheck="false" autocomplete="off" />
|
|
408
410
|
<button type="button" class="hx-btn" data-tokens-copy>Copy</button>
|
|
@@ -410,11 +412,11 @@
|
|
|
410
412
|
</div>
|
|
411
413
|
<ul id="tokens-list" class="hx-tokens-list" aria-label="Your review tokens"></ul>
|
|
412
414
|
<form id="tokens-form" class="hx-tokens-form" autocomplete="off">
|
|
413
|
-
<label class="hx-forge-field">Kind of token<select id="tokens-scope" class="hx-forge-select"><option value="review">Review: approve or send back proposals</option><option value="agent">Agent: ask for agent runs (POST /api/agent-requests)</option><option value="runner">Runner: pull, claim and report on runs (GET /api/agent-requests)</option></select></label>
|
|
414
|
-
<label class="hx-forge-field">Label<input id="tokens-label" class="hx-forge-input" type="text" maxlength="60" placeholder="chat bot" /></label>
|
|
415
|
-
<label class="hx-forge-field">Days<input id="tokens-days" class="hx-forge-input" type="text" inputmode="numeric" maxlength="2" aria-describedby="tokens-days-hint" /></label>
|
|
415
|
+
<label class="hx-forge-field" data-corn="field">Kind of token<select id="tokens-scope" class="hx-forge-select"><option value="review">Review: approve or send back proposals</option><option value="agent">Agent: ask for agent runs (POST /api/agent-requests)</option><option value="runner">Runner: pull, claim and report on runs (GET /api/agent-requests)</option></select></label>
|
|
416
|
+
<label class="hx-forge-field" data-corn="field">Label<input id="tokens-label" class="hx-forge-input" type="text" maxlength="60" placeholder="chat bot" /></label>
|
|
417
|
+
<label class="hx-forge-field" data-corn="field">Days<input id="tokens-days" class="hx-forge-input" type="text" inputmode="numeric" maxlength="2" aria-describedby="tokens-days-hint" /></label>
|
|
416
418
|
<span id="tokens-days-hint" class="hx-sr-only"></span>
|
|
417
|
-
<button type="submit" id="tokens-make" class="hx-btn hx-btn--approve">Make a token</button>
|
|
419
|
+
<button type="submit" id="tokens-make" class="hx-btn hx-btn--approve" data-corn-kind="approve">Make a token</button>
|
|
418
420
|
</form>
|
|
419
421
|
<div class="hx-confirm-actions">
|
|
420
422
|
<button type="button" class="hx-btn" data-tokens-close>Close</button>
|
package/explorer/layers.js
CHANGED
|
@@ -75,7 +75,7 @@ export function renderLayerToggles() {
|
|
|
75
75
|
const on = state.activeLayers[layer.key] !== false;
|
|
76
76
|
const color = themed(layer.color, state.theme); // the dot is the colour the map draws on this ground
|
|
77
77
|
return `
|
|
78
|
-
<button type="button" class="hx-toggle-row${on ? '' : ' is-off'}" data-action="toggle-layer" data-layer="${layer.key}" aria-pressed="${on}" title="${layer.desc}">
|
|
78
|
+
<button type="button" class="hx-toggle-row${on ? '' : ' is-off'}" data-action="toggle-layer" data-layer="${layer.key}" aria-pressed="${on}" title="${layer.desc}" data-corn="row">
|
|
79
79
|
<span class="hx-toggle-label">
|
|
80
80
|
<span class="hx-dot" style="background-color: ${color}; box-shadow: ${on && state.theme !== 'light' ? `0 0 8px ${color}90` : 'none'}"></span>
|
|
81
81
|
<span class="hx-toggle-name">${layer.label}</span>${layer.live ? '<span class="hx-live-tag">live</span>' : ''}
|
package/explorer/live-model.js
CHANGED
|
@@ -444,7 +444,7 @@ export function createLiveRunner({ source, groups, wanted, visible = () => true,
|
|
|
444
444
|
export function liveDetailsHtml(node, live, esc) {
|
|
445
445
|
if (!node) return '';
|
|
446
446
|
const answer = live && live.answer;
|
|
447
|
-
const sec = (title, body) => `<div class="hx-sec hx-live-sec"><strong class="hx-strong">${title}</strong>${body}</div>`;
|
|
447
|
+
const sec = (title, body) => `<div class="hx-sec hx-live-sec" data-corn="section"><strong class="hx-strong">${title}</strong>${body}</div>`;
|
|
448
448
|
const when = answer ? `<div class="hx-faint">Live · ${esc(clockOf(answer.at))}</div>` : '';
|
|
449
449
|
|
|
450
450
|
if (node.type === 'persona') {
|
package/explorer/live.js
CHANGED
|
@@ -169,7 +169,7 @@ function paintChip() {
|
|
|
169
169
|
row.innerHTML = `
|
|
170
170
|
<span class="hx-live-buttons">
|
|
171
171
|
<button type="button" class="hx-btn" data-live="refresh"${loading ? ' disabled' : ''}>Refresh</button>
|
|
172
|
-
${has ? '<button type="button" class="hx-btn" data-live="token-forget">Forget token</button>' : ''}
|
|
172
|
+
${has ? '<button type="button" class="hx-btn" data-live="token-forget" data-corn-kind="danger">Forget token</button>' : ''}
|
|
173
173
|
</span>
|
|
174
174
|
<span class="hx-faint">${escHtml(source && source.name ? source.name : '')}</span>`;
|
|
175
175
|
}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
import { state, escHtml } from './state.js';
|
|
15
15
|
import { mockupsOf } from '../core/proposal.js';
|
|
16
|
+
import { cornStateAttr } from './corn-state.js';
|
|
16
17
|
|
|
17
18
|
const STATE_WORDS = {
|
|
18
19
|
approved: 'Reviewed',
|
|
@@ -55,11 +56,11 @@ export function mockupsFor(proposal, slug, source, nodeId, states = {}) {
|
|
|
55
56
|
*/
|
|
56
57
|
export function mockupsSectionHtml(items) {
|
|
57
58
|
if (!items.length) return '';
|
|
58
|
-
const rows = items.map((m) => `<li class="hx-mockup-item">
|
|
59
|
+
const rows = items.map((m) => `<li class="hx-mockup-item" data-corn="row">
|
|
59
60
|
<button type="button" class="hx-btn hx-mockup-open" data-mockup="${m.index}" aria-haspopup="dialog">${escHtml(m.title)}<span class="hx-sr-only"> (${m.type === 'page' ? 'page' : 'image'}, opens in a window)</span></button>
|
|
60
|
-
<span class="hx-mockup-state hx-mockup-state--${escHtml(m.state)}">${escHtml(stateWords(m.state))}</span>
|
|
61
|
+
<span class="hx-mockup-state hx-mockup-state--${escHtml(m.state)}" data-corn="state-pill"${cornStateAttr(m.state)}>${escHtml(stateWords(m.state))}</span>
|
|
61
62
|
</li>`).join('');
|
|
62
|
-
return `<div class="hx-sec hx-mockups" data-mockups>
|
|
63
|
+
return `<div class="hx-sec hx-mockups" data-mockups data-corn="section">
|
|
63
64
|
<strong class="hx-strong" id="hx-mockups-h">${items.length === 1 ? 'Mockup' : 'Mockups'}</strong>
|
|
64
65
|
<ul class="hx-mockup-list" aria-labelledby="hx-mockups-h">${rows}</ul>
|
|
65
66
|
</div>`;
|
package/explorer/mockups.js
CHANGED
|
@@ -23,6 +23,7 @@ import { state } from './state.js';
|
|
|
23
23
|
import { hooks } from './proposal.js';
|
|
24
24
|
import { mockupsOf } from '../core/proposal.js';
|
|
25
25
|
import { mockupsFor, mockupsSectionHtml, stateWords } from './mockups-model.js';
|
|
26
|
+
import { cornState } from './corn-state.js';
|
|
26
27
|
|
|
27
28
|
const $ = (id) => document.getElementById(id);
|
|
28
29
|
|
|
@@ -122,6 +123,7 @@ export function openMockup(index, opener = null) {
|
|
|
122
123
|
returnTo = opener;
|
|
123
124
|
dialog = document.createElement('div');
|
|
124
125
|
dialog.className = 'hx-mockup-dialog';
|
|
126
|
+
dialog.dataset.corn = 'mockup-dialog';
|
|
125
127
|
dialog.setAttribute('role', 'dialog');
|
|
126
128
|
dialog.setAttribute('aria-modal', 'true');
|
|
127
129
|
dialog.setAttribute('aria-labelledby', 'mockup-title');
|
|
@@ -142,6 +144,8 @@ export function openMockup(index, opener = null) {
|
|
|
142
144
|
const status = document.createElement('p');
|
|
143
145
|
status.id = 'mockup-state';
|
|
144
146
|
status.className = `hx-mockup-state hx-mockup-state--${item.state}`;
|
|
147
|
+
status.dataset.corn = 'state-pill';
|
|
148
|
+
if (cornState(item.state)) status.dataset.cornState = cornState(item.state);
|
|
145
149
|
status.textContent = stateWords(item.state);
|
|
146
150
|
const stage = document.createElement('div');
|
|
147
151
|
stage.className = 'hx-mockup-stage';
|