@nanocollective/roster 0.1.0-beta.11 → 0.1.0-beta.12
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.
|
@@ -90,6 +90,12 @@
|
|
|
90
90
|
.homereportwho .meta{padding-left:21px}
|
|
91
91
|
.homereportask{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding-left:21px;margin-top:6px}
|
|
92
92
|
.homereportask .meta{padding-left:0}
|
|
93
|
+
/* A few lines of the report, fading out; the row opens it in full. */
|
|
94
|
+
.homereportbody{min-width:0;max-height:6em;overflow:hidden;
|
|
95
|
+
-webkit-mask-image:linear-gradient(#000 55%,transparent);mask-image:linear-gradient(#000 55%,transparent)}
|
|
96
|
+
.homereport.full .homereportbody{max-height:none;-webkit-mask-image:none;mask-image:none}
|
|
97
|
+
.homereportissue{border:0;background:none;padding:0;font:inherit;color:var(--accent);cursor:pointer}
|
|
98
|
+
.homereportissue:hover{text-decoration:underline}
|
|
93
99
|
.homereportbody p{margin:0 0 4px;color:var(--ink-dim);font-size:13px;line-height:1.5}
|
|
94
100
|
.homereportbody p:first-child{color:var(--ink)}
|
|
95
101
|
.homereportbody a{color:var(--accent)}
|
|
@@ -93,10 +93,13 @@ export function viewHome(m) {
|
|
|
93
93
|
|
|
94
94
|
/* ------------------------------- reports -------------------------------- */
|
|
95
95
|
|
|
96
|
+
/** Whose reports are open in full. Kept here, since Home repaints on every poll. */
|
|
97
|
+
const openReports = new Set();
|
|
98
|
+
|
|
96
99
|
/**
|
|
97
100
|
* One staff member's report: the body of their status issue, which every run rewrites, with a
|
|
98
101
|
* button that asks them to bring it up to date now. It is markdown they wrote, with links to the
|
|
99
|
-
* work it names.
|
|
102
|
+
* work it names. It shows its first few lines; the row opens it in full, and closes it again.
|
|
100
103
|
*/
|
|
101
104
|
function reportRow(s, reports) {
|
|
102
105
|
const r = reports.find((x) => x.staff.handle === s.handle);
|
|
@@ -124,23 +127,44 @@ function reportRow(s, reports) {
|
|
|
124
127
|
}
|
|
125
128
|
};
|
|
126
129
|
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
?
|
|
135
|
-
|
|
136
|
-
|
|
130
|
+
const issue = el("button", { className: "homereportissue", textContent: "#" + item.number });
|
|
131
|
+
issue.onclick = () => openThread(item);
|
|
132
|
+
const full = openReports.has(s.handle);
|
|
133
|
+
const row = el(
|
|
134
|
+
"div",
|
|
135
|
+
{
|
|
136
|
+
className: "homereport" + (r ? " homeclick" : "") + (full ? " full" : ""),
|
|
137
|
+
...(r ? { tabIndex: 0, role: "button", ariaExpanded: String(full) } : {}),
|
|
138
|
+
},
|
|
139
|
+
[
|
|
140
|
+
el("div", { className: "homereportwho" }, [
|
|
141
|
+
el("span", { className: "homewho2" }, [icon(staffIcon(s), "ic"), el("b", { textContent: s.name })]),
|
|
142
|
+
el("span", { className: "meta" }, [
|
|
143
|
+
document.createTextNode((r ? "Updated " + ago(r.at) : "No report yet") + " · "),
|
|
144
|
+
issue,
|
|
145
|
+
]),
|
|
146
|
+
el("div", { className: "homereportask" }, [ask, note]),
|
|
147
|
+
]),
|
|
148
|
+
r
|
|
149
|
+
? el("div", { className: "md homereportbody", innerHTML: mdlite(r.body, { repo: s.brain }) })
|
|
150
|
+
: el("div"),
|
|
151
|
+
],
|
|
152
|
+
);
|
|
153
|
+
if (!r) return row;
|
|
154
|
+
const toggle = () => {
|
|
155
|
+
if (openReports.has(s.handle)) openReports.delete(s.handle);
|
|
156
|
+
else openReports.add(s.handle);
|
|
157
|
+
const now = openReports.has(s.handle);
|
|
158
|
+
row.classList.toggle("full", now);
|
|
159
|
+
row.setAttribute("aria-expanded", String(now));
|
|
160
|
+
};
|
|
137
161
|
row.onclick = (ev) => {
|
|
138
|
-
if (!ev.target.closest("a, button"))
|
|
162
|
+
if (!ev.target.closest("a, button")) toggle();
|
|
139
163
|
};
|
|
140
164
|
row.onkeydown = (ev) => {
|
|
141
165
|
if (ev.target === row && (ev.key === "Enter" || ev.key === " ")) {
|
|
142
166
|
ev.preventDefault();
|
|
143
|
-
|
|
167
|
+
toggle();
|
|
144
168
|
}
|
|
145
169
|
};
|
|
146
170
|
return row;
|
package/package.json
CHANGED
|
@@ -90,6 +90,12 @@
|
|
|
90
90
|
.homereportwho .meta{padding-left:21px}
|
|
91
91
|
.homereportask{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding-left:21px;margin-top:6px}
|
|
92
92
|
.homereportask .meta{padding-left:0}
|
|
93
|
+
/* A few lines of the report, fading out; the row opens it in full. */
|
|
94
|
+
.homereportbody{min-width:0;max-height:6em;overflow:hidden;
|
|
95
|
+
-webkit-mask-image:linear-gradient(#000 55%,transparent);mask-image:linear-gradient(#000 55%,transparent)}
|
|
96
|
+
.homereport.full .homereportbody{max-height:none;-webkit-mask-image:none;mask-image:none}
|
|
97
|
+
.homereportissue{border:0;background:none;padding:0;font:inherit;color:var(--accent);cursor:pointer}
|
|
98
|
+
.homereportissue:hover{text-decoration:underline}
|
|
93
99
|
.homereportbody p{margin:0 0 4px;color:var(--ink-dim);font-size:13px;line-height:1.5}
|
|
94
100
|
.homereportbody p:first-child{color:var(--ink)}
|
|
95
101
|
.homereportbody a{color:var(--accent)}
|
|
@@ -93,10 +93,13 @@ export function viewHome(m) {
|
|
|
93
93
|
|
|
94
94
|
/* ------------------------------- reports -------------------------------- */
|
|
95
95
|
|
|
96
|
+
/** Whose reports are open in full. Kept here, since Home repaints on every poll. */
|
|
97
|
+
const openReports = new Set();
|
|
98
|
+
|
|
96
99
|
/**
|
|
97
100
|
* One staff member's report: the body of their status issue, which every run rewrites, with a
|
|
98
101
|
* button that asks them to bring it up to date now. It is markdown they wrote, with links to the
|
|
99
|
-
* work it names.
|
|
102
|
+
* work it names. It shows its first few lines; the row opens it in full, and closes it again.
|
|
100
103
|
*/
|
|
101
104
|
function reportRow(s, reports) {
|
|
102
105
|
const r = reports.find((x) => x.staff.handle === s.handle);
|
|
@@ -124,23 +127,44 @@ function reportRow(s, reports) {
|
|
|
124
127
|
}
|
|
125
128
|
};
|
|
126
129
|
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
?
|
|
135
|
-
|
|
136
|
-
|
|
130
|
+
const issue = el("button", { className: "homereportissue", textContent: "#" + item.number });
|
|
131
|
+
issue.onclick = () => openThread(item);
|
|
132
|
+
const full = openReports.has(s.handle);
|
|
133
|
+
const row = el(
|
|
134
|
+
"div",
|
|
135
|
+
{
|
|
136
|
+
className: "homereport" + (r ? " homeclick" : "") + (full ? " full" : ""),
|
|
137
|
+
...(r ? { tabIndex: 0, role: "button", ariaExpanded: String(full) } : {}),
|
|
138
|
+
},
|
|
139
|
+
[
|
|
140
|
+
el("div", { className: "homereportwho" }, [
|
|
141
|
+
el("span", { className: "homewho2" }, [icon(staffIcon(s), "ic"), el("b", { textContent: s.name })]),
|
|
142
|
+
el("span", { className: "meta" }, [
|
|
143
|
+
document.createTextNode((r ? "Updated " + ago(r.at) : "No report yet") + " · "),
|
|
144
|
+
issue,
|
|
145
|
+
]),
|
|
146
|
+
el("div", { className: "homereportask" }, [ask, note]),
|
|
147
|
+
]),
|
|
148
|
+
r
|
|
149
|
+
? el("div", { className: "md homereportbody", innerHTML: mdlite(r.body, { repo: s.brain }) })
|
|
150
|
+
: el("div"),
|
|
151
|
+
],
|
|
152
|
+
);
|
|
153
|
+
if (!r) return row;
|
|
154
|
+
const toggle = () => {
|
|
155
|
+
if (openReports.has(s.handle)) openReports.delete(s.handle);
|
|
156
|
+
else openReports.add(s.handle);
|
|
157
|
+
const now = openReports.has(s.handle);
|
|
158
|
+
row.classList.toggle("full", now);
|
|
159
|
+
row.setAttribute("aria-expanded", String(now));
|
|
160
|
+
};
|
|
137
161
|
row.onclick = (ev) => {
|
|
138
|
-
if (!ev.target.closest("a, button"))
|
|
162
|
+
if (!ev.target.closest("a, button")) toggle();
|
|
139
163
|
};
|
|
140
164
|
row.onkeydown = (ev) => {
|
|
141
165
|
if (ev.target === row && (ev.key === "Enter" || ev.key === " ")) {
|
|
142
166
|
ev.preventDefault();
|
|
143
|
-
|
|
167
|
+
toggle();
|
|
144
168
|
}
|
|
145
169
|
};
|
|
146
170
|
return row;
|