clavarium 0.2.293-next.1 → 0.2.295-next.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 +2 -2
- package/package.json +1 -1
- package/web/app.js +32 -11
- package/web/style.css +17 -3
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.295-next.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.295-next.1",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/package.json
CHANGED
package/web/app.js
CHANGED
|
@@ -406,13 +406,26 @@
|
|
|
406
406
|
/* ---------- the list of conversations, folded away or not ---------- */
|
|
407
407
|
/* One click hides it and the terminal takes the room; one click brings
|
|
408
408
|
it back. Kept on this device. */
|
|
409
|
-
/*
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
409
|
+
/* THE TOP BAR, ONE COMPONENT (03-11): every page has the conversation's bar -- the button that shows or hides the
|
|
410
|
+
list on its left, a state's dot when there is one, its title, and on its right what that page offers (a
|
|
411
|
+
conversation: Chat, Terminal, Assets, Binders, its settings; a room: its settings; the others: their own
|
|
412
|
+
controls). Built once here from each page's top line: the same element, the same looks, the same place. */
|
|
413
|
+
function topBar(top, { state = null } = {}) {
|
|
414
|
+
const bar = document.createElement('header'); bar.className = 'topbar';
|
|
415
|
+
const fold = document.createElement('button'); fold.type = 'button'; fold.className = 'fold-here'; fold.title = 'Hide or show the list of conversations';
|
|
416
|
+
fold.addEventListener('click', () => $('fold').click());
|
|
417
|
+
bar.append(fold);
|
|
418
|
+
if (state) { const dot = document.createElement('span'); dot.className = 'bar-state'; dot.id = state; dot.setAttribute('aria-hidden', 'true'); bar.append(dot); }
|
|
419
|
+
const title = top.querySelector(':scope > b'); if (title) bar.append(title);
|
|
420
|
+
const right = document.createElement('div'); right.className = 'bar-right';
|
|
421
|
+
right.append(...[...top.childNodes].filter((n) => n.nodeType === 1));
|
|
422
|
+
bar.append(right);
|
|
423
|
+
top.replaceWith(bar);
|
|
424
|
+
return bar;
|
|
425
|
+
}
|
|
426
|
+
for (const top of [...document.querySelectorAll('#places .sheet > .panel-top')]) topBar(top, top.parentElement.id === 'salon' ? { state: 'salon-state' } : {});
|
|
427
|
+
/* A room's settings: on its bar's right, in the same group of views a conversation's settings sit in. */
|
|
428
|
+
{ const views = document.createElement('div'); views.className = 'views'; views.setAttribute('role', 'group'); views.setAttribute('aria-label', 'Room'); views.append($('salon-settings')); $('salon').querySelector('.topbar .bar-right').prepend(views); }
|
|
416
429
|
const applyFold = (folded) => {
|
|
417
430
|
app.dataset.list = folded ? 'folded' : 'open';
|
|
418
431
|
for (const f of [$('fold'), ...document.querySelectorAll('.fold-here')]) {
|
|
@@ -1245,11 +1258,19 @@
|
|
|
1245
1258
|
const roomsNow = () => { try { return Array.isArray(rooms) ? rooms : []; } catch { return []; } };
|
|
1246
1259
|
const roomOpenNow = () => { try { return place === 'salon' ? salonId : ''; } catch { return ''; } };
|
|
1247
1260
|
function roomItem(r) {
|
|
1261
|
+
/* The same row as a conversation's (03-11: « de même nature ») -- its name, when, its last words on one line,
|
|
1262
|
+
its state's dot -- told apart by a small room sign before its name. */
|
|
1248
1263
|
const b = document.createElement('button'); b.type = 'button'; b.className = 'item room-item'; b.dataset.room = r.id;
|
|
1249
|
-
const
|
|
1250
|
-
const
|
|
1251
|
-
|
|
1252
|
-
|
|
1264
|
+
const title = document.createElement('b');
|
|
1265
|
+
const sign = document.createElement('span'); sign.className = 'room-sign'; sign.setAttribute('aria-hidden', 'true');
|
|
1266
|
+
title.append(sign, r.name);
|
|
1267
|
+
b.append(title);
|
|
1268
|
+
if (r.last) {
|
|
1269
|
+
const last = document.createElement('small'); last.className = 'last'; last.textContent = `${r.last.by ? `${r.last.by}: ` : ''}${r.last.text}`; b.append(last);
|
|
1270
|
+
const when = document.createElement('small'); when.className = 'when'; when.textContent = whenWords(Date.parse(r.last.at)); b.append(when); b.dataset.when = 'true';
|
|
1271
|
+
} else { const sub = document.createElement('small'); sub.textContent = `Room \u00b7 ${r.members.filter((m) => m.kind === 'ai').length} AIs`; b.append(sub); }
|
|
1272
|
+
/* Its dot: new words in it waiting (the colour of what waits for you), else ready. */
|
|
1273
|
+
const point = statePoint(r.unread > 0 ? 'wait' : 'ready'); point.title = r.unread > 0 ? `${r.unread} new` : 'Room'; b.append(point);
|
|
1253
1274
|
if (r.id === roomOpenNow()) b.setAttribute('aria-current', 'true');
|
|
1254
1275
|
b.addEventListener('click', () => { void openSalon(r.id); });
|
|
1255
1276
|
return b;
|
package/web/style.css
CHANGED
|
@@ -2278,6 +2278,20 @@ button.salon-switch[aria-checked="true"]::after { left: 18px; background: var(--
|
|
|
2278
2278
|
.nc-card > .salon-members-tools { padding-bottom: 4px; }
|
|
2279
2279
|
.nc-card > .salon-host-box + *, .nc-card > .salon-member-list + * { border-top: 0; }
|
|
2280
2280
|
/* The list's button on each page of its own (03-11), as the conversation's. */
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
.
|
|
2281
|
+
/* THE TOP BAR of every page (03-11): the conversation's header, the same element and looks (header {...} above). */
|
|
2282
|
+
header.topbar { flex-shrink: 0; }
|
|
2283
|
+
header.topbar > .fold-here { font-size: 1rem; line-height: 1; padding: 4px 9px; flex: none; }
|
|
2284
|
+
@media (max-width: 700px) { header.topbar > .fold-here { display: none; } }
|
|
2285
|
+
header.topbar > b { flex: 1 1 auto; font-size: 1rem; }
|
|
2286
|
+
header.topbar > .bar-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }
|
|
2287
|
+
header.topbar .bar-state { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
|
|
2288
|
+
header.topbar .views .icon-btn { width: auto; height: auto; }
|
|
2289
|
+
/* Pages with margins of their own: their bar goes edge to edge, as a conversation's. */
|
|
2290
|
+
#places .sheet:not(.as-place) > header.topbar { margin: -14px -14px 4px; }
|
|
2291
|
+
#newconv > header.topbar { margin: -14px -20px 4px; }
|
|
2292
|
+
#salon-new > header.topbar { margin: -14px -20px 4px; }
|
|
2293
|
+
@media (max-width: 700px) { #newconv > header.topbar { margin: -12px -16px 4px; } }
|
|
2294
|
+
/* A room's row in the list (03-11): a conversation's row, with a small sign of a room before its name (Lucide « users »). */
|
|
2295
|
+
.room-sign { display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; background: var(--ink2);
|
|
2296
|
+
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E") center / contain no-repeat;
|
|
2297
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E") center / contain no-repeat; }
|