cornfield 0.46.2 → 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/hint.js +1 -0
- package/explorer/engine/keyboard.js +2 -2
- package/explorer/engine/map-style.js +9 -4
- package/explorer/flow-build.js +88 -0
- package/explorer/flows.js +1 -81
- package/explorer/focus-room.js +1 -1
- package/explorer/header-fit.js +3 -3
- package/explorer/house.css +1 -1
- package/explorer/index.html +20 -10
- package/explorer/input.js +8 -1
- package/explorer/page-pieces.js +5 -0
- package/explorer/page.js +11 -20
- package/explorer/pieces/adopt-tokens.js +38 -0
- package/explorer/pieces/map-stage.css +14 -0
- package/explorer/pieces/map.js +332 -0
- package/explorer/renderer.js +1 -0
- 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); }
|
package/explorer/engine/hint.js
CHANGED
|
@@ -45,6 +45,7 @@ export function dismissHint(inst) {
|
|
|
45
45
|
const m = memory(inst);
|
|
46
46
|
if (m.dismissed) return;
|
|
47
47
|
m.dismissed = true;
|
|
48
|
+
if (!inst.el('instruction-badge-text')) return; // an instance with no hint (a map in another app's page) writes nothing in that page's storage
|
|
48
49
|
try { const store = sessionOf(inst); if (store) store.setItem(HINT_STORAGE_KEY, '1'); } catch { /* storage blocked: it holds for this page load */ }
|
|
49
50
|
syncHint(inst);
|
|
50
51
|
}
|
|
@@ -60,7 +60,7 @@ export function centreOn(inst, node) {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
function land(inst, node, order) {
|
|
63
|
-
if (!node) { announce(inst, 'No nodes are shown. Turn a layer on in the Layers menu.'); return; }
|
|
63
|
+
if (!node) { announce(inst, inst.el('legend-dropdown') ? 'No nodes are shown. Turn a layer on in the Layers menu.' : 'No nodes are shown.'); return; } // the Layers menu, when the instance has one
|
|
64
64
|
selectNode(inst, node, { frame: true, source: 'keyboard' }); // the keyboard's selection frames the node and what it lights (spec 0008 D6)
|
|
65
65
|
announce(inst, K.describeNode(node, order.length, order.indexOf(node)));
|
|
66
66
|
}
|
|
@@ -132,7 +132,7 @@ function onMapKey(inst, e) {
|
|
|
132
132
|
break;
|
|
133
133
|
case 'close':
|
|
134
134
|
clearSelection(inst, { source: 'keyboard' });
|
|
135
|
-
announce(inst, 'Panel closed');
|
|
135
|
+
announce(inst, inst.el('spec-drawer') ? 'Panel closed' : 'Selection cleared'); // a map with no node panel beside it (a component) has none to close
|
|
136
136
|
break;
|
|
137
137
|
case 'move':
|
|
138
138
|
moveSelected(inst, action.dx, action.dy);
|
|
@@ -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)
|
|
@@ -204,10 +204,12 @@ export function readMapTokens(read, extra = []) {
|
|
|
204
204
|
// Icons
|
|
205
205
|
// ---------------------------------------------------------------------------
|
|
206
206
|
|
|
207
|
-
|
|
207
|
+
/** `crossOrigin`: 'anonymous' asks for the image with CORS and no cookie, which WebGL needs for one from another origin (spec 0011 D9) */
|
|
208
|
+
function loadImage(url, crossOrigin = '') {
|
|
208
209
|
return new Promise((resolve, reject) => {
|
|
209
210
|
if (typeof Image === 'undefined') { reject(new Error('no Image')); return; }
|
|
210
211
|
const img = new Image();
|
|
212
|
+
if (crossOrigin) img.crossOrigin = crossOrigin; // before `src`
|
|
211
213
|
img.onload = () => (img.naturalWidth > 0 && img.naturalHeight > 0 ? resolve(img) : reject(new Error(`${url} has no size`)));
|
|
212
214
|
img.onerror = () => reject(new Error(`${url} did not load`));
|
|
213
215
|
img.src = url;
|
|
@@ -348,7 +350,10 @@ export function createMapStyle(inst) {
|
|
|
348
350
|
setIcons(theme, opts = {}) {
|
|
349
351
|
const urls = theme && theme.icons && typeof theme.icons === 'object' ? theme.icons : {};
|
|
350
352
|
pixelated = !!(theme && theme.pixelated === true);
|
|
351
|
-
|
|
353
|
+
// An instance with a base may fetch from another origin (a component on a sibling's page): WebGL refuses an image it was not given by CORS,
|
|
354
|
+
// so the icons are asked for that way. A page on its own origin (no base) is unchanged.
|
|
355
|
+
const crossOrigin = inst.base ? 'anonymous' : '';
|
|
356
|
+
const load = opts.load || ((url) => loadImage(inst.url(url), crossOrigin));
|
|
352
357
|
icons = Object.keys(urls).length ? createIconStore(urls, { ...opts, load, onChange: () => { changed(); if (opts.onChange) opts.onChange(); } }) : null;
|
|
353
358
|
changed();
|
|
354
359
|
return icons;
|
|
@@ -356,7 +361,7 @@ export function createMapStyle(inst) {
|
|
|
356
361
|
|
|
357
362
|
/**
|
|
358
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
|
|
359
|
-
* `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`).
|
|
360
365
|
* @param {{icons?: Record<string, string>, pixelated?: boolean} | null | undefined} theme `config.theme` of /cornfield/config.json
|
|
361
366
|
*/
|
|
362
367
|
applyTheme(theme, opts = {}) {
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module explorer/flow-build
|
|
3
|
+
*
|
|
4
|
+
* The data-flow preset's fold (pure: no state, no DOM), so a piece that runs on an instance (explorer/pieces/map.js) can build the preset without
|
|
5
|
+
* importing flows.js, which still reads the page's shared state. flows.js re-exports it.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Folds the topology into the six tiers of the preset. A page is lifted to the app that owns
|
|
10
|
+
* it (the API's endpoints become the API), edges are lifted with them and de-duplicated, and
|
|
11
|
+
* only what stays inside the tiers is kept:
|
|
12
|
+
* browser the stores that live in the visitor's browser (`tier: 'browser'` on a store, or the id `store-idb`)
|
|
13
|
+
* servers the apps whose pages read or write rows
|
|
14
|
+
* API the apps that own endpoints (pages with `methods`)
|
|
15
|
+
* tables SQLite, the audit_log changefeed and every table
|
|
16
|
+
* services the API's jobs, hooks and webhook handlers
|
|
17
|
+
* outside the systems the API reaches: cloud nodes and the self-hosted containers
|
|
18
|
+
* @returns {{ tiers: {key:string,title:string,note:string,nodes:object[]}[], ids: Set<string>, edges: object[] }}
|
|
19
|
+
*/
|
|
20
|
+
export function buildDataFlow(nodes, edges) {
|
|
21
|
+
const byId = new Map(nodes.map((n) => [n.id, n]));
|
|
22
|
+
const owner = new Map();
|
|
23
|
+
edges.forEach((e) => {
|
|
24
|
+
if (!e.kind && !e.dashed && byId.get(e.from)?.type === 'app' && byId.get(e.to)?.type === 'page') owner.set(e.to, e.from);
|
|
25
|
+
});
|
|
26
|
+
// A self-hosted service is the container that runs it (spec 0031 section 3, CLOUD-03): it stands in the
|
|
27
|
+
// Outside tier, and the worker of its stack that sends its webhook (nextcloud-webhooks) is drawn as it
|
|
28
|
+
const hosted = nodes.filter((n) => n.type === 'container' && n.selfHosted);
|
|
29
|
+
const sender = new Map();
|
|
30
|
+
edges.forEach((e) => {
|
|
31
|
+
const from = byId.get(e.from);
|
|
32
|
+
if (e.kind !== 'delivers' || from?.type !== 'container' || from.selfHosted || byId.get(e.to)?.type !== 'page') return;
|
|
33
|
+
const same = hosted.filter((h) => h.stack === from.stack);
|
|
34
|
+
if (same.length === 1) sender.set(from.id, same[0].id);
|
|
35
|
+
});
|
|
36
|
+
const lift = (id) => (byId.get(id)?.type === 'page' ? owner.get(id) || id : sender.get(id) || id);
|
|
37
|
+
|
|
38
|
+
// The API tier: every app that owns an endpoint (a page with methods)
|
|
39
|
+
const apis = new Set([...owner].filter(([page]) => Array.isArray(byId.get(page)?.methods) && byId.get(page).methods.length).map(([, app]) => app));
|
|
40
|
+
const isBrowserStore = (n) => n.type === 'store' && (n.tier === 'browser' || n.id === 'store-idb');
|
|
41
|
+
const withRows = new Set();
|
|
42
|
+
edges.forEach((e) => {
|
|
43
|
+
if (e.kind === 'reads' || e.kind === 'writes') {
|
|
44
|
+
const page = e.kind === 'reads' ? e.to : e.from;
|
|
45
|
+
if (byId.get(page)?.type === 'page') withRows.add(lift(page));
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
// An app whose own code calls the API (or publishes through an outside system) has a derived `api` flow, rows or not
|
|
49
|
+
edges.forEach((e) => {
|
|
50
|
+
if (e.kind === 'flow' && e.flow === 'api' && byId.get(e.from)?.type === 'app') withRows.add(e.from);
|
|
51
|
+
});
|
|
52
|
+
const apiFlowPairs = new Set(edges.filter((e) => e.kind === 'flow' && e.flow === 'api').map((e) => `${lift(e.from)}|${lift(e.to)}`));
|
|
53
|
+
|
|
54
|
+
const pick = (pred) => nodes.filter(pred).sort((a, b) => String(a.label).localeCompare(String(b.label)));
|
|
55
|
+
const tiers = [
|
|
56
|
+
{ key: 'browser', title: 'Browser', note: 'saved on the device first', nodes: pick(isBrowserStore) },
|
|
57
|
+
{ key: 'servers', title: 'App servers', note: 'pages, no-JS forms', nodes: pick((n) => n.type === 'app' && !apis.has(n.id) && withRows.has(n.id)) },
|
|
58
|
+
{ key: 'api', title: 'API', note: 'where the endpoints are', nodes: pick((n) => apis.has(n.id)) },
|
|
59
|
+
{ key: 'tables', title: 'Tables', note: 'stores and tables', nodes: [...pick((n) => n.type === 'store' && !isBrowserStore(n)), ...pick((n) => n.type === 'table')] },
|
|
60
|
+
{ key: 'services', title: 'Services', note: 'jobs, hooks, webhooks', nodes: pick((n) => n.type === 'service') },
|
|
61
|
+
{ key: 'outside', title: 'Outside', note: 'systems the API reaches', nodes: [...pick((n) => n.type === 'external'), ...pick((n) => n.type === 'container' && n.selfHosted)] },
|
|
62
|
+
];
|
|
63
|
+
const ids = new Set(tiers.flatMap((t) => t.nodes.map((n) => n.id)));
|
|
64
|
+
|
|
65
|
+
const out = [];
|
|
66
|
+
const seen = new Set();
|
|
67
|
+
const add = (e, from, to) => {
|
|
68
|
+
if (from === to || !ids.has(from) || !ids.has(to)) return;
|
|
69
|
+
const key = `${from}|${to}|${e.kind}|${e.flow || ''}`;
|
|
70
|
+
if (seen.has(key)) return;
|
|
71
|
+
seen.add(key);
|
|
72
|
+
out.push({ ...e, from, to, status: e.status || 'live', phase: undefined });
|
|
73
|
+
};
|
|
74
|
+
edges.forEach((e) => {
|
|
75
|
+
// A publisher page's `calls` edge to an outside system is the app's `api` flow already
|
|
76
|
+
if (e.kind === 'calls' && apiFlowPairs.has(`${lift(e.from)}|${lift(e.to)}`)) return;
|
|
77
|
+
// What a container pulls or calls itself (its image registry, its own cloud services) is not the API's data flow
|
|
78
|
+
if (e.kind === 'calls' && byId.get(e.from)?.type === 'container') return;
|
|
79
|
+
if (e.kind === 'flow' || ['calls', 'triggers', 'delivers'].includes(e.kind)) return add(e, lift(e.from), lift(e.to));
|
|
80
|
+
if (e.kind === 'reads' || e.kind === 'writes') {
|
|
81
|
+
const page = e.kind === 'reads' ? e.to : e.from;
|
|
82
|
+
// A page of an app server reaches its rows through the API: only the API's own endpoints and the services touch a table here
|
|
83
|
+
if (byId.get(page)?.type === 'page' && !apis.has(lift(page))) return;
|
|
84
|
+
return add(e, lift(e.from), lift(e.to));
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
return { tiers, ids, edges: out };
|
|
88
|
+
}
|
package/explorer/flows.js
CHANGED
|
@@ -25,87 +25,7 @@ export const flowReduceMotion = typeof window !== 'undefined' && !!(window.match
|
|
|
25
25
|
// The data-flow preset
|
|
26
26
|
// ---------------------------------------------------------------------------
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
* Folds the topology into the six tiers of the preset. A page is lifted to the app that owns
|
|
30
|
-
* it (the API's endpoints become the API), edges are lifted with them and de-duplicated, and
|
|
31
|
-
* only what stays inside the tiers is kept:
|
|
32
|
-
* browser the stores that live in the visitor's browser (`tier: 'browser'` on a store, or the id `store-idb`)
|
|
33
|
-
* servers the apps whose pages read or write rows
|
|
34
|
-
* API the apps that own endpoints (pages with `methods`)
|
|
35
|
-
* tables SQLite, the audit_log changefeed and every table
|
|
36
|
-
* services the API's jobs, hooks and webhook handlers
|
|
37
|
-
* outside the systems the API reaches: cloud nodes and the self-hosted containers
|
|
38
|
-
* @returns {{ tiers: {key:string,title:string,note:string,nodes:object[]}[], ids: Set<string>, edges: object[] }}
|
|
39
|
-
*/
|
|
40
|
-
export function buildDataFlow(nodes, edges) {
|
|
41
|
-
const byId = new Map(nodes.map((n) => [n.id, n]));
|
|
42
|
-
const owner = new Map();
|
|
43
|
-
edges.forEach((e) => {
|
|
44
|
-
if (!e.kind && !e.dashed && byId.get(e.from)?.type === 'app' && byId.get(e.to)?.type === 'page') owner.set(e.to, e.from);
|
|
45
|
-
});
|
|
46
|
-
// A self-hosted service is the container that runs it (spec 0031 section 3, CLOUD-03): it stands in the
|
|
47
|
-
// Outside tier, and the worker of its stack that sends its webhook (nextcloud-webhooks) is drawn as it
|
|
48
|
-
const hosted = nodes.filter((n) => n.type === 'container' && n.selfHosted);
|
|
49
|
-
const sender = new Map();
|
|
50
|
-
edges.forEach((e) => {
|
|
51
|
-
const from = byId.get(e.from);
|
|
52
|
-
if (e.kind !== 'delivers' || from?.type !== 'container' || from.selfHosted || byId.get(e.to)?.type !== 'page') return;
|
|
53
|
-
const same = hosted.filter((h) => h.stack === from.stack);
|
|
54
|
-
if (same.length === 1) sender.set(from.id, same[0].id);
|
|
55
|
-
});
|
|
56
|
-
const lift = (id) => (byId.get(id)?.type === 'page' ? owner.get(id) || id : sender.get(id) || id);
|
|
57
|
-
|
|
58
|
-
// The API tier: every app that owns an endpoint (a page with methods)
|
|
59
|
-
const apis = new Set([...owner].filter(([page]) => Array.isArray(byId.get(page)?.methods) && byId.get(page).methods.length).map(([, app]) => app));
|
|
60
|
-
const isBrowserStore = (n) => n.type === 'store' && (n.tier === 'browser' || n.id === 'store-idb');
|
|
61
|
-
const withRows = new Set();
|
|
62
|
-
edges.forEach((e) => {
|
|
63
|
-
if (e.kind === 'reads' || e.kind === 'writes') {
|
|
64
|
-
const page = e.kind === 'reads' ? e.to : e.from;
|
|
65
|
-
if (byId.get(page)?.type === 'page') withRows.add(lift(page));
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
// An app whose own code calls the API (or publishes through an outside system) has a derived `api` flow, rows or not
|
|
69
|
-
edges.forEach((e) => {
|
|
70
|
-
if (e.kind === 'flow' && e.flow === 'api' && byId.get(e.from)?.type === 'app') withRows.add(e.from);
|
|
71
|
-
});
|
|
72
|
-
const apiFlowPairs = new Set(edges.filter((e) => e.kind === 'flow' && e.flow === 'api').map((e) => `${lift(e.from)}|${lift(e.to)}`));
|
|
73
|
-
|
|
74
|
-
const pick = (pred) => nodes.filter(pred).sort((a, b) => String(a.label).localeCompare(String(b.label)));
|
|
75
|
-
const tiers = [
|
|
76
|
-
{ key: 'browser', title: 'Browser', note: 'saved on the device first', nodes: pick(isBrowserStore) },
|
|
77
|
-
{ key: 'servers', title: 'App servers', note: 'pages, no-JS forms', nodes: pick((n) => n.type === 'app' && !apis.has(n.id) && withRows.has(n.id)) },
|
|
78
|
-
{ key: 'api', title: 'API', note: 'where the endpoints are', nodes: pick((n) => apis.has(n.id)) },
|
|
79
|
-
{ key: 'tables', title: 'Tables', note: 'stores and tables', nodes: [...pick((n) => n.type === 'store' && !isBrowserStore(n)), ...pick((n) => n.type === 'table')] },
|
|
80
|
-
{ key: 'services', title: 'Services', note: 'jobs, hooks, webhooks', nodes: pick((n) => n.type === 'service') },
|
|
81
|
-
{ key: 'outside', title: 'Outside', note: 'systems the API reaches', nodes: [...pick((n) => n.type === 'external'), ...pick((n) => n.type === 'container' && n.selfHosted)] },
|
|
82
|
-
];
|
|
83
|
-
const ids = new Set(tiers.flatMap((t) => t.nodes.map((n) => n.id)));
|
|
84
|
-
|
|
85
|
-
const out = [];
|
|
86
|
-
const seen = new Set();
|
|
87
|
-
const add = (e, from, to) => {
|
|
88
|
-
if (from === to || !ids.has(from) || !ids.has(to)) return;
|
|
89
|
-
const key = `${from}|${to}|${e.kind}|${e.flow || ''}`;
|
|
90
|
-
if (seen.has(key)) return;
|
|
91
|
-
seen.add(key);
|
|
92
|
-
out.push({ ...e, from, to, status: e.status || 'live', phase: undefined });
|
|
93
|
-
};
|
|
94
|
-
edges.forEach((e) => {
|
|
95
|
-
// A publisher page's `calls` edge to an outside system is the app's `api` flow already
|
|
96
|
-
if (e.kind === 'calls' && apiFlowPairs.has(`${lift(e.from)}|${lift(e.to)}`)) return;
|
|
97
|
-
// What a container pulls or calls itself (its image registry, its own cloud services) is not the API's data flow
|
|
98
|
-
if (e.kind === 'calls' && byId.get(e.from)?.type === 'container') return;
|
|
99
|
-
if (e.kind === 'flow' || ['calls', 'triggers', 'delivers'].includes(e.kind)) return add(e, lift(e.from), lift(e.to));
|
|
100
|
-
if (e.kind === 'reads' || e.kind === 'writes') {
|
|
101
|
-
const page = e.kind === 'reads' ? e.to : e.from;
|
|
102
|
-
// A page of an app server reaches its rows through the API: only the API's own endpoints and the services touch a table here
|
|
103
|
-
if (byId.get(page)?.type === 'page' && !apis.has(lift(page))) return;
|
|
104
|
-
return add(e, lift(e.from), lift(e.to));
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
return { tiers, ids, edges: out };
|
|
108
|
-
}
|
|
28
|
+
export { buildDataFlow } from './flow-build.js';
|
|
109
29
|
|
|
110
30
|
// ---------------------------------------------------------------------------
|
|
111
31
|
// Legend and the panel's "Data flows" block (engine/flow-ui.js, on an instance)
|
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; }
|