clavarium 0.2.78-beta.1 → 0.2.79-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/npm-shrinkwrap.json +10 -10
- package/package.json +3 -3
- package/server/api.mjs +4 -1
- package/web/app.js +79 -10
- package/web/index.html +1 -1
- package/web/style.css +22 -0
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.79-beta.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "clavarium",
|
|
9
|
-
"version": "0.2.
|
|
9
|
+
"version": "0.2.79-beta.1",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
|
13
13
|
"@xterm/xterm": "^6.0.0",
|
|
14
|
-
"clavarium-binder": "0.1.
|
|
14
|
+
"clavarium-binder": "0.1.33-next.1",
|
|
15
15
|
"clavarium-docket": "0.1.1",
|
|
16
|
-
"clavarium-parley": "0.17.
|
|
16
|
+
"clavarium-parley": "0.17.15-next.1",
|
|
17
17
|
"clavarium-tether": "0.1.0-next.29",
|
|
18
18
|
"mermaid": "11.17.2",
|
|
19
19
|
"node-pty": "^1.1.0",
|
|
@@ -716,9 +716,9 @@
|
|
|
716
716
|
}
|
|
717
717
|
},
|
|
718
718
|
"node_modules/clavarium-binder": {
|
|
719
|
-
"version": "0.1.
|
|
720
|
-
"resolved": "https://registry.npmjs.org/clavarium-binder/-/clavarium-binder-0.1.
|
|
721
|
-
"integrity": "sha512-
|
|
719
|
+
"version": "0.1.33-next.1",
|
|
720
|
+
"resolved": "https://registry.npmjs.org/clavarium-binder/-/clavarium-binder-0.1.33-next.1.tgz",
|
|
721
|
+
"integrity": "sha512-UaUXLF0FFqEkwsXXERPNR+Z6iA8oo5dFBhU/vAp5J1M5x9oGiwvrutq8tsSXPQSf49+uAMzEPqKngFMghYK0ew==",
|
|
722
722
|
"license": "MIT",
|
|
723
723
|
"bin": {
|
|
724
724
|
"binder": "bin/binder.mjs",
|
|
@@ -742,9 +742,9 @@
|
|
|
742
742
|
}
|
|
743
743
|
},
|
|
744
744
|
"node_modules/clavarium-parley": {
|
|
745
|
-
"version": "0.17.
|
|
746
|
-
"resolved": "https://registry.npmjs.org/clavarium-parley/-/clavarium-parley-0.17.
|
|
747
|
-
"integrity": "sha512-
|
|
745
|
+
"version": "0.17.15-next.1",
|
|
746
|
+
"resolved": "https://registry.npmjs.org/clavarium-parley/-/clavarium-parley-0.17.15-next.1.tgz",
|
|
747
|
+
"integrity": "sha512-wep9VPz8CkS6Ce0ERgrDzZfXFtHlC3SpEECrK8YqzaOmICOzy6xbXjaYOANXePmXtWjpp6Ft7JH1h9gkASYP3w==",
|
|
748
748
|
"license": "MIT",
|
|
749
749
|
"bin": {
|
|
750
750
|
"parley": "bin/parley.mjs",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.79-beta.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "A conversation is a VM with a terminal in it. Everything else is a folder.",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@xterm/addon-fit": "^0.11.0",
|
|
46
46
|
"@xterm/xterm": "^6.0.0",
|
|
47
|
-
"clavarium-binder": "0.1.
|
|
47
|
+
"clavarium-binder": "0.1.33-next.1",
|
|
48
48
|
"clavarium-docket": "0.1.1",
|
|
49
|
-
"clavarium-parley": "0.17.
|
|
49
|
+
"clavarium-parley": "0.17.15-next.1",
|
|
50
50
|
"clavarium-tether": "0.1.0-next.29",
|
|
51
51
|
"mermaid": "11.17.2",
|
|
52
52
|
"node-pty": "^1.1.0",
|
package/server/api.mjs
CHANGED
|
@@ -152,6 +152,9 @@ function readBody(request, max = BODY_MAX) {
|
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
/* Returns true when the request was an API request (answered here). */
|
|
155
|
+
/* This run of the server: a page's count of binder changes is of one run, and starts again with the next. */
|
|
156
|
+
const BOOT = Math.random().toString(36).slice(2, 10);
|
|
157
|
+
|
|
155
158
|
export async function handleApi(request, response, conversations, headers, resources, originOk = sameOrigin, shortcuts, voice, sharing, secrets, network, signin, mailboxes, gitReview, platform, answerer, wakeups, alerts, talk, gitAccess, gitKeeper, shelf, health, setup, repair, guide, capacity, updates, instance, certificate, team, reacting, machinesMove, serverLogs, history, events, bundles, wifi, binders, meshcentral, tethers, accounts, groups) {
|
|
156
159
|
const { pathname } = new URL(request.url ?? '/', 'http://local');
|
|
157
160
|
if (!pathname.startsWith('/api/')) return false;
|
|
@@ -300,7 +303,7 @@ export async function handleApi(request, response, conversations, headers, resou
|
|
|
300
303
|
if (pathname === '/api/wifi/scan' && wifi) return send(200, await wifi.scan()), true;
|
|
301
304
|
if (pathname === '/api/meshcentral' && meshcentral) return send(200, await meshcentral.status()), true;
|
|
302
305
|
if (pathname === '/api/operators') return send(200, team ? { operators: team.list(), me: identity } : { local: true }), true;
|
|
303
|
-
if (pathname === '/api/binder/people' && binders) return send(200, { people: binders.people(identity), changes: binders.changes() }), true;
|
|
306
|
+
if (pathname === '/api/binder/people' && binders) return send(200, { people: binders.people(identity), changes: `${BOOT}:${binders.changes()}` }), true;
|
|
304
307
|
if (pathname === '/api/certificate' && certificate) return send(200, await certificate.about({ fresh: query.get('fresh') === '1' })), true;
|
|
305
308
|
/* This server's disk and memory (capacity.mjs): everything for Settings; only whether it is high for the list. */
|
|
306
309
|
if (pathname === '/api/server' && capacity) return send(200, await capacity.about()), true;
|
package/web/app.js
CHANGED
|
@@ -2562,6 +2562,8 @@
|
|
|
2562
2562
|
},
|
|
2563
2563
|
/* A reaction to one of its messages: wherever the chat may be written in. */
|
|
2564
2564
|
...(!DEVICE || deviceParts.chat === 'write' ? { react: (to, reaction) => post(talkPath(name, '/react'), { to, reaction }) } : {}),
|
|
2565
|
+
/* A message attached to a card (#180), from its menu: its id, as the card opens it again. */
|
|
2566
|
+
...(!DEVICE ? { card: (m) => attachToCard({ kind: 'message', ref: m.id, title: String(m.short || m.text || '').replace(/\s+/g, ' ').trim().slice(0, 80) }) } : {}),
|
|
2565
2567
|
/* The buttons of a line of the machine: what this screen may do. */
|
|
2566
2568
|
act: (id) => { if (id === 'seen-done') return; if (id === 'seen') void markSeen(); else if (id === 'memory') void openMemory(); else if (id === 'disk') void openDisk(); else if (id === 'room') seeTerminal(); else if (id === 'restart') void restartMachine(false); else if (id === 'terminal') seeTerminal(); else if (id.startsWith('allow:')) void decideTether(id.slice('allow:'.length), 'yes'); else if (id.startsWith('deny:')) void decideTether(id.slice('deny:'.length), 'no'); else if (id.startsWith('review:')) void openGit(id.slice('review:'.length)); else openCommits(id); },
|
|
2567
2569
|
/* What it opens over the thread (a picture, its media, a search...) is a step of this page's: one Back closes it. */
|
|
@@ -4834,18 +4836,76 @@
|
|
|
4834
4836
|
if (!repo || !rest) return;
|
|
4835
4837
|
void openGit(repo, kind === 'commit' ? { commit: rest } : { branch: rest });
|
|
4836
4838
|
}
|
|
4839
|
+
/* ATTACH TO A CARD (#180): from where a thing is (a file shown, a message of the chat), a card
|
|
4840
|
+
picked among the binders this page may write in -- by its title, typed or scrolled -- and
|
|
4841
|
+
the thing attached to it, as the agent attaches with `binder attach`. */
|
|
4842
|
+
async function attachToCard({ kind, ref, title }) {
|
|
4843
|
+
document.getElementById('attach-pick')?.remove();
|
|
4844
|
+
const box = document.createElement('div'); box.id = 'attach-pick'; box.setAttribute('role', 'dialog'); box.setAttribute('aria-modal', 'true'); box.setAttribute('aria-label', 'Attach to a card');
|
|
4845
|
+
const card = document.createElement('div'); card.className = 'attach-card';
|
|
4846
|
+
const head = document.createElement('div'); head.className = 'row';
|
|
4847
|
+
const h = document.createElement('b'); h.textContent = 'Attach to a card';
|
|
4848
|
+
const sp = document.createElement('span'); sp.className = 'sp';
|
|
4849
|
+
const x = document.createElement('button'); x.type = 'button'; x.textContent = '\u00d7'; x.setAttribute('aria-label', 'Close');
|
|
4850
|
+
head.append(h, sp, x);
|
|
4851
|
+
const what = document.createElement('p'); what.className = 'dim attach-what'; what.textContent = title || ref;
|
|
4852
|
+
const find = document.createElement('input'); find.type = 'search'; find.placeholder = 'Find a card'; find.setAttribute('aria-label', 'Find a card');
|
|
4853
|
+
const list = document.createElement('div'); list.className = 'attach-list';
|
|
4854
|
+
const said = document.createElement('p'); said.className = 'attach-said'; said.hidden = true;
|
|
4855
|
+
card.append(head, what, find, list, said); box.append(card); document.body.append(box);
|
|
4856
|
+
const close = () => { box.remove(); document.removeEventListener('keydown', esc, true); };
|
|
4857
|
+
const esc = (e) => { if (e.key === 'Escape') { e.stopPropagation(); close(); } };
|
|
4858
|
+
document.addEventListener('keydown', esc, true);
|
|
4859
|
+
x.onclick = close; box.addEventListener('pointerdown', (e) => { if (e.target === box) close(); });
|
|
4860
|
+
list.textContent = 'Loading...';
|
|
4861
|
+
/* The cards of every binder this page may change, the conversation's own binder first. */
|
|
4862
|
+
const lists = ((await binderCall('lists', {})).data ?? []).filter((l) => !l.archived && l.access === 'write');
|
|
4863
|
+
const own = (l) => Object.keys(l.grants ?? {}).includes(`conversation:${current}`);
|
|
4864
|
+
lists.sort((a, b) => Number(own(b)) - Number(own(a)));
|
|
4865
|
+
const cards = [];
|
|
4866
|
+
for (const l of lists.slice(0, 12)) { const r = await binderCall('show', { list: l.id }); for (const rec of r.data?.records ?? []) cards.push({ list: l, rec }); }
|
|
4867
|
+
const draw = () => {
|
|
4868
|
+
const q = find.value.trim().toLowerCase();
|
|
4869
|
+
const shown = cards.filter(({ rec, list: l }) => !q || `#${rec.n} ${rec.title} ${l.title}`.toLowerCase().includes(q)).slice(0, 80);
|
|
4870
|
+
list.replaceChildren(...(shown.length ? shown.map(({ rec, list: l }) => {
|
|
4871
|
+
const b = document.createElement('button'); b.type = 'button'; b.className = 'attach-item';
|
|
4872
|
+
const t = document.createElement('span'); t.textContent = `#${rec.n} ${rec.title}`;
|
|
4873
|
+
const w = document.createElement('small'); w.textContent = l.title;
|
|
4874
|
+
b.append(t, w);
|
|
4875
|
+
b.onclick = async () => {
|
|
4876
|
+
for (const o of list.querySelectorAll('button')) o.disabled = true;
|
|
4877
|
+
const r = await binderCall('attach', { id: rec.id, kind, ref, ...(title ? { title } : {}) });
|
|
4878
|
+
said.hidden = false; said.textContent = r.ok ? `Attached to #${rec.n} ${rec.title}.` : (r.text || 'Not attached.');
|
|
4879
|
+
said.classList.toggle('bad', !r.ok);
|
|
4880
|
+
if (r.ok) setTimeout(close, 1400); else for (const o of list.querySelectorAll('button')) o.disabled = false;
|
|
4881
|
+
};
|
|
4882
|
+
return b;
|
|
4883
|
+
}) : [Object.assign(document.createElement('p'), { className: 'dim', textContent: cards.length ? 'No card by that name.' : 'No binder you can write in.' })]));
|
|
4884
|
+
};
|
|
4885
|
+
find.addEventListener('input', draw);
|
|
4886
|
+
draw();
|
|
4887
|
+
find.focus();
|
|
4888
|
+
}
|
|
4889
|
+
/* Read again every screen of a binder when the binders changed. Taken as seen only once every
|
|
4890
|
+
screen read it again: one that failed (the server restarting) is read again at the next turn. */
|
|
4891
|
+
async function catchUpBinders() {
|
|
4892
|
+
const now = await getJson('/binder/people', null);
|
|
4893
|
+
if (!now) return;
|
|
4894
|
+
binderPeople = now.people;
|
|
4895
|
+
if (now.changes === binderChanges) return;
|
|
4896
|
+
const read = await Promise.all([...binderViews].map((one) => Promise.resolve(one.view.refresh()).then((ok) => ok !== false, () => false)));
|
|
4897
|
+
if (read.every(Boolean)) binderChanges = now.changes;
|
|
4898
|
+
}
|
|
4837
4899
|
function watchBinders() {
|
|
4838
4900
|
if (binderTimer) return;
|
|
4839
|
-
binderTimer = setInterval(
|
|
4901
|
+
binderTimer = setInterval(() => {
|
|
4840
4902
|
for (const one of binderViews) if (!one.box?.isConnected) { one.view.destroy(); binderViews.delete(one); }
|
|
4841
4903
|
if (binderViews.size === 0) { clearInterval(binderTimer); binderTimer = null; return; }
|
|
4842
|
-
if (document.hidden)
|
|
4843
|
-
const now = await getJson('/binder/people', null);
|
|
4844
|
-
if (!now) return;
|
|
4845
|
-
binderPeople = now.people;
|
|
4846
|
-
if (now.changes !== binderChanges) { binderChanges = now.changes; for (const one of binderViews) void one.view.refresh(); }
|
|
4904
|
+
if (!document.hidden) void catchUpBinders();
|
|
4847
4905
|
}, 4000);
|
|
4848
4906
|
}
|
|
4907
|
+
/* Back on the page (a tablet woken, a tab shown again): looked at at once, not 4 s later. */
|
|
4908
|
+
document.addEventListener('visibilitychange', () => { if (!document.hidden && binderViews.size) void catchUpBinders(); });
|
|
4849
4909
|
/* WHERE A BINDER IS, IN THIS PAGE'S BACK: a card (or a binder's settings) is one step over
|
|
4850
4910
|
its list; Back, Escape and its "‹" close it, and the list is there again. Another binder
|
|
4851
4911
|
picked takes no step. `viewOf()`: the screen shown now (it may be drawn again).
|
|
@@ -7225,6 +7285,7 @@
|
|
|
7225
7285
|
/* The file is shown in a WINDOW over the screen, wherever it was asked
|
|
7226
7286
|
from: closing it leaves the terminal, or the list, as it was. */
|
|
7227
7287
|
function closePreview() {
|
|
7288
|
+
if ($('viewer').classList.contains('viewer-full')) { $('viewer').classList.remove('viewer-full'); $('preview-full').setAttribute('aria-pressed', 'false'); try { if (document.fullscreenElement === $('viewer')) document.exitFullscreen?.(); } catch { /* already out */ } }
|
|
7228
7289
|
if (shownUrl) { URL.revokeObjectURL(shownUrl); shownUrl = null; }
|
|
7229
7290
|
for (const url of mdUrls) URL.revokeObjectURL(url);
|
|
7230
7291
|
mdUrls.clear();
|
|
@@ -7254,12 +7315,14 @@
|
|
|
7254
7315
|
const can = what && (what.text !== undefined || (what.picture && pictures));
|
|
7255
7316
|
button.hidden = !can;
|
|
7256
7317
|
copyLabel = what?.picture ? 'Copy image' : 'Copy';
|
|
7257
|
-
|
|
7318
|
+
/* An icon: its word is its name (hover, long press, reader); "Copied" shows a moment as a tick of colour. */
|
|
7319
|
+
const word = (w) => { button.title = w; button.setAttribute('aria-label', w); if (w === 'Copied') button.dataset.done = 'true'; else delete button.dataset.done; };
|
|
7320
|
+
word(copyLabel);
|
|
7258
7321
|
button.onclick = !can ? null : () => {
|
|
7259
7322
|
const done = (ok, why) => {
|
|
7260
|
-
|
|
7323
|
+
word(ok ? 'Copied' : copyLabel);
|
|
7261
7324
|
if (!ok && why) { $('preview-note').textContent = why; $('preview-note').hidden = false; }
|
|
7262
|
-
if (ok) setTimeout(() => { if (button.
|
|
7325
|
+
if (ok) setTimeout(() => { if (button.dataset.done) word(copyLabel); }, 1800);
|
|
7263
7326
|
};
|
|
7264
7327
|
if (what.text !== undefined) {
|
|
7265
7328
|
const fallback = () => { const at = select?.(); done(false, at ? 'The browser did not let this page copy: the text is selected, copy it yourself (Ctrl+C, or a long press).' : 'The browser did not let this page copy.'); };
|
|
@@ -7438,7 +7501,7 @@
|
|
|
7438
7501
|
/* From the terminal, a way to the folder it sits in. */
|
|
7439
7502
|
/* From the terminal or the chat, a way to the folder it sits in: the Assets tab, on it (Files, on a device). */
|
|
7440
7503
|
$('preview-where').hidden = Boolean(from) || (!$('files').hidden && !$('files').classList.contains('embedded')) || noTerminal() || (!DEVICE && assetsShown);
|
|
7441
|
-
|
|
7504
|
+
{ const word = DEVICE ? 'Show in Files' : 'Show in Assets'; $('preview-where').title = word; $('preview-where').setAttribute('aria-label', word); }
|
|
7442
7505
|
$('preview-where').onclick = async () => {
|
|
7443
7506
|
closePreview();
|
|
7444
7507
|
const folder = inner.split('/').slice(0, -1).join('/');
|
|
@@ -7456,6 +7519,12 @@
|
|
|
7456
7519
|
/* Text in a folder this conversation may write in: editable here. */
|
|
7457
7520
|
$('preview-edit').hidden = Boolean(from) || !editable(name, size) || !canWrite(tab);
|
|
7458
7521
|
$('preview-edit').onclick = () => { void editFile(tab, inner, name); };
|
|
7522
|
+
/* A file of the shared folders: attached to a card from here (#180). */
|
|
7523
|
+
$('preview-attach').hidden = Boolean(from) || DEVICE;
|
|
7524
|
+
/* Full screen: the file takes the whole screen (the real API where granted, else a cover); kept while it is open. */
|
|
7525
|
+
const full = (on) => { $('viewer').classList.toggle('viewer-full', on); $('preview-full').setAttribute('aria-pressed', String(on)); const w2 = on ? 'Leave full screen' : 'Full screen'; $('preview-full').title = w2; $('preview-full').setAttribute('aria-label', w2); try { if (on) $('viewer').requestFullscreen?.().catch(() => {}); else if (document.fullscreenElement === $('viewer')) document.exitFullscreen?.(); } catch { /* the cover stands in */ } };
|
|
7526
|
+
$('preview-full').onclick = () => full(!$('viewer').classList.contains('viewer-full'));
|
|
7527
|
+
$('preview-attach').onclick = () => void attachToCard({ kind: 'file', ref: tab === 'work' ? `/work/${inner}` : `/resources/${tab}/${inner}`, title: name });
|
|
7459
7528
|
/* A file read from the machine's disk says so, whatever else is said. */
|
|
7460
7529
|
const origin = from ? 'Read from the disk of the machine: this file is not kept here, and goes with the machine.' : '';
|
|
7461
7530
|
const note = (text) => { const all = [text, text === 'Loading...' ? '' : origin].filter(Boolean).join(' '); $('preview-note').textContent = all; $('preview-note').hidden = !all; };
|
package/web/index.html
CHANGED
|
@@ -1071,7 +1071,7 @@
|
|
|
1071
1071
|
<!-- A file, shown over whatever is on the screen; closing it leaves you where you were. -->
|
|
1072
1072
|
<div id="viewer" role="dialog" aria-modal="true" aria-labelledby="preview-name" hidden>
|
|
1073
1073
|
<div id="viewer-card">
|
|
1074
|
-
<div class="row"><b id="preview-name"></b><span class="sp"></span><button type="button" id="preview-where" hidden
|
|
1074
|
+
<div class="row"><b id="preview-name"></b><span class="sp"></span><button type="button" id="preview-where" class="ico" hidden title="Show in Assets" aria-label="Show in Assets"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 2 2 7l10 5 10-5-10-5z"/><path d="M2 17l10 5 10-5M2 12l10 5 10-5"/></svg></button><button type="button" id="preview-attach" class="ico" hidden title="Attach to a card" aria-label="Attach to a card"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"/></svg></button><button type="button" id="preview-edit" class="ico" hidden title="Edit" aria-label="Edit"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 20h9"/><path d="M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z"/></svg></button><button type="button" id="preview-copy" class="ico" hidden title="Copy" aria-label="Copy"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="9" y="9" width="11" height="11" rx="2"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/></svg></button><button type="button" id="preview-full" class="ico" title="Full screen" aria-label="Full screen" aria-pressed="false"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 3H5a2 2 0 0 0-2 2v3M21 8V5a2 2 0 0 0-2-2h-3M3 16v3a2 2 0 0 0 2 2h3M16 21h3a2 2 0 0 0 2-2v-3"/></svg></button><a id="preview-download" class="button ico primary" title="Download" aria-label="Download"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 3v12M7 11l5 5 5-5"/><path d="M5 21h14"/></svg></a><button type="button" id="preview-close" aria-label="Close" title="Close">×</button></div>
|
|
1075
1075
|
<p id="preview-note" class="hint" hidden></p>
|
|
1076
1076
|
<div id="preview-body"></div>
|
|
1077
1077
|
</div>
|
package/web/style.css
CHANGED
|
@@ -1876,3 +1876,25 @@ details.commit > pre { margin: 6px 0 0 1.6em; white-space: pre-wrap; overflow-wr
|
|
|
1876
1876
|
}
|
|
1877
1877
|
/* The review on a light screen: line numbers and the "changed" tag readable (diff2html's own greys are too pale). */
|
|
1878
1878
|
:root[data-theme="light"] .rv-diff { --d2h-dim-color: #5d6b7a; --d2h-change-label-color: #8a5d00; }
|
|
1879
|
+
|
|
1880
|
+
/* Attach to a card (#180): a card picked by its title, over whatever is shown. */
|
|
1881
|
+
#attach-pick { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-start; justify-content: center; padding: max(6vh, env(safe-area-inset-top)) 12px 12px; background: rgba(8, 11, 15, 0.55); }
|
|
1882
|
+
#attach-pick .attach-card { display: flex; flex-direction: column; gap: 8px; width: min(520px, 100%); max-height: 80vh; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; box-shadow: 0 18px 50px -12px rgba(0, 0, 0, .5); }
|
|
1883
|
+
#attach-pick .row { display: flex; align-items: center; gap: 8px; }
|
|
1884
|
+
#attach-pick .sp { flex: 1; }
|
|
1885
|
+
#attach-pick .attach-what { margin: 0; overflow-wrap: anywhere; }
|
|
1886
|
+
#attach-pick .attach-list { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; min-height: 0; }
|
|
1887
|
+
#attach-pick .attach-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; width: 100%; }
|
|
1888
|
+
#attach-pick .attach-item small { color: var(--dim); }
|
|
1889
|
+
#attach-pick .attach-said { margin: 0; font-weight: 600; }
|
|
1890
|
+
#attach-pick .attach-said.bad { color: var(--bad, #c0392b); }
|
|
1891
|
+
|
|
1892
|
+
/* The file viewer's buttons are icons (#89): each says its name on hover, a long press, a reader;
|
|
1893
|
+
Download stands out. Full screen: the file takes the whole screen. */
|
|
1894
|
+
#viewer .ico { display: inline-flex; align-items: center; justify-content: center; width: 38px; min-width: 38px; height: 34px; padding: 0; }
|
|
1895
|
+
#viewer .ico svg { width: 18px; height: 18px; }
|
|
1896
|
+
#viewer .ico.primary { background: var(--brass); border-color: var(--brass); color: var(--on-brass); }
|
|
1897
|
+
#viewer #preview-copy[data-done="true"] { color: var(--ok); border-color: currentColor; }
|
|
1898
|
+
#viewer #preview-full[aria-pressed="true"] { border-color: var(--brass); }
|
|
1899
|
+
#viewer.viewer-full { padding: 0; }
|
|
1900
|
+
#viewer.viewer-full #viewer-card { width: 100%; max-width: none; border-radius: 0; border: 0; padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
|