clavarium 0.2.312-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.
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/web/app.js +33 -0
- package/web/style.css +5 -0
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
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.
|
|
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
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
|
@@ -2583,3 +2583,8 @@ header.topbar .views .icon-btn { width: auto; height: auto; }
|
|
|
2583
2583
|
.ft *, .ft *::before, .ft *::after, .ft-toast { animation: none !important; transition: none !important; }
|
|
2584
2584
|
.ft-house .ft-wire.lit, .ft-house .ft-link.lit { stroke-dashoffset: 0 !important; }
|
|
2585
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; }
|