clavarium 0.2.311-next.1 → 0.2.313-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.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.311-next.1",
3
+ "version": "0.2.313-next.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "clavarium",
9
- "version": "0.2.311-next.1",
9
+ "version": "0.2.313-next.1",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@xterm/addon-fit": "^0.11.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clavarium",
3
- "version": "0.2.311-next.1",
3
+ "version": "0.2.313-next.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.",
package/web/app.js CHANGED
@@ -424,6 +424,39 @@
424
424
  return bar;
425
425
  }
426
426
  for (const top of [...document.querySelectorAll('#places .sheet > .panel-top')]) topBar(top, top.parentElement.id === 'salon' ? { state: 'salon-state' } : {});
427
+ /* A SEARCH ATOP A SETTINGS PAGE (05-11): one field in its top bar; what is typed keeps only the chapters (or
428
+ blocks) whose title or rows say it, opened; the headings left with nothing are hidden. Emptied, all comes back
429
+ as it was. The server's Settings, a conversation's, and any sheet given the same shape. */
430
+ const settingsSearch = (sheet) => {
431
+ const bar = sheet?.querySelector(':scope > header.topbar .bar-right') ?? sheet?.querySelector(':scope > header.topbar') ?? sheet?.querySelector(':scope > .panel-top');
432
+ if (!bar || sheet.querySelector('.settings-search')) return;
433
+ const field = document.createElement('input'); field.type = 'search'; field.className = 'settings-search';
434
+ field.placeholder = 'Search'; field.setAttribute('aria-label', 'Search these settings'); field.autocomplete = 'off';
435
+ bar.prepend(field);
436
+ const items = () => {
437
+ const chapters = [...sheet.querySelectorAll('details.chapter')];
438
+ return chapters.length ? chapters : [...sheet.querySelectorAll(':scope > :not(header.topbar):not(.panel-top)')].filter((e) => e.querySelector(':scope > .panel-top'));
439
+ };
440
+ const wasOpen = new Map();
441
+ const norm = (t) => String(t).toLowerCase().normalize('NFD').replace(/[̀-ͯ]/g, '');
442
+ field.addEventListener('input', () => {
443
+ const q = norm(field.value.trim());
444
+ sheet.dataset.searching = q ? 'on' : '';
445
+ for (const it of items()) {
446
+ if (!q) { it.hidden = false; for (const row of it.querySelectorAll('.search-out')) row.classList.remove('search-out'); if (it.tagName === 'DETAILS' && wasOpen.has(it)) { it.open = wasOpen.get(it); wasOpen.delete(it); } continue; }
447
+ const hit = norm(it.textContent).includes(q);
448
+ it.hidden = !hit;
449
+ /* Within a chapter whose title does not say it: only its rows that do. */
450
+ const head = it.querySelector(':scope > summary, :scope > .panel-top');
451
+ const whole = !head || norm(head.textContent).includes(q);
452
+ for (const row of it.querySelectorAll('.set-row')) row.classList.toggle('search-out', hit && !whole && !norm(row.textContent).includes(q));
453
+ if (hit && it.tagName === 'DETAILS') { if (!wasOpen.has(it)) wasOpen.set(it, it.open); it.open = true; }
454
+ }
455
+ for (const group of sheet.querySelectorAll('.settings-group')) group.hidden = Boolean(q) && ![...group.querySelectorAll('details.chapter')].some((d) => !d.hidden);
456
+ });
457
+ field.addEventListener('keydown', (e) => { if (e.key === 'Escape' && field.value) { e.stopPropagation(); field.value = ''; field.dispatchEvent(new Event('input')); } });
458
+ };
459
+ for (const id of ['settings', 'panel']) settingsSearch($(id));
427
460
  /* A room's title: its name, and under it who speaks now (salonLive). */
428
461
  /* The device page (/c/) has no rooms sheet (05-11: it stopped app.js there, the page stuck on connecting). */
429
462
  if ($('salon')) { const t = $('salon-title'); const name = document.createElement('span'); name.id = 'salon-name'; name.textContent = t.textContent; const live = document.createElement('small'); live.id = 'salon-live'; live.className = 'salon-live'; live.hidden = true; t.replaceChildren(name, live); }
package/web/style.css CHANGED
@@ -2308,6 +2308,9 @@ button.salon-switch[aria-checked="true"]::after { left: 18px; background: var(--
2308
2308
  /* The list's button on each page of its own (03-11), as the conversation's. */
2309
2309
  /* THE TOP BAR of every page (03-11): the conversation's header, the same element and looks (header {...} above). */
2310
2310
  header.topbar { flex-shrink: 0; }
2311
+ /* A place's top bar stays at the top while its page scrolls (05-11), as a conversation's does: the sheet scrolls,
2312
+ so the bar sticks to its top edge, over its padding. */
2313
+ .sheet > header.topbar { position: sticky; top: -14px; z-index: 5; margin-top: -14px; padding-top: 14px; background: var(--panel); }
2311
2314
  header.topbar > .fold-here { font-size: 1rem; line-height: 1; padding: 4px 9px; flex: none; }
2312
2315
  @media (max-width: 700px) { header.topbar > .fold-here { display: none; } }
2313
2316
  header.topbar > b { flex: 1 1 auto; font-size: 1rem; }
@@ -2580,3 +2583,8 @@ header.topbar .views .icon-btn { width: auto; height: auto; }
2580
2583
  .ft *, .ft *::before, .ft *::after, .ft-toast { animation: none !important; transition: none !important; }
2581
2584
  .ft-house .ft-wire.lit, .ft-house .ft-link.lit { stroke-dashoffset: 0 !important; }
2582
2585
  }
2586
+
2587
+ /* The search atop a settings page (05-11). */
2588
+ :is(header.topbar, .panel-top) .settings-search { margin-left: auto; width: min(240px, 42vw); min-height: 32px; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: .875rem; }
2589
+ .sheet[data-searching="on"] .settings-nav { opacity: .5; }
2590
+ .set-row.search-out { display: none; }