create-pmos 0.611.0 → 0.612.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/package.json +86 -14
- package/payload/KIT-VERSION +2 -2
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/payload/state/log.md +1 -1
- package/workspace/briefing-premium-board-test.js +1 -1
- package/workspace/briefing-premium-calendar-2-test.js +3 -2
- package/workspace/briefing-premium-calendar-3-test.js +1 -1
- package/workspace/briefing-premium-calendar-test.js +1 -1
- package/workspace/briefing-premium-insights-test.js +1 -1
- package/workspace/briefing-premium-test.js +1 -1
- package/workspace/changelog.json +85 -0
- package/workspace/guide/layout.md +52 -18
- package/workspace/guide/programs.md +3 -3
- package/workspace/guide/routine.md +28 -13
- package/workspace/guide/settings-and-switches.md +1 -1
- package/workspace/lib/board-premium.js +12 -4
- package/workspace/lib/cos-chat.js +1 -0
- package/workspace/lib/doc-library.js +43 -12
- package/workspace/lib/doc-path.js +30 -0
- package/workspace/lib/engine/boards.js +4 -2
- package/workspace/lib/events-place.js +190 -38
- package/workspace/lib/events-stated.js +129 -0
- package/workspace/lib/initiative-chat.js +1 -0
- package/workspace/lib/insights-premium.js +13 -1
- package/workspace/lib/library-find.js +162 -0
- package/workspace/lib/library-items.js +196 -24
- package/workspace/lib/notes.js +3 -0
- package/workspace/lib/plan-items.js +17 -3
- package/workspace/lib/routes-artefacts.js +5 -2
- package/workspace/lib/routes-boards.js +6 -2
- package/workspace/lib/routes-doc-sheet.js +1 -0
- package/workspace/lib/routes-events-place.js +47 -10
- package/workspace/lib/routes-library.js +74 -8
- package/workspace/lib/routes-report-setups.js +13 -2
- package/workspace/lib/routine-reports.js +36 -4
- package/workspace/lib/status-when.js +36 -0
- package/workspace/lib/task-items.js +5 -3
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-vw-meet-test.js +2 -1
- package/workspace/premium-vw-notes-test.js +3 -2
- package/workspace/public/pm/artefact-kind.js +87 -0
- package/workspace/public/pm/bd-ini-panel.js +6 -6
- package/workspace/public/pm/bd-span.js +5 -0
- package/workspace/public/pm/bd-work.css +62 -0
- package/workspace/public/pm/bd-work.js +195 -68
- package/workspace/public/pm/cozy-bar.css +11 -0
- package/workspace/public/pm/cozy-bar.js +99 -0
- package/workspace/public/pm/cozy-day-pick.css +27 -0
- package/workspace/public/pm/cozy-day-pick.js +97 -0
- package/workspace/public/pm/cozy-ev.css +0 -4
- package/workspace/public/pm/cozy-events-view.js +165 -33
- package/workspace/public/pm/cozy-events.css +75 -3
- package/workspace/public/pm/cozy-events.js +86 -18
- package/workspace/public/pm/cozy-goals.css +172 -0
- package/workspace/public/pm/cozy-library.css +106 -17
- package/workspace/public/pm/cozy-nav.js +2 -3
- package/workspace/public/pm/cozy-pick.css +3 -0
- package/workspace/public/pm/cozy-pop-work.css +83 -24
- package/workspace/public/pm/cozy-pop-work.js +313 -72
- package/workspace/public/pm/cozy-popup.css +11 -2
- package/workspace/public/pm/cozy-popup.js +67 -9
- package/workspace/public/pm/cozy-routine-job.js +203 -0
- package/workspace/public/pm/cozy-routine-model.js +139 -31
- package/workspace/public/pm/cozy-routine-pop.js +164 -42
- package/workspace/public/pm/cozy-routine.css +61 -8
- package/workspace/public/pm/cozy-routine.js +207 -28
- package/workspace/public/pm/cozy-settings.js +1 -5
- package/workspace/public/pm/cozy-status-when.js +48 -0
- package/workspace/public/pm/cozy-viewer.js +19 -8
- package/workspace/public/pm/cozy-vw-mtg.css +39 -0
- package/workspace/public/pm/goals-model.js +205 -0
- package/workspace/public/pm/goals-open.js +124 -0
- package/workspace/public/pm/home-chat.js +4 -2
- package/workspace/public/pm/home-ini.js +8 -6
- package/workspace/public/pm/ini-edit.js +3 -1
- package/workspace/public/pm/ini-view-model.js +1 -1
- package/workspace/public/pm/library-model.js +170 -42
- package/workspace/public/pm/library-open.js +8 -5
- package/workspace/public/pm/page-chat.js +12 -2
- package/workspace/public/pm/pop-work-model.js +199 -41
- package/workspace/public/pm/premium-board.js +108 -43
- package/workspace/public/pm/premium-goals.js +213 -0
- package/workspace/public/pm/premium-library.js +376 -62
- package/workspace/public/pm/premium-shell.js +1 -1
- package/workspace/public/pm/premium-vw-mtg.js +79 -1
- package/workspace/public/pm/scope-chip.js +204 -0
- package/workspace/public/premium-events.html +3 -1
- package/workspace/public/premium-goals.html +37 -0
- package/workspace/public/premium-library.html +15 -7
- package/workspace/public/premium-routine.html +2 -0
- package/workspace/server.js +2 -1
- package/workspace/test-lists/doc-path.json +9 -0
- package/workspace/test-lists/goals-place.json +9 -0
- package/workspace/test-lists/status-when.json +9 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/* pm/cozy-day-pick.js — one day field in the app's own form, "15 Oct 2026", with a small month calendar under it (popup round 3: the browser's
|
|
2
|
+
* own date field shows 10/15/2026, month first, which a reader outside the US reads wrong). Pure helpers and one mount; the look is in
|
|
3
|
+
* cozy-day-pick.css.
|
|
4
|
+
*
|
|
5
|
+
* dayText(iso) → "15 Oct 2026" ('' when not a day)
|
|
6
|
+
* parseDay(text, today) → 'YYYY-MM-DD' or null: "15 Oct 2026", "15 oct", "Oct 15 2026", "2026-10-15", "15/10/2026" (day first)
|
|
7
|
+
* monthGrid(iso, o) → { title, weeks: [[{ iso, n, out, off, on, today }]] } for the month of iso; o: { value, min, max, today }
|
|
8
|
+
* mountDay(el, o) draws the field into el. o: { label, value, min, max, today, onPick(iso), open } — onPick runs on Enter, on a
|
|
9
|
+
* change of the field, and on a press in the calendar. A day outside min..max is refused in plain words.
|
|
10
|
+
* Its own presses stop at its root, so a popup's click handler around it does not see them. */
|
|
11
|
+
const CSS = new URL('./cozy-day-pick.css', import.meta.url).href;
|
|
12
|
+
if (typeof document !== 'undefined' && document.head && !document.querySelector(`link[href="${CSS}"]`)) { const l = document.createElement('link'); l.rel = 'stylesheet'; l.href = CSS; document.head.appendChild(l); }
|
|
13
|
+
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
14
|
+
const FULL = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
|
|
15
|
+
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
16
|
+
const ms = (v) => { const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(String(v || '')); return m ? Date.UTC(+m[1], +m[2] - 1, +m[3]) : null; };
|
|
17
|
+
const iso = (n) => new Date(n).toISOString().slice(0, 10);
|
|
18
|
+
const valid = (y, m, d) => { const n = Date.UTC(y, m, d), t = new Date(n); return t.getUTCFullYear() === y && t.getUTCMonth() === m && t.getUTCDate() === d ? iso(n) : null; };
|
|
19
|
+
export const localToday = () => { const d = new Date(); return d.getFullYear() + '-' + String(d.getMonth() + 1).padStart(2, '0') + '-' + String(d.getDate()).padStart(2, '0'); };
|
|
20
|
+
|
|
21
|
+
export function dayText(v) { const n = ms(v); if (n == null) return ''; const d = new Date(n); return d.getUTCDate() + ' ' + MON[d.getUTCMonth()] + ' ' + d.getUTCFullYear(); }
|
|
22
|
+
|
|
23
|
+
export function parseDay(text, today = localToday()) {
|
|
24
|
+
const s = String(text || '').trim().toLowerCase().replace(/,/g, ' ').replace(/\s+/g, ' ');
|
|
25
|
+
if (!s) return null;
|
|
26
|
+
let m = /^(\d{4})-(\d{1,2})-(\d{1,2})$/.exec(s);
|
|
27
|
+
if (m) return valid(+m[1], +m[2] - 1, +m[3]);
|
|
28
|
+
m = /^(\d{1,2})[/.](\d{1,2})[/.](\d{4})$/.exec(s); // day first, the app's order
|
|
29
|
+
if (m) return valid(+m[3], +m[2] - 1, +m[1]);
|
|
30
|
+
const mon = (w) => MON.findIndex((x) => w.startsWith(x.toLowerCase()));
|
|
31
|
+
const y0 = +String(today).slice(0, 4);
|
|
32
|
+
m = /^(\d{1,2}) ([a-z]+)(?: (\d{4}))?$/.exec(s);
|
|
33
|
+
if (m && mon(m[2]) >= 0) return valid(m[3] ? +m[3] : y0, mon(m[2]), +m[1]);
|
|
34
|
+
m = /^([a-z]+) (\d{1,2})(?: (\d{4}))?$/.exec(s);
|
|
35
|
+
if (m && mon(m[1]) >= 0) return valid(m[3] ? +m[3] : y0, mon(m[1]), +m[2]);
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function monthGrid(at, o = {}) {
|
|
40
|
+
const n = ms(at) ?? ms(o.today) ?? ms(localToday()), d = new Date(n), y = d.getUTCFullYear(), m = d.getUTCMonth();
|
|
41
|
+
const first = Date.UTC(y, m, 1), lead = (new Date(first).getUTCDay() + 6) % 7; // weeks start on Monday
|
|
42
|
+
const weeks = []; let cur = first - lead * 864e5;
|
|
43
|
+
for (let w = 0; w < 6; w++) {
|
|
44
|
+
const row = [];
|
|
45
|
+
for (let k = 0; k < 7; k++, cur += 864e5) {
|
|
46
|
+
const v = iso(cur);
|
|
47
|
+
row.push({ iso: v, n: new Date(cur).getUTCDate(), out: new Date(cur).getUTCMonth() !== m, off: (o.min && v < o.min) || (o.max && v > o.max) || false, on: v === o.value, today: v === o.today });
|
|
48
|
+
}
|
|
49
|
+
weeks.push(row);
|
|
50
|
+
if (new Date(cur).getUTCMonth() !== m) break;
|
|
51
|
+
}
|
|
52
|
+
return { title: FULL[m] + ' ' + y, y, m, weeks };
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const CAL = 'M7 3v3M17 3v3M4 8h16M5 5h14a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1z';
|
|
56
|
+
const ARR = { prev: 'M14 7l-5 5 5 5', next: 'M10 7l5 5-5 5' };
|
|
57
|
+
const svg = (d) => `<svg aria-hidden="true" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="${d}"/></svg>`;
|
|
58
|
+
|
|
59
|
+
export function mountDay(el, o = {}) {
|
|
60
|
+
const today = o.today || localToday();
|
|
61
|
+
let value = ms(o.value) != null ? o.value : '', shown = value || (o.max && today > o.max ? o.max : today), open = !!o.open;
|
|
62
|
+
const say = (t) => { const p = el.querySelector('.dp-msg'); if (p) { p.textContent = t || ''; p.hidden = !t; } };
|
|
63
|
+
const limit = (v) => (o.min && v < o.min ? 'Pick ' + dayText(o.min) + ' or later.' : o.max && v > o.max ? (o.max === today ? 'Not a day in the future.' : 'Pick ' + dayText(o.max) + ' or earlier.') : '');
|
|
64
|
+
const pick = (v) => { const why = limit(v); if (why) { say(why); return; } value = v; shown = v; say(''); draw(); if (o.onPick) o.onPick(v); };
|
|
65
|
+
const grid = () => {
|
|
66
|
+
const G = monthGrid(shown, { value, min: o.min, max: o.max, today });
|
|
67
|
+
return `<div class="dp-cal" role="group" aria-label="${esc(G.title)}"><div class="dp-mh"><button type="button" class="dp-nav" data-dp-step="-1" aria-label="Previous month">${svg(ARR.prev)}</button><b>${esc(G.title)}</b><button type="button" class="dp-nav" data-dp-step="1" aria-label="Next month">${svg(ARR.next)}</button></div>`
|
|
68
|
+
+ '<div class="dp-wk" aria-hidden="true"><i>M</i><i>T</i><i>W</i><i>T</i><i>F</i><i>S</i><i>S</i></div>'
|
|
69
|
+
+ G.weeks.map((w) => '<div class="dp-row">' + w.map((c) => `<button type="button" class="dp-d${c.out ? ' out' : ''}${c.on ? ' on' : ''}${c.today ? ' td' : ''}" data-dp-day="${c.iso}"${c.off ? ' disabled' : ''} aria-pressed="${c.on}" aria-label="${esc(dayText(c.iso))}">${c.n}</button>`).join('') + '</div>').join('') + '</div>';
|
|
70
|
+
};
|
|
71
|
+
const draw = () => {
|
|
72
|
+
const f = el.querySelector('.dp-in'), had = f && document.activeElement === f;
|
|
73
|
+
el.innerHTML = `<label class="hi-field dp"><span>${esc(o.label || 'Date')}</span><span class="dp-box"><input class="dp-in" type="text" inputmode="text" autocomplete="off" placeholder="15 Oct 2026" value="${esc(dayText(value))}"><button type="button" class="dp-tg" data-dp-open aria-expanded="${open}" aria-label="Calendar">${svg(CAL)}</button></span></label>`
|
|
74
|
+
+ '<p class="hi-small dp-msg" role="status" hidden></p>' + (open ? grid() : '');
|
|
75
|
+
const inp = el.querySelector('.dp-in');
|
|
76
|
+
const take = () => { const t = inp.value.trim(); if (!t || t === dayText(value)) return; const v = parseDay(t, today); if (!v) { say('Write a day like 15 Oct 2026.'); return; } pick(v); };
|
|
77
|
+
inp.addEventListener('keydown', (e) => { if (e.key === 'Enter') { e.preventDefault(); e.stopPropagation(); take(); } });
|
|
78
|
+
inp.addEventListener('change', take);
|
|
79
|
+
if (had) inp.focus();
|
|
80
|
+
fit();
|
|
81
|
+
};
|
|
82
|
+
// a popup that grew (the calendar opened) moves up to stay inside the window (pm/hi-pop.js places it once, by two custom properties)
|
|
83
|
+
const fit = () => {
|
|
84
|
+
const pop = el.closest('.hi-pop:not(.sheet)'); if (!pop) return;
|
|
85
|
+
const r = pop.getBoundingClientRect();
|
|
86
|
+
if (r.bottom > innerHeight - 12) pop.style.setProperty('--hi-y', Math.round(Math.max(12, innerHeight - 12 - r.height)) + 'px');
|
|
87
|
+
};
|
|
88
|
+
el.addEventListener('click', (e) => {
|
|
89
|
+
const b = e.target.closest('button'); if (!b || !el.contains(b)) return;
|
|
90
|
+
e.stopPropagation();
|
|
91
|
+
if ('dpOpen' in b.dataset) { open = !open; draw(); return; }
|
|
92
|
+
if (b.dataset.dpStep) { const d = new Date(ms(shown)); shown = iso(Date.UTC(d.getUTCFullYear(), d.getUTCMonth() + +b.dataset.dpStep, 1)); draw(); el.querySelector(`[data-dp-step="${b.dataset.dpStep}"]`)?.focus(); return; }
|
|
93
|
+
if (b.dataset.dpDay && !b.disabled) pick(b.dataset.dpDay);
|
|
94
|
+
});
|
|
95
|
+
draw();
|
|
96
|
+
return { get value() { return value; }, focus() { el.querySelector('.dp-in')?.focus(); } };
|
|
97
|
+
}
|
|
@@ -268,10 +268,6 @@
|
|
|
268
268
|
.ev-st .ev-seg button { min-height: 40px; }
|
|
269
269
|
}
|
|
270
270
|
|
|
271
|
-
/* ── Settings › Viewer opens as Popup: the Viewer floats over the page instead of taking a column ── */
|
|
272
|
-
@media (min-width: 761px) {
|
|
273
|
-
body.ev-vw-popup .cz-vw:not(.cz-vw-float) { position: fixed; z-index: 70; top: 16px; right: 16px; bottom: 16px; width: min(500px, calc(100vw - 32px)); box-shadow: var(--cz-sheet); }
|
|
274
|
-
}
|
|
275
271
|
.cz .ev-ad-hd { display: flex; align-items: center; gap: 12px; padding: 4px 4px 10px; }
|
|
276
272
|
.cz .ev-sp-ad { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
|
|
277
273
|
.cz .ev-sp-ad p { margin: 0; }
|
|
@@ -2,16 +2,30 @@
|
|
|
2
2
|
* DOM, no fetch, so a unit test reads it (events-view.test.mjs).
|
|
3
3
|
*
|
|
4
4
|
* groupsOf(items, { show, day }) → { late, today, coming, later } the items the page shows, by group; show = the kinds on; day = one day
|
|
5
|
-
* listHtml(model, o) the left side: Late (with Yes to all), Today, Coming up, and the
|
|
5
|
+
* listHtml(model, o) the left side: Late (with Yes to all; the newest LATE_SHOWN, then one fold line), Today, Coming up, and the
|
|
6
|
+
* later delivery milestones as one fold line. o.open: Set of the folds open ('late', 'later')
|
|
7
|
+
* calHtml(model, o) the full calendar in the left column: Month | Week, a back arrow to the list. o: { view, ym, day, show }
|
|
6
8
|
* rowHtml(x, today, o) one date: the day, its mark (a diamond for a delivery milestone, round for the rest), what and its kind,
|
|
7
9
|
* then what PMOS suggests with ✓ ✕, the act of today, or nothing (a date that needs nothing shows nothing)
|
|
8
10
|
* monthHtml(ym, items, o) the small month: a mark under each day that has a date, today ringed, the day picked filled
|
|
9
|
-
* showHtml(show)
|
|
10
|
-
*
|
|
11
|
+
* showHtml(show, { counts, unread }) Show: the six types (TYPES) with their counts as the filter, which is also the key to the marks; a type whose
|
|
12
|
+
* source is not read says so and opens Connectors. countsOf(items, o) · hiddenHtml(items, o): the "Showing …
|
|
13
|
+
* only · N more hidden · Show all" line. visible(items, o): the types on and the chip (o.scopeOk)
|
|
14
|
+
* Round 2: each row's grey line starts with its type word (lineOf); a coming day with BUSY meetings or more is one line that opens them;
|
|
15
|
+
* a date stated in a source opens the line that states it under the row (o.open has 'src:<key>').
|
|
16
|
+
* KINDS · KIND_LABEL · LATE_SHOWN · shiftMonth(ym, n) · weekOf(day)
|
|
11
17
|
* Text from records goes through esc(). Every icon-only button has an aria-label. The words say PMOS. */
|
|
12
18
|
|
|
13
|
-
export const
|
|
14
|
-
export const
|
|
19
|
+
export const TYPES = ['meeting', 'focus', 'milestone', 'task', 'report', 'deadline'];
|
|
20
|
+
export const KINDS = TYPES; // the filter is by type since round 2
|
|
21
|
+
export const LATE_SHOWN = 5;
|
|
22
|
+
export const BUSY = 3; // a coming day with this many meetings or more shows as one line that opens them
|
|
23
|
+
export const TYPE_WORD = { meeting: 'Meeting', focus: 'Focus time', milestone: 'Milestone', task: 'Task', report: 'Report', deadline: 'Deadline' };
|
|
24
|
+
export const TYPE_LABEL = { meeting: 'Meetings', focus: 'Focus time', milestone: 'Milestones', task: 'Tasks', report: 'Reports', deadline: 'Deadlines' };
|
|
25
|
+
export const KIND_LABEL = TYPE_LABEL;
|
|
26
|
+
const typeOf = (x) => x.type || x.kind;
|
|
27
|
+
/** The grey line: the type word first, then what the model says. */
|
|
28
|
+
export const lineOf = (x) => TYPE_WORD[typeOf(x)] + (x.line ? ' · ' + x.line : '');
|
|
15
29
|
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
16
30
|
const MONTH = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
|
|
17
31
|
const WD = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
|
@@ -33,10 +47,15 @@ export function shortDay(d, today) {
|
|
|
33
47
|
}
|
|
34
48
|
const weekday = (d) => WD[new Date(ms(d)).getUTCDay()];
|
|
35
49
|
|
|
36
|
-
/** The items the
|
|
37
|
-
export function
|
|
38
|
-
const on = new Set(show);
|
|
39
|
-
|
|
50
|
+
/** The items the filters let through. o: { show: the types on, scopeOk(item) → bool (the product, program and project chip) } */
|
|
51
|
+
export function visible(items, o = {}) {
|
|
52
|
+
const on = new Set(o.show || TYPES);
|
|
53
|
+
return (items || []).filter((x) => on.has(typeOf(x)) && (!o.scopeOk || o.scopeOk(x)));
|
|
54
|
+
}
|
|
55
|
+
/** The items the page shows, by group. show: the types that are on; day: 'YYYY-MM-DD' to show only that day; scopeOk: the chip. */
|
|
56
|
+
export function groupsOf(items, o = {}) {
|
|
57
|
+
const day = o.day || null;
|
|
58
|
+
const list = visible(items, o).filter((x) => !day || x.date === day);
|
|
40
59
|
const g = (k) => list.filter((x) => x.group === k);
|
|
41
60
|
return { late: g('late'), today: g('today'), coming: g('coming'), later: g('later') };
|
|
42
61
|
}
|
|
@@ -50,15 +69,20 @@ function dayCell(x, today) {
|
|
|
50
69
|
return { b: shortDay(x.date, today), s: x.time ? weekday(x.date) + ' ' + x.time : 'in ' + n + ' ' + plural(n, 'day', 'days') };
|
|
51
70
|
}
|
|
52
71
|
/** The mark: a diamond for a delivery milestone, round for the rest; the tone says late or at risk. */
|
|
53
|
-
|
|
72
|
+
const MARK = { milestone: 'evp-dm', meeting: 'evp-mt', focus: 'evp-fo', task: 'evp-rd', report: 'evp-rp', deadline: 'evp-dl' };
|
|
73
|
+
export const markOf = (type, tone) => `<i class="evp-k ${MARK[type] || 'evp-rd'}${tone ? ' ' + tone : ''}" aria-hidden="true"></i>`;
|
|
74
|
+
export const markHtml = (x) => markOf(typeOf(x), x.tone);
|
|
54
75
|
|
|
55
76
|
/** One date. o: { today, busy: Set<key> of rows whose press is on its way } */
|
|
56
77
|
export function rowHtml(x, o = {}) {
|
|
57
78
|
const today = o.today;
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
const
|
|
79
|
+
// a meeting under an opened busy day: only its time, the day row above names the day
|
|
80
|
+
const d = o.child ? { b: x.time || 'All day', s: x.until ? 'to ' + x.until : '' } : dayCell(x, today);
|
|
81
|
+
const kindWord = TYPE_WORD[typeOf(x)];
|
|
82
|
+
const what = `<b>${esc(x.title)}</b><small><em class="evp-ty">${esc(kindWord)}</em>${x.line ? ' · ' + esc(x.line) : ''}</small>`;
|
|
83
|
+
const srcOpen = x.source && o.open && o.open.has('src:' + x.key);
|
|
84
|
+
const t = x.source ? `<button type="button" class="evp-t" data-evp-src aria-expanded="${srcOpen ? 'true' : 'false'}" aria-label="${esc(x.title)}. ${esc(lineOf(x))}. Show what was said">${what}</button>`
|
|
85
|
+
: x.work || x.task || x.own || x.link ? `<button type="button" class="evp-t" data-evp-open aria-label="${esc(x.title)}. ${esc(lineOf(x))}. Open it">${what}</button>` : `<span class="evp-t">${what}</span>`;
|
|
62
86
|
let a = '';
|
|
63
87
|
if (x.suggest) {
|
|
64
88
|
const s = x.suggest;
|
|
@@ -67,21 +91,67 @@ export function rowHtml(x, o = {}) {
|
|
|
67
91
|
+ `<button type="button" class="evp-ib" data-evp-no aria-label="No: ${esc(s.text)}" title="No">${svg(ICON.no, 15)}</button>`;
|
|
68
92
|
} else if (x.act && x.act.href) {
|
|
69
93
|
a = `<a class="evp-go" href="${esc(x.act.href)}">${esc(x.act.label)}${svg(ICON.go, 14)}</a>`;
|
|
94
|
+
} else if (x.group === 'today' && x.kind === 'meeting' && x.work && x.work.title) {
|
|
95
|
+
// a meeting or focus time about a piece of work: one press to that work (no record says more, so PMOS does not name the act)
|
|
96
|
+
a = `<button type="button" class="evp-go" data-evp-open aria-label="Open the work: ${esc(x.work.title)}">Open the work${svg(ICON.go, 14)}</button>`;
|
|
70
97
|
} else if (x.group === 'today' && (x.task || x.own)) {
|
|
71
98
|
a = `<button type="button" class="evp-ib" data-evp-done aria-label="Mark it done: ${esc(x.title)}" title="Mark it done">${svg(ICON.done, 16)}</button>`;
|
|
72
99
|
}
|
|
73
100
|
// the tools show on a row you point at or step to: a new day (edit in place) and Fixed
|
|
74
101
|
const tools = (x.editable && !(x.fixed && x.kind === 'milestone') ? `<label class="evp-ib evp-dt" title="Set a date"><span class="vh">Set a date for ${esc(x.title)}</span>${svg(ICON.date, 15)}<input type="date" data-evp-date value="${esc(x.date)}" /></label>` : '')
|
|
75
102
|
+ (x.canFix ? `<button type="button" class="evp-ib evp-fx" data-evp-fix aria-pressed="${x.fixed ? 'true' : 'false'}" aria-label="${x.fixed ? 'Fixed date. Press to let PMOS suggest a new date' : 'Mark as a fixed date'}" title="${x.fixed ? 'Fixed date' : 'Fixed date: never move it'}">${svg(ICON.lock, 15)}</button>` : '');
|
|
76
|
-
|
|
103
|
+
// a date stated in a source opens the line that states it, under the row: who said it, when, and a link to the source
|
|
104
|
+
// the sentence from the source only when it says more than the title; else who and when, and the link (say it once)
|
|
105
|
+
const said = x.source && x.source.text && x.source.text.trim().toLowerCase() !== String(x.title).trim().toLowerCase() ? `<q>${esc(x.source.text)}</q>` : '';
|
|
106
|
+
const src = srcOpen ? `<div class="evp-src" data-key="${esc(x.key)}">${said}<span>${esc([x.source.who, x.source.said ? shortDay(x.source.said, today) : ''].filter(Boolean).join(', '))}</span>`
|
|
107
|
+
+ (x.source.link ? `<a class="evp-go" href="${esc(x.source.link)}" target="_blank" rel="noopener">Open in ${esc(x.source.from)}${svg(ICON.go, 14)}</a>` : '')
|
|
108
|
+
+ (x.work ? `<button type="button" class="evp-go" data-evp-open>Open the work${svg(ICON.go, 14)}</button>` : '') + '</div>' : '';
|
|
109
|
+
return `<div class="evp-r${o.child ? ' evp-kid' : ''}${x.fixed ? ' fixed' : ''}${o.busy && o.busy.has(x.key) ? ' busy' : ''}" data-key="${esc(x.key)}" data-kind="${esc(x.kind)}" data-type="${esc(typeOf(x))}" aria-label="${esc(kindWord)}">`
|
|
77
110
|
+ `<span class="evp-d ${x.tone || ''}"><b>${esc(d.b)}</b><small>${esc(d.s)}${x.fixed ? ' · fixed' : ''}</small></span>${markHtml(x)}${t}`
|
|
78
|
-
+ `<span class="evp-a">${a}</span><span class="evp-tl">${tools}</span></div
|
|
111
|
+
+ `<span class="evp-a">${a}</span><span class="evp-tl">${tools}</span></div>${src}`;
|
|
79
112
|
}
|
|
80
113
|
|
|
81
|
-
function groupHtml(key, label, rows, o, head = '') {
|
|
114
|
+
function groupHtml(key, label, rows, o, head = '', tail = '', n = rows.length, body = null) {
|
|
82
115
|
if (!rows.length) return ''; // zero is silence
|
|
83
|
-
return `<section class="evp-g evp-${key}" aria-label="${esc(label)}"><h2>${esc(label)}<small>${
|
|
116
|
+
return `<section class="evp-g evp-${key}" aria-label="${esc(label)}"><h2>${esc(label)}<small>${n}</small>${head}</h2><div class="evp-b">${body != null ? body : rows.map((x) => rowHtml(x, o)).join('')}</div>${tail}</section>`;
|
|
117
|
+
}
|
|
118
|
+
const isMeet = (x) => x.kind === 'meeting';
|
|
119
|
+
/** Coming up: a day with BUSY meetings or more is one line, "Fri 20 Nov · 5 meetings", that opens them; every other date keeps its row. */
|
|
120
|
+
function comingBody(rows, o) {
|
|
121
|
+
const per = new Map();
|
|
122
|
+
for (const x of rows) if (isMeet(x)) per.set(x.date, (per.get(x.date) || 0) + 1);
|
|
123
|
+
const open = o.open || new Set();
|
|
124
|
+
const done = new Set();
|
|
125
|
+
let html = '';
|
|
126
|
+
for (const x of rows) {
|
|
127
|
+
const n = per.get(x.date) || 0;
|
|
128
|
+
if (!isMeet(x) || n < BUSY) { html += rowHtml(x, o); continue; }
|
|
129
|
+
if (done.has(x.date)) continue;
|
|
130
|
+
done.add(x.date);
|
|
131
|
+
const k = 'day:' + x.date, isOpen = open.has(k), dayRows = rows.filter((y) => y.date === x.date && isMeet(y));
|
|
132
|
+
const word = dayRows.every((y) => typeOf(y) === 'focus') ? plural(n, 'focus time', 'focus times') : plural(n, 'meeting', 'meetings');
|
|
133
|
+
html += `<button type="button" class="evp-r evp-day" data-evp-fold="${esc(k)}" aria-expanded="${isOpen ? 'true' : 'false'}"><span class="evp-d"><b>${esc(shortDay(x.date, o.today))}</b><small>${esc(weekday(x.date))}</small></span>${markOf('meeting')}<span class="evp-t"><b>${esc(weekday(x.date) + ' ' + shortDay(x.date, o.today))} · ${n} ${word}</b><small>${esc(dayRows.slice(0, 3).map((y) => (y.time ? y.time + ' ' : '') + y.title).join(', ') + (n > 3 ? ', …' : ''))}</small></span><i class="evp-fi" aria-hidden="true">${svg(ICON.go, 14)}</i></button>`;
|
|
134
|
+
if (isOpen) html += dayRows.map((y) => rowHtml(y, { ...o, child: true })).join('');
|
|
135
|
+
}
|
|
136
|
+
return html;
|
|
137
|
+
}
|
|
138
|
+
/** The line over the list when a filter hides dates: "Showing milestones only · 14 more hidden · Show all". o: { show, scopeOk, scopeWords } */
|
|
139
|
+
export function hiddenHtml(items, o = {}) {
|
|
140
|
+
const on = new Set(o.show || TYPES);
|
|
141
|
+
const typesCut = TYPES.some((t) => !on.has(t));
|
|
142
|
+
const scoped = !!(o.scopeOk && o.scopeWords);
|
|
143
|
+
if (!typesCut && !scoped) return '';
|
|
144
|
+
const all = (items || []).filter((x) => x.group !== 'later' || x.kind === 'milestone');
|
|
145
|
+
const shown = visible(all, o).length, hidden = all.length - shown;
|
|
146
|
+
if (!hidden) return '';
|
|
147
|
+
const and = (L) => (L.length > 1 ? L.slice(0, -1).join(', ') + ' and ' + L[L.length - 1] : L[0] || 'nothing');
|
|
148
|
+
const onL = TYPES.filter((t) => on.has(t)).map((t) => TYPE_LABEL[t].toLowerCase()), offL = TYPES.filter((t) => !on.has(t)).map((t) => TYPE_LABEL[t].toLowerCase());
|
|
149
|
+
// few types on: name them ("milestones only"); most on: name what is off ("all but meetings")
|
|
150
|
+
const tw = !typesCut ? (scoped ? 'the dates' : '') : onL.length <= 3 ? and(onL) : 'all but ' + and(offL);
|
|
151
|
+
const what = tw + (scoped ? ' of ' + o.scopeWords : '') + (typesCut && onL.length > 3 ? '' : ' only');
|
|
152
|
+
return `<p class="evp-hid" role="status">Showing ${esc(what)} · ${hidden} more hidden · <button type="button" data-evp-showall>Show all</button></p>`;
|
|
84
153
|
}
|
|
154
|
+
const fold = (key, open, text) => `<button type="button" class="evp-fold" data-evp-fold="${key}" aria-expanded="${open ? 'true' : 'false'}"><i aria-hidden="true">${svg(ICON.go, 14)}</i><span>${text}</span></button>`;
|
|
85
155
|
|
|
86
156
|
/** The left side. model: { today, items, later }; o: { show, day, busy } */
|
|
87
157
|
export function listHtml(model, o = {}) {
|
|
@@ -89,16 +159,27 @@ export function listHtml(model, o = {}) {
|
|
|
89
159
|
const G = groupsOf(model.items, o);
|
|
90
160
|
const yes = G.late.filter((x) => x.suggest).length;
|
|
91
161
|
const all = yes > 1 ? `<button type="button" class="evp-all" data-evp-all>Yes to all ${yes}</button>` : '';
|
|
92
|
-
const
|
|
162
|
+
const open = o.open || new Set();
|
|
163
|
+
const ro = { today, busy: o.busy, open };
|
|
93
164
|
let later = '';
|
|
94
|
-
const on = new Set(o.show ||
|
|
165
|
+
const on = new Set(o.show || TYPES);
|
|
95
166
|
if (o.day) {
|
|
96
167
|
later = G.later.length ? groupHtml('later', 'Later', G.later, ro) : '';
|
|
97
|
-
} else if (on.has('milestone') &&
|
|
98
|
-
|
|
99
|
-
|
|
168
|
+
} else if (on.has('milestone') && G.later.some((x) => x.kind === 'milestone')) {
|
|
169
|
+
// the far milestones the filters let through (the chip narrows this line too)
|
|
170
|
+
const far = G.later.filter((x) => x.kind === 'milestone'), n = far.length, nx = far[0];
|
|
171
|
+
const years = [...new Set(far.map((x) => x.date.slice(0, 4)))], year = years.length === 1 && years[0] !== String(today).slice(0, 4) ? years[0] : null;
|
|
172
|
+
later = fold('later', open.has('later'), `${n} ${plural(n, 'delivery milestone', 'delivery milestones')} ${year ? 'in ' + esc(year) : 'after the next 30 days'}. The next is ${esc(year ? shortDay(nx.date) : shortDay(nx.date, today))}: ${esc(nx.title)}`)
|
|
173
|
+
+ (open.has('later') && far.length ? `<div class="evp-b evp-far">${far.map((x) => rowHtml(x, ro)).join('')}</div>` : '');
|
|
100
174
|
}
|
|
101
|
-
|
|
175
|
+
// Late: the newest first (the model sorts them), LATE_SHOWN of them, then one line that opens the rest
|
|
176
|
+
let lateRows = G.late, lateTail = '';
|
|
177
|
+
if (!o.day && G.late.length > LATE_SHOWN + 1) {
|
|
178
|
+
const rest = G.late.length - LATE_SHOWN, oldest = -between(today, G.late[G.late.length - 1].date);
|
|
179
|
+
if (!open.has('late')) lateRows = G.late.slice(0, LATE_SHOWN);
|
|
180
|
+
lateTail = fold('late', open.has('late'), open.has('late') ? 'Show only the newest ' + LATE_SHOWN : `${rest} more late, the oldest ${oldest} ${plural(oldest, 'day', 'days')}`);
|
|
181
|
+
}
|
|
182
|
+
const body = groupHtml('late', 'Late', lateRows, ro, all, lateTail, G.late.length) + groupHtml('now', 'Today', G.today, ro) + groupHtml('coming', 'Coming up', G.coming, ro, '', '', G.coming.length, o.day ? null : comingBody(G.coming, ro)) + later;
|
|
102
183
|
if (body) return body;
|
|
103
184
|
if (o.day) return `<p class="evp-quiet">Nothing has a date on ${esc(weekday(o.day) + ' ' + shortDay(o.day, today))}.</p>`;
|
|
104
185
|
return '<p class="evp-quiet">Nothing is late, and nothing has a date in the next 30 days.</p>';
|
|
@@ -113,9 +194,8 @@ export function shiftMonth(ym, n) {
|
|
|
113
194
|
/** The small month of ym ('YYYY-MM'), Monday first. o: { today, day, show } */
|
|
114
195
|
export function monthHtml(ym, items, o = {}) {
|
|
115
196
|
const [y, m] = ym.split('-').map(Number);
|
|
116
|
-
const on = new Set(o.show || KINDS);
|
|
117
197
|
const byDay = new Map();
|
|
118
|
-
for (const x of items
|
|
198
|
+
for (const x of visible(items, o)) { if (!byDay.has(x.date)) byDay.set(x.date, []); byDay.get(x.date).push(x); }
|
|
119
199
|
const first = Date.UTC(y, m - 1, 1);
|
|
120
200
|
const lead = (new Date(first).getUTCDay() + 6) % 7;
|
|
121
201
|
let cells = ['M', 'T', 'W', 'T', 'F', 'S', 'S'].map((d) => `<span class="evp-mh" aria-hidden="true">${d}</span>`).join('');
|
|
@@ -125,18 +205,70 @@ export function monthHtml(ym, items, o = {}) {
|
|
|
125
205
|
const xs = byDay.get(k) || [];
|
|
126
206
|
// one mark per kind and tone, at most three: the day is the map, not the list
|
|
127
207
|
const seen = new Set(), marks = [];
|
|
128
|
-
for (const x of xs) { const sig = x
|
|
208
|
+
for (const x of xs) { const sig = typeOf(x) + '|' + (x.tone || ''); if (!seen.has(sig) && marks.length < 3) { seen.add(sig); marks.push(markHtml(x)); } }
|
|
129
209
|
const lab = `${t.getUTCDate()} ${MONTH[t.getUTCMonth()]}${xs.length ? ', ' + xs.length + ' ' + plural(xs.length, 'date', 'dates') : ''}`;
|
|
130
210
|
cells += `<button type="button" class="evp-md${out ? ' out' : ''}${k === o.today ? ' now' : ''}${k === o.day ? ' on' : ''}" data-evp-day="${k}" aria-pressed="${k === o.day ? 'true' : 'false'}" aria-label="${esc(lab)}">${t.getUTCDate()}<em>${marks.join('')}</em></button>`;
|
|
131
211
|
}
|
|
132
|
-
return `<div class="evp-mt-top"><
|
|
212
|
+
return `<div class="evp-mt-top"><button type="button" class="evp-mn" data-evp-full aria-label="${MONTH[m - 1]} ${y}. Open the full calendar">${MONTH[m - 1]} ${y}</button><button type="button" class="evp-ib" data-evp-month="-1" aria-label="The month before" title="The month before">${svg(ICON.back, 16)}</button><button type="button" class="evp-ib" data-evp-month="1" aria-label="The month after" title="The month after">${svg(ICON.go, 16)}</button></div>`
|
|
133
213
|
+ `<div class="evp-mg" role="group" aria-label="${MONTH[m - 1]} ${y}">${cells}</div>`;
|
|
134
214
|
}
|
|
135
215
|
|
|
136
|
-
/**
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
const
|
|
140
|
-
|
|
216
|
+
/** The key: each type with its mark and how many dates it has, each a switch (every type is on until the PM presses it). A type whose
|
|
217
|
+
* source PMOS does not read says so ("Meetings · calendar not connected") and its press opens Settings › Connectors. o: { counts, unread } */
|
|
218
|
+
export function showHtml(show, o = {}) {
|
|
219
|
+
const on = new Set(show || TYPES), counts = o.counts || {}, unread = o.unread || {};
|
|
220
|
+
const rows = TYPES.map((k) => {
|
|
221
|
+
if (unread[k] && !counts[k]) return `<button type="button" class="evp-un" data-evp-connect aria-label="${esc(TYPE_LABEL[k])}: ${esc(unread[k])}. Open Connectors">${markOf(k)}<span>${esc(TYPE_LABEL[k])} · ${esc(unread[k])}</span><span class="evp-on" aria-hidden="true">${svg(ICON.go, 14)}</span></button>`;
|
|
222
|
+
return `<button type="button" data-evp-show="${k}" aria-pressed="${on.has(k) ? 'true' : 'false'}">${markOf(k)}${esc(TYPE_LABEL[k])}${counts[k] ? `<small>${counts[k]}</small>` : ''}<span class="evp-on" aria-hidden="true">${on.has(k) ? svg(ICON.yes, 14) : ''}</span></button>`;
|
|
223
|
+
});
|
|
224
|
+
return `<h3 class="evp-sh">Show</h3><div class="evp-f" role="group" aria-label="Show">${rows.join('')}</div>`
|
|
141
225
|
+ '<div class="evp-key"><span><i class="evp-k evp-rd late" aria-hidden="true"></i>Late</span><span><i class="evp-k evp-rd risk" aria-hidden="true"></i>At risk</span></div>';
|
|
142
226
|
}
|
|
227
|
+
/** How many dates of each type the page lists (Late, Today, Coming up and the far milestones), under the chip. */
|
|
228
|
+
export function countsOf(items, o = {}) {
|
|
229
|
+
const c = {};
|
|
230
|
+
for (const x of items || []) { if (x.group === 'later' && x.kind !== 'milestone') continue; if (o.scopeOk && !o.scopeOk(x)) continue; c[typeOf(x)] = (c[typeOf(x)] || 0) + 1; }
|
|
231
|
+
return c;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/** The Monday of the week of day ('YYYY-MM-DD'). */
|
|
235
|
+
export function weekOf(day) {
|
|
236
|
+
const t = ms(day);
|
|
237
|
+
return new Date(t - ((new Date(t).getUTCDay() + 6) % 7) * 86400000).toISOString().slice(0, 10);
|
|
238
|
+
}
|
|
239
|
+
const addDays = (d, n) => new Date(ms(d) + n * 86400000).toISOString().slice(0, 10);
|
|
240
|
+
/** One date in a calendar cell: its mark and its title; a press opens it, as a row does. */
|
|
241
|
+
const chipHtml = (x) => `<button type="button" class="evp-cc${x.tone ? ' ' + x.tone : ''}" data-key="${esc(x.key)}" data-evp-open aria-label="${esc(x.title)}. ${esc(lineOf(x))}. Open it">${markHtml(x)}<span>${x.time ? esc(x.time) + ' ' : ''}${esc(x.title)}</span></button>`;
|
|
242
|
+
|
|
243
|
+
/** The full calendar in the left column. model: { today, items }; o: { view: 'month' | 'week', ym, day, show } */
|
|
244
|
+
export function calHtml(model, o = {}) {
|
|
245
|
+
const today = model.today, view = o.view === 'week' ? 'week' : 'month';
|
|
246
|
+
const byDay = new Map();
|
|
247
|
+
for (const x of visible(model.items, o)) { if (!byDay.has(x.date)) byDay.set(x.date, []); byDay.get(x.date).push(x); }
|
|
248
|
+
const seg = `<div class="cz-seg" role="group" aria-label="Calendar view">${['month', 'week'].map((v) => `<button type="button" data-evp-view="${v}" aria-pressed="${v === view ? 'true' : 'false'}">${v === 'month' ? 'Month' : 'Week'}</button>`).join('')}</div>`;
|
|
249
|
+
const back = `<button type="button" class="evp-ib" data-evp-list aria-label="Back to the list" title="Back to the list">${svg(ICON.back, 18)}</button>`;
|
|
250
|
+
const dayBtn = (k, label) => `<button type="button" class="evp-cd${k === today ? ' now' : ''}" data-evp-day="${k}" aria-label="${esc(label)}. See only this day">${new Date(ms(k)).getUTCDate()}</button>`;
|
|
251
|
+
if (view === 'week') {
|
|
252
|
+
const mon = weekOf(o.day || today);
|
|
253
|
+
const cols = [];
|
|
254
|
+
for (let i = 0; i < 7; i++) {
|
|
255
|
+
const k = addDays(mon, i), xs = byDay.get(k) || [];
|
|
256
|
+
cols.push(`<div class="evp-wc${k === today ? ' now' : ''}"><div class="evp-wh"><span>${WD[(i + 1) % 7]}</span>${dayBtn(k, weekday(k) + ' ' + shortDay(k, today))}</div>${xs.map(chipHtml).join('')}</div>`);
|
|
257
|
+
}
|
|
258
|
+
const end = addDays(mon, 6);
|
|
259
|
+
return `<div class="evp-ch">${back}<h2>${esc(shortDay(mon, today))} to ${esc(shortDay(end, today))}</h2><button type="button" class="evp-ib" data-evp-week="-1" aria-label="The week before" title="The week before">${svg(ICON.back, 16)}</button><button type="button" class="evp-ib" data-evp-week="1" aria-label="The week after" title="The week after">${svg(ICON.go, 16)}</button>${seg}</div>`
|
|
260
|
+
+ `<div class="evp-wk" role="group" aria-label="The week of ${esc(shortDay(mon, today))}">${cols.join('')}</div>`;
|
|
261
|
+
}
|
|
262
|
+
const ym = o.ym || String(today).slice(0, 7);
|
|
263
|
+
const [y, m] = ym.split('-').map(Number);
|
|
264
|
+
const first = Date.UTC(y, m - 1, 1), lead = (new Date(first).getUTCDay() + 6) % 7;
|
|
265
|
+
let cells = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'].map((d) => `<span class="evp-mh" aria-hidden="true">${d}</span>`).join('');
|
|
266
|
+
const len = new Date(Date.UTC(y, m, 0)).getUTCDate(), cellsN = Math.ceil((lead + len) / 7) * 7; // whole weeks, no row of the next month only
|
|
267
|
+
for (let i = 0; i < cellsN; i++) {
|
|
268
|
+
const t = new Date(first + (i - lead) * 86400000), k = t.toISOString().slice(0, 10), xs = byDay.get(k) || [];
|
|
269
|
+
const more = xs.length > 3 ? `<button type="button" class="evp-cm" data-evp-day="${k}">${xs.length - 3} more</button>` : '';
|
|
270
|
+
cells += `<div class="evp-mc${t.getUTCMonth() !== m - 1 ? ' out' : ''}${k === today ? ' now' : ''}">${dayBtn(k, t.getUTCDate() + ' ' + MONTH[t.getUTCMonth()] + (xs.length ? ', ' + xs.length + ' ' + plural(xs.length, 'date', 'dates') : ''))}${xs.slice(0, 3).map(chipHtml).join('')}${more}</div>`;
|
|
271
|
+
}
|
|
272
|
+
return `<div class="evp-ch">${back}<h2>${MONTH[m - 1]} ${y}</h2><button type="button" class="evp-ib" data-evp-month="-1" aria-label="The month before" title="The month before">${svg(ICON.back, 16)}</button><button type="button" class="evp-ib" data-evp-month="1" aria-label="The month after" title="The month after">${svg(ICON.go, 16)}</button>${seg}</div>`
|
|
273
|
+
+ `<div class="evp-fm" role="group" aria-label="${MONTH[m - 1]} ${y}">${cells}</div>`;
|
|
274
|
+
}
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
* panel; the dates sit in one card per group with a thin border; the small month and Show sit in one grey box on the right. Tokens only. */
|
|
3
3
|
.evp-page .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
|
|
4
4
|
.evp-hd { display: flex; align-items: center; gap: 12px; min-height: 44px; }
|
|
5
|
-
.evp-hd h1 { margin: 0
|
|
5
|
+
.evp-hd h1 { margin: 0; font-size: var(--fs-page); font-weight: var(--fw-page); line-height: var(--lh-page); }
|
|
6
6
|
.evp-dayf { margin: 0; display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-meta); color: var(--cz-ink2); background: var(--cz-bluebg); border-radius: 999px; padding: 2px 4px 2px 12px; }
|
|
7
7
|
.evp-dayf[hidden] { display: none; }
|
|
8
8
|
.evp-dayf b { font-weight: var(--fw-strong); color: var(--cz-blueink); }
|
|
9
|
-
.evp-
|
|
9
|
+
.evp-scope { margin-right: auto; }
|
|
10
|
+
/* the list takes at most about 1100 px, so a suggestion sits near its row on a wide screen (round 2, point 6) */
|
|
11
|
+
.evp-grid { display: grid; grid-template-columns: minmax(0, 1100px) 316px; gap: 28px; align-items: start; }
|
|
10
12
|
.evp-left { min-width: 0; }
|
|
11
13
|
|
|
12
14
|
/* the icon buttons */
|
|
@@ -42,9 +44,10 @@ button.evp-t { cursor: pointer; }
|
|
|
42
44
|
.evp-a { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-meta); color: var(--cz-ink2); white-space: nowrap; }
|
|
43
45
|
.evp-sg { display: inline-flex; align-items: center; gap: 6px; }
|
|
44
46
|
.evp-sp { display: inline-grid; color: var(--cz-blueink); }
|
|
47
|
+
button.evp-go { border: 0; font: inherit; font-size: var(--fs-meta); font-weight: var(--fw-strong); cursor: pointer; }
|
|
45
48
|
.evp-go { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 8px 0 14px; border-radius: 999px; background: var(--cz-card); font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--cz-ink); text-decoration: none; }
|
|
46
49
|
/* the tools: a new day and Fixed, shown on a row you point at or step into; a fixed row keeps its lock */
|
|
47
|
-
.evp-tl { display: inline-flex; align-items: center; gap: 2px; opacity: 0; }
|
|
50
|
+
.evp-tl { display: inline-flex; align-items: center; justify-content: flex-end; gap: 2px; min-width: 62px; opacity: 0; }
|
|
48
51
|
.evp-r:focus-within .evp-tl, .evp-r.fixed .evp-tl { opacity: 1; }
|
|
49
52
|
@media (hover: hover) { .evp-r:hover .evp-tl { opacity: 1; } }
|
|
50
53
|
@media (hover: none) { .evp-tl { opacity: 1; } }
|
|
@@ -59,6 +62,27 @@ button.evp-t { cursor: pointer; }
|
|
|
59
62
|
.evp-k.late { background: var(--cz-dot-late); }
|
|
60
63
|
.evp-k.risk { background: var(--cz-dot-risk); }
|
|
61
64
|
.evp-k.evp-mt.late { background: transparent; box-shadow: inset 0 0 0 2px var(--cz-dot-late); }
|
|
65
|
+
/* round 2: one mark per type, the same in the rows, the small month and the key */
|
|
66
|
+
.evp-k.evp-fo { border-radius: 50%; background: transparent; box-shadow: inset 0 0 0 2px var(--cz-ok); }
|
|
67
|
+
.evp-k.evp-rp { border-radius: 2px; background: var(--cz-ink3); }
|
|
68
|
+
.evp-k.evp-dl { border-radius: 50%; background: var(--cz-c-b07cc6); }
|
|
69
|
+
.evp-k.evp-fo.late, .evp-k.evp-fo.risk { background: transparent; }
|
|
70
|
+
.evp-ty { font-style: normal; font-weight: var(--fw-strong); color: var(--cz-ink2); }
|
|
71
|
+
/* the line over the list when a filter hides dates */
|
|
72
|
+
.evp-hid { margin: 0 0 12px; font-size: var(--fs-meta); color: var(--cz-ink2); }
|
|
73
|
+
.evp-hid button { all: unset; cursor: pointer; font-weight: var(--fw-strong); color: var(--cz-blueink); }
|
|
74
|
+
.evp-hid button:focus-visible, .evp-un:focus-visible, .evp-day:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
|
|
75
|
+
/* a coming day with many meetings: one line that opens them */
|
|
76
|
+
button.evp-day { all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: 104px 10px minmax(0, 1fr) auto; align-items: center; column-gap: 14px; width: 100%; min-height: 60px; padding: 6px 16px; }
|
|
77
|
+
.evp-r + .evp-day, .evp-day + .evp-r { box-shadow: inset 0 1px 0 var(--cz-hair); }
|
|
78
|
+
.evp-fi { display: inline-grid; color: var(--cz-ink3); transition: transform .15s; }
|
|
79
|
+
.evp-day[aria-expanded="true"] .evp-fi { transform: rotate(90deg); }
|
|
80
|
+
/* a date stated in a source: the line that states it, under the row */
|
|
81
|
+
.evp-src { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 4px 16px 12px 158px; font-size: var(--fs-meta); color: var(--cz-ink2); }
|
|
82
|
+
.evp-src q { flex: 1 1 100%; color: var(--cz-ink); }
|
|
83
|
+
.evp-r.evp-kid { padding-left: 32px; }
|
|
84
|
+
.evp-r.evp-kid .evp-d b { font-size: var(--fs-meta); }
|
|
85
|
+
.evp-src .evp-go { background: var(--cz-well); }
|
|
62
86
|
|
|
63
87
|
.evp-more { display: flex; align-items: center; gap: 8px; margin: 0; padding: 4px 2px; font-size: var(--fs-meta); color: var(--cz-ink2); }
|
|
64
88
|
.evp-quiet { margin: 8px 0; font-size: var(--fs-body); color: var(--cz-ink3); }
|
|
@@ -87,10 +111,46 @@ button.evp-t { cursor: pointer; }
|
|
|
87
111
|
.evp-f button { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 10px; background: var(--cz-card); font-size: var(--fs-meta); color: var(--cz-ink); }
|
|
88
112
|
.evp-f button[aria-pressed="false"] { background: transparent; color: var(--cz-ink3); }
|
|
89
113
|
.evp-on { margin-left: auto; display: inline-grid; color: var(--cz-blueink); }
|
|
114
|
+
.evp-f button small { font-size: var(--fs-meta); color: var(--cz-ink3); }
|
|
115
|
+
.evp-f button.evp-un { color: var(--cz-ink2); background: transparent; box-shadow: inset 0 0 0 1px var(--cz-hair); }
|
|
90
116
|
.evp-key { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 0 0; font-size: var(--fs-meta); color: var(--cz-ink2); }
|
|
91
117
|
.evp-key span { display: inline-flex; align-items: center; gap: 6px; }
|
|
92
118
|
.evp-hint { margin: 12px 0 0; font-size: var(--fs-meta); color: var(--cz-ink3); }
|
|
93
119
|
|
|
120
|
+
/* the fold lines: the rest of Late, and the far delivery milestones */
|
|
121
|
+
.evp-fold { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 8px; width: 100%; margin: 6px 0 0; padding: 8px 4px; border-radius: 10px; font-size: var(--fs-meta); color: var(--cz-ink2); }
|
|
122
|
+
.evp-fold i { display: inline-grid; transition: transform .15s; }
|
|
123
|
+
.evp-fold[aria-expanded="true"] i { transform: rotate(90deg); }
|
|
124
|
+
.evp-fold:focus-visible, .evp-mn:focus-visible, .evp-cc:focus-visible, .evp-cd:focus-visible, .evp-cm:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
|
|
125
|
+
.evp-far { margin: 4px 0 0; }
|
|
126
|
+
@media (hover: hover) { .evp-fold:hover { background: var(--cz-well); } .evp-mn:hover { text-decoration: underline; text-underline-offset: 3px; } .evp-cc:hover { background: var(--cz-well2); } }
|
|
127
|
+
|
|
128
|
+
/* the month name opens the full calendar */
|
|
129
|
+
.evp-mn { all: unset; box-sizing: border-box; cursor: pointer; margin-right: auto; font-size: var(--fs-section); font-weight: var(--fw-section); border-radius: 8px; }
|
|
130
|
+
|
|
131
|
+
/* the full calendar, in the left column */
|
|
132
|
+
.evp-ch { display: flex; align-items: center; gap: 4px; margin: 0 0 12px; }
|
|
133
|
+
.evp-ch h2 { margin: 0 auto 0 4px; font-size: var(--fs-section); font-weight: var(--fw-section); }
|
|
134
|
+
.evp-ch .cz-seg { margin-left: 8px; }
|
|
135
|
+
.evp-fm { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-radius: 16px; box-shadow: inset 0 0 0 1px var(--cz-hair); overflow: hidden; }
|
|
136
|
+
.evp-fm .evp-mh { padding: 8px 0 6px; }
|
|
137
|
+
.evp-mc { min-height: 104px; min-width: 0; padding: 4px; box-shadow: inset 1px 1px 0 var(--cz-hair); display: flex; flex-direction: column; gap: 2px; }
|
|
138
|
+
.evp-mc.out { background: var(--cz-well); }
|
|
139
|
+
.evp-mc.out .evp-cd { color: var(--cz-ink3); }
|
|
140
|
+
.evp-cd { all: unset; box-sizing: border-box; cursor: pointer; align-self: flex-start; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; display: inline-grid; place-items: center; font-size: var(--fs-meta); color: var(--cz-ink); }
|
|
141
|
+
.evp-cd.now { background: var(--cz-blue); color: var(--cz-onsolid); font-weight: var(--fw-strong); }
|
|
142
|
+
.evp-cc { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 6px; min-width: 0; padding: 2px 6px; border-radius: 8px; font-size: var(--fs-meta); color: var(--cz-ink); }
|
|
143
|
+
.evp-cc span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
144
|
+
.evp-cc.late span { color: var(--cz-late); }
|
|
145
|
+
.evp-cm { all: unset; box-sizing: border-box; cursor: pointer; padding: 0 6px; font-size: var(--fs-meta); color: var(--cz-ink3); }
|
|
146
|
+
.evp-wk { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
|
|
147
|
+
.evp-wc { min-width: 0; min-height: 240px; padding: 6px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--cz-hair); display: flex; flex-direction: column; gap: 4px; }
|
|
148
|
+
.evp-wc.now { background: var(--cz-bluebg); box-shadow: none; }
|
|
149
|
+
.evp-wc .evp-cc { align-items: flex-start; }
|
|
150
|
+
.evp-wc .evp-cc .evp-k { margin-top: 5px; }
|
|
151
|
+
.evp-wc .evp-cc span { white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
|
|
152
|
+
.evp-wh { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; font-size: var(--fs-label); font-weight: var(--fw-label); color: var(--cz-ink3); }
|
|
153
|
+
|
|
94
154
|
/* the toast with Undo */
|
|
95
155
|
.evp-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; z-index: 80; display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 18px; border-radius: 14px; background: var(--cz-ink); color: var(--cz-card); font-size: var(--fs-meta); box-shadow: var(--cz-float); transition: opacity .18s, transform .18s; }
|
|
96
156
|
.evp-toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
|
|
@@ -101,7 +161,19 @@ button.evp-t { cursor: pointer; }
|
|
|
101
161
|
.evp-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
|
|
102
162
|
.evp-r { grid-template-columns: 76px 10px minmax(0, 1fr); row-gap: 6px; padding: 8px 12px; }
|
|
103
163
|
.evp-a, .evp-tl { grid-column: 3; justify-self: start; }
|
|
164
|
+
button.evp-day { grid-template-columns: 76px 10px minmax(0, 1fr) auto; padding: 8px 12px; }
|
|
165
|
+
.evp-src { padding-left: 112px; }
|
|
166
|
+
.evp-tl { min-width: 0; justify-content: flex-start; }
|
|
167
|
+
.evp-a .evp-sg { flex: 1 1 100%; } /* the suggestion on its own line, then ✓ ✕ together */
|
|
104
168
|
.evp-a { flex-wrap: wrap; white-space: normal; }
|
|
105
169
|
.evp-new { grid-template-columns: minmax(0, 1fr) auto; }
|
|
106
170
|
.evp-new input[type="date"] { grid-column: 1; }
|
|
171
|
+
.evp-ch { flex-wrap: wrap; }
|
|
172
|
+
.evp-mc { min-height: 64px; }
|
|
173
|
+
.evp-mc .evp-cc span { display: none; }
|
|
174
|
+
.evp-wk { grid-template-columns: minmax(0, 1fr); }
|
|
175
|
+
.evp-wc { min-height: 0; }
|
|
176
|
+
}
|
|
177
|
+
@media (max-width: 760px) and (hover: hover) {
|
|
178
|
+
.evp-r:not(:hover):not(:focus-within):not(.fixed) .evp-tl { display: none; } /* a narrow window: no empty line for tools you are not pointing at */
|
|
107
179
|
}
|