cornfield 0.47.0 → 0.48.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/contrast.js +6 -6
- package/explorer/css/account.css +46 -0
- package/explorer/css/base.css +159 -0
- package/explorer/css/changes.css +160 -0
- package/explorer/css/decision.css +68 -0
- package/explorer/css/dialogs.css +50 -0
- package/explorer/css/header.css +75 -0
- package/explorer/css/layers.css +92 -0
- package/explorer/css/live.css +48 -0
- package/explorer/css/map.css +43 -0
- package/explorer/css/node-panel.css +188 -0
- package/explorer/css/page.css +83 -0
- package/explorer/css/proposal.css +151 -0
- package/explorer/css/search.css +84 -0
- package/explorer/css/sheets.css +134 -0
- package/explorer/css/whatif.css +55 -0
- package/explorer/css/work.css +288 -0
- package/explorer/engine/map-style.js +2 -2
- package/explorer/focus-room.js +1 -1
- package/explorer/header-fit.js +3 -3
- package/explorer/house.css +1 -1
- package/explorer/index.html +18 -3
- package/explorer/pieces/map-stage.css +1 -1
- package/explorer/review.js +1 -1
- package/explorer/theme-model.js +1 -1
- package/explorer/theme.js +1 -1
- package/explorer/tokens.css +2 -2
- package/package.json +1 -1
- package/server/components.js +144 -0
- package/server/embed.js +3 -1
- package/server/server.js +9 -1
- package/explorer/explorer.css +0 -1512
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* work.css: the Work panel
|
|
3
|
+
* The Work panel (forge-panel.js, runs-view.js) and its tabs (Specs, PRs, Issues, Threads, Runs, Deploys): the slide-over from the left from
|
|
4
|
+
* 768px, a bottom sheet below; the Work toggle in the header; the states, results and skeletons. Read by corn-work (D4); its tabs follow as
|
|
5
|
+
* pieces of their own.
|
|
6
|
+
* No rule here asks what the document says (`:root`, `html`, `body`, `[data-theme]`), sizes from the window (`vw`, `vh`) or is `position: fixed` unless it says why;
|
|
7
|
+
* a width rule is a container query on `corn-box` (page.css), a height rule on `corn-page`. base.css loads first.
|
|
8
|
+
*/
|
|
9
|
+
/* The Work toggle: opens the Work panel (forge-panel.js says in the tag which pull request is lit) */
|
|
10
|
+
.hx-work { display: inline-flex; align-items: center; gap: var(--corn-space-2); height: var(--hx-control-h); padding: 0 var(--corn-space-4); border-radius: var(--corn-radius-sm); border: var(--corn-border) solid var(--corn-line); background: var(--corn-surface-2); color: var(--corn-text-2); font-size: var(--corn-text-sm); font-weight: 600; white-space: nowrap; }
|
|
11
|
+
.hx-work:hover { background: var(--corn-surface-3); color: var(--corn-text); }
|
|
12
|
+
.hx-work[aria-expanded="true"] { background: var(--corn-accent); border-color: var(--corn-accent-text); color: var(--corn-text-on-accent); }
|
|
13
|
+
.hx-forge-lit { padding: 0 var(--corn-space-2); border-radius: var(--corn-radius-pill); border: var(--corn-border) solid var(--corn-warn); background: var(--corn-ground); color: var(--corn-warn); font-size: var(--corn-text-2xs); }
|
|
14
|
+
@container corn-box (max-width: 767px) {
|
|
15
|
+
.hx-work { height: var(--hx-control-h); min-width: var(--hx-control-h); justify-content: center; padding: 0 var(--corn-space-3); }
|
|
16
|
+
.hx-forge-lit { display: none; }
|
|
17
|
+
}
|
|
18
|
+
/* ---- the issues and PRs panel (forge-panel.js, CF-07) -------------------------------------------
|
|
19
|
+
A slide-over from the left from 768px (the node panel is the one from the right), a bottom sheet in #sheet-dock below.
|
|
20
|
+
Closed, it is inert (forge-panel.js), and off screen or not displayed. Only the tokens above are used, so it follows the theme. */
|
|
21
|
+
.hx-forge { --hx-forge-status-w: 56px; }
|
|
22
|
+
.hx-forge { display: flex; flex-direction: column; z-index: 40; border-color: var(--corn-line); pointer-events: none; touch-action: pan-y; transition: transform 0.2s ease-out; }
|
|
23
|
+
.hx-forge * { touch-action: pan-y; }
|
|
24
|
+
.hx-forge.forge-open { pointer-events: auto; }
|
|
25
|
+
.hx-forge:not(.forge-open) { box-shadow: none; }
|
|
26
|
+
@container corn-box (min-width: 768px) {
|
|
27
|
+
.hx-forge { position: absolute; top: 0; left: 0; bottom: 0; width: var(--hx-forge-w); border-left: 0; transform: translateX(-100%); box-shadow: var(--corn-shadow-lg); }
|
|
28
|
+
.hx-forge.forge-open { transform: translateX(0); }
|
|
29
|
+
}
|
|
30
|
+
@container corn-box (max-width: 767px) {
|
|
31
|
+
.hx-forge:not(.forge-open) { display: none; }
|
|
32
|
+
.hx-forge { max-height: 60cqh; }
|
|
33
|
+
}
|
|
34
|
+
.hx-forge-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: var(--corn-space-4); padding: var(--corn-panel-pad); overflow-y: auto; user-select: text; font-size: var(--corn-text-sm); }
|
|
35
|
+
.hx-forge-head { display: flex; align-items: center; gap: var(--corn-space-3); padding-bottom: var(--corn-space-3); border-bottom: var(--corn-border) solid var(--corn-line-soft); }
|
|
36
|
+
.hx-forge-head .hx-drawer-title { flex: 1; min-width: 0; }
|
|
37
|
+
.hx-forge-status, .hx-forge-rate { font-size: var(--corn-text-xs); line-height: 1.5; }
|
|
38
|
+
.hx-forge-controls { display: flex; flex-direction: column; gap: var(--corn-space-3); padding: var(--corn-space-3); border: var(--corn-border) solid var(--corn-line); border-radius: var(--corn-radius); background: var(--corn-surface-2); } /* the Filter chip's box */
|
|
39
|
+
/* The tabs, in the order of the loop: underlined here, pills that scroll sideways on a phone (below) */
|
|
40
|
+
.hx-forge-tabs { display: flex; gap: calc(var(--corn-space-1) / 2); margin: 0 calc(var(--corn-space-4) * -1); padding: 0 var(--corn-space-4); border-bottom: var(--corn-border) solid var(--corn-line); overflow-x: auto; scrollbar-width: none; }
|
|
41
|
+
.hx-forge-tabs::-webkit-scrollbar { display: none; }
|
|
42
|
+
.hx-forge-tab { flex: none; display: inline-flex; align-items: baseline; min-height: var(--hx-control-h); gap: var(--corn-space-1); padding: var(--corn-space-2) var(--corn-space-3) var(--corn-space-3); border: 0; border-bottom: var(--corn-border-strong) solid transparent; background: none; white-space: nowrap; color: var(--corn-text-2); font-size: var(--corn-text-sm); font-weight: 500; }
|
|
43
|
+
.hx-forge-tab:hover { color: var(--corn-text); }
|
|
44
|
+
.hx-forge-tab[aria-pressed="true"] { border-bottom-color: var(--corn-accent); color: var(--corn-text); font-weight: 600; }
|
|
45
|
+
.hx-forge-tab:focus-visible, .hx-forge-chip:focus-visible, .hx-forge-back:focus-visible { outline: var(--corn-focus-width) solid var(--corn-focus); outline-offset: calc(var(--corn-focus-width) * -1); }
|
|
46
|
+
.hx-forge-count { color: var(--corn-text-3); font-size: var(--corn-text-xs); font-weight: 500; }
|
|
47
|
+
.hx-forge-count[hidden] { display: none; }
|
|
48
|
+
/* A tab's count holds its width before it is read, so the tabs do not move when the counts arrive (issue #192): it is empty, not hidden; Deploys has none and keeps `hidden` */
|
|
49
|
+
.hx-forge-tab .hx-forge-count { display: inline-block; min-width: 2ch; }
|
|
50
|
+
/* The status line and the Filter chip; the focus is put on the title (a heading, tabindex -1) when the panel opens, so it shows no ring */
|
|
51
|
+
.hx-forge-body > * { flex-shrink: 0; } /* a tall detail scrolls the body; it must not squash the tabs */
|
|
52
|
+
.hx-forge .hx-drawer-title:focus-visible, .hx-forge-notes-title:focus-visible { outline: none; }
|
|
53
|
+
.hx-forge-bar { display: flex; align-items: center; gap: var(--corn-space-3); min-height: 28px; }
|
|
54
|
+
.hx-forge-bar .hx-forge-status { flex: 1; min-width: 0; }
|
|
55
|
+
.hx-forge-chip { flex: none; display: inline-flex; align-items: center; gap: var(--corn-space-1); min-height: 24px; padding: 0 var(--corn-space-3); border: var(--corn-border) solid var(--corn-line); border-radius: var(--corn-radius-pill); background: none; color: var(--corn-text-2); font-size: var(--corn-text-xs); }
|
|
56
|
+
.hx-forge-chip:hover { background: var(--corn-surface-3); color: var(--corn-text); }
|
|
57
|
+
.hx-forge-chip[aria-expanded="true"], .hx-forge-chip.is-on { border-color: var(--corn-accent); color: var(--corn-text); }
|
|
58
|
+
.hx-forge-bar[hidden], .hx-forge-chip[hidden], .hx-forge-controls[hidden], .hx-forge-foot[hidden], .hx-forge-detail[hidden], .hx-forge-notes[hidden] { display: none; }
|
|
59
|
+
.hx-forge-filters { display: grid; grid-template-columns: 1fr 1fr; gap: var(--corn-space-2) var(--corn-space-3); }
|
|
60
|
+
.hx-forge-field { display: flex; flex-direction: column; gap: calc(var(--corn-space-1) / 2); min-width: 0; font-size: var(--corn-text-2xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--corn-text-3); }
|
|
61
|
+
.hx-forge-field--text { grid-column: 1 / -1; }
|
|
62
|
+
/* The Start dialog's four limits: two a row, under their legend */
|
|
63
|
+
.hx-forge-limits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--corn-space-2) var(--corn-space-3); margin: 0; padding: 0; border: 0; }
|
|
64
|
+
.hx-forge-limits > legend { padding: 0 0 var(--corn-space-1); }
|
|
65
|
+
.hx-forge-select, .hx-forge-input { width: 100%; min-width: 0; padding: var(--corn-space-1) var(--corn-space-3); border-radius: var(--corn-radius-sm); border: var(--corn-border) solid var(--corn-line); background: color-mix(in srgb, var(--corn-ground) 80%, transparent); color: var(--corn-text); font: inherit; font-size: var(--corn-text-sm); font-weight: 400; text-transform: none; letter-spacing: 0; user-select: text; }
|
|
66
|
+
.hx-forge-input::placeholder { color: var(--corn-text-3); }
|
|
67
|
+
.hx-forge-input:focus-visible { outline: var(--corn-focus-width) solid var(--corn-focus); outline-offset: var(--corn-focus-offset); }
|
|
68
|
+
.hx-forge-notice { padding: var(--corn-space-2) var(--corn-space-3); border-radius: var(--corn-radius-sm); border: var(--corn-border) solid var(--corn-warn); background: color-mix(in srgb, var(--corn-ground) 55%, transparent); color: var(--corn-text-2); line-height: 1.5; }
|
|
69
|
+
.hx-forge-list, .hx-forge-checks, .hx-forge-files { display: flex; flex-direction: column; gap: var(--corn-space-1); margin: 0; padding: 0; list-style: none; }
|
|
70
|
+
.hx-forge-item { display: flex; align-items: stretch; gap: var(--corn-space-1); }
|
|
71
|
+
.hx-forge-row { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--corn-space-1); padding: var(--corn-space-3) var(--corn-space-3); border: var(--corn-border) solid var(--corn-line); border-radius: var(--corn-radius); background: var(--corn-surface-2); color: var(--corn-text); text-align: left; text-decoration: none; font-size: var(--corn-text-sm); }
|
|
72
|
+
a.hx-forge-row:hover, button.hx-forge-row:hover { background: var(--corn-surface-3); }
|
|
73
|
+
.hx-forge-row[aria-pressed="true"] { border-color: var(--corn-accent-text); border-left-width: calc(var(--corn-border-strong) * 2); background: var(--corn-surface-3); }
|
|
74
|
+
.hx-forge-title { font-weight: 600; overflow-wrap: anywhere; }
|
|
75
|
+
.hx-forge-meta { color: var(--corn-text-3); font-size: var(--corn-text-xs); overflow-wrap: anywhere; }
|
|
76
|
+
.hx-forge-labels { display: flex; flex-wrap: wrap; gap: var(--corn-space-1); }
|
|
77
|
+
.hx-forge-label { padding: 0 var(--corn-space-2); border-radius: var(--corn-radius-pill); border: var(--corn-border) solid var(--corn-line); background: color-mix(in srgb, var(--corn-ground) 55%, transparent); color: var(--corn-text-2); font-size: var(--corn-text-2xs); }
|
|
78
|
+
.hx-forge-out { flex: none; display: flex; align-items: center; justify-content: center; width: 32px; border-radius: var(--corn-radius); border: var(--corn-border) solid var(--corn-line); background: var(--corn-surface-2); color: var(--corn-info); text-decoration: none; }
|
|
79
|
+
.hx-forge-out:hover { background: var(--corn-surface-3); }
|
|
80
|
+
.hx-forge-empty { padding: var(--corn-space-3) calc(var(--corn-space-1) / 2); }
|
|
81
|
+
/* A state is a word as well as a colour: open, merged, a check's result */
|
|
82
|
+
.hx-forge-state { display: inline-block; padding: 0 var(--corn-space-2); border-radius: var(--corn-radius-pill); border: var(--corn-border) solid currentColor; font-size: var(--corn-text-2xs); font-weight: 700; }
|
|
83
|
+
.hx-forge-state--open, .hx-forge-state--success { color: var(--corn-ok); }
|
|
84
|
+
.hx-forge-state--merged { color: var(--corn-edit-text); }
|
|
85
|
+
.hx-forge-state--closed, .hx-forge-state--failure { color: var(--corn-bad); }
|
|
86
|
+
.hx-forge-state--draft, .hx-forge-state--running, .hx-forge-state--queued { color: var(--corn-warn); }
|
|
87
|
+
.hx-forge-state--neutral, .hx-forge-state--skipped, .hx-forge-state--cancelled { color: var(--corn-text-3); }
|
|
88
|
+
.hx-forge-detail { display: flex; flex-direction: column; gap: var(--corn-space-3); }
|
|
89
|
+
.hx-forge-detail-title, .hx-forge-notes-title { margin: 0; min-width: 0; font-size: var(--corn-text-lg); font-weight: 700; letter-spacing: -0.01em; color: var(--corn-text); overflow-wrap: anywhere; }
|
|
90
|
+
/* A section's label, in sentence case */
|
|
91
|
+
.hx-forge-sub, .hx-forge-subact, .hx-forge-runs-title { margin: var(--corn-space-1) 0 0; font-size: var(--corn-text-sm); font-weight: 600; color: var(--corn-text-3); }
|
|
92
|
+
.hx-forge-confirm-title { margin: var(--corn-space-1) 0 0; font-size: var(--corn-text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--corn-text-2); }
|
|
93
|
+
.hx-forge-check { display: flex; flex-wrap: wrap; align-items: center; gap: calc(var(--corn-space-1) / 2) var(--corn-space-2); }
|
|
94
|
+
.hx-forge-check .hx-link { display: inline-flex; align-items: center; min-height: 24px; }
|
|
95
|
+
.hx-forge-lights { flex-basis: 100%; font-size: var(--corn-text-xs); line-height: 1.5; }
|
|
96
|
+
.hx-forge-key { display: flex; flex-wrap: wrap; align-items: center; gap: calc(var(--corn-space-1) / 2) var(--corn-space-1); font-size: var(--corn-text-xs); }
|
|
97
|
+
.hx-forge-file { display: flex; flex-wrap: wrap; align-items: baseline; gap: calc(var(--corn-space-1) / 2) var(--corn-space-2); padding: var(--corn-space-1) 0; border-top: var(--corn-border) solid var(--corn-line-soft); overflow-wrap: anywhere; }
|
|
98
|
+
.hx-forge-fstatus { flex: none; min-width: var(--hx-forge-status-w); color: var(--corn-text-3); font-size: var(--corn-text-xs); }
|
|
99
|
+
.hx-forge-del { color: var(--corn-bad); }
|
|
100
|
+
.hx-forge-act { align-self: flex-start; min-height: 24px; padding: calc(var(--corn-space-1) / 2) var(--corn-space-3); }
|
|
101
|
+
.hx-forge-why { margin: 0; font-size: var(--corn-text-xs); line-height: 1.5; }
|
|
102
|
+
.hx-forge-step { display: flex; flex-direction: column; gap: var(--corn-space-1); }
|
|
103
|
+
.hx-forge-startspec { flex: none; align-self: center; }
|
|
104
|
+
.hx-forge-notice--ok { border-color: var(--corn-ok); }
|
|
105
|
+
.hx-forge-nodes { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: var(--corn-space-1); padding-left: calc(var(--hx-forge-status-w) + var(--corn-space-2)); }
|
|
106
|
+
/* A node button is a button (a square corner, a filled face, an arrow), never a state pill */
|
|
107
|
+
.hx-forge-node { padding: calc(var(--corn-space-1) / 2) var(--corn-space-3); border-radius: var(--corn-radius-sm); border: var(--corn-border) solid var(--corn-line); background: var(--corn-surface-3); color: var(--corn-text); font-size: var(--corn-text-xs); }
|
|
108
|
+
.hx-forge-node::after { content: ' \2192'; }
|
|
109
|
+
.hx-forge-node:hover { background: var(--corn-surface-3); }
|
|
110
|
+
.hx-forge-work-filters { display: flex; flex-wrap: wrap; gap: var(--corn-space-2) var(--corn-space-4); }
|
|
111
|
+
.hx-forge-work-filters[hidden], .hx-forge-filters[hidden] { display: none; }
|
|
112
|
+
.hx-forge-toggle { display: inline-flex; align-items: center; gap: var(--corn-space-2); min-height: 24px; color: var(--corn-text-2); font-size: var(--corn-text-sm); }
|
|
113
|
+
.hx-forge-toggle input { accent-color: var(--corn-accent-text); }
|
|
114
|
+
.hx-forge-toggle input:focus-visible { outline: var(--corn-focus-width) solid var(--corn-focus); outline-offset: var(--corn-focus-offset); }
|
|
115
|
+
.hx-forge-group { display: flex; flex-direction: column; gap: var(--corn-space-1); margin: 0 0 var(--corn-space-3); list-style: none; }
|
|
116
|
+
.hx-forge-gtitle { margin: 0; font-size: var(--corn-text-sm); font-weight: 700; color: var(--corn-text); overflow-wrap: anywhere; }
|
|
117
|
+
.hx-forge-gout { margin-left: var(--corn-space-1); }
|
|
118
|
+
.hx-forge-agentline { display: flex; flex-wrap: wrap; align-items: center; gap: calc(var(--corn-space-1) / 2) var(--corn-space-2); }
|
|
119
|
+
.hx-forge-agent { display: inline-block; padding: 0 var(--corn-space-2); border-radius: var(--corn-radius-pill); border: var(--corn-border) solid currentColor; color: var(--corn-edit-text); font-size: var(--corn-text-2xs); font-weight: 700; }
|
|
120
|
+
.hx-forge-why { font-size: var(--corn-text-xs); overflow-wrap: anywhere; }
|
|
121
|
+
.hx-forge-notes, .hx-forge-confirm { display: flex; flex-direction: column; gap: var(--corn-space-3); }
|
|
122
|
+
.hx-forge-preview { width: 100%; min-height: 12em; resize: vertical; padding: var(--corn-space-3); border-radius: var(--corn-radius-sm); border: var(--corn-border) solid var(--corn-line); background: color-mix(in srgb, var(--corn-ground) 80%, transparent); color: var(--corn-text); font-family: var(--corn-mono); font-size: var(--corn-text-xs); line-height: 1.5; font-weight: 400; text-transform: none; letter-spacing: 0; user-select: text; }
|
|
123
|
+
.hx-forge-preview:focus-visible { outline: var(--corn-focus-width) solid var(--corn-focus); outline-offset: var(--corn-focus-offset); }
|
|
124
|
+
.hx-forge-actions { display: flex; flex-wrap: wrap; gap: var(--corn-space-3); }
|
|
125
|
+
.hx-forge-msg { padding: var(--corn-space-2) var(--corn-space-3); border-radius: var(--corn-radius-sm); border: var(--corn-border) solid var(--corn-line); background: color-mix(in srgb, var(--corn-ground) 55%, transparent); color: var(--corn-text-2); line-height: 1.5; overflow-wrap: anywhere; }
|
|
126
|
+
.hx-forge-msg--bad { border-color: var(--corn-warn); }
|
|
127
|
+
.hx-forge-confirm { padding: var(--corn-space-3); border: var(--corn-border) solid var(--corn-line); border-left: calc(var(--corn-border-strong) * 2) solid var(--corn-added-text); border-radius: var(--corn-radius); background: color-mix(in srgb, var(--corn-ground) 55%, transparent); line-height: 1.5; }
|
|
128
|
+
.hx-forge-runs { display: flex; flex-direction: column; gap: var(--corn-space-2); margin: var(--corn-space-1) 0 var(--corn-space-3); }
|
|
129
|
+
.hx-forge-runs[hidden] { display: none; }
|
|
130
|
+
/* A Specs row: title and state on one line, a line of what it is, the facts */
|
|
131
|
+
.hx-forge-line { display: flex; align-items: center; gap: var(--corn-space-3); }
|
|
132
|
+
.hx-forge-line .hx-forge-title { flex: 1; min-width: 0; }
|
|
133
|
+
.hx-forge-sum { color: var(--corn-text-2); line-height: 1.4; overflow-wrap: anywhere; }
|
|
134
|
+
.hx-forge-facts { display: flex; flex-wrap: wrap; gap: 0 var(--corn-space-3); }
|
|
135
|
+
.hx-forge-add { color: var(--corn-added-text); }
|
|
136
|
+
.hx-forge-chg { color: var(--corn-warn); }
|
|
137
|
+
/* A selection replaces the list, with a back control named by the list; Land it is the one primary action */
|
|
138
|
+
.hx-forge-back { align-self: flex-start; display: inline-flex; align-items: center; gap: var(--corn-space-2); min-height: 28px; margin-left: calc(var(--corn-space-2) * -1); padding: 0 var(--corn-space-3) 0 var(--corn-space-2); border: 0; border-radius: var(--corn-radius-sm); background: none; color: var(--corn-text-2); font-size: var(--corn-text-xs); }
|
|
139
|
+
.hx-forge-back:hover { background: var(--corn-surface-3); color: var(--corn-text); }
|
|
140
|
+
.hx-forge-dmeta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--corn-space-1) var(--corn-space-3); }
|
|
141
|
+
.hx-forge-cta { display: flex; flex-wrap: wrap; gap: var(--corn-space-3); }
|
|
142
|
+
.hx-forge-cta .hx-btn { min-height: 32px; justify-content: center; }
|
|
143
|
+
.hx-forge-cta .hx-btn[disabled] { background: var(--corn-surface-3); border-color: var(--corn-line); color: var(--corn-text-3); box-shadow: none; cursor: default; }
|
|
144
|
+
.hx-forge-open { text-decoration: none; color: var(--corn-text-2); }
|
|
145
|
+
.hx-forge-runline { display: flex; flex-wrap: wrap; align-items: center; gap: var(--corn-space-2); margin: 0; color: var(--corn-text-2); } /* a line of text with a state pill, not a box: it is not a control */
|
|
146
|
+
/* The foot of a list: Release notes … on PRs, New idea on Specs and Threads */
|
|
147
|
+
.hx-forge-foot { display: flex; flex-direction: column; gap: var(--corn-space-3); margin-top: auto; padding-top: var(--corn-space-3); border-top: var(--corn-border) solid var(--corn-line); }
|
|
148
|
+
.hx-forge-foot > .hx-btn { align-self: flex-start; }
|
|
149
|
+
@container corn-box (max-width: 767px) {
|
|
150
|
+
/* A phone: the tabs are pills, and everything a thumb has to hit is 44px */
|
|
151
|
+
.hx-forge-tabs { gap: var(--corn-space-2); padding-bottom: var(--corn-space-3); border-bottom: 0; }
|
|
152
|
+
.hx-forge-tab { align-items: center; min-height: 44px; padding: 0 var(--corn-space-4); border: var(--corn-border) solid var(--corn-line); border-radius: var(--corn-radius-pill); }
|
|
153
|
+
.hx-forge-tab[aria-pressed="true"] { background: var(--corn-accent); border-color: var(--corn-accent); color: var(--corn-text-on-accent); }
|
|
154
|
+
.hx-forge-tab[aria-pressed="true"] .hx-forge-count { color: inherit; }
|
|
155
|
+
.hx-forge .hx-btn, .hx-forge .hx-close, .hx-forge-chip, .hx-forge-back, .hx-forge-node, .hx-forge-toggle, .hx-forge-select, .hx-forge-input, .hx-forge-check .hx-link, .hx-forge-out { min-height: 44px; min-width: 44px; }
|
|
156
|
+
.hx-forge .hx-close { display: inline-flex; align-items: center; justify-content: center; }
|
|
157
|
+
}
|
|
158
|
+
/* Threads (forge-panel.js, docs/threads.md): messages as written, read-only; a node's "Threads" opens one */
|
|
159
|
+
.hx-thread-msgs { display: flex; flex-direction: column; gap: var(--corn-space-3); margin: 0; padding: 0; list-style: none; }
|
|
160
|
+
.hx-thread-msg { display: flex; flex-direction: column; gap: var(--corn-space-1); padding: var(--corn-space-3) var(--corn-space-3); border: var(--corn-border) solid var(--corn-line); border-radius: var(--corn-radius); background: var(--corn-surface-2); }
|
|
161
|
+
.hx-thread-body { margin: 0; color: var(--corn-text); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }
|
|
162
|
+
.hx-thread-nodes { padding-left: 0; }
|
|
163
|
+
.hx-thread-compose { font-family: inherit; min-height: 8em; }
|
|
164
|
+
.hx-thread-open { display: block; max-width: 100%; text-align: left; overflow-wrap: anywhere; }
|
|
165
|
+
#forge-idea[hidden], #idea-form[hidden], #idea-message[hidden] { display: none; }
|
|
166
|
+
/* The Runs view (forge-panel.js, runs-view.js): each run, its limits beside what was reported, its timeline; the compare puts profiles side by side */
|
|
167
|
+
.hx-runs-list { display: flex; flex-direction: column; gap: var(--corn-space-3); margin: 0; padding: 0; list-style: none; }
|
|
168
|
+
.hx-run { display: flex; flex-direction: column; gap: var(--corn-space-1); padding: var(--corn-space-3) var(--corn-space-3); border: var(--corn-border) solid var(--corn-line); border-radius: var(--corn-radius); background: var(--corn-surface-2); overflow-wrap: anywhere; min-width: 0; }
|
|
169
|
+
.hx-run-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--corn-space-1) var(--corn-space-3); }
|
|
170
|
+
.hx-run-actions { display: flex; flex-wrap: wrap; gap: var(--corn-space-2); }
|
|
171
|
+
.hx-run-collide { margin: 0; padding: calc(var(--corn-space-1) / 2) var(--corn-space-3); border: var(--corn-border) dashed var(--corn-warn); border-radius: var(--corn-radius-sm); color: var(--corn-warn); font-weight: 600; }
|
|
172
|
+
.hx-run-limits { display: grid; grid-template-columns: auto 1fr; gap: 0 var(--corn-space-3); margin: 0; font-size: var(--corn-text-xs); }
|
|
173
|
+
.hx-run-limits dt { color: var(--corn-text-2); font-weight: 600; }
|
|
174
|
+
.hx-run-limits dd { margin: 0; color: var(--corn-text-2); }
|
|
175
|
+
.hx-run-timeline { display: flex; flex-direction: column; gap: var(--corn-space-1); margin: 0; padding: 0 0 0 var(--corn-space-5); font-size: var(--corn-text-xs); }
|
|
176
|
+
.hx-run-timeline li { color: var(--corn-text-2); }
|
|
177
|
+
.hx-run-timeline time { color: var(--corn-text-2); margin-right: var(--corn-space-2); }
|
|
178
|
+
.hx-run-note { display: block; color: var(--corn-text-2); white-space: pre-wrap; }
|
|
179
|
+
.hx-run-compare { border: var(--corn-border) solid var(--corn-line); border-left: calc(var(--corn-border-strong) * 2) solid var(--corn-added-text); border-radius: var(--corn-radius); padding: var(--corn-space-3); display: flex; flex-direction: column; gap: var(--corn-space-2); }
|
|
180
|
+
.hx-run-compare-title { margin: 0; font-size: var(--corn-text-sm); font-weight: 700; color: var(--corn-text); }
|
|
181
|
+
.hx-run-columns { display: grid; grid-template-columns: 1fr; gap: var(--corn-space-3); margin: 0; padding: 0; list-style: none; }
|
|
182
|
+
@container corn-box (min-width: 1100px) {
|
|
183
|
+
.hx-run-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
184
|
+
}
|
|
185
|
+
@container corn-box (min-width: 1100px) and (max-width: 1599px) {
|
|
186
|
+
.hx-stage:has(.drawer-open) .hx-run-columns { grid-template-columns: 1fr; }
|
|
187
|
+
}
|
|
188
|
+
/* A scroll container never cuts a focus ring: a row that is tabbed to stops short of the edge by the ring's width and offset */
|
|
189
|
+
.hx-forge-body { scroll-padding-block: calc(var(--corn-focus-width) + var(--corn-focus-offset) + var(--corn-space-1)); }
|
|
190
|
+
/* The Work tabs scroll sideways: a tab brought into view stops short of the edge by the strip's own padding */
|
|
191
|
+
.hx-forge-tabs { scroll-padding-inline: var(--corn-space-4); }
|
|
192
|
+
.hx-forge-count, .hx-forge-lit, .hx-run-limits dd { font-family: var(--corn-font-num); font-variant-numeric: tabular-nums; }
|
|
193
|
+
@media (prefers-reduced-motion: reduce) {
|
|
194
|
+
.hx-forge { transition: none; animation: none; }
|
|
195
|
+
}
|
|
196
|
+
.hx-run .hx-link { display: inline-flex; align-items: center; min-height: 24px; } /* a run card's links sit on lines 14px apart: 24px at a desk (WCAG 2.5.8) */
|
|
197
|
+
@container corn-box (max-width: 767px) {
|
|
198
|
+
.hx-run .hx-link, .hx-forge-check .hx-link { display: inline-flex; align-items: center; min-height: 44px; }
|
|
199
|
+
}
|
|
200
|
+
@media (pointer: coarse) {
|
|
201
|
+
.hx-run .hx-link, .hx-forge-check .hx-link { display: inline-flex; align-items: center; min-height: 44px; }
|
|
202
|
+
}
|
|
203
|
+
/* ==========================================================================
|
|
204
|
+
The Work panel's states, results, disabled controls, loading and empty lists, and its fixed top (the 0.34 design review)
|
|
205
|
+
========================================================================== */
|
|
206
|
+
/* A state is a word, an icon and a colour: the colour comes from a --corn-run-<state> token, the icon is a shape of its own (corn-state.js), and
|
|
207
|
+
the waiting pill is solid, since a run that waits needs the maintainer and should stand out most. A pill is never a button: it has no hover. */
|
|
208
|
+
.hx-forge-state { display: inline-flex; align-items: center; gap: var(--corn-space-1); }
|
|
209
|
+
.hx-state-icon { flex: none; width: 1em; height: 1em; }
|
|
210
|
+
.hx-forge-state--requested { color: var(--corn-run-requested); }
|
|
211
|
+
.hx-forge-state--claimed { color: var(--corn-run-claimed); }
|
|
212
|
+
.hx-forge-state--working { color: var(--corn-run-working); }
|
|
213
|
+
.hx-forge-state--waiting { color: var(--corn-run-waiting-ink); background: var(--corn-run-waiting); border-color: var(--corn-run-waiting); border-width: var(--corn-border-strong); }
|
|
214
|
+
.hx-forge-state--done { color: var(--corn-run-done); }
|
|
215
|
+
.hx-forge-state--failed { color: var(--corn-run-failed); }
|
|
216
|
+
.hx-forge-state--stopped { color: var(--corn-run-stopped); }
|
|
217
|
+
.hx-state-spin { transform-origin: 6px 6px; animation: hx-state-turn 1.2s linear infinite; }
|
|
218
|
+
@keyframes hx-state-turn { to { transform: rotate(360deg); } }
|
|
219
|
+
@media (prefers-reduced-motion: reduce) {
|
|
220
|
+
.hx-state-spin { animation: none; }
|
|
221
|
+
}
|
|
222
|
+
/* What an action came to, by the control that was used: the words, and a mark that is not a colour */
|
|
223
|
+
.hx-forge-result { margin: 0; padding: var(--corn-space-1) var(--corn-space-3); border-left: calc(var(--corn-border-strong) * 2) solid var(--corn-line); border-radius: var(--corn-radius-sm); background: var(--corn-surface-2); color: var(--corn-text); line-height: 1.5; overflow-wrap: anywhere; }
|
|
224
|
+
.hx-forge-result[hidden] { display: none; }
|
|
225
|
+
.hx-forge-result[data-corn-state="success"] { border-left-color: var(--corn-ok); }
|
|
226
|
+
.hx-forge-result[data-corn-state="failure"] { border-left-color: var(--corn-bad); }
|
|
227
|
+
.hx-forge-result[data-corn-state="success"]::before { content: '\2713 '; }
|
|
228
|
+
.hx-forge-result[data-corn-state="failure"]::before { content: '\2715 '; }
|
|
229
|
+
/* A disabled control looks disabled: no fill, a dashed edge, the quiet text colour and a cursor that says so */
|
|
230
|
+
.hx-forge .hx-btn:disabled, .hx-forge-act:disabled, .hx-forge-cta .hx-btn[disabled] { background: none; border-style: dashed; color: var(--corn-text-3); box-shadow: none; cursor: not-allowed; }
|
|
231
|
+
/* Retry, in a notice, sits at the end of the line */
|
|
232
|
+
.hx-forge-notice .hx-btn { margin-left: var(--corn-space-2); }
|
|
233
|
+
.hx-forge-runs .hx-forge-notice[hidden], .hx-forge-notice[hidden] { display: none; }
|
|
234
|
+
/* A list that is being read holds its height: rows of a row's size, a quiet bar in each */
|
|
235
|
+
.hx-forge-skeleton { display: flex; flex-direction: column; gap: var(--corn-space-2); min-height: 64px; padding: var(--corn-space-3); border: var(--corn-border) solid var(--corn-line-soft); border-radius: var(--corn-radius); list-style: none; }
|
|
236
|
+
.hx-forge-skeleton > span { display: block; height: 10px; border-radius: var(--corn-radius-sm); background: var(--corn-surface-3); }
|
|
237
|
+
.hx-forge-skeleton > span:last-child { width: 55%; }
|
|
238
|
+
.hx-forge-skeleton-line > span { display: inline-block; width: 55%; height: 10px; vertical-align: middle; border-radius: var(--corn-radius-sm); background: var(--corn-surface-3); } /* one line of the runner line or the totals, while they load */
|
|
239
|
+
.hx-forge-empty { line-height: 1.5; }
|
|
240
|
+
/* The panel's title row and tabs stay in place while a list scrolls; the body's padding is taken up by the top so nothing shows above it */
|
|
241
|
+
.hx-forge-body { --hx-forge-pad: var(--corn-panel-pad); --hx-forge-padx: var(--corn-panel-pad); }
|
|
242
|
+
.hx-forge-top { position: sticky; top: calc(var(--hx-forge-pad) * -1); z-index: 3; display: flex; flex-direction: column; gap: var(--corn-space-4); margin: calc(var(--hx-forge-pad) * -1) calc(var(--hx-forge-padx) * -1) 0; padding: var(--hx-forge-pad) var(--hx-forge-padx) 0; background: linear-gradient(var(--corn-surface-1), var(--corn-surface-1)), var(--corn-ground); } /* opaque: the panel's surface over the ground, so a list scrolls under it without showing through */
|
|
243
|
+
.hx-forge-top .hx-forge-tabs { margin: 0 calc(var(--hx-forge-padx) * -1); padding: 0 var(--hx-forge-padx); }
|
|
244
|
+
/* Where the tabs run on past an edge (a phone), they fade out on that side: a mask (only its alpha counts, so any opaque token does), so it works on any surface and in any theme */
|
|
245
|
+
.hx-forge-top .hx-forge-tabs { mask-image: linear-gradient(to right, transparent 0, var(--corn-ground) var(--hx-fade-l, 0px), var(--corn-ground) calc(100% - var(--hx-fade-r, 0px)), transparent 100%); -webkit-mask-image: linear-gradient(to right, transparent 0, var(--corn-ground) var(--hx-fade-l, 0px), var(--corn-ground) calc(100% - var(--hx-fade-r, 0px)), transparent 100%); }
|
|
246
|
+
.hx-forge-top[data-more~="start"] { --hx-fade-l: calc(var(--corn-space-6) * 1.5); }
|
|
247
|
+
.hx-forge-top[data-more~="end"] { --hx-fade-r: calc(var(--corn-space-6) * 1.5); }
|
|
248
|
+
/* ==========================================================================
|
|
249
|
+
What is waiting on you (spec 0010): the one number's badge, the Specs groups, each row's review state, the search, the Runs headings
|
|
250
|
+
========================================================================== */
|
|
251
|
+
/* The badge: filled, in the waiting colour the solid waiting pill already uses, so one number looks the same on the Work button and on the tabs */
|
|
252
|
+
.hx-waiting-badge, .hx-forge-count--waiting { border-radius: var(--corn-radius-pill); background: var(--corn-run-waiting); color: var(--corn-run-waiting-ink); font-weight: 700; }
|
|
253
|
+
.hx-waiting-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 1.6em; height: 1.6em; padding: 0 var(--corn-space-1); font-family: var(--corn-font-num); font-variant-numeric: tabular-nums; font-size: var(--corn-text-xs); line-height: 1; }
|
|
254
|
+
.hx-waiting-badge[hidden] { display: none; }
|
|
255
|
+
/* On a tab the badge keeps the count's own width (the tab does not move when a count becomes a badge): its fill reaches past the digits into the tab's own
|
|
256
|
+
right padding, by a margin that gives the room back (content-box, so the padding is added to the count's 2ch and the margin takes exactly that away
|
|
257
|
+
again), and keeps the tab's gap from its word on the left */
|
|
258
|
+
.hx-forge-tab .hx-forge-count.hx-forge-count--waiting, .hx-forge-tab[aria-pressed="true"] .hx-forge-count.hx-forge-count--waiting { box-sizing: content-box; padding: 0 var(--corn-space-1); margin: 0 calc(var(--corn-space-1) * -2) 0 0; text-align: center; background: var(--corn-run-waiting); color: var(--corn-run-waiting-ink); }
|
|
259
|
+
.hx-work .hx-waiting-badge { margin-right: calc(var(--corn-space-2) * -1); }
|
|
260
|
+
/* A group of the Specs list: its header says who must act and how many; Drafts past ten rows fold behind it */
|
|
261
|
+
.hx-spec-group > .hx-forge-list { margin: 0; padding: 0; }
|
|
262
|
+
.hx-spec-group > .hx-forge-list[hidden] { display: none; }
|
|
263
|
+
.hx-forge-gtoggle { display: inline-flex; align-items: center; gap: var(--corn-space-2); min-height: 24px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
|
|
264
|
+
.hx-forge-gtoggle::before { content: '\25B8'; font-size: var(--corn-text-xs); }
|
|
265
|
+
.hx-forge-gtoggle[aria-expanded="true"]::before { content: '\25BE'; }
|
|
266
|
+
.hx-forge-gtoggle:focus-visible { outline: var(--corn-focus-width) solid var(--corn-focus); outline-offset: var(--corn-focus-offset); }
|
|
267
|
+
/* A Runs heading is an item of the flat list, so a run's card (and a reply typed in it) is never moved into a section */
|
|
268
|
+
.hx-run-heading { list-style: none; margin: var(--corn-space-3) 0 var(--corn-space-1); }
|
|
269
|
+
.hx-run-heading:first-child { margin-top: 0; }
|
|
270
|
+
/* A spec sent back is not a colour alone: a dashed edge and a turning arrow, and its words */
|
|
271
|
+
.hx-forge-state--sent-back { color: var(--corn-run-stopped); border-style: dashed; }
|
|
272
|
+
.hx-forge-reviewed { color: var(--corn-text-2); }
|
|
273
|
+
.hx-forge-unread { margin: var(--corn-space-1) 0 0; color: var(--corn-bad); overflow-wrap: anywhere; }
|
|
274
|
+
.hx-forge-specsearch { margin: 0 0 var(--corn-space-2); }
|
|
275
|
+
.hx-forge-specsearch[hidden] { display: none; }
|
|
276
|
+
.hx-forge-specsearch .hx-forge-field { width: 100%; }
|
|
277
|
+
@container corn-box (max-width: 767px) {
|
|
278
|
+
.hx-forge-gtoggle { min-height: 44px; }
|
|
279
|
+
.hx-forge-unread .hx-btn { min-height: 44px; }
|
|
280
|
+
}
|
|
281
|
+
.hx-runner-dot { display: inline-block; width: 8px; height: 8px; margin-left: var(--corn-space-1); border-radius: 50%; background: var(--corn-warn); vertical-align: middle; }
|
|
282
|
+
.hx-runner-dot[hidden] { display: none; }
|
|
283
|
+
.hx-forge-detail-title, .hx-forge-notes-title { font-size: var(--corn-text-lg); font-weight: 700; line-height: 1.25; letter-spacing: normal; }
|
|
284
|
+
/* The head of a panel: its title row. The Work panel and the node panel start at one edge (the padding is --corn-panel-pad) and the head is at least this tall */
|
|
285
|
+
.hx-forge-head { min-height: var(--corn-panel-head-height); }
|
|
286
|
+
/* The controls of a bar that had no height of their own */
|
|
287
|
+
/* (the waiting line's Answer is in the proposal bar too, so it is the bar's height; it is a strip's action elsewhere, at its own size) */
|
|
288
|
+
:where(.hx-forge-head, .hx-player-controls, .hx-player-as, .hx-proposal-bar .hx-waiting-line) .hx-btn { height: var(--hx-control-h); }
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* --corn-map-added|changed|removed|edit the diff: a proposal's marks on nodes and edges
|
|
13
13
|
* --corn-map-selected|match the halo of the selected node, and of a search hit
|
|
14
14
|
* --corn-map-lit the lines of the focus: the links the selection (or a walk's step) lights
|
|
15
|
-
* --corn-map-collision the collision mark of two runs on one node (a DOM mark:
|
|
15
|
+
* --corn-map-collision the collision mark of two runs on one node (a DOM mark: css/map.css reads it)
|
|
16
16
|
* --corn-map-font the font list of every label on the map (a list of families, `auto` for the map's own)
|
|
17
17
|
* --corn-map-edge-width the width of an ordinary line, in map px (`auto` keeps each line's own; the focus's and the marks' keep their proportion)
|
|
18
18
|
* --corn-map-label-min the smallest a label is drawn on screen, in px (11 by default; below 9px it is ignored; a hub's title is 2 more)
|
|
@@ -361,7 +361,7 @@ export function createMapStyle(inst) {
|
|
|
361
361
|
|
|
362
362
|
/**
|
|
363
363
|
* The config's part of the map theme once the page has it: loads the icons, sets the pixelated flag, and marks the root element
|
|
364
|
-
* `data-pixelated` (for the page, <html>) so a stylesheet can sample any DOM image without smoothing too (`image-rendering
|
|
364
|
+
* `data-pixelated` (for the page, <html>) so a stylesheet can sample any DOM image without smoothing too (`image-rendering`, css/base.css, from page.css's `--hx-pixelated`).
|
|
365
365
|
* @param {{icons?: Record<string, string>, pixelated?: boolean} | null | undefined} theme `config.theme` of /cornfield/config.json
|
|
366
366
|
*/
|
|
367
367
|
applyTheme(theme, opts = {}) {
|
package/explorer/focus-room.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* A control that is tabbed to inside a strip that scrolls sideways (the Work panel's tabs) is brought fully into view, ring and all
|
|
5
5
|
* (CF review F54). A browser scrolls a focused control only until it is "mostly" visible, and the last tab was left a few pixels under
|
|
6
|
-
* the strip's edge, with its focus ring cut. `scroll-padding-inline` in
|
|
6
|
+
* the strip's edge, with its focus ring cut. `scroll-padding-inline` in css/work.css says how much room to leave; this asks for the scroll.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
/** The strips: a scroll container whose children are tabbed to */
|
package/explorer/header-fit.js
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Keeps the header's left group (the brand, the View switch, the Layers chip) inside its box (CF review F46). A brand wordmark can be wider
|
|
5
5
|
* than the room a phone leaves, and the group used to scroll sideways behind a scrollbar nobody could see, with House half out of sight.
|
|
6
6
|
* Nothing here guesses a width: it measures. With the wordmark shown, if the group's content is wider than its box the wordmark goes
|
|
7
|
-
* (`data-brand-short` on the group,
|
|
8
|
-
*
|
|
7
|
+
* (`data-brand-short` on the group, css/header.css hides it and the logo stays); if the content still does not fit, `data-overflow` is set, and
|
|
8
|
+
* css/header.css draws a fade at the edge it scrolls under, so a scroll is never silent. The brand button keeps its accessible name either way.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
export const SHORT_ATTR = 'data-brand-short';
|
|
@@ -23,7 +23,7 @@ export function fitLeft(left) {
|
|
|
23
23
|
left.removeAttribute(SHORT_ATTR);
|
|
24
24
|
left.removeAttribute(OVERFLOW_ATTR);
|
|
25
25
|
// A menu that is open hangs under its chip and past the group's edge; that is not the group's content running over, and the fade
|
|
26
|
-
// (
|
|
26
|
+
// (css/header.css [data-overflow]) is a mask that would hide the menu itself. Measure with open menus out of the way, then put them back.
|
|
27
27
|
const open = [...left.querySelectorAll('.hx-menu')].filter((m) => !m.hidden).map((m) => [m, m.style.display]);
|
|
28
28
|
open.forEach(([m]) => { m.style.display = 'none'; });
|
|
29
29
|
try { return measure(left); } finally { open.forEach(([m, was]) => { m.style.display = was; }); }
|
package/explorer/house.css
CHANGED
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
@media (min-width: 768px) and (max-width: 1439px) { .hx-live-chip-text { max-width: 140px; } }
|
|
54
54
|
|
|
55
55
|
@media (max-width: 767px) {
|
|
56
|
-
/* Under the Layers chip, the live chip and Fit, which sit on the map's top edge on a phone (explorer
|
|
56
|
+
/* Under the Layers chip, the live chip and Fit, which sit on the map's top edge on a phone (explorer/css/) */
|
|
57
57
|
.hx-house-bar { top: calc(var(--corn-space-4) * 2 + 44px); left: 8px; right: 8px; }
|
|
58
58
|
.hx-house-chip { min-height: 32px; padding: var(--corn-space-1) var(--corn-space-4); }
|
|
59
59
|
.hx-house-people { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
|
package/explorer/index.html
CHANGED
|
@@ -7,9 +7,24 @@
|
|
|
7
7
|
<!-- The server puts the config's import map here (server/server.js), for a repo-local source's bare imports -->
|
|
8
8
|
<!--@importmap-->
|
|
9
9
|
|
|
10
|
-
<!-- The explorer's own stylesheet and modules (explorer/): no build step, no CDN -->
|
|
10
|
+
<!-- The explorer's own stylesheets (explorer/css/, one per piece: base.css first, page.css, the page's own, last; in an order that keeps the one explorer.css's cascade: test/explorer/stylesheet-split.test.js holds it) and modules (explorer/): no build step, no CDN -->
|
|
11
11
|
<link rel="stylesheet" href="/explorer/tokens.css" />
|
|
12
|
-
<link rel="stylesheet" href="/explorer/
|
|
12
|
+
<link rel="stylesheet" href="/explorer/css/base.css" />
|
|
13
|
+
<link rel="stylesheet" href="/explorer/css/header.css" />
|
|
14
|
+
<link rel="stylesheet" href="/explorer/css/layers.css" />
|
|
15
|
+
<link rel="stylesheet" href="/explorer/css/search.css" />
|
|
16
|
+
<link rel="stylesheet" href="/explorer/css/account.css" />
|
|
17
|
+
<link rel="stylesheet" href="/explorer/css/live.css" />
|
|
18
|
+
<link rel="stylesheet" href="/explorer/css/map.css" />
|
|
19
|
+
<link rel="stylesheet" href="/explorer/css/node-panel.css" />
|
|
20
|
+
<link rel="stylesheet" href="/explorer/css/proposal.css" />
|
|
21
|
+
<link rel="stylesheet" href="/explorer/css/changes.css" />
|
|
22
|
+
<link rel="stylesheet" href="/explorer/css/decision.css" />
|
|
23
|
+
<link rel="stylesheet" href="/explorer/css/whatif.css" />
|
|
24
|
+
<link rel="stylesheet" href="/explorer/css/dialogs.css" />
|
|
25
|
+
<link rel="stylesheet" href="/explorer/css/sheets.css" />
|
|
26
|
+
<link rel="stylesheet" href="/explorer/css/work.css" />
|
|
27
|
+
<link rel="stylesheet" href="/explorer/css/page.css" />
|
|
13
28
|
<link rel="stylesheet" href="/explorer/house.css" />
|
|
14
29
|
<!-- The config's brand (server/server.js puts it here): the favicon, the web app manifest and the tab colour -->
|
|
15
30
|
<!--@brand-->
|
|
@@ -199,7 +214,7 @@
|
|
|
199
214
|
<div class="hx-proposal-tools">
|
|
200
215
|
<!-- Shown only while there are what-if edits: off, the map is the proposal as written; the edits are kept and still go with a review (whatif.js) -->
|
|
201
216
|
<!-- The review narrows the map to the change; this puts the whole map back, as Diff always was (layers.js setWholeMap). Off at every opening -->
|
|
202
|
-
<!-- Its words are "Whole map", which read right pressed or not; its name and tooltip are the full "Show the whole map". On a desk it sits beside the title, so the bar keeps its rows (
|
|
217
|
+
<!-- Its words are "Whole map", which read right pressed or not; its name and tooltip are the full "Show the whole map". On a desk it sits beside the title, so the bar keeps its rows (css/proposal.css) -->
|
|
203
218
|
<button data-corn="whole-map" data-corn-kind="secondary" type="button" id="proposal-whole" class="hx-btn" data-action="proposal-whole" aria-pressed="false" aria-label="Show the whole map" title="Show the whole map" data-peek-ok data-corn-string="wholeMap" data-corn-string-aria-label="showWholeMap">Whole map</button>
|
|
204
219
|
<button data-corn-kind="secondary" type="button" id="proposal-myedits" class="hx-btn" aria-pressed="true" data-peek-ok data-corn-string="myEdits" hidden>My edits</button>
|
|
205
220
|
<button data-corn-kind="secondary" type="button" id="proposal-edit" class="hx-btn" aria-expanded="false" aria-controls="whatif" title="Try a change: add a node or an edge, reword a scenario">Edit</button>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* The map piece's own box, for a shadow root (explorer/pieces/map.js; components/src/corn-map). cornfield's page styles the same
|
|
2
|
-
elements from explorer
|
|
2
|
+
elements from explorer/css/ (#graph-canvas, .hx-stage), so nothing here loads there. Every colour is a --corn-* token; a host
|
|
3
3
|
restyles an element with ::part(map-stage), ::part(map-canvas), ::part(label-canvas). */
|
|
4
4
|
/* As tall as the host makes it, and never under 16rem: a map dropped in with no height is visible. A host that wants it lower says so on the
|
|
5
5
|
part: corn-map::part(map-stage) { min-height: 0 } */
|
package/explorer/review.js
CHANGED
|
@@ -135,7 +135,7 @@ function mount() {
|
|
|
135
135
|
undo.hidden = true;
|
|
136
136
|
undo.textContent = t('undo');
|
|
137
137
|
// Before Approve, not after it: Approve keeps its place under the pointer, so the second click of a double click lands on the held
|
|
138
|
-
// button (which ignores it), never on Undo; on a phone Undo takes a row of its own under the two (
|
|
138
|
+
// button (which ignores it), never on Undo; on a phone Undo takes a row of its own under the two (css/decision.css)
|
|
139
139
|
const approve = actions.querySelector('[data-review="approved"]');
|
|
140
140
|
if (approve) approve.before(undo); else actions.append(undo);
|
|
141
141
|
}
|
package/explorer/theme-model.js
CHANGED
|
@@ -52,7 +52,7 @@ export function themeNameFrom(stored, names, fallback) {
|
|
|
52
52
|
/** Where a named theme's stylesheet is served (server/server.js); '' for no named theme */
|
|
53
53
|
export const themeNameHref = (name) => (/^[a-z0-9][a-z0-9-]{0,31}$/.test(name) ? `/cornfield/theme/${name}.css` : '');
|
|
54
54
|
|
|
55
|
-
/** The light page's ground (--hx-bg in
|
|
55
|
+
/** The light page's ground (--hx-bg, an alias of --corn-ground in tokens.css): what the light colours are measured against */
|
|
56
56
|
export const LIGHT_GROUND = '#f4f6fa';
|
|
57
57
|
/** The dark page's ground, for checking what the dark theme already does */
|
|
58
58
|
export const DARK_GROUND = '#090d16';
|
package/explorer/theme.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* - the choice is `system` (the default: `prefers-color-scheme`, followed live), `light` or `dark`;
|
|
8
8
|
* the System / Dark / Light segment in the account menu sets it and keeps the choice in localStorage
|
|
9
9
|
* (THEME_STORAGE_KEY). `?theme=light|dark|system` in the address wins, for that visit, and is not kept;
|
|
10
|
-
* - the theme in force is `<html data-theme="light|dark">`:
|
|
10
|
+
* - the theme in force is `<html data-theme="light|dark">`: tokens.css swaps its tokens on it,
|
|
11
11
|
* theme-boot.js sets it before the first paint (so a light page never flashes dark), and this module
|
|
12
12
|
* keeps it right afterwards;
|
|
13
13
|
* - the map: `state.theme`, then `touchScene()`, so the next scene is built for the new ground (scene.js), and the map's
|
package/explorer/tokens.css
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
The explorer's design tokens (docs/theming.md)
|
|
3
3
|
==========================================================================
|
|
4
4
|
The ONLY file in explorer/ that holds a literal colour, font, size, radius, border width, shadow or spacing:
|
|
5
|
-
explorer
|
|
5
|
+
explorer/css/*.css and house.css read these `--corn-*` custom properties and nothing else (a test holds it,
|
|
6
6
|
test/explorer/tokens.test.js). A brand re-skins the explorer by loading a stylesheet after this one that
|
|
7
7
|
redefines some of them.
|
|
8
8
|
|
|
@@ -312,7 +312,7 @@
|
|
|
312
312
|
color-scheme: light;
|
|
313
313
|
}
|
|
314
314
|
|
|
315
|
-
/* A phone's density: controls are 44px tall (the target), and a panel pads by 16px under 640px.
|
|
315
|
+
/* A phone's density: controls are 44px tall (the target), and a panel pads by 16px under 640px. css/base.css floors a phone's control at 44px whatever
|
|
316
316
|
a brand sets (max(44px, …)); a brand that sets --corn-panel-pad on :root sets a phone's too, unless it sets it again under the same query */
|
|
317
317
|
@media (max-width: 767px) { :root { --corn-control-height: 44px; } }
|
|
318
318
|
@media (max-width: 639px) { :root { --corn-panel-pad: var(--corn-space-5); } }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cornfield",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.48.0",
|
|
4
4
|
"description": "A self-hostable dev dashboard with the topology map at its centre: proposals on the map, scenarios, outages and what-if edits, for any repo.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "popcorn245 (https://github.com/popcorn245)",
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module server/components
|
|
3
|
+
*
|
|
4
|
+
* The web components (components/, spec 0011 D11) served from this server, at `/cornfield/components/<file>`, so a host app loads them with
|
|
5
|
+
* one `<script type="module" src="https://map.example.com/cornfield/components/corn-map.js">` and always gets the build that matches the server.
|
|
6
|
+
*
|
|
7
|
+
* cornfield has no build step: a checkout has no built components, and then this route answers a plain 404 that says how to get them. The
|
|
8
|
+
* image builds them (Dockerfile) into `components/dist` beside the server, and so does `cd components && npm ci && npm run build`. One rule:
|
|
9
|
+
* the folder is `<cornfield>/components/dist`, and it is served only when `manifest.json` (written last by the build, components/scripts/manifest.mjs)
|
|
10
|
+
* is there.
|
|
11
|
+
*
|
|
12
|
+
* What is served is what the manifest names, looked up by exact name in a map: a request path is never joined into a file path, so there is no
|
|
13
|
+
* traversal to get wrong, no listing, no dotfile, and nothing the build did not produce. Only `.js`, `.css`, `.json`, `.d.ts` and `.map`.
|
|
14
|
+
*
|
|
15
|
+
* The route is open (before the sign-in guard): a browser fetches a module script from another origin with CORS and without the cookie. It holds
|
|
16
|
+
* no secret: it is the published package. server/embed.js adds the CORS headers for a listed origin; with none listed there are none.
|
|
17
|
+
*
|
|
18
|
+
* Headers: the type, `nosniff`, a strong ETag (the content's hash, and the encoding's name when the answer will be compressed, so two encodings
|
|
19
|
+
* are two ETags), and caching: `chunks/<name>-<hash>.js` are named by their content, so cached for a year; everything else (`corn-map.js`,
|
|
20
|
+
* `index.js`, `version.json`, `tokens.css`, the types) is revalidated every time, so a host always gets this server's version.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import fs from 'node:fs';
|
|
24
|
+
import path from 'node:path';
|
|
25
|
+
import { createHash } from 'node:crypto';
|
|
26
|
+
import { pickEncoding } from './compress.js';
|
|
27
|
+
import { notFound } from './files.js';
|
|
28
|
+
|
|
29
|
+
export const COMPONENTS_PREFIX = '/cornfield/components/';
|
|
30
|
+
|
|
31
|
+
/** Plain segments, none starting with a dot (the same rule the build holds its manifest to) */
|
|
32
|
+
const SAFE_PATH = /^(?!\.)[A-Za-z0-9_-][A-Za-z0-9._-]*(?:\/(?!\.)[A-Za-z0-9_-][A-Za-z0-9._-]*)*$/;
|
|
33
|
+
const TYPES = [
|
|
34
|
+
[/\.js$/, 'application/javascript; charset=utf-8'],
|
|
35
|
+
[/\.css$/, 'text/css; charset=utf-8'],
|
|
36
|
+
[/\.json$/, 'application/json; charset=utf-8'],
|
|
37
|
+
[/\.map$/, 'application/json; charset=utf-8'],
|
|
38
|
+
[/\.d\.ts$/, 'text/plain; charset=utf-8'],
|
|
39
|
+
];
|
|
40
|
+
/** A chunk the build named by its content */
|
|
41
|
+
const HASHED = /^chunks\/[A-Za-z0-9_-]+-[A-Za-z0-9_-]{8,}\.js$/;
|
|
42
|
+
const MAX_BYTES = 4 * 1024 * 1024;
|
|
43
|
+
/** server/compress.js does not compress below this */
|
|
44
|
+
const MIN_COMPRESSED = 512;
|
|
45
|
+
|
|
46
|
+
const NOT_BUILT = 'The web components are not built here: this cornfield runs from a checkout, which has no build step.\n'
|
|
47
|
+
+ 'Build them with `cd components && npm ci && npm run build`, or run the Docker image (it builds them), or install @popcorn245/cornfield-components from npm.\n';
|
|
48
|
+
|
|
49
|
+
/** @param {{ dir: string }} opts the folder the build wrote (`components/dist`) */
|
|
50
|
+
export function createComponents({ dir }) {
|
|
51
|
+
const root = path.resolve(dir);
|
|
52
|
+
/** @type {{ stamp: string, names: Set<string> } | null} */
|
|
53
|
+
let listed = null;
|
|
54
|
+
/** @type {Map<string, { stamp: string, body: Buffer, etag: string }>} */
|
|
55
|
+
const bodies = new Map();
|
|
56
|
+
|
|
57
|
+
/** The names the manifest lists, read again when it changes; null when nothing is built (or the manifest is not one) */
|
|
58
|
+
function names() {
|
|
59
|
+
const file = path.join(root, 'manifest.json');
|
|
60
|
+
let stats;
|
|
61
|
+
try { stats = fs.lstatSync(file); } catch { return (listed = null); }
|
|
62
|
+
if (!stats.isFile() || stats.size > MAX_BYTES) return (listed = null);
|
|
63
|
+
const stamp = `${stats.size}:${stats.mtimeMs}`;
|
|
64
|
+
if (listed?.stamp === stamp) return listed.names;
|
|
65
|
+
try {
|
|
66
|
+
const manifest = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
67
|
+
const out = new Set();
|
|
68
|
+
for (const f of Array.isArray(manifest.files) ? manifest.files : []) {
|
|
69
|
+
const p = f && typeof f.path === 'string' ? f.path : '';
|
|
70
|
+
if (SAFE_PATH.test(p) && TYPES.some(([re]) => re.test(p))) out.add(p);
|
|
71
|
+
}
|
|
72
|
+
bodies.clear();
|
|
73
|
+
listed = { stamp, names: out };
|
|
74
|
+
return out;
|
|
75
|
+
} catch {
|
|
76
|
+
return (listed = null);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** The bytes of a listed file and their ETag; null when it is not a plain file there */
|
|
81
|
+
function load(name) {
|
|
82
|
+
const file = path.join(root, ...name.split('/'));
|
|
83
|
+
let stats;
|
|
84
|
+
try { stats = fs.lstatSync(file); } catch { return null; }
|
|
85
|
+
if (!stats.isFile() || stats.size > MAX_BYTES) return null;
|
|
86
|
+
// lstat looks at the last segment only: a folder on the way (`chunks`) that is a link out of the build is refused too. The build folder
|
|
87
|
+
// itself may be a link; what is served is what lies, really, inside it
|
|
88
|
+
try {
|
|
89
|
+
const real = fs.realpathSync(file);
|
|
90
|
+
const realRoot = fs.realpathSync(root);
|
|
91
|
+
if (real !== path.join(realRoot, ...name.split('/'))) return null;
|
|
92
|
+
} catch { return null; }
|
|
93
|
+
const stamp = `${stats.size}:${stats.mtimeMs}`;
|
|
94
|
+
const known = bodies.get(name);
|
|
95
|
+
if (known?.stamp === stamp) return known;
|
|
96
|
+
try {
|
|
97
|
+
const body = fs.readFileSync(file);
|
|
98
|
+
const entry = { stamp, body, etag: createHash('sha256').update(body).digest('base64url').slice(0, 27) };
|
|
99
|
+
bodies.set(name, entry);
|
|
100
|
+
return entry;
|
|
101
|
+
} catch {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return {
|
|
107
|
+
dir: root,
|
|
108
|
+
/** Whether the folder holds a build (a manifest) */
|
|
109
|
+
built: () => names() !== null,
|
|
110
|
+
/**
|
|
111
|
+
* Answers a GET or HEAD under COMPONENTS_PREFIX.
|
|
112
|
+
* @param {import('node:http').IncomingMessage} req
|
|
113
|
+
* @param {import('node:http').ServerResponse} res
|
|
114
|
+
* @param {string} reqPath the decoded path
|
|
115
|
+
*/
|
|
116
|
+
serve(req, res, reqPath) {
|
|
117
|
+
const listing = names();
|
|
118
|
+
if (!listing) {
|
|
119
|
+
res.writeHead(404, { 'Content-Type': 'text/plain; charset=utf-8', 'X-Content-Type-Options': 'nosniff' });
|
|
120
|
+
return res.end(`404 Not Found: ${reqPath}\n${NOT_BUILT}`);
|
|
121
|
+
}
|
|
122
|
+
const name = reqPath.slice(COMPONENTS_PREFIX.length);
|
|
123
|
+
const found = listing.has(name) ? load(name) : null;
|
|
124
|
+
if (!found) return notFound(res, reqPath);
|
|
125
|
+
const type = TYPES.find(([re]) => re.test(name))[1];
|
|
126
|
+
// The compressor (server/compress.js) will encode this answer when it is long enough and the browser accepts one: the ETag names the encoding
|
|
127
|
+
const encoding = found.body.length >= MIN_COMPRESSED && /^(?:text\/|application\/(?:javascript|json))/.test(type) ? pickEncoding(req.headers['accept-encoding']) : null;
|
|
128
|
+
const etag = `"${found.etag}${encoding ? `-${encoding}` : ''}"`;
|
|
129
|
+
const headers = {
|
|
130
|
+
'Content-Type': type,
|
|
131
|
+
'X-Content-Type-Options': 'nosniff',
|
|
132
|
+
'Cache-Control': HASHED.test(name) ? 'public, max-age=31536000, immutable' : 'no-cache',
|
|
133
|
+
ETag: etag,
|
|
134
|
+
};
|
|
135
|
+
const asked = req.headers['if-none-match'];
|
|
136
|
+
if (asked && (asked.trim() === '*' || asked.split(',').some((t) => t.trim().replace(/^W\//, '') === etag))) {
|
|
137
|
+
res.writeHead(304, headers);
|
|
138
|
+
return res.end();
|
|
139
|
+
}
|
|
140
|
+
res.writeHead(200, { ...headers, 'Content-Length': found.body.length });
|
|
141
|
+
return res.end(req.method === 'HEAD' ? undefined : found.body);
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
}
|