tux-review 0.1.0 → 0.1.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/client/tux-review.js +17 -2
- package/package.json +1 -1
package/client/tux-review.js
CHANGED
|
@@ -333,18 +333,33 @@
|
|
|
333
333
|
function clearHover() {
|
|
334
334
|
if (hoverEl) { hoverEl.classList.remove('tux-hover'); hoverEl = null; }
|
|
335
335
|
}
|
|
336
|
+
// TUX's own chrome (overlay root, editor, markers) is never reviewable —
|
|
337
|
+
// independent of any user-set [data-tux-ui] scope markers (SPC 16, 66).
|
|
338
|
+
function inChrome(el) {
|
|
339
|
+
if (el.closest && el.closest('.tux-editor,.tux-marker,.tux-toast')) return true;
|
|
340
|
+
const r = root();
|
|
341
|
+
return !!(r && (r === el || r.contains(el)));
|
|
342
|
+
}
|
|
343
|
+
// [data-tux-ui] marks reviewable scopes. With no scope on the page the
|
|
344
|
+
// whole document is reviewable; with scopes, only inside them.
|
|
345
|
+
function inScope(el) {
|
|
346
|
+
const scopes = document.querySelectorAll('[data-tux-ui]');
|
|
347
|
+
if (!scopes.length) return true;
|
|
348
|
+
for (const s of scopes) if (s.contains(el)) return true;
|
|
349
|
+
return false;
|
|
350
|
+
}
|
|
336
351
|
function onMouseOver(e) {
|
|
337
352
|
if (!mode) return;
|
|
338
353
|
clearHover();
|
|
339
354
|
const t = e.target.closest('body *');
|
|
340
|
-
if (t && !t
|
|
355
|
+
if (t && !inChrome(t) && inScope(t)) {
|
|
341
356
|
t.classList.add('tux-hover');
|
|
342
357
|
hoverEl = t;
|
|
343
358
|
}
|
|
344
359
|
}
|
|
345
360
|
function onClick(e) {
|
|
346
361
|
if (!mode) return;
|
|
347
|
-
if (e.target.
|
|
362
|
+
if (inChrome(e.target) || !inScope(e.target)) return;
|
|
348
363
|
e.preventDefault();
|
|
349
364
|
e.stopPropagation();
|
|
350
365
|
const target = e.target.closest('body *');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tux-review",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "TUX - TUX UIX review system: attach structured, machine-readable feedback directly to running web UIs (pages, routes, components, elements, states) with a deterministic CLI, canonical JSON and LLM-friendly skills.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|