feat(terminal): older TVs get a legacy build with a compatibility layer; modern output unchanged

- @vitejs/plugin-legacy: browsers without import.meta.resolve (older than Chrome 105 /
  Firefox 106 / Safari 16.4) load a second copy built for Chrome 79 / Firefox 78 / Safari 13
  with polyfills. The modern targets and the stylesheet stay on Vite's own defaults, so modern
  chunks are byte-identical to before (only plugin-legacy's 230-byte guard in the entry).
- terminal/src/compat.js (legacy copy only): swaps in <name>.compat.css (lightningcss for the
  older targets), sets container-size variables for signage slides, emulates flex gap.
- @xenia/signage cq()/CQ_BOX: container units as before where supported, calc(var()) fallback
  otherwise; EmbeddedSlide no longer uses inline `inset`.
- Shared Notice (@xenia/ui); "Devices that work" in Pair a device and Signage -> Screens (EN/EL).
- tests/e2e/compat.mjs: modern browser loads nothing extra; a simulated older TV runs the legacy
  copy and the layer, pairs, and plays a slide at the same sizes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-21 17:26:16 +02:00
co-authored by Claude Opus 5.5
parent aa8ba5d1d4
commit 14d592d963
23 changed files with 625 additions and 40 deletions
+23
View File
@@ -679,3 +679,26 @@
border-right: 1px dashed #888; border-bottom: 1px dashed #888;
padding: 6mm 4mm; display: grid; justify-items: center; align-content: start; gap: 2mm; text-align: center;
}
/* ── Notice (2026-11-21) ─────────────────────────────────────────────────── */
.x-notice {
--x-notice-tone: var(--x-info); --x-notice-soft: var(--x-info-soft); --x-notice-ink: var(--x-info-ink);
display: grid; gap: 6px; padding: 10px 14px; border-radius: var(--x-radius-control);
border: 1px solid var(--x-notice-tone); border-left-width: 4px; background: var(--x-notice-soft);
color: var(--x-ink); font-size: var(--x-text-label); line-height: var(--x-leading-label);
}
.x-notice--success { --x-notice-tone: var(--x-success); --x-notice-soft: var(--x-success-soft); --x-notice-ink: var(--x-success-ink); }
.x-notice--warning { --x-notice-tone: var(--x-warning); --x-notice-soft: var(--x-warning-soft); --x-notice-ink: var(--x-warning-ink); }
.x-notice--danger { --x-notice-tone: var(--x-danger); --x-notice-soft: var(--x-danger-soft); --x-notice-ink: var(--x-danger-ink); }
.x-notice--neutral { --x-notice-tone: var(--x-line-strong); --x-notice-soft: var(--x-surface-2); --x-notice-ink: var(--x-ink); }
.x-notice__title { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--x-notice-ink); }
.x-notice__icon { display: inline-flex; }
.x-notice__body { color: var(--x-ink-2); }
.x-notice__items { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.x-notice__item { display: grid; grid-template-columns: 8px 1fr; gap: 10px; align-items: baseline; color: var(--x-ink-2); }
.x-notice__dot { width: 8px; height: 8px; border-radius: var(--x-radius-full); background: var(--x-notice-item, var(--x-ink-3)); transform: translateY(-1px); }
.x-notice__item--success { --x-notice-item: var(--x-success); }
.x-notice__item--warning { --x-notice-item: var(--x-warning); }
.x-notice__item--danger { --x-notice-item: var(--x-danger); }
.x-notice__item--info { --x-notice-item: var(--x-info); }
.x-notice__label { color: var(--x-ink); font-weight: 600; }
+32
View File
@@ -0,0 +1,32 @@
import { cx } from '../internal/cx.js'
/**
* A boxed note in a tone (2026-11-21): a title, text, and an optional list of points, each with a tone
* dot and a short label (e.g. what works, what works with limits, what doesn't).
* <Notice tone="info" title="Devices that work">Some text</Notice>
* <Notice title="…" items={[{ tone: 'success', label: 'Best', text: 'Chrome 111+' }, …]} />
* Tones: info (default), success, warning, danger, neutral.
*/
export function Notice({ tone = 'info', title, icon, items, className, children, ...rest }) {
return (
<div className={cx('x-notice', `x-notice--${tone}`, className)} {...rest}>
{(title || icon) && (
<div className="x-notice__title">
{icon && <span className="x-notice__icon" aria-hidden="true">{icon}</span>}
{title}
</div>
)}
{children && <div className="x-notice__body">{children}</div>}
{items?.length > 0 && (
<ul className="x-notice__items">
{items.map((it, i) => (
<li key={i} className={cx('x-notice__item', `x-notice__item--${it.tone || 'neutral'}`)} data-tone={it.tone || 'neutral'}>
<span className="x-notice__dot" aria-hidden="true" />
<span>{it.label && <strong className="x-notice__label">{it.label}</strong>}{it.label && ' '}{it.text}</span>
</li>
))}
</ul>
)}
</div>
)
}
+1
View File
@@ -28,6 +28,7 @@ export { COLOUR_PRESETS, joinAlpha, splitAlpha, typedColour } from './components
export { FieldRow } from './components/FieldRow.jsx'
export { Slider } from './components/Slider.jsx'
export { NumberInput } from './components/NumberInput.jsx'
export { Notice } from './components/Notice.jsx'
export { IconPicker } from './components/IconPicker.jsx'
export { Page, PageHeader, Pane, Toolbar, ToolbarSpacer } from './components/Page.jsx'
export { SearchInput, FilterChip, Segmented, Tabs } from './components/Controls.jsx'