create-pmos 0.396.0 → 0.398.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 +25 -25
- 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/scripts/nine-stages.js +49 -20
- package/payload/state/discoveries.md +1 -1
- package/payload/state/log.md +1 -1
- package/workspace/briefing-premium-adddoc-test.js +103 -74
- package/workspace/briefing-premium-board-test.js +316 -154
- package/workspace/briefing-premium-calendar-2-test.js +135 -195
- package/workspace/briefing-premium-calendar-3-test.js +143 -413
- package/workspace/briefing-premium-calendar-test.js +86 -185
- package/workspace/briefing-premium-doc-edit-test.js +95 -83
- package/workspace/briefing-premium-initiative-test.js +166 -294
- package/workspace/briefing-premium-insights-test.js +351 -214
- package/workspace/briefing-premium-metrics-test.js +53 -118
- package/workspace/briefing-premium-products-test.js +40 -27
- package/workspace/briefing-premium-sources-test.js +91 -52
- package/workspace/briefing-premium-test.js +150 -633
- package/workspace/briefing-premium-work-test.js +88 -269
- package/workspace/changelog.json +24 -0
- package/workspace/fixtures/board-premium-facts.js +2 -1
- package/workspace/fixtures/board-premium-jira.js +28 -0
- package/workspace/fixtures/board-premium-trail.js +32 -0
- package/workspace/fixtures/initiative-premium-facts.js +2 -1
- package/workspace/fixtures/initiatives-api/list.json +30 -42
- package/workspace/fixtures/initiatives-api/roadmap.json +40 -56
- package/workspace/fixtures/initiatives-api/sheet.json +10 -14
- package/workspace/fixtures/insights-premium-facts.js +11 -2
- package/workspace/fixtures/premium-viewer-fixtures.js +182 -0
- package/workspace/guide/briefing-premium.md +3 -1
- package/workspace/guide/home.md +47 -0
- package/workspace/guide/index.md +2 -0
- package/workspace/guide/lifecycle.md +51 -0
- package/workspace/home-shot.js +38 -0
- package/workspace/lib/agent-roles.js +71 -0
- package/workspace/lib/board-premium.js +160 -3
- package/workspace/lib/board-trail.js +223 -0
- package/workspace/lib/engine/boards.js +15 -14
- package/workspace/lib/engine/nine-stages.js +49 -20
- package/workspace/lib/engine/signals/detectors.js +13 -11
- package/workspace/lib/home-work-item.js +58 -0
- package/workspace/lib/insights-goals.js +196 -0
- package/workspace/lib/insights-premium.js +126 -1
- package/workspace/lib/insights-records.js +101 -0
- package/workspace/lib/jira-tickets.js +1 -1
- package/workspace/lib/route-modules.js +4 -0
- package/workspace/lib/routes-board-premium.js +3 -2
- package/workspace/lib/routes-board-trail.js +33 -0
- package/workspace/lib/routes-home-desk.js +176 -0
- package/workspace/lib/routes-initiatives.js +1 -1
- package/workspace/lib/routes-insights-premium.js +19 -3
- package/workspace/lib/routes-insights-records.js +129 -0
- package/workspace/lib/routes-notes.js +1 -0
- package/workspace/lib/routes-viewer.js +108 -0
- package/workspace/lib/transcript-steps.js +123 -0
- package/workspace/lib/vendor/scripts/nine-stages.js +49 -20
- package/workspace/lib/viewer-meeting.js +205 -0
- package/workspace/lib/viewer-report.js +89 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-agreed-viewer-shots.js +76 -0
- package/workspace/premium-board-actions-test.js +85 -73
- package/workspace/premium-briefing-depth-test.js +66 -53
- package/workspace/premium-chat-attach-test.js +54 -63
- package/workspace/premium-chat-chart-tab-test.js +35 -36
- package/workspace/premium-chat-context-test.js +22 -19
- package/workspace/premium-chat-goal-view-test.js +28 -26
- package/workspace/premium-chat-notes-test.js +29 -33
- package/workspace/premium-chat-report-tab-test.js +35 -25
- package/workspace/premium-chat-term-test.js +16 -14
- package/workspace/premium-chat-viewer-test.js +60 -53
- package/workspace/premium-core-doc-issue-test.js +50 -41
- package/workspace/premium-html-viewer-test.js +17 -18
- package/workspace/premium-phone-card-test.js +8 -2
- package/workspace/premium-phone-room-test.js +42 -31
- package/workspace/premium-report-read-test.js +115 -197
- package/workspace/premium-viewer-download-test.js +19 -22
- package/workspace/premium-viewer-flicker-test.js +11 -16
- package/workspace/premium-viewer-share-test.js +6 -9
- package/workspace/premium-viewer-test.js +41 -60
- package/workspace/premium-vw-backlog-test.js +53 -31
- package/workspace/premium-vw-cal-test.js +82 -123
- package/workspace/premium-vw-copy-test.js +17 -33
- package/workspace/premium-vw-doc-test.js +12 -11
- package/workspace/premium-vw-item-test.js +50 -48
- package/workspace/premium-vw-jira-test.js +55 -26
- package/workspace/premium-vw-meet-test.js +118 -187
- package/workspace/premium-vw-notes-test.js +85 -107
- package/workspace/premium-vw-rec-test.js +72 -193
- package/workspace/premium-vw-slides-test.js +46 -50
- package/workspace/premium-welcome-test.js +3 -2
- package/workspace/premium-work-depth-test.js +63 -51
- package/workspace/public/pm/bd-acts.js +305 -0
- package/workspace/public/pm/bd-span.js +224 -0
- package/workspace/public/pm/bd-stages.js +47 -0
- package/workspace/public/pm/c3-doc-sheet.js +1 -1
- package/workspace/public/pm/c3-md.js +3 -395
- package/workspace/public/pm/c3-phone-detail.js +1 -1
- package/workspace/public/pm/c3-phone-model.js +3 -68
- package/workspace/public/pm/chat-term.js +3 -3
- package/workspace/public/pm/cozy-board.css +640 -0
- package/workspace/public/pm/cozy-home.css +580 -0
- package/workspace/public/pm/cozy-home.js +172 -0
- package/workspace/public/pm/cozy-initiative.css +138 -0
- package/workspace/public/pm/cozy-insights.css +421 -0
- package/workspace/public/pm/cozy-md.js +396 -0
- package/workspace/public/pm/cozy-nav.js +65 -0
- package/workspace/public/pm/cozy-placeholder.js +26 -0
- package/workspace/public/pm/cozy-viewer.css +143 -0
- package/workspace/public/pm/cozy-viewer.js +144 -0
- package/workspace/public/pm/cozy-vw.css +485 -0
- package/workspace/public/pm/cozy.css +254 -0
- package/workspace/public/pm/home-adddoc.js +48 -0
- package/workspace/public/pm/home-app.js +905 -0
- package/workspace/public/pm/home-around.js +515 -0
- package/workspace/public/pm/home-chat.js +459 -0
- package/workspace/public/pm/home-data.js +312 -0
- package/workspace/public/pm/home-draft.js +68 -0
- package/workspace/public/pm/home-more.js +249 -0
- package/workspace/public/pm/home-phone-card.js +109 -0
- package/workspace/public/pm/home-work.js +519 -0
- package/workspace/public/pm/lifecycle-lens-model.js +45 -27
- package/workspace/public/pm/lifecycle-lens.js +22 -11
- package/workspace/public/pm/phone-moment.js +69 -0
- package/workspace/public/pm/pm-work-view.js +1 -1
- package/workspace/public/pm/premium-attach.js +4 -0
- package/workspace/public/pm/premium-board.js +544 -253
- package/workspace/public/pm/premium-brief.js +1 -1
- package/workspace/public/pm/premium-chart-tab.js +110 -62
- package/workspace/public/pm/premium-chat.js +17 -10
- package/workspace/public/pm/premium-deck.js +3 -3
- package/workspace/public/pm/premium-first.js +25 -21
- package/workspace/public/pm/premium-initiative-head.js +138 -0
- package/workspace/public/pm/premium-initiative.js +28 -4
- package/workspace/public/pm/premium-insights.js +950 -440
- package/workspace/public/pm/premium-meeting.js +61 -549
- package/workspace/public/pm/premium-notes.js +1 -1
- package/workspace/public/pm/premium-report-frame.css +20 -0
- package/workspace/public/pm/premium-report-read.js +509 -480
- package/workspace/public/pm/premium-report-tab.js +87 -63
- package/workspace/public/pm/premium-shell.js +107 -124
- package/workspace/public/pm/premium-viewer.js +27 -1
- package/workspace/public/pm/premium-vw-cal.js +187 -48
- package/workspace/public/pm/premium-vw-doc.css +6 -0
- package/workspace/public/pm/premium-vw-doc.js +40 -2
- package/workspace/public/pm/premium-vw-file.js +2 -2
- package/workspace/public/pm/premium-vw-jira-model.js +22 -5
- package/workspace/public/pm/premium-vw-jira.css +11 -0
- package/workspace/public/pm/premium-vw-jira.js +11 -4
- package/workspace/public/pm/premium-vw-meet.js +6 -83
- package/workspace/public/pm/premium-vw-mtg.js +731 -0
- package/workspace/public/pm/premium-vw-notes.js +56 -69
- package/workspace/public/pm/premium-vw-open.js +35 -0
- package/workspace/public/pm/premium-vw-page.js +16 -0
- package/workspace/public/pm/premium-vw-rec.js +11 -215
- package/workspace/public/pm/premium-vw-slides.css +5 -0
- package/workspace/public/pm/premium-vw-slides.js +44 -8
- package/workspace/public/pm/term-view.js +22 -0
- package/workspace/public/premium-board.html +57 -64
- package/workspace/public/premium-chat.html +7 -33
- package/workspace/public/premium-initiative.html +8 -41
- package/workspace/public/premium-insights.html +63 -62
- package/workspace/public/premium-viewer.html +20 -0
- package/workspace/public/premium-work.html +6 -72
- package/workspace/public/premium.html +21 -66
- package/workspace/public/vendor/nunito-var.woff2 +0 -0
- package/workspace/server.js +25 -3
- package/workspace/test-files.json +1 -0
- package/workspace/test-lists/home-libs.json +9 -0
- package/workspace/test-lists/premium-agreed-viewer.json +9 -0
- package/workspace/test-lists/premium-report-read.json +1 -1
- package/workspace/test-lists/premium-vw-agreed.json +9 -0
- package/workspace/test-lists/premium-vw-notes.json +1 -1
- package/workspace/third-party/README.md +1 -0
- package/workspace/public/pm/premium-work.js +0 -719
- package/workspace/public/pm/premium.js +0 -1133
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
/* pm/premium-vw-notes.js — the Notes list
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* field, grouped by what a note is about as the console groups them: Portfolio, each board in the portfolio's order, Initiatives (linked
|
|
5
|
-
* before boards were), then Not linked. The notes of one meeting series (two or more notes with one series key) are one entry: its
|
|
6
|
-
* title, the newest day, "N meetings", "series" and how many next steps are still open; it folds open to its newest three notes.
|
|
7
|
-
* Pressing a note opens its note sheet as a viewer tab (premium-vw-meet.js openNoteTab: Before, During and After, series paging,
|
|
8
|
-
* Since the last one, the notes tables). Pressing a series opens its newest note, which pages through the series.
|
|
9
|
-
*
|
|
1
|
+
/* pm/premium-vw-notes.js — the Notes list (initiative premium-agreed-design, area viewer; Main.dc.html viewer prop notelist).
|
|
2
|
+
* notesGroups is the Notes tab of Calendar | Notes (premium-vw-cal.js): the notes grouped by initiative, a series as one row.
|
|
3
|
+
* notesList, rowOf, hits and the html builders below are the earlier list's pure half, kept for their suite; no dialog draws them.
|
|
10
4
|
* Data: GET /api/notes (rows and series_open), GET /api/boards (the group order), GET /api/notes/search (what was said). Every row
|
|
11
5
|
* field is a field of those answers; a part a note does not hold is left out.
|
|
12
6
|
*/
|
|
13
|
-
import
|
|
14
|
-
import { openNoteTab } from './premium-vw-meet.js';
|
|
7
|
+
import './premium-vw-open.js'; // registers window.czViews (openNotes opens Calendar | Notes on its Notes tab)
|
|
15
8
|
|
|
16
9
|
const pad = (n) => String(n).padStart(2, '0');
|
|
17
10
|
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
@@ -125,64 +118,58 @@ export function listBodyHtml(L, esc, ui = {}) {
|
|
|
125
118
|
|
|
126
119
|
export const countLine = (L) => (L && L.state === 'ok' ? (L.count === L.total ? `${L.total} ${L.total === 1 ? 'note' : 'notes'}` : `${L.count} of ${L.total} notes`) : '');
|
|
127
120
|
|
|
128
|
-
/* ── the
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
*
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
121
|
+
/* ── the Notes tab (Main.dc.html notelist) ───────────────────────────────────────────────────────────────────────── */
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* The Notes tab: { state, error, total, count, groups: [{ title, n: 'N notes', rows: [{ id, title, sub, chip, k }] }] }.
|
|
125
|
+
* A group is the initiative a note is about, else its board, else Portfolio, else Not linked (last). A meeting series (two or more notes
|
|
126
|
+
* with one series key) is one row: "Series · N meetings · when" and, from series_open, "N steps open". A note row's chip is Recording,
|
|
127
|
+
* Done or Link it (no initiative, board or portfolio). opts = { q, found (Set of ids from /api/notes/search), initiative (an id: only its notes) }
|
|
128
|
+
*/
|
|
129
|
+
export function notesGroups(answer, opts = {}) {
|
|
130
|
+
if (!answer) return null;
|
|
131
|
+
if (answer.ok !== true) return { state: 'error', error: answer.error || 'The notes could not be read.', total: 0, count: 0, groups: [] };
|
|
132
|
+
let all = (answer.notes || []).filter((r) => r && r.id);
|
|
133
|
+
if (opts.initiative) all = all.filter((r) => r.initiative && r.initiative.id === opts.initiative);
|
|
134
|
+
const shown = all.filter((r) => hits(r, opts.q, opts.found));
|
|
135
|
+
const size = new Map();
|
|
136
|
+
for (const r of all) { const k = r.series && r.series.key; if (k) size.set(k, (size.get(k) || 0) + 1); }
|
|
137
|
+
const ents = new Map();
|
|
138
|
+
for (const r of shown) {
|
|
139
|
+
const k = r.series && r.series.key, ek = k && size.get(k) >= 2 ? 'S' + k : 'N' + r.id;
|
|
140
|
+
if (!ents.has(ek)) ents.set(ek, { series: ek[0] === 'S' ? k : null, rows: [] });
|
|
141
|
+
ents.get(ek).rows.push(r);
|
|
142
|
+
}
|
|
143
|
+
const g = new Map();
|
|
144
|
+
for (const e of ents.values()) {
|
|
145
|
+
e.rows.sort((a, b) => at(b) - at(a));
|
|
146
|
+
const r = e.rows[0];
|
|
147
|
+
const title = r.initiative && r.initiative.id ? clip(r.initiative.title || r.initiative.id, 60) : r.board && r.board.id ? clip(r.board.title || r.board.name || r.board.id, 60) : r.portfolio ? 'Portfolio' : 'Not linked';
|
|
148
|
+
if (!g.has(title)) g.set(title, { title, rows: [], n: 0, t: 0 });
|
|
149
|
+
const G = g.get(title);
|
|
150
|
+
G.n += e.rows.length; G.t = Math.max(G.t, at(r));
|
|
151
|
+
if (e.series) {
|
|
152
|
+
const o = (answer.series_open || {})[e.series], open = o && o.open ? o.open : 0;
|
|
153
|
+
G.rows.push({ id: r.id, t: at(r), series: e.series, title: clip((r.meeting && r.meeting.kind === 'event' && r.meeting.title) || r.title || 'Untitled meeting', 120),
|
|
154
|
+
sub: ['Series', size.get(e.series) + ' meetings', whenOf(startOf(r))].join(' · '), chip: open ? open + (open === 1 ? ' step open' : ' steps open') : '', k: open ? 'warn' : '' });
|
|
155
|
+
} else {
|
|
156
|
+
const R = rowOf(r), linked = title !== 'Not linked';
|
|
157
|
+
G.rows.push({ id: r.id, t: at(r), title: R.title, sub: [R.when, R.len, R.gist].filter(Boolean).join(' · '),
|
|
158
|
+
chip: R.live ? (R.live === 'paused' ? 'Paused' : 'Recording') : !linked ? 'Link it' : r.state === 'ended' ? 'Done' : 'Note', k: R.live ? 'rec' : linked && r.state === 'ended' ? 'ok' : '' });
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
const groups = [...g.values()].sort((a, b) => (a.title === 'Not linked') - (b.title === 'Not linked') || b.t - a.t)
|
|
162
|
+
.map((x) => ({ title: x.title, n: x.n + (x.n === 1 ? ' note' : ' notes'), rows: x.rows.sort((a, b) => b.t - a.t).map(({ t, ...row }) => row) }));
|
|
163
|
+
return { state: 'ok', total: all.length, count: shown.length, groups };
|
|
147
164
|
}
|
|
148
165
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
if (!box.isConnected) return;
|
|
159
|
-
const L = model();
|
|
160
|
-
d.$('#vnBody').innerHTML = listBodyHtml(L, d.esc, ui);
|
|
161
|
-
d.$('#vnCount').textContent = countLine(L);
|
|
162
|
-
};
|
|
163
|
-
const read = async () => {
|
|
164
|
-
const [l, bs] = await Promise.all([d.pmGet('/api/notes'), d.pmGet('/api/boards')]);
|
|
165
|
-
ui.answer = l || { ok: false, error: 'no answer' };
|
|
166
|
-
ui.boards = bs && bs.ok && Array.isArray(bs.boards) ? bs.boards : [];
|
|
167
|
-
draw();
|
|
168
|
-
};
|
|
169
|
-
let findT = null;
|
|
170
|
-
box.oninput = (e) => {
|
|
171
|
-
if (e.target.id !== 'vnQ') return;
|
|
172
|
-
ui.q = e.target.value; ui.found = null; clearTimeout(findT);
|
|
173
|
-
const q = ui.q.trim(), my = ++ui.token;
|
|
174
|
-
ui.searching = q.length >= SEARCH_MIN; draw();
|
|
175
|
-
if (!ui.searching) return;
|
|
176
|
-
findT = setTimeout(async () => {
|
|
177
|
-
const r = await d.pmGet('/api/notes/search?q=' + encodeURIComponent(q));
|
|
178
|
-
if (my !== ui.token) return;
|
|
179
|
-
ui.searching = false; ui.found = new Set(r && r.ok && Array.isArray(r.ids) ? r.ids : []); draw();
|
|
180
|
-
}, 250);
|
|
181
|
-
};
|
|
182
|
-
box.onclick = (e) => {
|
|
183
|
-
const t = e.target.closest('button'); if (!t) return;
|
|
184
|
-
if (t.dataset.vnFold) { const k = t.dataset.vnFold; if (ui.expand.has(k)) ui.expand.delete(k); else ui.expand.add(k); draw(); const x = box.querySelector(`[data-vn-fold="${CSS.escape(k)}"]`); if (x) x.focus(); return; }
|
|
185
|
-
if (t.dataset.vnNote) openNoteTab({ pmGet: d.pmGet, pmPost: d.pmPost, esc: d.esc, toast: d.toast, task: d.task || (async () => ({ ok: false, text: 'Make task is not available on this page.' })), changed: read }, t.dataset.vnNote);
|
|
186
|
-
};
|
|
187
|
-
await read();
|
|
166
|
+
/* ── the page half ─────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
167
|
+
|
|
168
|
+
/** Kept for premium.js: the Briefing card's Notes button is gone (Home opens czViews.openNotes). Draws nothing; safe with no card. */
|
|
169
|
+
export function mountNotes() { return null; }
|
|
170
|
+
|
|
171
|
+
/** Opens Calendar | Notes on its Notes tab. o = { ws, initiative } (an old caller's shell deps are ignored). */
|
|
172
|
+
export async function openNotes(o = {}) {
|
|
173
|
+
const M = await import('./premium-vw-cal.js');
|
|
174
|
+
return M.openNotesTab(o && (o.openDlg || o.$) ? {} : o);
|
|
188
175
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* pm/premium-vw-open.js — the one registry of the Viewer's open functions (initiative premium-agreed-design, area viewer).
|
|
2
|
+
*
|
|
3
|
+
* Importing this module sets window.czViews (and window.pmViewer, the same object). Each function opens its item in the czViewer card
|
|
4
|
+
* (cozy-viewer.js): one item at a time, no tabs, no conversation, nothing in #dlg.
|
|
5
|
+
* openMeeting(idOrRow, { ws }) a note id, { note }, { event, date }, a week row (premium-meeting.js weekView) or a today row { id, start, title }
|
|
6
|
+
* openCalendar({ ws, tab: 'cal' | 'notes', date, view }) Calendar | Notes
|
|
7
|
+
* openNotes({ ws, initiative }) Calendar | Notes on its Notes tab
|
|
8
|
+
* openReport(idOrRow, { ws, name, cycles, onIssue, onChange }) a report path reports/<cadence>/<date>.md or a Reports card row
|
|
9
|
+
* newNote(ws | { ws }) starts an untitled note now and opens it, recording
|
|
10
|
+
* makeWorkItem(noteId, step) Becomes V.4: a ticket drafted in PMOS from a next step (never pushed to Jira here)
|
|
11
|
+
* The modules load on first use (dynamic import), so this file has no import cycle with the view modules that import it.
|
|
12
|
+
* It also adds the Viewer's style sheet (cozy-vw.css) to the page once. */
|
|
13
|
+
|
|
14
|
+
const CSS = '/pm/cozy-vw.css';
|
|
15
|
+
export function vzStyle() {
|
|
16
|
+
if (typeof document === 'undefined' || document.querySelector(`link[href="${CSS}"]`)) return;
|
|
17
|
+
const l = document.createElement('link'); l.rel = 'stylesheet'; l.href = CSS; document.head.append(l);
|
|
18
|
+
}
|
|
19
|
+
const mtg = () => import('./premium-vw-mtg.js');
|
|
20
|
+
const cal = () => import('./premium-vw-cal.js');
|
|
21
|
+
const rep = () => import('./premium-report-read.js');
|
|
22
|
+
const plain = (o) => (o && typeof o === 'object' && !o.openDlg && !o.$ ? o : {}); // an old caller passed the shell's deps
|
|
23
|
+
|
|
24
|
+
export async function openMeeting(ref, o = {}) { vzStyle(); return (await mtg()).openMeeting(ref, plain(o)); }
|
|
25
|
+
export async function openCalendar(o = {}) { vzStyle(); return (await cal()).openCalendar(plain(o)); }
|
|
26
|
+
export async function openNotes(o = {}) { vzStyle(); return (await cal()).openNotesTab(plain(o)); }
|
|
27
|
+
export async function openReport(ref, o = {}) { vzStyle(); return (await rep()).openReportView(ref, plain(o)); }
|
|
28
|
+
export async function newNote(o) { vzStyle(); return (await mtg()).newNote(typeof o === 'string' ? o : (o && o.ws) || ''); }
|
|
29
|
+
export async function makeWorkItem(noteId, step) { return (await mtg()).workItem(noteId, step); }
|
|
30
|
+
|
|
31
|
+
export const views = { openMeeting, openCalendar, openNotes, openReport, newNote, makeWorkItem };
|
|
32
|
+
if (typeof window !== 'undefined') {
|
|
33
|
+
window.czViews = Object.assign(window.czViews || {}, views);
|
|
34
|
+
window.pmViewer = window.czViews;
|
|
35
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* pm/premium-vw-page.js — /premium-viewer.html: opens the item its address names in the Viewer card (initiative premium-agreed-design).
|
|
2
|
+
* ?open=meeting¬e=<id> | &event=<id>&date=YYYY-MM-DD ?open=calendar[&tab=notes][&date=] ?open=notes[&initiative=]
|
|
3
|
+
* ?open=report&path=reports/<cadence>/<date>.md each with an optional &ws=
|
|
4
|
+
* Closing the card leaves a line that links to Home. An address that names nothing says so. */
|
|
5
|
+
import { views } from './premium-vw-open.js';
|
|
6
|
+
import { onChange } from './cozy-viewer.js';
|
|
7
|
+
|
|
8
|
+
const q = new URLSearchParams(location.search), ws = q.get('ws') || '';
|
|
9
|
+
const gone = document.getElementById('vzGone');
|
|
10
|
+
onChange((d) => { gone.hidden = d.open; });
|
|
11
|
+
const what = q.get('open');
|
|
12
|
+
if (what === 'meeting') views.openMeeting(q.get('note') ? { note: q.get('note') } : { event: q.get('event') || '', date: q.get('date') || '' }, { ws });
|
|
13
|
+
else if (what === 'calendar') views.openCalendar({ ws, tab: q.get('tab') === 'notes' ? 'notes' : 'cal', date: q.get('date') || '' });
|
|
14
|
+
else if (what === 'notes') views.openNotes({ ws, initiative: q.get('initiative') || '' });
|
|
15
|
+
else if (what === 'report' && q.get('path')) views.openReport(q.get('path'), { ws });
|
|
16
|
+
else gone.hidden = false;
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
/* pm/premium-vw-rec.js — note recording
|
|
2
|
-
* The
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
|
|
8
|
-
* Reads GET /api/notes/one, GET /api/meeting-focus. Writes through window.__premiumRec (premium-meeting.js: the console's recorder) and POST /api/notes/save,
|
|
9
|
-
* /api/notes/private. The pure half (menuView, duringView, chipActs, focusPath) takes the routes' answers, so a test reads it without a DOM. */
|
|
10
|
-
import { vwOpen, vwStyle, vwConfirm, vwState } from './premium-viewer.js';
|
|
11
|
-
import { recordable, focusView, mmss, CONSENT_LINE, STOP_LINE, RECORD_LINE, FOCUS_LINE } from './premium-meeting.js';
|
|
12
|
-
import { setStage, duringHtml } from './premium-vw-meet.js';
|
|
1
|
+
/* pm/premium-vw-rec.js — note recording (initiative premium-viewer, S4; rebuilt for the Agreed design, initiative premium-agreed-design, area viewer).
|
|
2
|
+
* The live capture (state, Highlight, Pause or Resume, Stop, the audio source, Pause shots, Private, your notes, the highlights and the
|
|
3
|
+
* transcript) is the Transcript part of the meeting card in the Viewer (premium-vw-mtg.js). This module keeps the pure half the shell's chip and
|
|
4
|
+
* the Record menu read, and opens the card:
|
|
5
|
+
* openLive(id) · openFocus(id) → the note's meeting card in the Viewer (Focus is in its ⋯ menu)
|
|
6
|
+
* The pure half (menuView, duringView, chipActs, focusPath, stageOf) takes the routes' answers, so a test reads it without a DOM. */
|
|
7
|
+
import { recordable, mmss } from './premium-meeting.js';
|
|
13
8
|
|
|
14
9
|
const clip = (s, n) => { const t = String(s == null ? '' : s).replace(/\s+/g, ' ').trim(); return t.length > n ? t.slice(0, n - 1).trimEnd() + '…' : t; };
|
|
15
10
|
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' }[c]));
|
|
@@ -66,206 +61,7 @@ export function stageOf(material) {
|
|
|
66
61
|
present: m.kind === 'pmos-deck' || m.kind === 'slides', audience: m.kind === 'pmos-deck', url: /^https:\/\//.test(String(m.url || '')) ? m.url : '' })).filter((x) => x.title);
|
|
67
62
|
}
|
|
68
63
|
|
|
69
|
-
/* ── the
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
const ICO = {
|
|
74
|
-
mic: '<rect x="9" y="3" width="6" height="11" rx="3"/><path d="M5 11a7 7 0 0 0 14 0M12 18v3"/>', chev: '<path d="m6 9 6 6 6-6"/>', flag: '<path d="M5 21V4h11l-1.5 4L16 12H5"/>',
|
|
75
|
-
pause: '<path d="M8 5v14M16 5v14"/>', stop: '<rect x="6" y="6" width="12" height="12" rx="2"/>', play: '<path d="M7 5v14l11-7z"/>', lock: '<rect x="5" y="11" width="14" height="10" rx="2"/><path d="M8 11V8a4 4 0 0 1 8 0v3"/>',
|
|
76
|
-
focus: '<path d="M4 8V4h4M16 4h4v4M20 16v4h-4M8 20H4v-4"/><circle cx="12" cy="12" r="3"/>', plus: '<path d="M12 5v14M5 12h14"/>',
|
|
77
|
-
};
|
|
78
|
-
const ic = (k) => `<svg class="i" viewBox="0 0 24 24" aria-hidden="true">${ICO[k]}</svg>`;
|
|
79
|
-
const fail = (d, res, what) => d.toast((res && res.error) || what);
|
|
80
|
-
|
|
81
|
-
/** The dialog the tabs sit in: the open one, else the meeting's dialog on the Briefing, else a dialog of the note's own. */
|
|
82
|
-
async function ensureDialog(id, d) {
|
|
83
|
-
if ($('#dlg') && $('#dlg').classList.contains('on')) return true;
|
|
84
|
-
const rec = REC(), n = rec ? rec.note(id) : null;
|
|
85
|
-
if (rec && n && n.meeting && n.meeting.kind === 'event') { await rec.open(id); if ($('#dlg').classList.contains('on')) return true; }
|
|
86
|
-
if (!d.openDlg) return false;
|
|
87
|
-
d.openDlg({ eye: 'Note', title: clip((n && n.title) || 'Untitled note', 120), label: 'Note',
|
|
88
|
-
say: 'This note is not linked to a meeting in this week’s calendar. What it holds shows in the Live notes tab.', html: '<p class="note">The note has no meeting. Its live notes are in the next tab.</p>' });
|
|
89
|
-
return true;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export async function openLive(id, d) {
|
|
93
|
-
if (!id || !(await ensureDialog(id, d))) return null;
|
|
94
|
-
vwStyle('rec');
|
|
95
|
-
return vwOpen({ id: 'rec:' + id, title: 'Live notes', icon: 'mic', render: (el) => renderDuring(el, id, d) });
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
let mineSeq = 0, DEPS = null; // DEPS: the Briefing's { openDlg, toast, pmGet, pmPost }, kept by mountRecord for the During stage
|
|
99
|
-
/** The During capture of one note: in the meeting sheet's During stage (stage: true, the sheet's head already names the note) and in the Live notes tab openLive opens. */
|
|
100
|
-
export function renderDuring(el, id, d, { stage = false } = {}) {
|
|
101
|
-
vwStyle('rec');
|
|
102
|
-
const mineId = 'rvMine' + (++mineSeq);
|
|
103
|
-
const ui = { v: null, ask: '', draft: null, saving: false };
|
|
104
|
-
let timer = null;
|
|
105
|
-
const read = async () => {
|
|
106
|
-
const r = await d.pmGet('/api/notes/one?id=' + encodeURIComponent(id));
|
|
107
|
-
ui.v = duringView(r, { held: holding() === id });
|
|
108
|
-
};
|
|
109
|
-
const clock = () => { const rec = REC(), t = rec && holding() === id ? rec.started() : null; return Number.isFinite(t) ? mmss(Date.now() - t) : ''; };
|
|
110
|
-
const draw = () => {
|
|
111
|
-
const v = ui.v;
|
|
112
|
-
if (!v) { el.innerHTML = '<article class="paper doc rvw"><p class="note" role="status">Reading the note.</p></article>'; return; }
|
|
113
|
-
if (v.state === 'error') { el.innerHTML = `<article class="paper doc rvw"><p class="note" role="status">The note could not be read: ${esc(v.reason)}</p></article>`; return; }
|
|
114
|
-
const b = (a, label, icon, cls) => `<button type="button" class="rvb${cls ? ' ' + cls : ''}" data-rv="${a}">${icon ? ic(icon) : ''}${label}</button>`;
|
|
115
|
-
const hl = REC() && REC().highlighting ? REC().highlighting() : null;
|
|
116
|
-
let head = '';
|
|
117
|
-
if (v.mode === 'recording') head = `<div class="rvh"><span class="rvdot" aria-hidden="true"></span><b>Recording</b><span class="rvclk" data-rv-clock>${esc(clock())}</span><span class="rvsp"></span>${b('hl', hl && hl.state === 'listening' ? 'Highlighting' : 'Highlight', 'flag')}${b('pause', 'Pause', 'pause')}${b('stop', 'Stop', 'stop', 'cta')}</div>`;
|
|
118
|
-
else if (v.mode === 'paused') head = `<div class="rvh"><span class="rvdot paused" aria-hidden="true"></span><b>Paused</b>${v.until ? `<span class="note">Open until ${esc(v.until)}</span>` : ''}<span class="rvsp"></span>${b('resume', 'Resume', 'play')}${b('stop', 'Stop', 'stop', 'cta')}</div>`;
|
|
119
|
-
else if (v.mode === 'stale') head = `<div class="rvh"><b>Marked recording</b><span class="rvsp"></span>${b('resume', 'Resume', 'play')}${b('stop', 'Stop', 'stop', 'cta')}</div><p class="note">The server holds this note as recording, but this page is not capturing audio. Resume starts listening again.</p>`;
|
|
120
|
-
else if (v.mode === 'ended') head = '<div class="rvh"><b>Ended</b></div><p class="note">The recording has ended. A stopped meeting cannot be recorded again. Its notes are in the meeting’s After part.</p>';
|
|
121
|
-
else head = '<div class="rvh"><b>Not recording</b></div>';
|
|
122
|
-
const ask = ui.ask === 'stop' ? `<div class="rvask" role="alert"><p><b>Stop “${esc(clip(v.title, 60))}” for good?</b> ${esc(STOP_LINE)}</p><div>${b('stopno', 'Cancel')}${v.mode === 'recording' ? b('pause', 'Pause instead') : ''}${b('stopgo', 'Stop for good', '', 'cta')}</div></div>` : '';
|
|
123
|
-
const opts = v.mode === 'ended' ? '' : `<div class="rvopts">${v.event ? b('fv', 'Focus', 'focus') : ''}<button type="button" class="rvb" data-rv="private" aria-pressed="${v.private}" title="${esc(PRIVATE_LINE)}">${ic('lock')}Private</button>${v.shots ? `<span class="note">${v.shots} screen ${v.shots === 1 ? 'shot' : 'shots'} kept</span>` : ''}</div>`;
|
|
124
|
-
const body = ui.draft == null ? v.body : ui.draft;
|
|
125
|
-
const mine = `<section class="rvsec"><label class="label" for="${mineId}">Your notes</label><textarea id="${mineId}" class="rvta" rows="4" placeholder="Type a line. Each line keeps the time it was written." data-rv-mine>${esc(body)}</textarea><p class="note" data-rv-saved>${ui.saving ? 'Saving.' : 'Saved on this machine when you leave the box.'}</p></section>`;
|
|
126
|
-
const hls = v.highlights.length ? `<section class="rvsec"><span class="label">Highlights</span><ul class="rvhl">${v.highlights.map((h) => `<li><time>${esc(h.time)}</time><span>${esc(h.text)}</span>${h.cat ? `<em>${esc(h.cat)}</em>` : ''}</li>`).join('')}</ul></section>` : '';
|
|
127
|
-
const tr = v.private ? '<p class="note">This note is private, so it keeps no transcript.</p>' : v.lines.length ? `<div class="rvtr" data-rv-tr>${v.lines.map((l, i) => `<p${i === v.lines.length - 1 ? ' class="cur"' : ''}><time>${esc(l.time)}</time><b>${esc(l.who)}</b><span>${esc(l.text)}</span></p>`).join('')}</div>` : `<p class="note">${v.mode === 'recording' ? 'Nothing has been heard yet.' : 'The transcript starts when the note records.'}</p>`;
|
|
128
|
-
const keep = el.querySelector('[data-rv-mine]') === document.activeElement;
|
|
129
|
-
el.innerHTML = `<article class="paper doc rvw">${stage ? '' : `<h3 class="rvt">${esc(v.title)}</h3>`}${head}${ask}${opts}${mine}${hls}<section class="rvsec"><span class="label">${v.mode === 'recording' ? 'Live transcript' : 'Transcript'}</span>${tr}</section></article>`;
|
|
130
|
-
if (keep) { const t = el.querySelector('[data-rv-mine]'); t.focus(); t.setSelectionRange(t.value.length, t.value.length); }
|
|
131
|
-
const t = el.querySelector('[data-rv-tr]'); if (t) t.scrollTop = t.scrollHeight;
|
|
132
|
-
};
|
|
133
|
-
const loop = async () => {
|
|
134
|
-
clearTimeout(timer);
|
|
135
|
-
if (!el.isConnected) return;
|
|
136
|
-
if (!ui.v || !el.closest('[hidden]')) { await read(); if (!el.isConnected) return; if (el.querySelector('[data-rv-mine]') !== document.activeElement || !el.querySelector('.rvh')) draw(); }
|
|
137
|
-
timer = setTimeout(loop, 3000);
|
|
138
|
-
};
|
|
139
|
-
const tick = setInterval(() => { if (!el.isConnected) { clearInterval(tick); return; } const c = el.querySelector('[data-rv-clock]'); if (c) c.textContent = clock(); }, 1000);
|
|
140
|
-
const save = async () => {
|
|
141
|
-
if (ui.draft == null || !ui.v || ui.v.state !== 'ok' || ui.draft === ui.v.body) { ui.draft = null; return; }
|
|
142
|
-
ui.saving = true; const res = await d.pmPost('/api/notes/save', { id, body: ui.draft }); ui.saving = false;
|
|
143
|
-
if (!res || res.ok !== true) { fail(d, res, 'Your notes were not saved.'); return; }
|
|
144
|
-
ui.draft = null; await read(); draw();
|
|
145
|
-
};
|
|
146
|
-
el.addEventListener('input', (e) => { if (e.target.matches('[data-rv-mine]')) ui.draft = e.target.value; });
|
|
147
|
-
el.addEventListener('focusout', (e) => { if (e.target.matches('[data-rv-mine]')) save(); });
|
|
148
|
-
el.onclick = async (e) => { // delegated to the presses of the capture
|
|
149
|
-
const t = e.target.closest('[data-rv]'); if (!t) return;
|
|
150
|
-
const rec = REC(), a = t.dataset.rv; let res = null;
|
|
151
|
-
if (a === 'stop') { ui.ask = 'stop'; draw(); const g = el.querySelector('[data-rv="stopno"]'); if (g) g.focus(); return; }
|
|
152
|
-
if (a === 'stopno') { ui.ask = ''; draw(); return; }
|
|
153
|
-
if (a === 'fv') { openFocus(id, d); return; }
|
|
154
|
-
if (!rec) { d.toast('Recording is held by the Briefing. Open it there.'); return; }
|
|
155
|
-
t.disabled = true;
|
|
156
|
-
if (a === 'hl') { res = await rec.highlight(); if (res.ok) d.toast('Highlighting. ' + HL_LINE); }
|
|
157
|
-
else if (a === 'pause') { ui.ask = ''; res = await rec.pause(); if (res.ok) d.toast('Paused. You can resume within 1 hour.'); }
|
|
158
|
-
else if (a === 'resume') { res = await rec.resume(id); if (res.ok) d.toast('Resumed. Let people know.'); }
|
|
159
|
-
else if (a === 'stopgo') { ui.ask = ''; res = await rec.stop(id); if (res.ok) d.toast(res.discarded ? 'Nothing was recorded, so the note was deleted.' : 'Stopped for good. The final notes are written now.'); }
|
|
160
|
-
else if (a === 'private') {
|
|
161
|
-
const on = !(ui.v && ui.v.private);
|
|
162
|
-
if (on && !(await vwConfirm(el, { text: PRIVATE_LINE, yes: 'Make it private', no: 'Cancel' }))) { t.disabled = false; return; }
|
|
163
|
-
res = await d.pmPost('/api/notes/private', { id, private: on });
|
|
164
|
-
}
|
|
165
|
-
if (res && res.ok !== true) fail(d, res, 'That did not work.');
|
|
166
|
-
await read(); draw();
|
|
167
|
-
};
|
|
168
|
-
draw(); loop();
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
/** Focus: the meeting as it is now, read every 3 s while its tab is shown (GET /api/meeting-focus), with the material on a stage. */
|
|
172
|
-
export async function openFocus(id, d) {
|
|
173
|
-
if (!id || !(await ensureDialog(id, d))) return null;
|
|
174
|
-
vwStyle('rec');
|
|
175
|
-
if (!vwState().ids.includes('rec:' + id)) vwOpen({ id: 'rec:' + id, title: 'Live notes', icon: 'mic', render: (el) => renderDuring(el, id, d) }); // Focus sits beside the note's live notes
|
|
176
|
-
return vwOpen({ id: 'focus:' + id, title: 'Focus', icon: 'list', render: (el) => renderFocus(el, id, d) });
|
|
177
|
-
}
|
|
178
|
-
function renderFocus(el, id, d) {
|
|
179
|
-
let F = null, stage = [], timer = null, path = null, note = null;
|
|
180
|
-
const draw = () => {
|
|
181
|
-
const head = `<div class="fvh"><b>${esc(clip((note && note.title) || 'Focus', 80))}</b><span class="note">${esc(F && F.state === 'ok' ? F.status : path ? 'Reading the meeting' : '')}</span></div>`;
|
|
182
|
-
if (!path) { el.innerHTML = `<article class="paper doc rvw">${head}<p class="note">Focus reads a meeting from the calendar. This note is not linked to a calendar event.</p></article>`; return; }
|
|
183
|
-
if (!F) { el.innerHTML = `<article class="paper doc rvw">${head}<p class="note">${esc(FOCUS_LINE)}</p></article>`; return; }
|
|
184
|
-
if (F.state === 'error') { el.innerHTML = `<article class="paper doc rvw">${head}<p class="note" role="status">Focus could not read this meeting: ${esc(F.reason)}</p></article>`; return; }
|
|
185
|
-
const nowT = F.phase === 'before' ? F.topics[0] : F.current;
|
|
186
|
-
let h = head;
|
|
187
|
-
if (F.stretches.length) h += `<div class="fvbar" role="img" aria-label="What the room talked about, in order. Numbers match the topic list.">${F.stretches.map((x) => `<span class="${x.on ? 'on' : ''}" data-flex="${x.flex}" title="${esc(x.text)}">${x.n}</span>`).join('')}</div>`;
|
|
188
|
-
h += `<div class="fvnow"><span class="label">${F.phase === 'before' ? 'First up' : 'Now'}</span><b>${esc(nowT ? nowT.text : 'No topic is current yet')}</b>${F.gist ? `<p>${esc(F.gist)}</p>` : ''}</div>`;
|
|
189
|
-
h += `<div class="fvg"><section class="rvsec"><span class="label">Topics</span>${F.topics.length ? `<ol class="fvtp">${F.topics.map((t) => `<li class="${t.state}"><span>${esc(t.text)}</span><small>${t.state === 'now' ? 'now' : t.state === 'done' ? (t.minutes ? t.minutes + ' min' : 'done') : t.state === 'parked' ? 'parked' : 'planned'}</small></li>`).join('')}</ol>` : '<p class="note">The meeting has no topics yet.</p>'}</section>`;
|
|
190
|
-
h += `<section class="rvsec"><span class="label">Captured so far</span>${F.rec || F.paused || F.phase === 'done' ? `<div class="fvcap"><div><b>${F.captured.decisions}</b><span>Decisions</span></div><div><b>${F.captured.actions}</b><span>Next steps</span></div><div><b>${F.captured.questions}</b><span>Questions</span></div></div>` : '<p class="note">Counts start when the note records.</p>'}</section></div>`;
|
|
191
|
-
h += `<section class="rvsec"><span class="label">${F.rec ? 'What is being said' : 'Transcript'}</span>${F.tail.length ? `<div class="rvtr">${F.tail.map((l, i) => `<p${i === F.tail.length - 1 ? ' class="cur"' : ''}><b>${esc(l.who)}</b><span>${esc(l.text)}</span></p>`).join('')}</div>` : `<p class="note">${F.rec ? 'Nothing has been said yet.' : 'The transcript starts when you record.'}</p>`}</section>`;
|
|
192
|
-
h += `<section class="rvsec"><span class="label">Material</span>${stage.length ? `<ul class="fvst">${stage.map((m) => `<li><span><b>${esc(m.title)}</b><small>${esc([m.kind, m.topic ? 'on ' + m.topic : ''].filter(Boolean).join(' · '))}</small></span>${m.present ? `<button type="button" class="rvb cta" data-fv="present" data-i="${m.i}">${ic('play')}Present</button>` : ''}${m.audience ? `<button type="button" class="rvb" data-fv="aud" data-i="${m.i}">Audience view</button>` : ''}${!m.present && m.url ? `<button type="button" class="rvb" data-fv="open" data-i="${m.i}">Open</button>` : ''}</li>`).join('')}</ul>` : '<p class="note">No material linked. Add some from the meeting.</p>'}</section>`;
|
|
193
|
-
if (F.companion) h += `<p class="note">${esc(F.companion)}</p>`;
|
|
194
|
-
el.innerHTML = `<article class="paper doc rvw">${h}</article>`;
|
|
195
|
-
el.querySelectorAll('.fvbar [data-flex]').forEach((x) => x.style.setProperty('--fc-flex', x.dataset.flex)); // run-time geometry: each stretch is as long as its talk
|
|
196
|
-
};
|
|
197
|
-
const loop = async () => {
|
|
198
|
-
clearTimeout(timer);
|
|
199
|
-
if (!el.isConnected) return;
|
|
200
|
-
if (!el.hidden) {
|
|
201
|
-
if (!note) { const one = await d.pmGet('/api/notes/one?id=' + encodeURIComponent(id)); note = one && one.ok ? one.note : null; path = focusPath(note); }
|
|
202
|
-
if (path) { const r = await d.pmGet(path); F = focusView(r); stage = stageOf(r && r.ok ? r.material : []); }
|
|
203
|
-
if (!el.isConnected) return;
|
|
204
|
-
draw();
|
|
205
|
-
if (!path) return;
|
|
206
|
-
}
|
|
207
|
-
timer = setTimeout(loop, 3000);
|
|
208
|
-
};
|
|
209
|
-
el.onclick = async (e) => { // delegated to Present, Audience view and Open
|
|
210
|
-
const t = e.target.closest('[data-fv]'); if (!t) return;
|
|
211
|
-
const r = F && F.state === 'ok' ? await d.pmGet(path) : null, raw = r && r.ok && Array.isArray(r.material) ? r.material[+t.dataset.i] : null, m = stage[+t.dataset.i];
|
|
212
|
-
if (!m) return;
|
|
213
|
-
if (t.dataset.fv === 'open') { window.open(m.url, '_blank', 'noopener'); return; }
|
|
214
|
-
const C = await import('./c3-material.js'); // the console's presenter: a PMOS deck in the presenter view, Google Slides in present mode
|
|
215
|
-
if (t.dataset.fv === 'present') C.presentItem(raw); else C.audienceItem(raw);
|
|
216
|
-
};
|
|
217
|
-
draw(); loop();
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
/** The Record control on the Briefing's top bar: one round mic. With a meeting of today it lists the meetings and New note; with none it
|
|
221
|
-
* goes straight to a new note. Each start asks "Tell everyone first" once (premium-calmer-first-screen). */
|
|
222
|
-
export function mountRecord(here, d) {
|
|
223
|
-
if (here !== 'brief' || $('#recCtl')) return;
|
|
224
|
-
DEPS = d;
|
|
225
|
-
const at = $('.tools-top'); if (!at) return;
|
|
226
|
-
vwStyle('rec');
|
|
227
|
-
const w = document.createElement('div'); w.id = 'recCtl'; w.className = 'recctl';
|
|
228
|
-
w.innerHTML = `<button type="button" class="recb round glass" data-rc="mic" aria-haspopup="menu" aria-expanded="false" aria-label="Record a note or a meeting of today" title="${esc(NEW_LINE)}">${ic('mic')}</button><div class="recm" role="menu" hidden></div>`;
|
|
229
|
-
at.prepend(w);
|
|
230
|
-
const menu = $('.recm', w), arr = $('[data-rc="mic"]', w);
|
|
231
|
-
let rows = [], told = false, pend = null;
|
|
232
|
-
const close = () => { menu.hidden = true; arr.setAttribute('aria-expanded', 'false'); };
|
|
233
|
-
const consent = (what) => { pend = what; menu.innerHTML = `<div class="recask" role="alert"><p><b>Tell everyone first.</b> ${esc(CONSENT_LINE.replace('Tell everyone first. ', ''))}</p><p class="note">${esc(what === 'new' ? NEW_LINE : RECORD_LINE)}</p><div><button type="button" class="rvb cta" data-rc="go">I told them, start</button><button type="button" class="rvb" data-rc="no">Not yet</button></div></div>`; menu.hidden = false; arr.setAttribute('aria-expanded', 'true'); const g = $('[data-rc="go"]', menu); if (g) g.focus(); };
|
|
234
|
-
const start = async (what) => {
|
|
235
|
-
const rec = REC(); if (!rec) { d.toast('The recorder is not ready yet.'); return; }
|
|
236
|
-
close();
|
|
237
|
-
const res = what === 'new' ? await rec.fresh() : await rec.record(rows[what]);
|
|
238
|
-
if (!res || res.ok !== true) { fail(d, res, 'The recording did not start.'); return; }
|
|
239
|
-
d.toast('Recording. Notes are being taken on this machine. Let people know.');
|
|
240
|
-
const id = res.id || holding(); if (id) openLive(id, d);
|
|
241
|
-
};
|
|
242
|
-
const ask = (what) => { if (told) start(what); else consent(what); };
|
|
243
|
-
const list = async () => {
|
|
244
|
-
const rec = REC(); rows = rec ? await rec.today() : [];
|
|
245
|
-
const v = menuView(rows, rec ? rec.notes() : []);
|
|
246
|
-
if (!v.items.some((x) => x.mark !== 'Recording' && x.mark !== 'Paused')) { ask('new'); return; } // no meeting to choose: the mic records a new note
|
|
247
|
-
menu.innerHTML = `<p class="label">Today’s meetings</p>${v.items.length ? v.items.map((x) => `<button type="button" role="menuitem" data-rc="ev" data-i="${x.i}"${x.mark === 'Recording' || x.mark === 'Paused' ? ' disabled' : ''}><b>${esc(x.title)}</b><small>${esc(x.time)}${x.mark ? ' · ' + esc(x.mark) : ''}</small></button>`).join('') : '<p class="note">No meeting of today can be recorded now.</p>'}<button type="button" role="menuitem" data-rc="new">${ic('plus')}New note</button>`;
|
|
248
|
-
menu.hidden = false; arr.setAttribute('aria-expanded', 'true'); const f = $('[role="menuitem"]:not([disabled])', menu); if (f) f.focus();
|
|
249
|
-
};
|
|
250
|
-
const draw = () => { const rec = REC(), live = rec ? rec.notes().some((n) => n.state === 'recording') || !!holding() : false; w.hidden = live; if (live) close(); };
|
|
251
|
-
w.onclick = (e) => { // delegated to the control's presses
|
|
252
|
-
const t = e.target.closest('[data-rc]'); if (!t) return; e.stopPropagation();
|
|
253
|
-
const a = t.dataset.rc;
|
|
254
|
-
if (a === 'mic') { if (menu.hidden) list(); else close(); return; }
|
|
255
|
-
if (a === 'new') { ask('new'); return; }
|
|
256
|
-
if (a === 'ev') { ask(+t.dataset.i); return; }
|
|
257
|
-
if (a === 'go') { told = true; start(pend); return; }
|
|
258
|
-
if (a === 'no') { close(); arr.focus(); }
|
|
259
|
-
};
|
|
260
|
-
w.addEventListener('keydown', (e) => { if (e.key === 'Escape' && !menu.hidden) { close(); arr.focus(); } });
|
|
261
|
-
document.addEventListener('click', (e) => { if (!e.target.closest('#recCtl')) close(); });
|
|
262
|
-
addEventListener('premium-rec', draw); draw();
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
/* The meeting sheet's During stage (premium-vw-meet.js setStage). On the Briefing, which holds the recorder, a note that records or is
|
|
266
|
-
* paused gets the live capture with its presses; anywhere else, and for a note that is not recording, the sheet's own transcript. */
|
|
267
|
-
const liveNote = (S) => !!(DEPS && S && (S.state === 'recording' || S.state === 'paused'));
|
|
268
|
-
setStage('during', {
|
|
269
|
-
html: (S, x) => (liveNote(S) ? '<div data-rv-stage></div>' : duringHtml(S, x.esc)),
|
|
270
|
-
wire: (el, S) => { const host = el.querySelector('[data-rv-stage]'); if (host && liveNote(S)) renderDuring(host, S.id, DEPS, { stage: true }); },
|
|
271
|
-
});
|
|
64
|
+
/* ── the page half: the Viewer's meeting card ───────────────────────────────────────────────────────────────────────── */
|
|
65
|
+
const card = () => import('./premium-vw-mtg.js');
|
|
66
|
+
export async function openLive(id) { if (!id) return null; return (await card()).openMeeting({ note: id }); }
|
|
67
|
+
export async function openFocus(id) { if (!id) return null; return (await card()).openMeeting({ note: id }); }
|
|
@@ -161,3 +161,8 @@
|
|
|
161
161
|
.sl-tha{display:flex;position:static;grid-column:2;justify-content:flex-end;background:none;box-shadow:none}
|
|
162
162
|
.sl-tha .sl-b{min-width:44px;height:44px}
|
|
163
163
|
}
|
|
164
|
+
|
|
165
|
+
/* Report blue: the report panel's slide (ReportPanel.dc.html: a blue gradient, white text, a lime accent) */
|
|
166
|
+
.sl-cv[data-th="report"]{--sbg:linear-gradient(135deg,var(--cz-c-2546b8,rgb(37,70,184)),var(--cz-c-1b3a9e,rgb(27,58,158)));--sfg:rgb(255,255,255);--smu:rgba(255,255,255,.85);--sac:var(--cz-c-cfe88a,rgb(207,232,138));--sso:rgba(255,255,255,.18);--sln:rgba(255,255,255,.22)}
|
|
167
|
+
|
|
168
|
+
.sl-cv[data-th="report"]{--fs-sl-title:50px}
|