@cyberskill/design 1.0.0 → 1.1.1
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/DESIGN.md +10 -9
- package/README.md +31 -28
- package/SKILL.md +13 -9
- package/VERSION +1 -1
- package/_ds_bundle.js +660 -202
- package/_ds_manifest.json +1 -1
- package/_esm/cs.mjs +14 -8
- package/_esm/react.d.ts +216 -0
- package/_esm/react.mjs +114 -0
- package/base/collections.css +31 -0
- package/base/components.css +3 -0
- package/base/data.css +33 -0
- package/base/forms.css +8 -0
- package/base/interaction.css +1 -0
- package/base/typography.css +6 -0
- package/components/_i18n/strings.js +8 -4
- package/components/ai/ai-conversation.card.html +2 -2
- package/components/ai/ai-lumi.card.html +2 -2
- package/components/ai/ai.card.html +2 -2
- package/components/brand/brand.card.html +2 -2
- package/components/button/buttons.card.html +2 -2
- package/components/data/AspectRatio.d.ts +16 -0
- package/components/data/AspectRatio.figma.tsx +12 -0
- package/components/data/AspectRatio.jsx +16 -0
- package/components/data/AspectRatio.prompt.md +7 -0
- package/components/data/Collapsible.d.ts +21 -0
- package/components/data/Collapsible.figma.tsx +12 -0
- package/components/data/Collapsible.jsx +49 -0
- package/components/data/Collapsible.prompt.md +7 -0
- package/components/data/Image.d.ts +4 -0
- package/components/data/Image.prompt.md +2 -2
- package/components/data/Item.d.ts +26 -0
- package/components/data/Item.figma.tsx +12 -0
- package/components/data/Item.jsx +63 -0
- package/components/data/Item.prompt.md +10 -0
- package/components/data/ScrollArea.d.ts +16 -0
- package/components/data/ScrollArea.figma.tsx +12 -0
- package/components/data/ScrollArea.jsx +25 -0
- package/components/data/ScrollArea.prompt.md +7 -0
- package/components/data/collections.card.html +15 -4
- package/components/data/data.card.html +15 -4
- package/components/datatable/datatable.card.html +2 -2
- package/components/dialog/dialog.card.html +2 -2
- package/components/feedback/feedback-2.card.html +2 -2
- package/components/feedback/feedback.card.html +2 -2
- package/components/forms/Cascader.jsx +5 -3
- package/components/forms/Editor.prompt.md +1 -1
- package/components/forms/InputGroup.d.ts +4 -0
- package/components/forms/InputGroup.jsx +38 -8
- package/components/forms/InputGroup.prompt.md +3 -3
- package/components/forms/NativeSelect.d.ts +22 -0
- package/components/forms/NativeSelect.figma.tsx +12 -0
- package/components/forms/NativeSelect.jsx +56 -0
- package/components/forms/NativeSelect.prompt.md +10 -0
- package/components/forms/NumberField.d.ts +5 -0
- package/components/forms/NumberField.jsx +51 -7
- package/components/forms/NumberField.prompt.md +2 -2
- package/components/forms/SegmentedControl.jsx +1 -1
- package/components/forms/TagInput.d.ts +3 -0
- package/components/forms/TagInput.jsx +62 -20
- package/components/forms/TagInput.prompt.md +2 -2
- package/components/forms/forms-2.card.html +2 -2
- package/components/forms/forms.card.html +5 -4
- package/components/icon/Icon.prompt.md +1 -1
- package/components/icon/icon.card.html +2 -2
- package/components/logo/Logo.jsx +2 -1
- package/components/logo/logo.card.html +2 -2
- package/components/navigation/Menu.jsx +14 -1
- package/components/navigation/navigation.card.html +2 -2
- package/components/navigation/shell.card.html +2 -2
- package/components/overlays/AlertDialog.d.ts +29 -0
- package/components/overlays/AlertDialog.figma.tsx +12 -0
- package/components/overlays/AlertDialog.jsx +142 -0
- package/components/overlays/AlertDialog.prompt.md +12 -0
- package/components/overlays/Drawer.jsx +1 -1
- package/components/overlays/Popconfirm.jsx +14 -1
- package/components/overlays/Popover.jsx +14 -1
- package/components/overlays/alertdialog.card.html +42 -0
- package/components/overlays/overlays.card.html +2 -2
- package/components/textfield/textfield.card.html +2 -2
- package/docs/benchmark-rubric.md +46 -0
- package/docs/ci-cd.md +17 -11
- package/docs/consumer-grant.md +37 -0
- package/docs/consuming.md +45 -16
- package/docs/contrast-report.md +91 -103
- package/docs/conventions.md +12 -9
- package/docs/decisions.md +33 -10
- package/docs/deploy.md +1 -1
- package/docs/design-styles.md +26 -8
- package/docs/figma.md +3 -3
- package/docs/live-hub.md +5 -3
- package/docs/products.md +13 -11
- package/docs/quality-gates.md +35 -21
- package/docs/release-notes.md +21 -3
- package/docs/status/assets/favicon.svg +5 -0
- package/docs/status/assets/status-legacy.css +399 -0
- package/docs/status/assets/status-legacy.js +505 -0
- package/docs/status/assets/status.css +644 -0
- package/docs/status/assets/status.js +1308 -0
- package/docs/status/data/status-feed.json +1 -0
- package/docs/status/data/task/TASK-REL-001.js +1 -0
- package/docs/status/data/task/TASK-REL-002.js +1 -0
- package/docs/status/index.html +42 -0
- package/docs/status/roadmap.html +4 -0
- package/docs/status/status-legacy.html +117 -0
- package/docs/storybook.md +5 -4
- package/docs/sync.md +3 -2
- package/docs/tasks/BACKLOG.md +26 -0
- package/docs/tasks/release/TASK-REL-001-launch-1-1-0/spec.md +55 -0
- package/docs/tasks/release/TASK-REL-002-republish-1-1-1/spec.md +54 -0
- package/docs/template-schema-v2.md +15 -3
- package/docs/vi/benchmark-rubric.md +46 -0
- package/docs/vi/ci-cd.md +17 -11
- package/docs/vi/consumer-grant.md +37 -0
- package/docs/vi/consuming.md +45 -16
- package/docs/vi/contrast-report.md +94 -106
- package/docs/vi/conventions.md +12 -9
- package/docs/vi/decisions.md +33 -10
- package/docs/vi/deploy.md +1 -1
- package/docs/vi/design-styles.md +26 -8
- package/docs/vi/figma.md +3 -3
- package/docs/vi/live-hub.md +5 -3
- package/docs/vi/products.md +13 -11
- package/docs/vi/quality-gates.md +35 -21
- package/docs/vi/release-notes.md +26 -8
- package/docs/vi/storybook.md +5 -4
- package/docs/vi/sync.md +3 -2
- package/docs/vi/template-schema-v2.md +15 -3
- package/docs/viewer.html +2 -2
- package/fonts/spacegrotesk-var-latin-ext.woff2 +0 -0
- package/fonts/spacegrotesk-var-latin.woff2 +0 -0
- package/fonts/spacegrotesk-var-vietnamese.woff2 +0 -0
- package/guidelines/atomic-view.html +40 -27
- package/guidelines/elements-geometry.html +69 -0
- package/guidelines/elements-variants.html +17 -17
- package/guidelines/type-families.html +16 -10
- package/llms.txt +17 -11
- package/package.json +38 -16
- package/styles.css +1 -0
- package/templates/ai-cluster-demo.html +29 -14
- package/templates/app-shell/support.js +4 -4
- package/templates/article/content-schema.json +6 -0
- package/templates/article/support.js +4 -4
- package/templates/auth/support.js +4 -4
- package/templates/bod-deck/support.js +4 -4
- package/templates/bod-investor-update/support.js +4 -4
- package/templates/bod-memo/support.js +4 -4
- package/templates/bod-minutes/content-schema.json +12 -0
- package/templates/bod-minutes/support.js +4 -4
- package/templates/bod-report/support.js +4 -4
- package/templates/bod-resolution/support.js +4 -4
- package/templates/culture-event-invite/support.js +4 -4
- package/templates/dashboard/support.js +4 -4
- package/templates/delivery-change-note/support.js +4 -4
- package/templates/delivery-kickoff/support.js +4 -4
- package/templates/delivery-qbr-deck/support.js +4 -4
- package/templates/delivery-runbook/content-schema.json +6 -0
- package/templates/delivery-runbook/support.js +4 -4
- package/templates/delivery-status-email/support.js +4 -4
- package/templates/doc-style-guide/DocStyleGuide.dc.html +2 -2
- package/templates/doc-style-guide/support.js +4 -4
- package/templates/doc-suite-index/support.js +4 -4
- package/templates/doc-templates/DocTemplates.dc.html +1 -1
- package/templates/doc-templates/support.js +4 -4
- package/templates/email/support.js +4 -4
- package/templates/email-safe/README.md +17 -4
- package/templates/email-safe/email-launch.html +3 -3
- package/templates/email-safe/email-newsletter.html +1 -1
- package/templates/finance-dunning-email/support.js +4 -4
- package/templates/finance-expense-report/support.js +4 -4
- package/templates/finance-invoice/support.js +4 -4
- package/templates/finance-quote/support.js +4 -4
- package/templates/hr-announcement/support.js +4 -4
- package/templates/hr-interview-kit/content-schema.json +12 -0
- package/templates/hr-interview-kit/support.js +4 -4
- package/templates/hr-offboarding/content-schema.json +12 -0
- package/templates/hr-offboarding/support.js +4 -4
- package/templates/hr-performance-review/content-schema.json +12 -0
- package/templates/hr-performance-review/support.js +4 -4
- package/templates/hr-pip/content-schema.json +12 -0
- package/templates/hr-pip/support.js +4 -4
- package/templates/legal-msa/content-schema.json +16 -0
- package/templates/legal-msa/support.js +4 -4
- package/templates/legal-sow/support.js +4 -4
- package/templates/marketing-campaign-brief/support.js +4 -4
- package/templates/marketing-case-study/support.js +4 -4
- package/templates/marketing-launch/support.js +4 -4
- package/templates/marketing-newsletter/support.js +4 -4
- package/templates/marketing-page/content-schema.json +0 -1
- package/templates/marketing-page/support.js +4 -4
- package/templates/marketing-press-release/support.js +4 -4
- package/templates/marketing-social-kit/support.js +4 -4
- package/templates/playground.html +8 -4
- package/templates/sales-one-pager/support.js +4 -4
- package/templates/sales-proposal-deck/support.js +4 -4
- package/templates/settings/Settings.dc.html +26 -14
- package/templates/settings/content-schema.json +36 -0
- package/templates/settings/support.js +4 -4
- package/templates/slide-deck/support.js +4 -4
- package/templates/team-meeting-agenda/content-schema.json +16 -0
- package/templates/team-meeting-agenda/support.js +4 -4
- package/templates/tech-incident-report/support.js +4 -4
- package/templates/tech-release-notes/support.js +4 -4
- package/templates/tech-retro/content-schema.json +12 -0
- package/templates/tech-retro/support.js +4 -4
- package/templates/tech-rfc/content-schema.json +6 -0
- package/templates/tech-rfc/support.js +4 -4
- package/templates/vn-appointment-transfer/support.js +4 -4
- package/templates/vn-certificate-of-employment/support.js +4 -4
- package/templates/vn-code-of-conduct/support.js +4 -4
- package/templates/vn-compensation-regulation/support.js +4 -4
- package/templates/vn-contract-amendment/support.js +4 -4
- package/templates/vn-contractor-agreement/support.js +4 -4
- package/templates/vn-data-protection-policy/support.js +4 -4
- package/templates/vn-disciplinary-case-file/support.js +4 -4
- package/templates/vn-disciplinary-schedule/content-schema.json +15 -0
- package/templates/vn-disciplinary-schedule/support.js +4 -4
- package/templates/vn-employee-request/support.js +4 -4
- package/templates/vn-exit-handover/support.js +4 -4
- package/templates/vn-foreign-employee-pack/support.js +4 -4
- package/templates/vn-grassroots-democracy/support.js +4 -4
- package/templates/vn-infosec-policy/support.js +4 -4
- package/templates/vn-internal-labor-regulations/support.js +4 -4
- package/templates/vn-internship-agreement/support.js +4 -4
- package/templates/vn-job-description/support.js +4 -4
- package/templates/vn-labor-contract/support.js +4 -4
- package/templates/vn-labour-management-book/content-schema.json +15 -0
- package/templates/vn-labour-management-book/support.js +4 -4
- package/templates/vn-mutual-nda/support.js +4 -4
- package/templates/vn-ndnca-ip/support.js +4 -4
- package/templates/vn-offer-letter/support.js +4 -4
- package/templates/vn-onboarding-checklist/support.js +4 -4
- package/templates/vn-pdpl-consent/support.js +4 -4
- package/templates/vn-performance-evaluation-regulation/support.js +4 -4
- package/templates/vn-performance-review-form/support.js +4 -4
- package/templates/vn-phantom-stock/support.js +4 -4
- package/templates/vn-probation-contract/support.js +4 -4
- package/templates/vn-receipt-acknowledgement/content-schema.json +15 -0
- package/templates/vn-receipt-acknowledgement/support.js +4 -4
- package/templates/vn-remote-work-policy/support.js +4 -4
- package/templates/vn-resignation-letter/support.js +4 -4
- package/templates/vn-salary-scale/content-schema.json +15 -0
- package/templates/vn-salary-scale/support.js +4 -4
- package/templates/vn-sow-appendix/support.js +4 -4
- package/templates/vn-termination-decision/support.js +4 -4
- package/templates/vn-total-rewards-appendix/support.js +4 -4
- package/templates/vn-training-commitment/support.js +4 -4
- package/templates/vn-travel-expense-policy/support.js +4 -4
- package/tokens/element-seeds.json +112 -0
- package/tokens/elements.css +274 -187
- package/tokens/fonts.css +12 -3
- package/tokens/native/CSTokens.kt +84 -68
- package/tokens/native/CSTokens.swift +84 -68
- package/tokens/native/cs_tokens.dart +84 -68
- package/tokens/provenance.json +9 -9
- package/tokens/styles.css +15 -0
- package/tokens/tokens.dtcg.json +258 -233
- package/tokens/tokens.js +168 -167
- package/tokens/tokens.json +167 -166
- package/tokens/typography.css +9 -1
- package/ui_kits/status-hub/README.md +1 -2
- package/ui_kits/status-hub/index.html +2 -2
- package/ui_kits/status-hub/settings.html +6 -3
- package/ui_kits/website/chat.html +2 -2
- package/ui_kits/website/index.html +2 -2
- package/ui_kits/status-hub/identity-lab.html +0 -134
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
/* status-app.js - client for status-hub@2.
|
|
2
|
+
One corpus, three lenses (board / table / releases) + a task detail drawer.
|
|
3
|
+
No dependencies and no network calls except the on-demand per-task spec chunk
|
|
4
|
+
(data/task/<ID>.js - a classic script, so it works over file:// too).
|
|
5
|
+
The page stays readable without this file: <noscript> carries a static table
|
|
6
|
+
of every task plus the full release list. */
|
|
7
|
+
(function () {
|
|
8
|
+
"use strict";
|
|
9
|
+
|
|
10
|
+
var el = document.getElementById("cs-data");
|
|
11
|
+
if (!el) return;
|
|
12
|
+
var D = JSON.parse(el.textContent);
|
|
13
|
+
// status.css already has a `.tasks` rule meaning something else, so renaming
|
|
14
|
+
// the class would collide. Data key: renamed. CSS class: frozen.
|
|
15
|
+
var TASKS = D.tasks;
|
|
16
|
+
var BY = {};
|
|
17
|
+
TASKS.forEach(function (f) { BY[f.i] = f; });
|
|
18
|
+
|
|
19
|
+
var ACTIVE = { ready_to_implement: 1, implementing: 1, ready_to_review: 1,
|
|
20
|
+
reviewing: 1, ready_to_test: 1, testing: 1 };
|
|
21
|
+
// cannot_reproduce / duplicate are TERMINAL (added 2026-07-14 with `type: bug`).
|
|
22
|
+
// Omit them here and they bucket as "todo" — the board would show closed bugs as
|
|
23
|
+
// outstanding work forever, which is exactly the kind of quiet lie a status page
|
|
24
|
+
// must not tell.
|
|
25
|
+
var DONE = { done: 1, closed: 1, cannot_reproduce: 1, duplicate: 1 };
|
|
26
|
+
function bucket(s) {
|
|
27
|
+
return DONE[s] ? "done" : ACTIVE[s] ? "active" : s === "on_hold" ? "hold" : "todo";
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
var LENSES = { board: 1, table: 1, timeline: 1 };
|
|
31
|
+
var LEGACY = { roadmap: "board", backlog: "table", changelog: "timeline" };
|
|
32
|
+
var FKEYS = ["m", "s", "p", "c", "ph", "b"];
|
|
33
|
+
var FFIELD = { m: "m", s: "s", p: "p", c: "c", ph: "ph" };
|
|
34
|
+
var FLABEL = { m: "module", s: "status", p: "priority", c: "class", ph: "phase", b: "group" };
|
|
35
|
+
|
|
36
|
+
var S = { lens: "board", q: "", f: {}, group: "m", sort: "i", dir: 1, task: null };
|
|
37
|
+
|
|
38
|
+
/* ---- hash state ------------------------------------------------------- */
|
|
39
|
+
function readHash() {
|
|
40
|
+
var h = decodeURIComponent(location.hash.replace(/^#/, ""));
|
|
41
|
+
if (!h) return;
|
|
42
|
+
var parts = h.split("?");
|
|
43
|
+
var path = parts[0];
|
|
44
|
+
var qs = parts[1] || "";
|
|
45
|
+
if (path.indexOf("task/") === 0) S.task = path.slice(5);
|
|
46
|
+
else if (LENSES[path]) S.lens = path;
|
|
47
|
+
else if (LEGACY[path]) S.lens = LEGACY[path];
|
|
48
|
+
qs.split("&").forEach(function (kv) {
|
|
49
|
+
if (!kv) return;
|
|
50
|
+
var i = kv.indexOf("=");
|
|
51
|
+
var k = i < 0 ? kv : kv.slice(0, i);
|
|
52
|
+
var v = i < 0 ? "" : decodeURIComponent(kv.slice(i + 1));
|
|
53
|
+
if (k === "q") S.q = v;
|
|
54
|
+
else if (k === "g") S.group = v;
|
|
55
|
+
else if (FKEYS.indexOf(k) >= 0 && v) S.f[k] = v;
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function writeHash(replace) {
|
|
59
|
+
var q = [];
|
|
60
|
+
if (S.q) q.push("q=" + encodeURIComponent(S.q));
|
|
61
|
+
FKEYS.forEach(function (k) { if (S.f[k]) q.push(k + "=" + encodeURIComponent(S.f[k])); });
|
|
62
|
+
if (S.lens === "board" && S.group !== "m") q.push("g=" + S.group);
|
|
63
|
+
var h = "#" + (S.task ? "task/" + S.task : S.lens) + (q.length ? "?" + q.join("&") : "");
|
|
64
|
+
if (h === location.hash) return;
|
|
65
|
+
if (replace && history.replaceState) history.replaceState(null, "", h);
|
|
66
|
+
else if (history.pushState) history.pushState(null, "", h);
|
|
67
|
+
else location.hash = h;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* ---- filtering -------------------------------------------------------- */
|
|
71
|
+
function matches(f) {
|
|
72
|
+
for (var k in FFIELD) if (S.f[k] && f[FFIELD[k]] !== S.f[k]) return false;
|
|
73
|
+
if (S.f.b && bucket(f.s) !== S.f.b) return false;
|
|
74
|
+
if (S.q) {
|
|
75
|
+
var q = S.q.toLowerCase();
|
|
76
|
+
var hay = (f.i + " " + f.t + " " + f.m + " " + (f.o || "") + " " +
|
|
77
|
+
(f.ph || "") + " " + (f.sm || "")).toLowerCase();
|
|
78
|
+
if (hay.indexOf(q) < 0) return false;
|
|
79
|
+
}
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
function view() { return TASKS.filter(matches); }
|
|
83
|
+
|
|
84
|
+
/* ---- helpers ---------------------------------------------------------- */
|
|
85
|
+
function esc(s) {
|
|
86
|
+
return String(s == null ? "" : s).replace(/&/g, "&").replace(/</g, "<")
|
|
87
|
+
.replace(/>/g, ">").replace(/"/g, """);
|
|
88
|
+
}
|
|
89
|
+
function pct(n, d) { return d ? (100 * n / d).toFixed(1) : "0.0"; }
|
|
90
|
+
function chip(f, ghost) {
|
|
91
|
+
if (!f) return "";
|
|
92
|
+
return '<button class="chip ' + bucket(f.s) + (ghost ? " ghost" : "") +
|
|
93
|
+
'" data-task="' + esc(f.i) + '" title="' + esc(f.i + " — " + f.t + " [" + f.s + "]") +
|
|
94
|
+
'">' + esc(f.i.replace(/^TASK-/, "")) + "</button>";
|
|
95
|
+
}
|
|
96
|
+
function chipId(id, ghost) {
|
|
97
|
+
return BY[id] ? chip(BY[id], ghost)
|
|
98
|
+
: '<span class="chip ghost" title="not in this corpus">' + esc(id.replace(/^TASK-/, "")) + "</span>";
|
|
99
|
+
}
|
|
100
|
+
function segs(rows) {
|
|
101
|
+
var d = 0, a = 0, h = 0;
|
|
102
|
+
rows.forEach(function (f) {
|
|
103
|
+
var b = bucket(f.s);
|
|
104
|
+
if (b === "done") d++; else if (b === "active") a++; else if (b === "hold") h++;
|
|
105
|
+
});
|
|
106
|
+
var n = rows.length;
|
|
107
|
+
return '<div class="minibar"><i class="seg-done" style="width:' + pct(d, n) + '%"></i>' +
|
|
108
|
+
'<i class="seg-active" style="width:' + pct(a, n) + '%"></i>' +
|
|
109
|
+
'<i class="seg-hold" style="width:' + pct(h, n) + '%"></i></div>';
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* ---- lens: board ------------------------------------------------------ */
|
|
113
|
+
function board(rows) {
|
|
114
|
+
var g = S.group, keys = [], bag = {};
|
|
115
|
+
rows.forEach(function (f) {
|
|
116
|
+
var k = f[g] || "(unset)";
|
|
117
|
+
if (!bag[k]) { bag[k] = []; keys.push(k); }
|
|
118
|
+
bag[k].push(f);
|
|
119
|
+
});
|
|
120
|
+
if (g === "s") keys.sort(function (a, b) { return D.statuses.indexOf(a) - D.statuses.indexOf(b); });
|
|
121
|
+
else keys.sort(function (a, b) {
|
|
122
|
+
return bag[b].length - bag[a].length || String(a).localeCompare(String(b));
|
|
123
|
+
});
|
|
124
|
+
if (!keys.length) return '<p class="empty">No task matches these filters.</p>';
|
|
125
|
+
return '<div class="grid">' + keys.map(function (k) {
|
|
126
|
+
var rs = bag[k];
|
|
127
|
+
var d = rs.filter(function (f) { return bucket(f.s) === "done"; }).length;
|
|
128
|
+
var a = rs.filter(function (f) { return bucket(f.s) === "active"; }).length;
|
|
129
|
+
return '<section class="card' + (a ? " hot" : "") + '">' +
|
|
130
|
+
'<div class="card-h"><h3><span class="k">' + esc(k) + '</span> ' +
|
|
131
|
+
'<span class="muted">· ' + rs.length + " tasks</span></h3>" +
|
|
132
|
+
'<span class="pct">' + pct(d, rs.length) + "% done</span></div>" +
|
|
133
|
+
segs(rs) + '<div class="task-chips">' +
|
|
134
|
+
rs.map(function (f) { return chip(f); }).join("") + "</div></section>";
|
|
135
|
+
}).join("") + "</div>";
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/* ---- lens: table ------------------------------------------------------ */
|
|
139
|
+
var COLS = [
|
|
140
|
+
{ k: "i", h: "id" }, { k: "t", h: "title" }, { k: "m", h: "module" },
|
|
141
|
+
{ k: "c", h: "class" }, { k: "p", h: "priority" }, { k: "ph", h: "phase" },
|
|
142
|
+
{ k: "e", h: "effort" }, { k: "s", h: "status" }
|
|
143
|
+
];
|
|
144
|
+
function table(rows) {
|
|
145
|
+
var k = S.sort, dir = S.dir;
|
|
146
|
+
var sorted = rows.slice().sort(function (a, b) {
|
|
147
|
+
var x = a[k], y = b[k];
|
|
148
|
+
if (k === "s") { x = D.statuses.indexOf(x); y = D.statuses.indexOf(y); }
|
|
149
|
+
else if (k === "e") { x = +x || 0; y = +y || 0; }
|
|
150
|
+
else { x = x == null ? "" : x; y = y == null ? "" : y; }
|
|
151
|
+
return (x > y ? 1 : x < y ? -1 : 0) * dir || String(a.i).localeCompare(String(b.i));
|
|
152
|
+
});
|
|
153
|
+
if (!sorted.length) return '<p class="empty">No task matches these filters.</p>';
|
|
154
|
+
var head = COLS.map(function (c) {
|
|
155
|
+
var s = S.sort === c.k ? (S.dir > 0 ? "ascending" : "descending") : "none";
|
|
156
|
+
return '<th data-sort="' + c.k + '" aria-sort="' + s + '" scope="col">' + c.h + "</th>";
|
|
157
|
+
}).join("");
|
|
158
|
+
var body = sorted.map(function (f) {
|
|
159
|
+
return '<tr data-task="' + esc(f.i) + '" tabindex="0">' +
|
|
160
|
+
'<td class="code">' + esc(f.i) + "</td>" +
|
|
161
|
+
'<td class="t">' + esc(f.t) + "</td>" +
|
|
162
|
+
"<td>" + esc(f.m) + "</td><td>" + esc(f.c || "") + "</td>" +
|
|
163
|
+
'<td class="pri ' + esc(f.p || "") + '">' + esc(f.p || "") + "</td>" +
|
|
164
|
+
"<td>" + esc(f.ph || "") + "</td><td>" + esc(f.e || "") + "</td>" +
|
|
165
|
+
'<td><span class="pill ' + bucket(f.s) + '">' + esc(f.s) + "</span></td></tr>";
|
|
166
|
+
}).join("");
|
|
167
|
+
return '<div class="tbl-wrap"><table><thead><tr>' + head +
|
|
168
|
+
"</tr></thead><tbody>" + body + "</tbody></table></div>";
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/* ---- lens: releases --------------------------------------------------- */
|
|
172
|
+
var BOUND = {};
|
|
173
|
+
(D.bound || []).forEach(function (id) { BOUND[id] = 1; });
|
|
174
|
+
|
|
175
|
+
function timeline(rows) {
|
|
176
|
+
var seen = {};
|
|
177
|
+
rows.forEach(function (f) { seen[f.i] = 1; });
|
|
178
|
+
// "unreleased" = in flight, plus anything already done that no release accounts for
|
|
179
|
+
var moving = rows.filter(function (f) {
|
|
180
|
+
var b = bucket(f.s);
|
|
181
|
+
return b === "active" || (b === "done" && !BOUND[f.i]);
|
|
182
|
+
});
|
|
183
|
+
var out = [];
|
|
184
|
+
if (moving.length) {
|
|
185
|
+
var shipped = moving.filter(function (f) { return bucket(f.s) === "done"; }).length;
|
|
186
|
+
out.push('<article class="rel now"><span class="tick">★</span><div>' +
|
|
187
|
+
'<div class="rel-h"><b>unreleased</b><span class="muted">' + moving.length + " tasks</span></div>" +
|
|
188
|
+
'<p class="relnote">No release accounts for these yet — ' +
|
|
189
|
+
(moving.length - shipped) + " in flight (<code>ready_to_implement</code> → <code>testing</code>)" +
|
|
190
|
+
(shipped ? ", " + shipped + " already <code>done</code> but not cut into a release" : "") +
|
|
191
|
+
".</p>" +
|
|
192
|
+
'<div class="task-chips">' + moving.map(function (f) { return chip(f); }).join("") +
|
|
193
|
+
"</div></div></article>");
|
|
194
|
+
}
|
|
195
|
+
D.releases.forEach(function (r, i) {
|
|
196
|
+
var cited = r.cited.filter(function (id) { return !BY[id] || seen[id]; });
|
|
197
|
+
var dated = r.dated.filter(function (id) { return seen[id]; });
|
|
198
|
+
var secs = r.sec.map(function (s) {
|
|
199
|
+
return '<div class="rel-sec"><h4>' + esc(s.h) + "</h4><ul>" +
|
|
200
|
+
s.items.map(function (x) { return "<li>" + x + "</li>"; }).join("") + "</ul></div>";
|
|
201
|
+
}).join("");
|
|
202
|
+
var chips = cited.map(function (id) { return chipId(id); }).join("") +
|
|
203
|
+
dated.map(function (id) { return chipId(id, true); }).join("");
|
|
204
|
+
out.push('<article class="rel' + (i === 0 && !moving.length ? " now" : "") +
|
|
205
|
+
'"><span class="tick">' + (i === 0 ? "★" : "✓") + "</span><div>" +
|
|
206
|
+
'<div class="rel-h"><b>' + esc(r.vl) + "</b>" +
|
|
207
|
+
(r.d ? '<span class="muted">' + esc(r.d) + "</span>" : "") +
|
|
208
|
+
'<span class="muted">' + (cited.length + dated.length) + " tasks</span></div>" +
|
|
209
|
+
(chips ? '<div class="task-chips">' + chips + "</div>"
|
|
210
|
+
: '<p class="relnote">No task id cited in this entry.</p>') +
|
|
211
|
+
(dated.length ? '<p class="relnote">Dashed chips were bound by <code>shipped:</code> date, ' +
|
|
212
|
+
"not cited in the entry text.</p>" : "") +
|
|
213
|
+
(r.intro.length || secs
|
|
214
|
+
? "<details><summary>Release notes</summary>" +
|
|
215
|
+
r.intro.map(function (p) { return "<p>" + p + "</p>"; }).join("") + secs + "</details>"
|
|
216
|
+
: "") +
|
|
217
|
+
"</div></article>");
|
|
218
|
+
});
|
|
219
|
+
return '<div class="rels">' + out.join("") + "</div>";
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/* ---- drawer ----------------------------------------------------------- */
|
|
223
|
+
var drawer = document.getElementById("drawer");
|
|
224
|
+
var scrim = document.getElementById("scrim");
|
|
225
|
+
var dwTab = "overview";
|
|
226
|
+
var lastFocus = null;
|
|
227
|
+
|
|
228
|
+
// the markdown is only reachable when it ships next to the page (docs/status/ does; the
|
|
229
|
+
// website build does not - there the rendered task page is the way in)
|
|
230
|
+
function specHref(f) { return D.frBase ? D.frBase + f.dm + "/" + f.k + "/spec.md" : ""; }
|
|
231
|
+
function srcLink(f, label) {
|
|
232
|
+
var h = specHref(f);
|
|
233
|
+
return h ? '<a href="' + esc(h) + '">' + label + "</a>"
|
|
234
|
+
: (f.pg ? '<a href="' + esc(f.pg) + '">the task page</a>' : "");
|
|
235
|
+
}
|
|
236
|
+
function row(dt, dd) { return dd ? "<div><dt>" + esc(dt) + "</dt><dd>" + dd + "</dd></div>" : ""; }
|
|
237
|
+
|
|
238
|
+
function drawerHtml(f) {
|
|
239
|
+
var n = f.d.length + f.b.length + f.rl.length;
|
|
240
|
+
var tabs = [["overview", "Overview"], ["spec", "Full spec"], ["links", "Links (" + n + ")"]];
|
|
241
|
+
return '<div class="dw-h"><div class="row">' +
|
|
242
|
+
'<span class="pill ' + bucket(f.s) + '">' + esc(f.s) + "</span>" +
|
|
243
|
+
'<span class="code muted">' + esc(f.i) + "</span>" +
|
|
244
|
+
'<span class="pri ' + esc(f.p || "") + '">' + esc(f.p || "") + "</span>" +
|
|
245
|
+
'<button class="dw-x" type="button" aria-label="Close">×</button></div>' +
|
|
246
|
+
'<h2 id="dw-title">' + esc(f.t) + "</h2></div>" +
|
|
247
|
+
'<div class="dw-tabs" role="tablist">' + tabs.map(function (t) {
|
|
248
|
+
return '<button class="dw-tab" role="tab" type="button" data-dwtab="' + t[0] +
|
|
249
|
+
'" aria-selected="' + (dwTab === t[0]) + '">' + t[1] + "</button>";
|
|
250
|
+
}).join("") + "</div><div class=\"dw-b\" id=\"dw-body\"></div>";
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
function overview(f) {
|
|
254
|
+
var m = '<dl class="meta">' +
|
|
255
|
+
row("module", esc(f.m)) + row("class", esc(f.c)) + row("phase", esc(f.ph)) +
|
|
256
|
+
row("milestone", esc(f.ms)) + row("slice", esc(f.sl)) + row("owner", esc(f.o)) +
|
|
257
|
+
row("effort", f.e ? esc(f.e) + " h" : "") + row("verify", esc(f.v)) +
|
|
258
|
+
row("created", esc(f.cr)) + row("shipped", esc(f.sh)) + "</dl>";
|
|
259
|
+
var s = "";
|
|
260
|
+
if (f.sm) s += '<div class="sect"><h3>Summary</h3><p>' + esc(f.sm) + "</p></div>";
|
|
261
|
+
if (f.st && f.st.length) {
|
|
262
|
+
s += '<div class="sect"><h3>Sub-tasks (' + f.st.length + ')</h3><ul class="tasks">' +
|
|
263
|
+
f.st.map(function (t) { return "<li>" + esc(t) + "</li>"; }).join("") + "</ul></div>";
|
|
264
|
+
}
|
|
265
|
+
if (f.r) s += '<div class="sect"><h3>Risk if skipped</h3><p class="risk">' + esc(f.r) + "</p></div>";
|
|
266
|
+
return m + s;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
function links(f) {
|
|
270
|
+
function blk(title, ids, none) {
|
|
271
|
+
return "<div><h3>" + esc(title) + " (" + ids.length + ")</h3>" +
|
|
272
|
+
(ids.length ? '<div class="task-chips">' + ids.map(function (id) { return chipId(id); }).join("") + "</div>"
|
|
273
|
+
: '<p class="muted">' + esc(none) + "</p>") + "</div>";
|
|
274
|
+
}
|
|
275
|
+
var srcs = [];
|
|
276
|
+
if (f.pg) srcs.push('<a href="' + esc(f.pg) + '">Rendered task page</a>');
|
|
277
|
+
if (specHref(f)) srcs.push('<a href="' + esc(specHref(f)) + '"><code>spec.md</code> — the record of truth</a>');
|
|
278
|
+
if (!srcs.length) srcs.push('<span class="muted">Markdown is the record of truth: <code>' +
|
|
279
|
+
esc("docs/tasks/" + f.dm + "/" + f.k + "/spec.md") + "</code></span>");
|
|
280
|
+
return '<div class="rel-links">' +
|
|
281
|
+
blk("Depends on", f.d, "Nothing blocks this task.") +
|
|
282
|
+
blk("Blocks", f.b, "This task blocks nothing.") +
|
|
283
|
+
blk("Related", f.rl, "No related tasks recorded.") + "</div>" +
|
|
284
|
+
'<div class="sect"><h3>Sources</h3><p>' + srcs.join(" · ") + "</p></div>";
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
function specTab(f) {
|
|
288
|
+
var body = document.getElementById("dw-body");
|
|
289
|
+
if (!f.sp) {
|
|
290
|
+
body.innerHTML = '<p class="load">No spec body was rendered into this page. ' +
|
|
291
|
+
srcLink(f, "Open spec.md") + "</p>";
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
var W = window.CS_SPEC || (window.CS_SPEC = {});
|
|
295
|
+
function paintSpec() {
|
|
296
|
+
var tmp = document.createElement("div");
|
|
297
|
+
tmp.innerHTML = W[f.i];
|
|
298
|
+
var toc = [];
|
|
299
|
+
Array.prototype.forEach.call(tmp.querySelectorAll("h2"), function (h, n) {
|
|
300
|
+
var id = "s" + n;
|
|
301
|
+
h.id = id;
|
|
302
|
+
toc.push('<a href="#' + id + '" data-anchor="' + id + '">' + esc(h.textContent) + "</a>");
|
|
303
|
+
});
|
|
304
|
+
body.innerHTML = (toc.length ? '<nav class="toc">' + toc.join("") + "</nav>" : "") +
|
|
305
|
+
'<div class="spec">' + tmp.innerHTML + "</div>";
|
|
306
|
+
}
|
|
307
|
+
if (W[f.i]) { paintSpec(); return; }
|
|
308
|
+
body.innerHTML = '<p class="load">Loading the full spec …</p>';
|
|
309
|
+
var sc = document.createElement("script");
|
|
310
|
+
sc.src = D.specDir + "/" + f.i + ".js";
|
|
311
|
+
sc.onerror = function () {
|
|
312
|
+
body.innerHTML = '<p class="load">The spec chunk did not load. ' + srcLink(f, "Open spec.md") + "</p>";
|
|
313
|
+
};
|
|
314
|
+
sc.onload = function () { if (W[f.i]) paintSpec(); else sc.onerror(); };
|
|
315
|
+
document.head.appendChild(sc);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
function paintDrawer(f) {
|
|
319
|
+
if (dwTab === "spec") specTab(f);
|
|
320
|
+
else document.getElementById("dw-body").innerHTML = dwTab === "links" ? links(f) : overview(f);
|
|
321
|
+
}
|
|
322
|
+
function openTask(id, push) {
|
|
323
|
+
var f = BY[id];
|
|
324
|
+
if (!f) return;
|
|
325
|
+
if (!S.task) lastFocus = document.activeElement;
|
|
326
|
+
S.task = id;
|
|
327
|
+
drawer.innerHTML = drawerHtml(f);
|
|
328
|
+
drawer.hidden = false;
|
|
329
|
+
scrim.hidden = false;
|
|
330
|
+
document.body.style.overflow = "hidden";
|
|
331
|
+
paintDrawer(f);
|
|
332
|
+
drawer.querySelector(".dw-x").focus();
|
|
333
|
+
if (push !== false) writeHash();
|
|
334
|
+
}
|
|
335
|
+
function closeFR() {
|
|
336
|
+
if (!S.task) return;
|
|
337
|
+
S.task = null;
|
|
338
|
+
dwTab = "overview";
|
|
339
|
+
drawer.hidden = true;
|
|
340
|
+
scrim.hidden = true;
|
|
341
|
+
drawer.innerHTML = "";
|
|
342
|
+
document.body.style.overflow = "";
|
|
343
|
+
writeHash();
|
|
344
|
+
if (lastFocus && lastFocus.focus) lastFocus.focus();
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/* ---- paint ------------------------------------------------------------ */
|
|
348
|
+
var lensEl = document.getElementById("lens");
|
|
349
|
+
var countEl = document.getElementById("count");
|
|
350
|
+
var chipbar = document.getElementById("active-filters");
|
|
351
|
+
|
|
352
|
+
function paint() {
|
|
353
|
+
var rows = view();
|
|
354
|
+
countEl.textContent = rows.length === TASKS.length
|
|
355
|
+
? TASKS.length + " tasks"
|
|
356
|
+
: "showing " + rows.length + " of " + TASKS.length;
|
|
357
|
+
lensEl.innerHTML = S.lens === "table" ? table(rows)
|
|
358
|
+
: S.lens === "timeline" ? timeline(rows) : board(rows);
|
|
359
|
+
|
|
360
|
+
Array.prototype.forEach.call(document.querySelectorAll(".ln"), function (b) {
|
|
361
|
+
b.setAttribute("aria-selected", String(b.dataset.lens === S.lens));
|
|
362
|
+
});
|
|
363
|
+
var g = document.getElementById("f-g");
|
|
364
|
+
if (g) g.parentNode.hidden = S.lens !== "board";
|
|
365
|
+
|
|
366
|
+
var on = [];
|
|
367
|
+
FKEYS.forEach(function (k) {
|
|
368
|
+
if (S.f[k]) on.push('<span class="fchip">' + esc(FLABEL[k]) + ": " + esc(S.f[k]) +
|
|
369
|
+
'<button type="button" data-drop="' + k + '" aria-label="Remove filter">×</button></span>');
|
|
370
|
+
});
|
|
371
|
+
if (S.q) on.push('<span class="fchip">search: ' + esc(S.q) +
|
|
372
|
+
'<button type="button" data-drop="q" aria-label="Clear search">×</button></span>');
|
|
373
|
+
chipbar.innerHTML = on.join("");
|
|
374
|
+
chipbar.hidden = !on.length;
|
|
375
|
+
|
|
376
|
+
Array.prototype.forEach.call(document.querySelectorAll(".kpi"), function (k) {
|
|
377
|
+
k.dataset.on = S.f.b && S.f.b === k.dataset.bucket ? "1" : "0";
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
function syncControls() {
|
|
382
|
+
var q = document.getElementById("q");
|
|
383
|
+
if (q) q.value = S.q;
|
|
384
|
+
FKEYS.forEach(function (k) {
|
|
385
|
+
var s = document.getElementById("f-" + k);
|
|
386
|
+
if (s) s.value = S.f[k] || "";
|
|
387
|
+
});
|
|
388
|
+
var g = document.getElementById("f-g");
|
|
389
|
+
if (g) g.value = S.group;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/* ---- events ----------------------------------------------------------- */
|
|
393
|
+
document.addEventListener("click", function (e) {
|
|
394
|
+
var t = e.target;
|
|
395
|
+
if (!t.closest) return;
|
|
396
|
+
|
|
397
|
+
if (t === scrim || t.closest(".dw-x")) { closeFR(); return; }
|
|
398
|
+
|
|
399
|
+
var dt = t.closest("[data-dwtab]");
|
|
400
|
+
if (dt && S.task) {
|
|
401
|
+
dwTab = dt.dataset.dwtab;
|
|
402
|
+
Array.prototype.forEach.call(drawer.querySelectorAll(".dw-tab"), function (b) {
|
|
403
|
+
b.setAttribute("aria-selected", String(b.dataset.dwtab === dwTab));
|
|
404
|
+
});
|
|
405
|
+
paintDrawer(BY[S.task]);
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
var anchor = t.closest("[data-anchor]");
|
|
410
|
+
if (anchor) {
|
|
411
|
+
e.preventDefault();
|
|
412
|
+
var target = document.getElementById(anchor.dataset.anchor);
|
|
413
|
+
if (target) target.scrollIntoView({ block: "start" });
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
// branch never fired: clicking a task row on the status page did nothing, in every repo
|
|
418
|
+
// that vendored this file. Renamed the declaration, left the target — again.
|
|
419
|
+
var task = t.closest("[data-task]");
|
|
420
|
+
if (task) { openTask(task.dataset.task); return; }
|
|
421
|
+
|
|
422
|
+
var ln = t.closest(".ln");
|
|
423
|
+
if (ln) { S.lens = ln.dataset.lens; writeHash(); paint(); return; }
|
|
424
|
+
|
|
425
|
+
var drop = t.closest("[data-drop]");
|
|
426
|
+
if (drop) {
|
|
427
|
+
var dk = drop.dataset.drop;
|
|
428
|
+
if (dk === "q") S.q = ""; else delete S.f[dk];
|
|
429
|
+
syncControls(); writeHash(); paint();
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
var kpi = t.closest(".kpi");
|
|
434
|
+
if (kpi && kpi.dataset.bucket) {
|
|
435
|
+
if (S.f.b === kpi.dataset.bucket) delete S.f.b; else S.f.b = kpi.dataset.bucket;
|
|
436
|
+
writeHash(); paint();
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
var th = t.closest("th[data-sort]");
|
|
441
|
+
if (th) {
|
|
442
|
+
if (S.sort === th.dataset.sort) S.dir = -S.dir;
|
|
443
|
+
else { S.sort = th.dataset.sort; S.dir = 1; }
|
|
444
|
+
paint();
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
if (t.closest("#clear")) { S.q = ""; S.f = {}; syncControls(); writeHash(); paint(); }
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
document.addEventListener("keydown", function (e) {
|
|
452
|
+
if (e.key === "Escape" && S.task) { closeFR(); return; }
|
|
453
|
+
if (e.key === "/" && document.activeElement.tagName !== "INPUT") {
|
|
454
|
+
e.preventDefault();
|
|
455
|
+
document.getElementById("q").focus();
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
if (e.key === "Enter" && e.target.dataset && e.target.dataset.task) openTask(e.target.dataset.task);
|
|
459
|
+
});
|
|
460
|
+
|
|
461
|
+
var qEl = document.getElementById("q");
|
|
462
|
+
var timer;
|
|
463
|
+
qEl.addEventListener("input", function () {
|
|
464
|
+
clearTimeout(timer);
|
|
465
|
+
timer = setTimeout(function () { S.q = qEl.value.trim(); writeHash(true); paint(); }, 120);
|
|
466
|
+
});
|
|
467
|
+
|
|
468
|
+
Array.prototype.forEach.call(document.querySelectorAll("#bar select"), function (s) {
|
|
469
|
+
s.addEventListener("change", function () {
|
|
470
|
+
var k = s.id.slice(2);
|
|
471
|
+
if (k === "g") S.group = s.value;
|
|
472
|
+
else if (s.value) S.f[k] = s.value;
|
|
473
|
+
else delete S.f[k];
|
|
474
|
+
writeHash();
|
|
475
|
+
paint();
|
|
476
|
+
});
|
|
477
|
+
});
|
|
478
|
+
|
|
479
|
+
document.getElementById("theme").addEventListener("click", function () {
|
|
480
|
+
var next = document.documentElement.dataset.theme === "dark" ? "light" : "dark";
|
|
481
|
+
document.documentElement.dataset.theme = next;
|
|
482
|
+
try { window.localStorage.setItem("cs-theme", next); } catch (err) { /* private mode */ }
|
|
483
|
+
});
|
|
484
|
+
|
|
485
|
+
window.addEventListener("hashchange", function () {
|
|
486
|
+
var was = S.task;
|
|
487
|
+
S.task = null; S.q = ""; S.f = {};
|
|
488
|
+
readHash();
|
|
489
|
+
syncControls();
|
|
490
|
+
if (S.task) { openTask(S.task, false); return; }
|
|
491
|
+
if (was) closeFR();
|
|
492
|
+
paint();
|
|
493
|
+
});
|
|
494
|
+
|
|
495
|
+
/* ---- boot ------------------------------------------------------------- */
|
|
496
|
+
try {
|
|
497
|
+
var saved = window.localStorage.getItem("cs-theme");
|
|
498
|
+
if (saved) document.documentElement.dataset.theme = saved;
|
|
499
|
+
} catch (err) { /* private mode */ }
|
|
500
|
+
|
|
501
|
+
readHash();
|
|
502
|
+
syncControls();
|
|
503
|
+
paint();
|
|
504
|
+
if (S.task) openTask(S.task, false);
|
|
505
|
+
})();
|