clavarium 0.2.43-next.1 → 0.2.44-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/links.js +23 -5
- package/web/style.css +3 -0
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.44-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.44-next.1",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/package.json
CHANGED
package/web/links.js
CHANGED
|
@@ -69,6 +69,12 @@
|
|
|
69
69
|
let allLines = true;
|
|
70
70
|
try { allLines = localStorage.getItem('clavarium-links-all') !== '0'; } catch { /* none kept */ }
|
|
71
71
|
let picked = null; let pinned = null; let focus = null; let drag = null; let pop = null; let popLink = null; let drawnMany = false;
|
|
72
|
+
/* A box is shown only if its column's filter is empty or its name holds what was typed: so a
|
|
73
|
+
crowded map (many assets) is narrowed to a few boxes, their links with them. The layout is
|
|
74
|
+
kept while typing (no reorder), and a filter cleared brings everything back. */
|
|
75
|
+
const filters = { device: '', conversation: '', asset: '' };
|
|
76
|
+
let laidOut = null;
|
|
77
|
+
const matches = (n, k) => { const f = (filters[k] || '').trim().toLowerCase(); return !f || n.name.toLowerCase().includes(f) || String(n.sub || '').toLowerCase().includes(f); };
|
|
72
78
|
const ph = { screen: 'list', kind: 'device', id: null, adding: false, sheet: null };
|
|
73
79
|
let traceOf = '*';
|
|
74
80
|
|
|
@@ -182,27 +188,39 @@
|
|
|
182
188
|
}
|
|
183
189
|
return best;
|
|
184
190
|
}
|
|
185
|
-
|
|
191
|
+
/* `relayout` false keeps the order found last: used while typing a filter, so boxes do not jump. */
|
|
192
|
+
function paint(relayout = true) {
|
|
186
193
|
for (const b of document.querySelectorAll('#links-tabs [data-view]')) b.setAttribute('aria-selected', String(b.dataset.view === view));
|
|
187
194
|
$('links-all').checked = allLines;
|
|
188
195
|
legend();
|
|
189
196
|
const bd = board();
|
|
190
197
|
bd.className = `lk-board ${VIEWS[view].cols.length === 3 ? 'three' : 'two'}`;
|
|
191
198
|
bd.querySelectorAll('.lk-col, .lk-knob').forEach((e) => e.remove()); closePop();
|
|
192
|
-
|
|
199
|
+
if (relayout || !laidOut) laidOut = layout();
|
|
200
|
+
const lists = laidOut;
|
|
193
201
|
VIEWS[view].cols.forEach((cols, ci) => {
|
|
194
202
|
const col = h('div', { class: 'lk-col' });
|
|
195
203
|
cols.forEach((k, i) => {
|
|
196
204
|
if (i) col.append(h('div', { class: 'lk-gap' }));
|
|
197
|
-
col.append(h('h3', { class: 'lk-colh' }, h('span', { text: TITLES[k] }), plus(k)));
|
|
198
|
-
const
|
|
205
|
+
col.append(h('h3', { class: 'lk-colh' }, h('span', { class: 'lk-colt', text: TITLES[k] }), find(k), plus(k)));
|
|
206
|
+
const whole = lists[ci][i];
|
|
207
|
+
const list = whole.filter((n) => matches(n, k));
|
|
199
208
|
for (const n of list) col.append(nodeEl(n));
|
|
200
|
-
if (!list.length) col.append(empty(k));
|
|
209
|
+
if (!list.length) col.append(whole.length ? h('p', { class: 'hint lk-none', text: 'Nothing matches.' }) : empty(k));
|
|
201
210
|
});
|
|
202
211
|
bd.append(col);
|
|
203
212
|
});
|
|
204
213
|
fit(); draw(); hint(); paintPhone();
|
|
205
214
|
}
|
|
215
|
+
/* A box in each column's title to narrow it: it filters only what is shown, kept while typing. */
|
|
216
|
+
const onFind = (e) => {
|
|
217
|
+
const k = e.target.dataset.k; const at = e.target.selectionStart;
|
|
218
|
+
filters[k] = e.target.value;
|
|
219
|
+
paint(false);
|
|
220
|
+
const ni = board().querySelector(`.lk-find[data-k="${k}"]`);
|
|
221
|
+
if (ni) { ni.focus(); try { ni.setSelectionRange(at, at); } catch { /* a search input may refuse it */ } }
|
|
222
|
+
};
|
|
223
|
+
const find = (k) => h('input', { type: 'search', class: 'lk-find', 'data-k': k, value: filters[k], placeholder: 'Filter…', 'aria-label': `Filter ${TITLES[k]}`, oninput: onFind });
|
|
206
224
|
/* How each kind is made: a device paired, a conversation created, an asset added. The same,
|
|
207
225
|
from the small round "+" by each column's title (always there, however many it holds)
|
|
208
226
|
and from an empty column. */
|
package/web/style.css
CHANGED
|
@@ -1280,6 +1280,9 @@ select.pill { appearance: auto; }
|
|
|
1280
1280
|
#copy-close, #files-close, #preview-close { font-size: 1.375rem; line-height: 1; min-width: 40px; padding: 4px 10px; }
|
|
1281
1281
|
/* The title of a column of the map, and its round "+" (a new device, conversation, asset): always there. */
|
|
1282
1282
|
.lk-col h3.lk-colh, .lk-phead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
|
|
1283
|
+
.lk-col h3.lk-colh .lk-colt { flex: none; }
|
|
1284
|
+
.lk-col h3.lk-colh .lk-find { flex: 1 1 auto; min-width: 0; width: auto; font: inherit; font-size: .72rem; letter-spacing: 0; text-transform: none; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink); }
|
|
1285
|
+
.lk-col h3.lk-colh .lk-find::placeholder { color: var(--ink2); }
|
|
1283
1286
|
.lk-col h3.lk-colh .lk-add { width: 26px; height: 26px; font-size: .95rem; letter-spacing: 0; }
|
|
1284
1287
|
.lk-phead { margin: 4px 0 6px; }
|
|
1285
1288
|
.as-kinds { display: flex; flex-wrap: wrap; gap: 8px; } .as-kinds button { display: inline-flex; align-items: center; gap: 8px; }
|