create-pmos 0.397.0 → 0.399.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/state/discoveries.md +1 -1
- package/payload/state/log.md +1 -1
- package/workspace/briefing-premium-adddoc-test.js +105 -52
- package/workspace/briefing-premium-board-test.js +284 -128
- package/workspace/briefing-premium-calendar-2-test.js +135 -198
- package/workspace/briefing-premium-calendar-3-test.js +143 -418
- package/workspace/briefing-premium-calendar-test.js +85 -196
- package/workspace/briefing-premium-doc-edit-test.js +99 -83
- package/workspace/briefing-premium-initiative-test.js +175 -290
- package/workspace/briefing-premium-insights-test.js +414 -219
- package/workspace/briefing-premium-metrics-test.js +55 -97
- package/workspace/briefing-premium-products-test.js +44 -28
- package/workspace/briefing-premium-sources-test.js +70 -49
- package/workspace/briefing-premium-test.js +155 -648
- package/workspace/briefing-premium-work-test.js +88 -283
- package/workspace/changelog.json +24 -0
- package/workspace/ev-everywhere-test.js +210 -0
- package/workspace/fixtures/board-premium-trail.js +32 -0
- package/workspace/fixtures/premium-viewer-fixtures.js +187 -0
- package/workspace/guide/briefing-premium.md +3 -1
- package/workspace/guide/home.md +68 -0
- package/workspace/guide/index.md +1 -0
- package/workspace/lib/agent-roles.js +71 -0
- package/workspace/lib/board-grill.js +63 -0
- package/workspace/lib/board-premium.js +121 -24
- package/workspace/lib/board-trail.js +223 -0
- package/workspace/lib/home-work-item.js +58 -0
- package/workspace/lib/initiative-layout.js +77 -0
- package/workspace/lib/insights-goals.js +196 -0
- package/workspace/lib/insights-premium.js +64 -15
- package/workspace/lib/insights-records.js +115 -0
- package/workspace/lib/jira-tickets.js +1 -1
- package/workspace/lib/meeting-points.js +52 -0
- package/workspace/lib/news-for-you.js +88 -0
- package/workspace/lib/notes-series.js +29 -6
- package/workspace/lib/report-confirm.js +48 -0
- package/workspace/lib/route-modules.js +12 -0
- package/workspace/lib/routes-board-docs.js +46 -0
- package/workspace/lib/routes-board-grill.js +90 -0
- package/workspace/lib/routes-board-trail.js +33 -0
- package/workspace/lib/routes-home-desk.js +176 -0
- package/workspace/lib/routes-home-review.js +108 -0
- package/workspace/lib/routes-initiative-layout.js +57 -0
- package/workspace/lib/routes-insights-premium.js +16 -4
- package/workspace/lib/routes-insights-records.js +133 -0
- package/workspace/lib/routes-meeting-points.js +37 -0
- package/workspace/lib/routes-news.js +57 -0
- package/workspace/lib/routes-notes.js +3 -1
- package/workspace/lib/routes-report-confirm.js +31 -0
- package/workspace/lib/routes-search.js +38 -0
- package/workspace/lib/routes-viewer.js +108 -0
- package/workspace/lib/search-index.js +176 -0
- package/workspace/lib/transcript-steps.js +123 -0
- 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-board-actions-test.js +128 -82
- package/workspace/premium-briefing-depth-test.js +104 -90
- package/workspace/premium-chat-attach-test.js +54 -63
- package/workspace/premium-chat-chart-tab-test.js +37 -37
- package/workspace/premium-chat-context-test.js +19 -18
- package/workspace/premium-chat-goal-view-test.js +23 -23
- package/workspace/premium-chat-notes-test.js +26 -31
- package/workspace/premium-chat-report-tab-test.js +46 -28
- package/workspace/premium-chat-term-test.js +16 -16
- package/workspace/premium-chat-viewer-test.js +60 -59
- package/workspace/premium-core-doc-issue-test.js +52 -43
- package/workspace/premium-html-viewer-test.js +14 -17
- package/workspace/premium-phone-card-test.js +10 -3
- package/workspace/premium-phone-room-test.js +41 -35
- package/workspace/premium-report-read-test.js +152 -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 -33
- package/workspace/premium-vw-cal-test.js +97 -128
- package/workspace/premium-vw-copy-test.js +17 -33
- package/workspace/premium-vw-doc-test.js +17 -10
- package/workspace/premium-vw-item-test.js +50 -49
- package/workspace/premium-vw-jira-test.js +53 -27
- package/workspace/premium-vw-meet-test.js +115 -187
- package/workspace/premium-vw-notes-test.js +88 -109
- package/workspace/premium-vw-rec-test.js +71 -194
- package/workspace/premium-vw-slides-test.js +46 -50
- package/workspace/premium-welcome-test.js +3 -2
- package/workspace/premium-work-depth-test.js +61 -53
- package/workspace/public/pm/bd-acts.js +383 -0
- package/workspace/public/pm/bd-asks.js +261 -0
- package/workspace/public/pm/bd-pop.js +59 -0
- package/workspace/public/pm/bd-span.js +222 -82
- package/workspace/public/pm/bd-stages.js +25 -11
- package/workspace/public/pm/bd-views.js +169 -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 +798 -230
- package/workspace/public/pm/cozy-ev.css +228 -0
- package/workspace/public/pm/cozy-evmodel.js +106 -0
- package/workspace/public/pm/cozy-evui.js +47 -0
- package/workspace/public/pm/cozy-home.css +570 -142
- package/workspace/public/pm/cozy-home.js +5 -3
- package/workspace/public/pm/cozy-insights.css +437 -170
- package/workspace/public/pm/cozy-md.js +396 -0
- package/workspace/public/pm/cozy-nav.js +104 -29
- package/workspace/public/pm/cozy-news.js +140 -0
- package/workspace/public/pm/cozy-placeholder.js +26 -0
- package/workspace/public/pm/cozy-search.js +203 -0
- package/workspace/public/pm/cozy-settings.js +198 -0
- package/workspace/public/pm/cozy-sources.js +89 -0
- package/workspace/public/pm/cozy-today.css +217 -0
- package/workspace/public/pm/cozy-viewer.css +3 -3
- package/workspace/public/pm/cozy-viewer.js +145 -0
- package/workspace/public/pm/cozy-vw-mtg.css +350 -0
- package/workspace/public/pm/cozy-vw-rp.css +152 -0
- package/workspace/public/pm/cozy-vw.css +485 -0
- package/workspace/public/pm/cozy.css +83 -1
- package/workspace/public/pm/home-adddoc.js +48 -0
- package/workspace/public/pm/home-app.js +1179 -0
- package/workspace/public/pm/home-around.js +413 -0
- package/workspace/public/pm/home-chat.js +512 -0
- package/workspace/public/pm/home-data.js +312 -0
- package/workspace/public/pm/home-dictate.js +54 -0
- package/workspace/public/pm/home-draft.js +68 -0
- package/workspace/public/pm/home-ini-model.js +190 -0
- package/workspace/public/pm/home-ini.css +171 -0
- package/workspace/public/pm/home-ini.js +456 -0
- package/workspace/public/pm/home-list.js +276 -0
- package/workspace/public/pm/home-more.js +132 -0
- package/workspace/public/pm/home-phone-card.js +109 -0
- package/workspace/public/pm/home-review.js +104 -0
- package/workspace/public/pm/home-task.js +67 -0
- package/workspace/public/pm/home-today.js +144 -0
- package/workspace/public/pm/home-work.js +547 -0
- 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 +548 -395
- package/workspace/public/pm/premium-chart-tab.js +109 -62
- package/workspace/public/pm/premium-deck.js +3 -3
- package/workspace/public/pm/premium-first.js +23 -21
- package/workspace/public/pm/premium-insights.js +1102 -581
- package/workspace/public/pm/premium-meeting.js +61 -549
- package/workspace/public/pm/premium-mtg-present.js +138 -0
- package/workspace/public/pm/premium-mtg-replay.js +142 -0
- 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 +669 -476
- package/workspace/public/pm/premium-report-tab.js +116 -67
- package/workspace/public/pm/premium-shell.js +76 -123
- package/workspace/public/pm/premium-viewer.js +22 -1
- package/workspace/public/pm/premium-vw-cal.js +277 -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-meet.js +6 -83
- package/workspace/public/pm/premium-vw-mtg.js +958 -0
- package/workspace/public/pm/premium-vw-notes.js +116 -68
- 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 -218
- package/workspace/public/pm/premium-vw-slides.css +5 -0
- package/workspace/public/pm/premium-vw-slides.js +44 -8
- package/workspace/public/pm/rp-parts.js +269 -0
- package/workspace/public/pm/term-view.js +22 -0
- package/workspace/public/premium-board.html +29 -70
- package/workspace/public/premium-initiative.html +8 -48
- package/workspace/public/premium-insights.html +26 -64
- package/workspace/public/premium-viewer.html +20 -0
- package/workspace/public/premium.html +18 -107
- package/workspace/r/m1.png +0 -0
- package/workspace/r/m2.png +0 -0
- package/workspace/r/m3.png +0 -0
- package/workspace/r/nl.png +0 -0
- package/workspace/server.js +18 -3
- package/workspace/test-files.json +1 -0
- package/workspace/test-lists/home-libs.json +9 -0
- package/workspace/test-lists/initiative-layout.json +9 -0
- package/workspace/test-lists/premium-report-read.json +1 -1
- package/workspace/test-lists/premium-uncovered-meetings.json +9 -0
- package/workspace/test-lists/premium-uncovered-reports.json +9 -0
- package/workspace/test-lists/premium-vw-agreed.json +9 -0
- package/workspace/test-lists/premium-vw-notes.json +1 -1
- package/workspace/test-lists/uf-everywhere.json +15 -0
- package/workspace/test-lists/uf-home.json +9 -0
- package/workspace/test-lists/uncovered-board.json +9 -0
- package/workspace/public/pm/premium-work.js +0 -729
- package/workspace/public/pm/premium.js +0 -1146
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/* pm/cozy-sources.js — Sources, in the Viewer (initiative premium-uncovered-features, E3; canvas EvSources).
|
|
2
|
+
*
|
|
3
|
+
* What PMOS reads, and how old each reading is (GET /api/sources). The source furthest behind leads in an amber box that names what may be
|
|
4
|
+
* out of date, with Read again. Then the table: each source, when it was last read, and Read again for one that is old, failed or never
|
|
5
|
+
* read (POST /api/sources/refresh), or Connect for one that is off (Settings › Connectors). Read all again reads every source and then
|
|
6
|
+
* writes Home's list from those reads (POST /api/sources/refresh-all). The read lines say which reads Home shows. Every press is the PM's
|
|
7
|
+
* (pmPost carries the launch nonce); PMOS reads these sources and never posts to them.
|
|
8
|
+
* openSources() → the body element */
|
|
9
|
+
import { pmGet, pmPost } from './http.js';
|
|
10
|
+
import { open as vwOpen, current as vwCurrent } from './cozy-viewer.js';
|
|
11
|
+
import { esc, svg, ICON, toast, wsParam, wsQ, skelRows, cantRead } from './cozy-evui.js';
|
|
12
|
+
import { sourceRows, staleOf, partsOf } from './cozy-evmodel.js';
|
|
13
|
+
|
|
14
|
+
const TILE = { repository: ICON.repo, initiatives: ICON.flag, calendar: ICON.cal, jira: ICON.jira, 'my-work': ICON.check, tracker: ICON.board, tools: ICON.tools };
|
|
15
|
+
const two = (n) => String(n).padStart(2, '0');
|
|
16
|
+
const hm = (d) => two(d.getHours()) + ':' + two(d.getMinutes());
|
|
17
|
+
const M = { r: null, at: null, busy: '', note: {}, body: null };
|
|
18
|
+
|
|
19
|
+
/** The read line of each part of Home (briefing-source-flow slice 5), from one GET /api/sources answer; home-more.js readLine words. */
|
|
20
|
+
function readsHtml(s) {
|
|
21
|
+
return import('./home-more.js').then((H) => {
|
|
22
|
+
const L = [['Today', H.readLine(s, ['calendar'])], ['Needs you', H.readLine(s, ['initiatives', 'my-work', 'd:brief'])]].filter((x) => x[1]);
|
|
23
|
+
return L.map(([k, v]) => `<p class="ev-small ev-mut ev-reads" data-reads="${esc(k)}"><b>${esc(k)}:</b> ${esc(v)}</p>`).join('');
|
|
24
|
+
}).catch(() => '');
|
|
25
|
+
}
|
|
26
|
+
async function draw() {
|
|
27
|
+
const b = M.body; if (!b || !b.isConnected) return;
|
|
28
|
+
{ const c = vwCurrent(); if (!c || c.id !== 'sources') return; } // the Viewer moved on to another item: a late read draws nothing
|
|
29
|
+
const s = M.r;
|
|
30
|
+
const head = `<div><h2 class="ev-h2">Sources</h2><p class="ev-sub">What PMOS reads, and how old each reading is. All real data${M.at ? ', as of ' + hm(M.at) : ''}.</p></div>`;
|
|
31
|
+
if (!s) { b.innerHTML = head + skelRows(4); return; }
|
|
32
|
+
if (!s.ok) { b.innerHTML = head + cantRead({ what: 'The sources', why: s.error || '', sources: false }); return; }
|
|
33
|
+
const st = staleOf(s.sources);
|
|
34
|
+
const warn = st ? `<div class="ev-warn ev-line" id="srcWarn"><i class="ev-dot risk" aria-hidden="true"></i><p class="ev-grow"><b>${esc(st.state === 'stale' ? st.name + ' was last read ' + st.ago + '.' : st.text + '.')}</b> ${esc(partsOf(st.id))} may be out of date.</p><button type="button" class="ev-btn sm" data-ev-read="${esc(st.id)}"${M.busy ? ' disabled' : ''}>${svg(ICON.refresh, 16)}Read again</button></div>` : '';
|
|
35
|
+
// the background line (harness-health): quiet when all is well, a box when something needs a look
|
|
36
|
+
const hl = s.health && s.health.level;
|
|
37
|
+
const health = !s.health ? '' : hl === 'warn' || hl === 'bad'
|
|
38
|
+
? `<div class="ev-box ev-small ev-line" id="srcHealth" data-level="${esc(hl)}" role="status"><i class="ev-dot risk" aria-hidden="true"></i><p class="ev-grow"><b>${esc(s.health.line)}</b>${(s.health.issues || []).slice(1, 4).map((i) => `<br>${esc(i.text)}`).join('')}</p></div>`
|
|
39
|
+
: `<p class="ev-small ev-mut ev-line" id="srcHealth" data-level="ok"><i class="ev-dot ok" aria-hidden="true"></i>${esc(s.health.line || '')}</p>`;
|
|
40
|
+
const rows = sourceRows(s.sources).map((x) => {
|
|
41
|
+
const name = x.id === 'repository' ? (s.ws || 'This product') + ' · main' : x.sub;
|
|
42
|
+
const act = x.act === 'read' ? `<button type="button" class="ev-btn sm soft" data-ev-read="${esc(x.id)}" aria-label="Read ${esc(x.name)} again"${M.busy ? ' disabled' : ''}>Read again</button>`
|
|
43
|
+
: x.act === 'connect' ? `<button type="button" class="ev-btn sm" data-ev-connect="${esc(x.id)}">Connect</button>` : '';
|
|
44
|
+
return `<div class="ev-trow" data-src="${esc(x.id)}"><span class="ev-tile" aria-hidden="true">${svg(TILE[x.id] || ICON.sources, 16)}</span><div class="ev-tx"><b>${esc(x.name)}</b><p class="ev-small ev-mut">${esc(name)}</p>${M.note[x.id] ? `<p class="ev-small" role="status">${esc(M.note[x.id])}</p>` : ''}</div><span class="ev-w-140 ev-small ${x.risk ? 'ev-late' : 'ev-mut'}">${esc(x.when)}</span><span class="ev-w-96">${act}</span></div>`;
|
|
45
|
+
}).join('');
|
|
46
|
+
const all = s.all && !s.all.done;
|
|
47
|
+
b.innerHTML = head + warn + health
|
|
48
|
+
+ `<div><div class="ev-th"><span class="ev-grow">Source</span><span class="ev-w-140">Last read</span><span class="ev-w-96"></span></div>${rows}</div>`
|
|
49
|
+
+ `<div class="ev-acts"><button type="button" class="ev-btn sm" data-ev-all${M.busy || all ? ' disabled' : ''}>${svg(ICON.refresh, 16)}${all ? 'Reading every source' : 'Read all again'}</button></div>`
|
|
50
|
+
+ '<div id="srcReads"></div>'
|
|
51
|
+
+ '<p class="ev-small ev-mut">PMOS reads these sources and never posts to them. To send anything, you press Send.</p>';
|
|
52
|
+
const reads = await readsHtml(s);
|
|
53
|
+
const box = b.querySelector('#srcReads'); if (box) box.innerHTML = reads;
|
|
54
|
+
}
|
|
55
|
+
async function read() {
|
|
56
|
+
M.r = await pmGet('/api/sources' + wsQ());
|
|
57
|
+
if (!M.r || M.r.ok === false) M.r = { ok: false, error: (M.r && M.r.error) || 'the server did not answer' };
|
|
58
|
+
M.at = new Date();
|
|
59
|
+
draw();
|
|
60
|
+
if (M.r.ok) window.dispatchEvent(new CustomEvent('pm:sources', { detail: M.r }));
|
|
61
|
+
}
|
|
62
|
+
export function openSources() {
|
|
63
|
+
M.r = null; M.note = {};
|
|
64
|
+
M.body = vwOpen({ id: 'sources', kind: 'What PMOS reads', title: 'Sources', icon: 'source', render: (b) => { b.classList.add('ev-card-b', 'ev-src'); M.body = b; draw(); } });
|
|
65
|
+
M.body.onclick = async (e) => {
|
|
66
|
+
const t = e.target.closest('button'); if (!t || M.busy) return;
|
|
67
|
+
if ('evRetry' in t.dataset) { M.r = null; draw(); read(); return; }
|
|
68
|
+
if (t.dataset.evConnect) { import('./cozy-settings.js').then((S) => S.openSettings('connectors')); return; }
|
|
69
|
+
const ws = (M.r && M.r.ws) || wsParam() || '';
|
|
70
|
+
if ('evAll' in t.dataset) {
|
|
71
|
+
M.busy = 'all'; draw();
|
|
72
|
+
const r = await pmPost('/api/sources/refresh-all', { ws });
|
|
73
|
+
M.busy = '';
|
|
74
|
+
toast(r && r.ok ? (r.joined ? 'Every source is already being read.' : 'Reading every source, then Home\'s list.') : 'Read all again did not start: ' + ((r && r.error) || 'the server did not answer') + '.');
|
|
75
|
+
await read(); setTimeout(read, 4000); return;
|
|
76
|
+
}
|
|
77
|
+
if (t.dataset.evRead) {
|
|
78
|
+
const id = t.dataset.evRead;
|
|
79
|
+
M.busy = id; draw();
|
|
80
|
+
const r = await pmPost('/api/sources/refresh', { ws, source: id });
|
|
81
|
+
M.busy = '';
|
|
82
|
+
M.note[id] = r && r.ok ? (r.started === 'session' ? 'An agent session started to read it, with your own connection.' : 'Reading it again on this machine.') : 'It did not start: ' + ((r && r.error) || 'the server did not answer') + '.';
|
|
83
|
+
toast(r && r.ok ? 'Reading again.' : M.note[id]);
|
|
84
|
+
await read(); setTimeout(read, 4000);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
read();
|
|
88
|
+
return M.body;
|
|
89
|
+
}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
/* pm/cozy-today.css — Home's one list, the Today card, the products picker, the task and the review in the Viewer, the decision card in
|
|
2
|
+
* the chat and the mic (initiative premium-uncovered-features, H1 and H2; canvas HmMyWork, HmReview, HmProducts, HmMic, HmDay, HmDecide,
|
|
3
|
+
* HmPhone, HmPhone2). Token vars only (cozy.css :root holds every raw value). Loaded after cozy-home.css, so a rule here may narrow one there.
|
|
4
|
+
* Motion only for info, warning and critical (cozy.css .cz-dot.m-*): nothing here animates. */
|
|
5
|
+
|
|
6
|
+
/* ── the list head ── */
|
|
7
|
+
body.cz-home .hm-hd { padding: 2px 6px 6px 10px; gap: 6px; }
|
|
8
|
+
body.cz-home .hm-hd h1 { font-size: 16px; font-weight: 800; color: var(--cz-ink); margin-right: auto; }
|
|
9
|
+
.hm-pk { height: 30px; font-size: 13px; font-weight: 700; color: var(--cz-ink2); background: var(--cz-card); }
|
|
10
|
+
.hm-pk svg, .ut-ib svg, .hm-tg svg, .ut-btn svg, .hm-tch svg, .hm-cap svg, .ut-mic svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
|
|
11
|
+
.ut-ib { width: 32px; height: 32px; border-radius: 999px; border: 0; padding: 0; background: none; color: var(--cz-ink2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; font-family: var(--cz-sans); }
|
|
12
|
+
.ut-ib.lg { width: 40px; height: 40px; }
|
|
13
|
+
.ut-ib.solid { background: var(--cz-ink); color: var(--cz-card); }
|
|
14
|
+
.ut-ib.solid svg.fill, .ut-ib svg.fill { fill: currentColor; stroke: none; }
|
|
15
|
+
.ut-ib.on { background: var(--cz-bluebg); color: var(--cz-blueink); }
|
|
16
|
+
.ut-ib.pri { width: 44px; height: 44px; background: var(--cz-solid); color: var(--cz-onsolid); }
|
|
17
|
+
@media (hover: hover) { .ut-ib:hover { background: var(--cz-well); } .ut-ib.solid:hover { background: var(--cz-ink); } .ut-ib.pri:hover { background: var(--cz-solid); } }
|
|
18
|
+
|
|
19
|
+
/* ── buttons, boxes and fields the canvas draws ── */
|
|
20
|
+
.ut-btn { height: 36px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-family: var(--cz-sans); font-size: 13.5px; font-weight: 700; border: 1px solid var(--cz-hair); background: var(--cz-card); color: var(--cz-ink); white-space: nowrap; cursor: pointer; text-decoration: none; box-sizing: border-box; }
|
|
21
|
+
.ut-btn.pri { background: var(--cz-solid); border-color: transparent; color: var(--cz-onsolid); }
|
|
22
|
+
.ut-btn.dark { background: var(--cz-ink); border-color: transparent; color: var(--cz-card); }
|
|
23
|
+
.ut-btn.soft { background: var(--cz-well); border-color: transparent; }
|
|
24
|
+
.ut-btn.ghost { border-color: transparent; background: transparent; color: var(--cz-ink2); }
|
|
25
|
+
.ut-btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
|
|
26
|
+
.ut-btn:disabled { opacity: .5; cursor: not-allowed; }
|
|
27
|
+
.ut-lbl { margin: 0; font-size: 12px; font-weight: 800; color: var(--cz-ink3); }
|
|
28
|
+
.ut-h2 { margin: 0; font-size: 18px; font-weight: 800; color: var(--cz-ink); }
|
|
29
|
+
.ut-sub { margin: 0; font-size: 13px; color: var(--cz-ink3); }
|
|
30
|
+
.ut-small { font-size: 12.5px; }
|
|
31
|
+
.ut-mut { color: var(--cz-ink3); }
|
|
32
|
+
.ut-bl { color: var(--cz-blueink); }
|
|
33
|
+
.ut-box { background: var(--cz-well); border-radius: 16px; padding: 12px 14px; font-size: 12.5px; color: var(--cz-ink); }
|
|
34
|
+
.ut-card { background: var(--cz-card); border-radius: 16px; border: 1px solid var(--cz-hair); padding: 12px 14px; }
|
|
35
|
+
.ut-need { background: var(--cz-bluebg); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
|
|
36
|
+
.ut-chk { width: 18px; height: 18px; border-radius: 6px; box-shadow: inset 0 0 0 2px var(--cz-c-c5c9d0); flex: none; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }
|
|
37
|
+
.ut-chk.on { background: var(--cz-ink); box-shadow: none; color: var(--cz-card); }
|
|
38
|
+
.ut-chk svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
|
|
39
|
+
.ut-field { display: flex; flex-direction: column; gap: 6px; }
|
|
40
|
+
.ut-field > span, .ut-field > label { font-size: 12.5px; font-weight: 800; color: var(--cz-ink2); }
|
|
41
|
+
.ut-field em { font-style: normal; font-weight: 600; color: var(--cz-ink3); }
|
|
42
|
+
.ut-field textarea, .ut-field input { font: inherit; font-family: var(--cz-sans); font-size: 14px; color: var(--cz-ink); border: 0; outline: 0; border-radius: 14px; background: var(--cz-well); padding: 10px 14px; min-height: 72px; resize: vertical; box-sizing: border-box; width: 100%; }
|
|
43
|
+
.ut-field input { min-height: 42px; }
|
|
44
|
+
.ut-field textarea:focus-visible, .ut-field input:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
|
|
45
|
+
.ut-radio { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--cz-hair); width: 100%; background: var(--cz-card); color: var(--cz-ink); text-align: left; cursor: pointer; font: inherit; font-family: var(--cz-sans); font-size: 14px; box-sizing: border-box; }
|
|
46
|
+
.ut-radio .o { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--cz-c-c5c9d0); flex: none; margin-top: 1px; box-sizing: border-box; }
|
|
47
|
+
.ut-radio[aria-checked="true"] { border-color: var(--cz-blue); box-shadow: 0 0 0 3px var(--cz-bluebg); }
|
|
48
|
+
.ut-radio[aria-checked="true"] .o { box-shadow: inset 0 0 0 5px var(--cz-blue); }
|
|
49
|
+
.ut-radio b { font-weight: 700; }
|
|
50
|
+
.ut-radio small { display: block; font-size: 12.5px; color: var(--cz-ink3); }
|
|
51
|
+
.ut-trow { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--cz-hair); font-size: 13.5px; color: var(--cz-ink); }
|
|
52
|
+
.ut-trow:last-child { border-bottom: 0; }
|
|
53
|
+
.ut-trow > span { flex: 1; min-width: 0; }
|
|
54
|
+
.ut-trow svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; color: var(--cz-ink2); }
|
|
55
|
+
.ut-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
|
|
56
|
+
.ut-acts .sp { margin-left: auto; }
|
|
57
|
+
.ut-rec { width: 10px; height: 10px; border-radius: 50%; background: var(--cz-dot-red); flex: none; display: inline-block; }
|
|
58
|
+
.ut-rec.b { background: var(--cz-blue); }
|
|
59
|
+
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
60
|
+
|
|
61
|
+
/* ── the Today card ── */
|
|
62
|
+
.hm-tc { box-sizing: border-box; width: 100%; display: flex; flex-direction: column; gap: 2px; margin: 0 0 6px; padding: 12px 14px; border-radius: 18px; border: 0; background: var(--cz-card); color: var(--cz-ink); text-align: left; font: inherit; font-family: var(--cz-sans); box-shadow: 0 1px 2px var(--cz-hair); }
|
|
63
|
+
button.hm-tc { cursor: pointer; }
|
|
64
|
+
.hm-tc .big { display: block; font-size: 15px; font-weight: 800; }
|
|
65
|
+
.hm-tc .sub { margin: 0; font-size: 13px; color: var(--cz-ink3); }
|
|
66
|
+
.hm-tc.soon, .hm-tc.live { gap: 8px; }
|
|
67
|
+
.hm-tc.eod { gap: 10px; }
|
|
68
|
+
.hm-tc.rec { flex-direction: row; align-items: center; gap: 10px; }
|
|
69
|
+
.hm-tc.rec > div { flex: 1; min-width: 0; }
|
|
70
|
+
.hm-tc.rec p { margin: 0; font-size: 12.5px; color: var(--cz-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
71
|
+
.hm-tch { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; }
|
|
72
|
+
.hm-tch > b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
73
|
+
.hm-tch > .r { margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--cz-blueink); white-space: nowrap; }
|
|
74
|
+
.hm-tch > .r.q { color: var(--cz-ink3); font-weight: 600; }
|
|
75
|
+
.hm-tch svg { color: var(--cz-blueink); width: 18px; height: 18px; }
|
|
76
|
+
.hm-tch .ut-ib { margin-right: -6px; }
|
|
77
|
+
.hm-tc .ut-acts { gap: 6px; }
|
|
78
|
+
.hm-load { display: flex; gap: 2px; height: 6px; margin-top: 10px; }
|
|
79
|
+
.hm-load i { flex: var(--bd-f, 1); border-radius: 3px; background: var(--cz-c-eceae6); }
|
|
80
|
+
.hm-load i.m { background: var(--cz-c-b6c6dc); }
|
|
81
|
+
.hm-load i.n { background: var(--cz-blue); }
|
|
82
|
+
.hm-lx { display: flex; justify-content: space-between; margin-top: 4px; font-size: 12.5px; color: var(--cz-ink3); }
|
|
83
|
+
.hm-eodl { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
|
|
84
|
+
.hm-eodl span { display: flex; gap: 8px; }
|
|
85
|
+
.hm-eodl b { width: 74px; flex: none; }
|
|
86
|
+
.hm-tc.clear { font-size: 13px; color: var(--cz-ink2); }
|
|
87
|
+
|
|
88
|
+
/* ── the filters ── */
|
|
89
|
+
.hm-flt { display: flex; gap: 4px; padding: 2px 4px; flex-wrap: wrap; margin: 0 0 4px; }
|
|
90
|
+
.hm-flt .cz-chip { font-weight: 600; }
|
|
91
|
+
|
|
92
|
+
/* ── a product group and its rows (canvas .ghd and .lrow) ── */
|
|
93
|
+
.hm-pg { margin: 0; }
|
|
94
|
+
.hm-ghd { display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 10px 4px 8px; font-size: 13px; font-weight: 800; color: var(--cz-ink2); border: 0; background: none; text-align: left; font-family: var(--cz-sans); box-sizing: border-box; }
|
|
95
|
+
button.hm-ghd { cursor: pointer; }
|
|
96
|
+
.hm-ghd svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
|
|
97
|
+
.hm-ghd .n, .hm-gn { margin-left: auto; font-weight: 700; color: var(--cz-ink3); font-size: 12px; }
|
|
98
|
+
.hm-ghr2 { display: flex; align-items: center; }
|
|
99
|
+
.hm-ghr2 .hm-ghd { flex: 1; min-width: 0; }
|
|
100
|
+
.hm-gn { border: 0; background: none; padding: 10px 10px 4px 4px; cursor: pointer; font-family: var(--cz-sans); white-space: nowrap; }
|
|
101
|
+
body.cz-home .hm-r.lr { min-height: 0; margin: 0; border-radius: 16px; gap: 0; }
|
|
102
|
+
body.cz-home .hm-r.lr .hm-rm { min-height: 48px; padding: 8px 10px; gap: 10px; border-radius: 16px; }
|
|
103
|
+
body.cz-home .hm-r.lr.kid { margin: 0; }
|
|
104
|
+
body.cz-home .hm-r.lr.kid .hm-rm { min-height: 44px; padding: 6px 10px; }
|
|
105
|
+
body.cz-home .hm-r.lr .hm-tile { width: 32px; height: 32px; }
|
|
106
|
+
.hm-r.lr .hm-rt { flex: 1; gap: 1px; }
|
|
107
|
+
.hm-r.lr .hm-rt em { font-size: 12.5px; }
|
|
108
|
+
.hm-r.lr .hm-rt em.q, .hm-r.lr.st-quiet .hm-rt em, .hm-r.lr.st-wait .hm-rt em { color: var(--cz-ink3); }
|
|
109
|
+
.hm-r.lr.task .hm-rt b, .hm-r.lr.item .hm-rt b { font-weight: 600; }
|
|
110
|
+
.hm-r.lr.st-wait .hm-rt b { color: var(--cz-ink2); }
|
|
111
|
+
.hm-rr { font-size: 12px; font-weight: 700; color: var(--cz-blueink); white-space: nowrap; flex: none; }
|
|
112
|
+
.hm-rr.q { color: var(--cz-ink3); font-weight: 600; }
|
|
113
|
+
.hm-tg { flex: none; width: 32px; height: 32px; margin-left: 10px; margin-right: -4px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--cz-hair); background: var(--cz-card); color: var(--cz-ink2); cursor: pointer; padding: 0; z-index: 1; }
|
|
114
|
+
.hm-r.lr.ini .hm-rm { padding-left: 14px; }
|
|
115
|
+
.hm-ck { flex: none; width: 32px; height: 32px; margin: 0 -10px 0 4px; display: grid; place-items: center; border: 0; background: none; padding: 0; cursor: pointer; border-radius: 10px; z-index: 1; }
|
|
116
|
+
.hm-ck.wait { cursor: default; }
|
|
117
|
+
.hm-ck.wait i { width: 7px; height: 7px; border-radius: 50%; background: var(--cz-c-c5c9d0); }
|
|
118
|
+
.hm-r.lr.done .hm-rt b { color: var(--cz-ink3); text-decoration: line-through; }
|
|
119
|
+
.hm-nest { margin: 0 0 4px 26px; padding-left: 8px; border-left: 2px solid var(--cz-hair); }
|
|
120
|
+
.hm-r.lr.sel { background: var(--cz-card); box-shadow: 0 6px 18px -10px var(--cz-c-9da3ac); }
|
|
121
|
+
@media (hover: hover) { body.cz-home .hm-r.lr:hover { background: var(--cz-well2); } body.cz-home .hm-r.lr.sel:hover { background: var(--cz-card); } .hm-tg:hover { background: var(--cz-well); } }
|
|
122
|
+
.hm-r.lr .hm-x { width: 32px; height: 32px; }
|
|
123
|
+
.hm-tile.wk { box-shadow: none; background: var(--cz-well2); }
|
|
124
|
+
.hm-more2 { display: block; margin: 2px 0 4px 10px; height: 32px; border: 0; background: none; font-size: 12px; font-weight: 700; color: var(--cz-ink3); cursor: pointer; padding: 0 2px; font-family: var(--cz-sans); }
|
|
125
|
+
|
|
126
|
+
/* ── the capture box and the untouched row ── */
|
|
127
|
+
.hm-cap { display: flex; align-items: center; gap: 8px; margin: 6px 4px 2px; height: 40px; border-radius: 14px; background: var(--cz-card); padding: 0 6px 0 12px; border: 1px solid var(--cz-hair); }
|
|
128
|
+
.hm-cap input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-family: var(--cz-sans); font-size: 13px; color: var(--cz-ink); }
|
|
129
|
+
.hm-cap input::placeholder { color: var(--cz-ink3); }
|
|
130
|
+
.hm-cap.on { box-shadow: 0 0 0 2px var(--cz-bluebg); }
|
|
131
|
+
.hm-un { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 10px; min-height: 36px; border: 0; background: none; border-radius: 16px; cursor: pointer; font-family: var(--cz-sans); text-align: left; }
|
|
132
|
+
.hm-un b { flex: 1; font-size: 12.5px; font-weight: 700; color: var(--cz-ink3); }
|
|
133
|
+
.hm-un span { font-size: 12px; font-weight: 600; color: var(--cz-ink3); }
|
|
134
|
+
.hm-all { display: none; }
|
|
135
|
+
|
|
136
|
+
/* ── the small menus: the products picker and Later (home-app.js menu()) ── */
|
|
137
|
+
.hm-menu .ut-mi { flex-direction: row; align-items: center; gap: 10px; min-height: 40px; }
|
|
138
|
+
.hm-menu .ut-mi.tall { min-height: 52px; }
|
|
139
|
+
.hm-menu .ut-mi > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
|
|
140
|
+
.hm-menu .ut-mi .k { margin-left: auto; font-size: 12px; color: var(--cz-ink3); font-weight: 600; flex: none; }
|
|
141
|
+
.hm-menu .ut-mi svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; color: var(--cz-ink2); flex: none; }
|
|
142
|
+
.hm-menu .ut-it { width: 28px; height: 28px; border-radius: 9px; background: var(--cz-well2); color: var(--cz-ink2); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; flex: none; }
|
|
143
|
+
.hm-menu .ut-it.p { background: var(--cz-bluebg); color: var(--cz-blueink); }
|
|
144
|
+
.hm-menu .ut-hr { height: 1px; background: var(--cz-hair); margin: 4px 0; flex: none; }
|
|
145
|
+
|
|
146
|
+
/* ── the task in the Viewer (HmMyWork) and the weekly review (HmReview) ── */
|
|
147
|
+
.ut-vc { display: flex; flex-direction: column; gap: 14px; padding: 4px 2px; min-height: 100%; box-sizing: border-box; }
|
|
148
|
+
.cz-vw-body:not(.hx) > .ut-vc { padding: 16px 20px 24px; }
|
|
149
|
+
.ut-ib svg.dots { stroke-width: 3.2; }
|
|
150
|
+
.ut-btn.ghost svg { width: 16px; height: 16px; }
|
|
151
|
+
.ut-vh { display: flex; align-items: flex-start; gap: 10px; }
|
|
152
|
+
.ut-vh > div { flex: 1; min-width: 0; }
|
|
153
|
+
.ut-vh .ut-chk, .ut-vh .hm-ck { margin-top: 4px; }
|
|
154
|
+
.ut-vh .hm-ck { margin: 2px 0 0 -7px; }
|
|
155
|
+
.ut-chips { display: flex; gap: 6px; flex-wrap: wrap; }
|
|
156
|
+
.ut-foot { display: flex; gap: 8px; margin-top: auto; flex-wrap: wrap; }
|
|
157
|
+
.ut-steps { display: flex; flex-direction: column; gap: 8px; }
|
|
158
|
+
.ut-step { display: flex; align-items: center; gap: 10px; border-radius: 16px; padding: 12px 14px; border: 1px solid var(--cz-hair); background: transparent; width: 100%; box-sizing: border-box; font: inherit; font-family: var(--cz-sans); color: var(--cz-ink); text-align: left; }
|
|
159
|
+
.ut-step > b { flex: 1; }
|
|
160
|
+
.ut-step.later { border-style: dashed; border-color: var(--cz-c-c5c9d0); }
|
|
161
|
+
.ut-step.later > b { color: var(--cz-ink3); }
|
|
162
|
+
.ut-step.now { flex-direction: column; align-items: stretch; background: var(--cz-card); border-color: var(--cz-blue); }
|
|
163
|
+
.ut-step.now > .h { display: flex; align-items: center; gap: 10px; }
|
|
164
|
+
.ut-step.now > .h > b { flex: 1; }
|
|
165
|
+
.ut-step .pill { flex: none; }
|
|
166
|
+
.ut-tabs { align-self: flex-start; }
|
|
167
|
+
|
|
168
|
+
/* ── the decision card in the chat (HmDecide) and Return a run in the Viewer ── */
|
|
169
|
+
.ut-dec { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; padding: 16px; max-width: 620px; }
|
|
170
|
+
.ut-dec .ut-acts { flex-wrap: nowrap; }
|
|
171
|
+
.ut-dec .ut-acts .sp { font-size: 12.5px; color: var(--cz-ink3); flex: 1 1 120px; min-width: 0; text-align: right; }
|
|
172
|
+
.ut-dec [role="status"]:empty, .ut-vc [role="status"]:empty { display: none; }
|
|
173
|
+
.hm-chat .hm-icard { margin-top: 2px; }
|
|
174
|
+
.ut-later { position: relative; }
|
|
175
|
+
|
|
176
|
+
/* ── the mic in the composer (HmMic) and the phone's Speak to Claude sheet ── */
|
|
177
|
+
.ut-mic { flex: none; width: 32px; height: 32px; border-radius: 999px; border: 0; padding: 0; background: none; color: var(--cz-blueink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
|
|
178
|
+
.ut-mic svg { width: 18px; height: 18px; }
|
|
179
|
+
.ut-mic.on { background: var(--cz-bluebg); }
|
|
180
|
+
.ut-mic.on svg { width: 12px; height: 12px; fill: currentColor; stroke: none; }
|
|
181
|
+
.hm-chat .ut-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--cz-blueink); }
|
|
182
|
+
.hm-chat .hm-box.ut-on, .hm-chat .hm-basic.ut-on { box-shadow: 0 0 0 2px var(--cz-bluebg); }
|
|
183
|
+
.ut-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; background: var(--cz-card); border-radius: 28px 28px 0 0; box-shadow: var(--cz-sheet); padding: 10px 16px calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
|
|
184
|
+
.ut-sheet[hidden] { display: none; }
|
|
185
|
+
.ut-sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--cz-c-c5c9d0); align-self: center; margin-bottom: 4px; }
|
|
186
|
+
.ut-sheet h3 { margin: 0; font-size: 16px; font-weight: 800; }
|
|
187
|
+
.ut-sheet .bar { display: flex; align-items: center; gap: 10px; height: 56px; border-radius: 999px; background: var(--cz-bluebg); color: var(--cz-blueink); padding: 0 6px 0 16px; }
|
|
188
|
+
.ut-sheet .bar .sp { flex: 1; }
|
|
189
|
+
|
|
190
|
+
/* ── a phone: the list is the page (HmPhone); a conversation opens over it with a back bar (HmPhone2) ── */
|
|
191
|
+
@media (max-width: 760px) {
|
|
192
|
+
body.cz-home.hm-plist .hm-top { display: none; }
|
|
193
|
+
body.cz-home.hm-plist .hm-list { display: flex; position: static; width: auto; background: none; padding: 22px 0 96px; border-radius: 0; box-shadow: none; border: 0; }
|
|
194
|
+
body.cz-home.hm-plist .hm-lsc { margin: 0; padding: 0; overflow: visible; }
|
|
195
|
+
body.cz-home.hm-plist .hm-chat, body.cz-home.hm-plist:not(.hm-vw-open) .hm-vw { display: none; }
|
|
196
|
+
body.cz-home.hm-plist .cz-fabw { bottom: 24px; }
|
|
197
|
+
body.cz-home .hm-needs, body.cz-home #hmMoreP { display: none; }
|
|
198
|
+
body.cz-home .hm-top .hm-back { display: grid; }
|
|
199
|
+
body.cz-home .hm-top { background: var(--cz-card); padding: 8px 12px 4px 8px; }
|
|
200
|
+
body.cz-home:not(.hm-plist) { background: var(--cz-card); }
|
|
201
|
+
.hm-flt .dk, .hm-un { display: none; }
|
|
202
|
+
.hm-all { display: flex; }
|
|
203
|
+
body.cz-home .hm-r.lr .hm-rm, body.cz-home .hm-r.lr.kid .hm-rm { min-height: 48px; }
|
|
204
|
+
.hm-tc .ut-btn, .ut-dec .ut-btn, .ut-vc .ut-btn { height: 44px; }
|
|
205
|
+
.hm-tc.eod .ut-acts .ut-btn { flex: 1; justify-content: center; }
|
|
206
|
+
.ut-ib, .hm-tg, .hm-ck, .ut-mic { min-width: 44px; min-height: 44px; }
|
|
207
|
+
.ut-vc .ut-tabs button, .ut-vc .ut-chips .cz-chip { min-height: 44px; }
|
|
208
|
+
.hm-tg { margin-left: 6px; }
|
|
209
|
+
.hm-cap { height: 48px; }
|
|
210
|
+
.hm-cap input { font-size: 16px; }
|
|
211
|
+
.ut-field textarea, .ut-field input { font-size: 16px; }
|
|
212
|
+
.ut-dec { padding: 0; border: 0; box-shadow: none; background: none; }
|
|
213
|
+
.ut-dec .ut-acts .sp { display: none; }
|
|
214
|
+
.ut-dec .ut-acts .ut-btn.pri { flex: 1; justify-content: center; height: 48px; }
|
|
215
|
+
.ut-dec .ut-acts .ut-btn { height: 48px; }
|
|
216
|
+
}
|
|
217
|
+
.hm-top .hm-back { display: none; }
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* this file does the same for the dialog, its Viewer tabs, its menus and the toast, so every view (doc, slides, Jira, meeting, notes,
|
|
5
5
|
* calendar, report) takes the cozy look from the tokens it already reads. Motion: only the cz-dot levels move (cozy.css). */
|
|
6
6
|
|
|
7
|
-
.cz .dlg, .cz .veil, .cz .toast, .cz .vmenu, .cz .crmenu, .cz .tbmenu, .cz .czi-tok {
|
|
7
|
+
.cz .dlg, .cz .veil, .cz .toast, .cz .vmenu, .cz .crmenu, .cz .tbmenu, .cz .czi-tok, .cz .cz-vw { /* .cz-vw: the Home Viewer (cozy-viewer.js), whose views read the same tokens */
|
|
8
8
|
--sans: 'Nunito', ui-sans-serif, system-ui, sans-serif;
|
|
9
9
|
--ink: var(--cz-c-2a2e35); --ink-2: var(--cz-c-4a4f58); --ink-3: var(--cz-c-646a74);
|
|
10
10
|
--card: var(--cz-c-ffffff); --card-solid: var(--cz-c-ffffff); --well: var(--cz-c-f4f3f0); --hair: rgba(42,46,53,.1);
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
font-family: var(--sans);
|
|
18
18
|
}
|
|
19
19
|
:root[data-theme="dark"] .cz .dlg, :root[data-theme="dark"] .cz .veil, :root[data-theme="dark"] .cz .toast, :root[data-theme="dark"] .cz .vmenu,
|
|
20
|
-
:root[data-theme="dark"] .cz .crmenu, :root[data-theme="dark"] .cz .tbmenu, :root[data-theme="dark"] .cz .czi-tok {
|
|
20
|
+
:root[data-theme="dark"] .cz .crmenu, :root[data-theme="dark"] .cz .tbmenu, :root[data-theme="dark"] .cz .czi-tok, :root[data-theme="dark"] .cz .cz-vw {
|
|
21
21
|
--ink: var(--cz-c-eceef1); --ink-2: var(--cz-c-c5c9d0); --ink-3: var(--cz-c-9ea4ad); --card: var(--cz-c-24262b); --card-solid: var(--cz-c-24262b); --well: var(--cz-c-1b1d21); --hair: rgba(236,238,241,.1);
|
|
22
22
|
--ember: var(--cz-c-6aaaf0); --ember-ink: var(--cz-c-9bc7f4); --solid: var(--cz-c-6aaaf0); --on-solid: var(--cz-c-17191c); --spot: rgba(106,170,240,.14);
|
|
23
23
|
--ok: var(--cz-c-7fc79a); --bad: var(--cz-c-f2948c); --warn: var(--cz-c-e8c27a); --warn-bg: rgba(212,161,58,.14); --ok-bg: rgba(94,156,106,.16); --live: var(--cz-c-f2a27a); --live-bg: rgba(217,119,63,.16);
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
}
|
|
26
26
|
@media (prefers-color-scheme: dark) {
|
|
27
27
|
:root:not([data-theme="light"]) .cz .dlg, :root:not([data-theme="light"]) .cz .veil, :root:not([data-theme="light"]) .cz .toast, :root:not([data-theme="light"]) .cz .vmenu,
|
|
28
|
-
:root:not([data-theme="light"]) .cz .crmenu, :root:not([data-theme="light"]) .cz .tbmenu, :root:not([data-theme="light"]) .cz .czi-tok {
|
|
28
|
+
:root:not([data-theme="light"]) .cz .crmenu, :root:not([data-theme="light"]) .cz .tbmenu, :root:not([data-theme="light"]) .cz .czi-tok, :root:not([data-theme="light"]) .cz .cz-vw {
|
|
29
29
|
--ink: var(--cz-c-eceef1); --ink-2: var(--cz-c-c5c9d0); --ink-3: var(--cz-c-9ea4ad); --card: var(--cz-c-24262b); --card-solid: var(--cz-c-24262b); --well: var(--cz-c-1b1d21); --hair: rgba(236,238,241,.1);
|
|
30
30
|
--ember: var(--cz-c-6aaaf0); --ember-ink: var(--cz-c-9bc7f4); --solid: var(--cz-c-6aaaf0); --on-solid: var(--cz-c-17191c); --spot: rgba(106,170,240,.14);
|
|
31
31
|
--ok: var(--cz-c-7fc79a); --bad: var(--cz-c-f2948c); --warn: var(--cz-c-e8c27a); --warn-bg: rgba(212,161,58,.14); --ok-bg: rgba(94,156,106,.16); --live: var(--cz-c-f2a27a); --live-bg: rgba(217,119,63,.16);
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/* pm/cozy-viewer.js — the Viewer of the Agreed design (initiative premium-agreed-design; Main.dc.html section.viewer, M:897-913).
|
|
2
|
+
*
|
|
3
|
+
* One card shows one item at a time. Opening another item replaces the one shown: there is no strip of tabs, no grey label band,
|
|
4
|
+
* no conversation pane and no Detail / Conversation switch. The header is the design's: a 34px icon tile, the kind (12px), the title
|
|
5
|
+
* (15px/700), "Open in a new tab" and Close, with a hairline under them.
|
|
6
|
+
* Desktop: the card is at most 500px wide. A page that has a place for it marks that element with data-cz-viewer-host, and the card
|
|
7
|
+
* goes in it as a flex column beside the chat or the page. With no host, the card floats at the right of the window.
|
|
8
|
+
* Phone (760px or less): the card covers the whole screen.
|
|
9
|
+
*
|
|
10
|
+
* The API (also on window.czViewer, for scripts that do not import modules):
|
|
11
|
+
* open({ kind, title, icon?, url?, render?(body), html?, id?, onClose? }) → the body element the content goes in
|
|
12
|
+
* kind the small line over the title, for example "Meeting notes", "Report", "Settings"
|
|
13
|
+
* title the item's name
|
|
14
|
+
* icon a key of ICONS below (doc, cal, notes, meet, report, chart, jira, goal, gear, source, info, list, mic, slides) or an SVG path "M…"
|
|
15
|
+
* url the item's own address; with none, "Open in a new tab" is drawn disabled and says "Not available yet"
|
|
16
|
+
* full true: the report panel's header (ReportPanel.dc.html): the kind over a 16px title, and "Open full" (expand arrows) in place of
|
|
17
|
+
* "Open in a new tab", hidden on a phone, where only Close shows
|
|
18
|
+
* render called with the body element to draw into; html is the same as a string. Neither: the body is left empty for the caller.
|
|
19
|
+
* id optional; current() returns it, so a caller can tell whether its item is the one shown
|
|
20
|
+
* onClose called once when this item leaves the card (Close, Escape, close(), or another open())
|
|
21
|
+
* close() · isOpen() · current() → { id, kind, title, url } | null · body() → the body element or null
|
|
22
|
+
* placeholder(featureName, { kind?, icon? }) opens the card with czPlaceholder(featureName) in it (cozy-placeholder.js)
|
|
23
|
+
* onChange(fn) → fn({ open, id, kind, title }) after each open and close; document also gets the event 'cz-viewer' with the same detail.
|
|
24
|
+
* The look is in cozy.css (.cz-vw…). The old #dlg path (premium-viewer.js) is separate and keeps working until its callers move here. */
|
|
25
|
+
import { czPlaceholder } from './cozy-placeholder.js';
|
|
26
|
+
|
|
27
|
+
export const ICONS = {
|
|
28
|
+
doc: 'M6 3h9l4 4v14H6zM14 3v5h5M9 12h7M9 16h5',
|
|
29
|
+
notes: 'M6 3h9l4 4v14H6zM14 3v5h5M9 12h7M9 16h5',
|
|
30
|
+
cal: 'M3.5 5h17v15h-17zM3.5 10h17M8 3v4M16 3v4',
|
|
31
|
+
meet: 'M3.5 5h17v15h-17zM3.5 10h17M8 3v4M16 3v4',
|
|
32
|
+
report: 'M4 20V10M10 20V4M16 20v-8M22 20H2',
|
|
33
|
+
chart: 'M4 20V10M10 20V4M16 20v-8M22 20H2',
|
|
34
|
+
slides: 'M3 5h18v12H3zM8 21h8M12 17v4',
|
|
35
|
+
jira: 'M4 4h16v16H4zM8.5 12.5l2.5 2.5 4.5-5',
|
|
36
|
+
list: 'M8 6h12M8 12h12M8 18h12M4 6h.01M4 12h.01M4 18h.01',
|
|
37
|
+
mic: 'M9 3h6v11H9zM5 11a7 7 0 0 0 14 0M12 18v3',
|
|
38
|
+
goal: 'M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8',
|
|
39
|
+
gear: 'M12 9a3 3 0 1 0 0 6a3 3 0 1 0 0-6M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9l2.1 2.1M16.9 16.9l2.1 2.1M4.9 19.1l2.1-2.1M16.9 7.1l2.1-2.1',
|
|
40
|
+
source: 'M12 3c4.4 0 8 1.3 8 3s-3.6 3-8 3-8-1.3-8-3 3.6-3 8-3M4 6v6c0 1.7 3.6 3 8 3s8-1.3 8-3V6M4 12v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6',
|
|
41
|
+
info: 'M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18M12 11v5M12 8h.01',
|
|
42
|
+
export: 'M12 4v11M7 10l5 5 5-5M5 20h14',
|
|
43
|
+
};
|
|
44
|
+
const OPEN_NEW = 'M14 4h6v6M20 4l-9 9M18 14v6H4V6h6';
|
|
45
|
+
const OPEN_FULL = 'M14 4h6v6M20 4l-7 7M10 20H4v-6M4 20l7-7';
|
|
46
|
+
const CLOSE = 'M6 6l12 12M18 6L6 18';
|
|
47
|
+
export const PHONE = 760;
|
|
48
|
+
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' }[c]));
|
|
49
|
+
const path = (icon) => (/^M/.test(icon || '') ? icon : ICONS[icon] || ICONS.doc);
|
|
50
|
+
const svg = (d, w) => `<svg aria-hidden="true" width="${w}" height="${w}" viewBox="0 0 24 24"><path d="${esc(d)}"/></svg>`;
|
|
51
|
+
|
|
52
|
+
const V = { el: null, cur: null, back: null, subs: [] };
|
|
53
|
+
|
|
54
|
+
/** The header's markup for one item; pure, so a unit test can read it. */
|
|
55
|
+
export function headHtml(it) {
|
|
56
|
+
const o = it || {};
|
|
57
|
+
const nm = o.full ? 'Open full' : 'Open in a new tab', ico = o.full ? OPEN_FULL : OPEN_NEW, cls = o.full ? 'cz-vw-ib cz-vw-wide' : 'cz-vw-ib';
|
|
58
|
+
const tab = o.url
|
|
59
|
+
? `<button type="button" class="${cls}" data-cz-vw="tab" aria-label="${nm}" title="${nm}">${svg(ico, 16)}</button>`
|
|
60
|
+
: `<button type="button" class="${cls}" data-cz-vw="tab" aria-label="${nm}. Not available yet" title="Not available yet" disabled>${svg(ico, 16)}</button>`;
|
|
61
|
+
return `<span class="cz-vw-tile" aria-hidden="true">${svg(path(o.icon), 18)}</span>`
|
|
62
|
+
+ `<div class="cz-vw-t${o.full ? ' cz-vw-t2' : ''}"><p class="cz-vw-kind">${esc(o.kind || '')}</p><h3 class="cz-vw-title" id="czVwTitle">${esc(o.title || '')}</h3></div>`
|
|
63
|
+
+ tab
|
|
64
|
+
+ `<button type="button" class="cz-vw-ib" data-cz-vw="close" aria-label="Close the viewer" title="Close the viewer">${svg(CLOSE, 16)}</button>`;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function mount() {
|
|
68
|
+
if (V.el && V.el.isConnected) return V.el;
|
|
69
|
+
const el = document.createElement('section');
|
|
70
|
+
el.className = 'cz-vw'; el.id = 'czViewer'; el.hidden = true;
|
|
71
|
+
el.setAttribute('aria-labelledby', 'czVwTitle'); el.tabIndex = -1;
|
|
72
|
+
el.innerHTML = '<header class="cz-vw-hd"></header><div class="cz-vw-body"></div>';
|
|
73
|
+
el.addEventListener('click', (e) => { // delegated to the header's two buttons
|
|
74
|
+
const b = e.target.closest('[data-cz-vw]'); if (!b || b.disabled) return;
|
|
75
|
+
if (b.dataset.czVw === 'close') close();
|
|
76
|
+
else if (V.cur && V.cur.url) window.open(V.cur.url, '_blank', 'noopener');
|
|
77
|
+
});
|
|
78
|
+
place(el);
|
|
79
|
+
V.el = el;
|
|
80
|
+
return el;
|
|
81
|
+
}
|
|
82
|
+
/** In the page's own place for it when there is one (data-cz-viewer-host), else at the end of the body, floating. */
|
|
83
|
+
function place(el) {
|
|
84
|
+
const host = document.querySelector('[data-cz-viewer-host]');
|
|
85
|
+
if (host) { if (el.parentNode !== host) host.appendChild(el); el.classList.remove('cz-vw-float'); }
|
|
86
|
+
else { if (el.parentNode !== document.body) document.body.appendChild(el); el.classList.add('cz-vw-float'); }
|
|
87
|
+
}
|
|
88
|
+
function emit() {
|
|
89
|
+
const d = { open: !!V.cur, id: V.cur ? V.cur.id : null, kind: V.cur ? V.cur.kind : null, title: V.cur ? V.cur.title : null };
|
|
90
|
+
document.body.classList.toggle('cz-vw-on', d.open);
|
|
91
|
+
V.subs.forEach((f) => { try { f(d); } catch { /* a listener's fault stays its own */ } });
|
|
92
|
+
document.dispatchEvent(new CustomEvent('cz-viewer', { detail: d }));
|
|
93
|
+
}
|
|
94
|
+
function leave() {
|
|
95
|
+
const was = V.cur; V.cur = null;
|
|
96
|
+
if (was && typeof was.onClose === 'function') { try { was.onClose(); } catch { /* the caller's own fault */ } }
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** Show one item in the Viewer, in place of the one shown. Returns the body element the content is in. */
|
|
100
|
+
export function open(it) {
|
|
101
|
+
const o = it || {};
|
|
102
|
+
const el = mount(); place(el);
|
|
103
|
+
if (!V.cur) { const ae = document.activeElement; V.back = ae && ae !== document.body && !el.contains(ae) ? ae : null; }
|
|
104
|
+
leave();
|
|
105
|
+
V.cur = { id: o.id == null ? null : String(o.id), kind: o.kind || '', title: o.title || '', url: o.url || '', onClose: o.onClose };
|
|
106
|
+
el.setAttribute('aria-label', 'Viewer: ' + (o.kind || o.title || 'item'));
|
|
107
|
+
el.querySelector('.cz-vw-hd').innerHTML = headHtml(o);
|
|
108
|
+
const body = el.querySelector('.cz-vw-body');
|
|
109
|
+
body.innerHTML = ''; body.scrollTop = 0;
|
|
110
|
+
body.className = 'cz-vw-body'; body.onclick = null; body.oninput = null; body.onchange = null; body.onkeydown = null; // what one item's render added to the body does not reach the next
|
|
111
|
+
if (typeof o.render === 'function') o.render(body); else if (o.html) body.innerHTML = o.html;
|
|
112
|
+
el.hidden = false;
|
|
113
|
+
emit();
|
|
114
|
+
if (innerWidth <= PHONE) el.focus();
|
|
115
|
+
return body;
|
|
116
|
+
}
|
|
117
|
+
/** Close the Viewer. Focus goes back to what had it before the Viewer opened. */
|
|
118
|
+
export function close() {
|
|
119
|
+
if (!V.el || V.el.hidden) return;
|
|
120
|
+
leave();
|
|
121
|
+
V.el.hidden = true;
|
|
122
|
+
V.el.querySelector('.cz-vw-body').innerHTML = '';
|
|
123
|
+
emit();
|
|
124
|
+
const b = V.back; V.back = null;
|
|
125
|
+
if (b && b.isConnected) { try { b.focus(); } catch { /* gone */ } }
|
|
126
|
+
}
|
|
127
|
+
export const isOpen = () => !!(V.el && !V.el.hidden && V.cur);
|
|
128
|
+
export const current = () => (V.cur ? { id: V.cur.id, kind: V.cur.kind, title: V.cur.title, url: V.cur.url } : null);
|
|
129
|
+
export const body = () => (isOpen() ? V.el.querySelector('.cz-vw-body') : null);
|
|
130
|
+
export function onChange(fn) { if (typeof fn === 'function') V.subs.push(fn); }
|
|
131
|
+
/** Open the Viewer on a feature the design does not draw yet. */
|
|
132
|
+
export function placeholder(featureName, o = {}) {
|
|
133
|
+
return open({ id: 'placeholder:' + featureName, kind: o.kind || featureName, title: featureName, icon: o.icon || 'info', render: (el) => czPlaceholder(el, featureName) });
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (typeof window !== 'undefined' && typeof window.addEventListener === 'function') {
|
|
137
|
+
// Escape closes the Viewer first, unless a layer over it (a menu, a confirm) is open: that layer closes first. The listener is on
|
|
138
|
+
// window in the capture phase and is added before premium-shell.js adds its own, so the old dialog does not also close on the same key.
|
|
139
|
+
window.addEventListener('keydown', (e) => {
|
|
140
|
+
if (e.key !== 'Escape' || !isOpen() || e.defaultPrevented) return;
|
|
141
|
+
if (document.querySelector('[data-esc-layer]')) return;
|
|
142
|
+
e.preventDefault(); e.stopImmediatePropagation(); close();
|
|
143
|
+
}, true);
|
|
144
|
+
}
|
|
145
|
+
if (typeof window !== 'undefined') window.czViewer = { open, close, isOpen, current, body, onChange, placeholder, ICONS };
|