diff --git a/gui/app-next/eslint.config.js b/gui/app-next/eslint.config.js index fe44bcd3b..0cefd11cd 100644 --- a/gui/app-next/eslint.config.js +++ b/gui/app-next/eslint.config.js @@ -1,9 +1,12 @@ import eslint from '@eslint/js'; +import betterTailwind from 'eslint-plugin-better-tailwindcss'; import boundaries from 'eslint-plugin-boundaries'; +import jsxA11y from 'eslint-plugin-jsx-a11y'; import solid from 'eslint-plugin-solid/configs/typescript'; import globals from 'globals'; import tseslint from 'typescript-eslint'; import l10n from './eslint/l10n.js'; +import layers from './eslint/layers.js'; // Each entry is allowed only in the files listed in `allowedIn` const restricted = { @@ -27,6 +30,12 @@ const restricted = { selector: "MemberExpression[property.name='electronAPI']", message: 'Use platform from @/lib/platform.', }, + keydown: { + allowedIn: ['src/lib/keyboard.ts', 'src/ui/motion/**'], + selector: + "CallExpression[callee.property.name='addEventListener'][arguments.0.value=/^key(down|up)$/]", + message: 'Use useShortcut from @/lib/keyboard, Escape goes to the back stack (useBack).', + }, android: { allowedIn: ['src/app/platform/**', 'src/env.d.ts'], selector: "Identifier[name='__ANDROID__']", @@ -114,6 +123,49 @@ export default tseslint.config( }, }, ...restrictedOverrides(), + { + files: ['src/lib/**/*.{ts,tsx}'], + plugins: { layers }, + rules: { 'layers/no-jsx': 'error' }, + }, + // Peer range stops at ESLint 9 but the rules only read JSX attributes + { files: ['src/**/*.tsx'], ...jsxA11y.flatConfigs.recommended }, + // Long class strings wrap into a multiline template literal, fixed by lint:fix + { + files: ['src/**/*.tsx'], + plugins: { 'better-tailwindcss': betterTailwind }, + settings: { 'better-tailwindcss': { entryPoint: 'src/styles.css' } }, + rules: { + 'better-tailwindcss/enforce-consistent-line-wrapping': [ + 'error', + // Packed lines, no line per variant group. Wider than prettier so + // only really long strings wrap at JSX indentation depth. + { printWidth: 100, group: 'never', preferSingleLine: true, strictness: 'loose' }, + ], + }, + }, + // Solid compiles `ref={x}` into an assignment the rule cannot see + { files: ['src/**/*.tsx'], rules: { 'no-unassigned-vars': 'off' } }, + // Motion hooks belong to ui primitives, pages only use the containers + { + files: ['src/**/*.{ts,tsx}'], + ignores: ['src/ui/**'], + rules: { + 'no-restricted-imports': [ + 'error', + { + paths: [ + { + name: '@/ui/motion', + importNames: ['useMotionItem'], + message: 'Only ui primitives register motion items.', + }, + ], + patterns: [{ group: ['@/ui/motion/*'], message: 'Import from @/ui/motion.' }], + }, + ], + }, + }, // Local rules run in node { files: ['eslint/**/*.js'], languageOptions: { globals: globals.node } }, // Tests build their own bundles with made-up ids diff --git a/gui/app-next/eslint/layers.js b/gui/app-next/eslint/layers.js new file mode 100644 index 000000000..4f70e5aab --- /dev/null +++ b/gui/app-next/eslint/layers.js @@ -0,0 +1,14 @@ +// lib holds services and reactive state, anything that renders lives in ui +const noJsx = { + meta: { + type: 'problem', + messages: { jsx: 'No JSX in lib, components belong in ui.' }, + schema: [], + }, + create(context) { + const report = (node) => context.report({ node, messageId: 'jsx' }); + return { JSXElement: report, JSXFragment: report }; + }, +}; + +export default { rules: { 'no-jsx': noJsx } }; diff --git a/gui/app-next/package.json b/gui/app-next/package.json index 74c06488b..0551336d3 100644 --- a/gui/app-next/package.json +++ b/gui/app-next/package.json @@ -43,7 +43,9 @@ "@types/node": "26.6.5", "eslint": "10.13.0", "eslint-import-resolver-typescript": "^4.4.4", + "eslint-plugin-better-tailwindcss": "4.10.0", "eslint-plugin-boundaries": "7.3.0", + "eslint-plugin-jsx-a11y": "6.10.2", "eslint-plugin-solid": "0.18.1", "globals": "17.13.0", "jsdom": "30.1.3", diff --git a/gui/app-next/src/app/app.tsx b/gui/app-next/src/app/app.tsx index 29011b8e2..870c7a318 100644 --- a/gui/app-next/src/app/app.tsx +++ b/gui/app-next/src/app/app.tsx @@ -1,5 +1,10 @@ import { DesignPage } from '@/pages/design/design-page'; +import { MotionRoot } from '@/ui/motion'; export function App() { - return ; + return ( + + + + ); } diff --git a/gui/app-next/src/index.tsx b/gui/app-next/src/index.tsx index d5f84c40b..c03c30d32 100644 --- a/gui/app-next/src/index.tsx +++ b/gui/app-next/src/index.tsx @@ -5,6 +5,7 @@ import { render } from 'solid-js/web'; import { App } from '@/app/app'; import { createPlatform } from '@/app/platform/detect'; import { initErrorReporting } from '@/domain/error-reporting'; +import { initKeyboard } from '@/lib/keyboard'; import { initL10n } from '@/lib/l10n'; import { setPlatform } from '@/lib/platform'; import { loadPrefs } from '@/lib/storage'; @@ -19,5 +20,6 @@ setClient(createSocketClient({ url: serverUrl() })); await initErrorReporting(); await loadPrefs(); await initL10n(); +initKeyboard(); render(() => , root); diff --git a/gui/app-next/src/lib/back-stack.test.ts b/gui/app-next/src/lib/back-stack.test.ts new file mode 100644 index 000000000..12fc675dc --- /dev/null +++ b/gui/app-next/src/lib/back-stack.test.ts @@ -0,0 +1,85 @@ +import { createRoot, createSignal } from 'solid-js'; +import { afterEach, describe, expect, it, vi } from 'vitest'; +import { + canHandleBack, + dismiss, + handleBack, + modalOpen, + pushBack, + setBackFallback, + useBack, +} from '@/lib/back-stack'; + +afterEach(() => setBackFallback(null)); + +describe('back stack', () => { + it('handles the most recent entry first', () => { + const calls: string[] = []; + const removeA = pushBack(() => calls.push('a')); + const removeB = pushBack(() => calls.push('b')); + expect(handleBack()).toBe(true); + removeB(); + expect(handleBack()).toBe(true); + removeA(); + expect(calls).toEqual(['b', 'a']); + expect(handleBack()).toBe(false); + }); + + it('falls back to history under the overlays', () => { + const back = vi.fn(); + const [can, setCan] = createSignal(false); + setBackFallback({ can, back }); + expect(canHandleBack()).toBe(false); + expect(handleBack()).toBe(false); + setCan(true); + expect(canHandleBack()).toBe(true); + const overlay = vi.fn(); + const remove = pushBack(overlay); + handleBack(); + expect(overlay).toHaveBeenCalledOnce(); + expect(back).not.toHaveBeenCalled(); + remove(); + handleBack(); + expect(back).toHaveBeenCalledOnce(); + }); + + it('dismiss closes overlays but never goes back in history', () => { + const back = vi.fn(); + setBackFallback({ can: () => true, back }); + const overlay = vi.fn(); + const remove = pushBack(overlay); + expect(dismiss()).toBe(true); + remove(); + expect(dismiss()).toBe(false); + expect(overlay).toHaveBeenCalledOnce(); + expect(back).not.toHaveBeenCalled(); + }); + + it('tracks modal entries', () => { + const removePlain = pushBack(() => {}); + expect(modalOpen()).toBe(false); + const removeModal = pushBack(() => {}, { modal: true }); + expect(modalOpen()).toBe(true); + removeModal(); + removePlain(); + expect(modalOpen()).toBe(false); + }); + + it('useBack pushes while `when` holds and on top of older entries', () => { + const calls: string[] = []; + const removeOld = pushBack(() => calls.push('old')); + const [open, setOpen] = createSignal(false); + const dispose = createRoot((dispose) => { + useBack(() => calls.push('overlay'), { when: open }); + return dispose; + }); + handleBack(); + setOpen(true); + handleBack(); + setOpen(false); + handleBack(); + dispose(); + removeOld(); + expect(calls).toEqual(['old', 'overlay', 'old']); + }); +}); diff --git a/gui/app-next/src/lib/back-stack.ts b/gui/app-next/src/lib/back-stack.ts new file mode 100644 index 000000000..c4a65f84d --- /dev/null +++ b/gui/app-next/src/lib/back-stack.ts @@ -0,0 +1,62 @@ +import { type Accessor, createEffect, createSignal, onCleanup } from 'solid-js'; + +export interface BackOptions { + // Dialogs: page-scope shortcuts are suspended while one is on the stack + modal?: boolean; +} + +export interface BackFallback { + can: Accessor; + back(): void; +} + +interface Entry { + handle: () => void; + modal: boolean; +} + +const [entries, setEntries] = createSignal([]); +const [fallback, setFallback] = createSignal(null); + +export function pushBack(handle: () => void, options: BackOptions = {}): () => void { + const entry: Entry = { handle, modal: options.modal ?? false }; + setEntries((list) => [...list, entry]); + return () => setEntries((list) => list.filter((e) => e !== entry)); +} + +export function useBack( + handle: () => void, + options: BackOptions & { when?: Accessor } = {} +) { + createEffect(() => { + if (options.when && !options.when()) return; + onCleanup(pushBack(handle, options)); + }); +} + +export function setBackFallback(next: BackFallback | null) { + setFallback(() => next); +} + +export function dismiss(): boolean { + const top = entries().at(-1); + if (!top) return false; + top.handle(); + return true; +} + +export function handleBack(): boolean { + if (dismiss()) return true; + const history = fallback(); + if (!history?.can()) return false; + history.back(); + return true; +} + +export function canHandleBack(): boolean { + return entries().length > 0 || (fallback()?.can() ?? false); +} + +export function modalOpen(): boolean { + return entries().some((e) => e.modal); +} diff --git a/gui/app-next/src/lib/keyboard.test.ts b/gui/app-next/src/lib/keyboard.test.ts new file mode 100644 index 000000000..e3117ef85 --- /dev/null +++ b/gui/app-next/src/lib/keyboard.test.ts @@ -0,0 +1,125 @@ +import { createRoot } from 'solid-js'; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest'; +import { pushBack, setBackFallback } from '@/lib/back-stack'; +import { captureKeys, initKeyboard, shortcuts, useShortcut } from '@/lib/keyboard'; +import { setPlatform } from '@/lib/platform'; +import { fakePlatform } from '@/lib/platform-fake'; + +let uninstall: () => void; +const disposers: (() => void)[] = []; + +function shortcut(...args: Parameters) { + createRoot((dispose) => { + useShortcut(...args); + disposers.push(dispose); + }); +} + +function press( + key: string, + init: KeyboardEventInit = {}, + target: EventTarget = document.body +) { + const event = new KeyboardEvent('keydown', { + key, + bubbles: true, + cancelable: true, + ...init, + }); + target.dispatchEvent(event); + return event; +} + +beforeAll(() => setPlatform(fakePlatform())); +beforeEach(() => { + uninstall = initKeyboard(); +}); +afterEach(() => { + uninstall(); + disposers.splice(0).forEach((d) => d()); + document.body.innerHTML = ''; +}); + +describe('keyboard', () => { + it('sends Escape to the top overlay', () => { + const back = vi.fn(); + const remove = pushBack(back); + const event = press('Escape'); + remove(); + expect(back).toHaveBeenCalledOnce(); + expect(event.defaultPrevented).toBe(true); + expect(press('Escape').defaultPrevented).toBe(false); + }); + + it('never sends Escape to history', () => { + const history = vi.fn(); + setBackFallback({ can: () => true, back: history }); + press('Escape'); + setBackFallback(null); + expect(history).not.toHaveBeenCalled(); + }); + + it('matches Mod as Ctrl off macOS and ignores shift on symbols', () => { + const k = vi.fn(); + const help = vi.fn(); + shortcut('Mod+K', k, { scope: 'global' }); + shortcut('?', help, { scope: 'global' }); + press('k', { ctrlKey: true }); + press('K', { ctrlKey: true, shiftKey: true }); + press('?', { shiftKey: true }); + expect(k).toHaveBeenCalledOnce(); + expect(help).toHaveBeenCalledOnce(); + }); + + it('ignores shortcuts while typing unless opted in', () => { + const plain = vi.fn(); + const typed = vi.fn(); + shortcut('F1', plain); + shortcut('F2', typed, { inTextEntry: true }); + const input = document.createElement('input'); + document.body.append(input); + press('F1', {}, input); + press('F2', {}, input); + expect(plain).not.toHaveBeenCalled(); + expect(typed).toHaveBeenCalledOnce(); + }); + + it('suspends page shortcuts while a dialog is open', () => { + const page = vi.fn(); + const global = vi.fn(); + shortcut('F1', page); + shortcut('F2', global, { scope: 'global' }); + const remove = pushBack(() => {}, { modal: true }); + press('F1'); + press('F2'); + remove(); + press('F1'); + expect(page).toHaveBeenCalledOnce(); + expect(global).toHaveBeenCalledOnce(); + }); + + it('gives every key to a capture, Escape included', () => { + const back = vi.fn(); + const f1 = vi.fn(); + const captured: string[] = []; + const removeBack = pushBack(back); + shortcut('F1', f1); + const release = captureKeys((e) => captured.push(e.key)); + press('Escape'); + press('F1'); + release(); + removeBack(); + expect(captured).toEqual(['Escape', 'F1']); + expect(back).not.toHaveBeenCalled(); + expect(f1).not.toHaveBeenCalled(); + }); + + it('lists labelled shortcuts and warns on duplicates', () => { + const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}); + shortcut('F1', () => {}, { label: 'help' }); + shortcut('F1', () => {}); + shortcut('F1', () => {}, { scope: 'global' }); + expect(warn).toHaveBeenCalledOnce(); + expect(shortcuts()).toEqual([{ combo: 'F1', scope: 'page', label: 'help' }]); + }); +}); diff --git a/gui/app-next/src/lib/keyboard.ts b/gui/app-next/src/lib/keyboard.ts new file mode 100644 index 000000000..e0034fdac --- /dev/null +++ b/gui/app-next/src/lib/keyboard.ts @@ -0,0 +1,176 @@ +import { createSignal, onCleanup } from 'solid-js'; +import { dismiss, modalOpen } from '@/lib/back-stack'; +import { platform } from '@/lib/platform'; + +export type ShortcutScope = 'global' | 'page'; + +export interface ShortcutOptions { + scope?: ShortcutScope; + label?: string; + inTextEntry?: boolean; +} + +export interface ShortcutInfo { + combo: string; + scope: ShortcutScope; + label: string; +} + +interface Combo { + key: string; + ctrl: boolean; + alt: boolean; + meta: boolean; + shift: boolean | null; +} + +interface Shortcut { + combo: string; + parsed: Combo; + fn: (e: KeyboardEvent) => void; + scope: ShortcutScope; + label?: string; + inTextEntry: boolean; +} + +const TEXT_INPUT_TYPES = new Set([ + 'text', + 'search', + 'url', + 'tel', + 'email', + 'password', + 'number', + 'date', + 'datetime-local', + 'month', + 'week', + 'time', +]); + +// A field where keystrokes are text +export function isTextEntry(el: EventTarget | null): boolean { + if (!(el instanceof HTMLElement)) return false; + if (el.isContentEditable) return true; + if (el instanceof HTMLTextAreaElement || el instanceof HTMLSelectElement) return true; + return el instanceof HTMLInputElement && TEXT_INPUT_TYPES.has(el.type); +} + +function normalizeKey(key: string): string { + return key.length === 1 ? key.toLowerCase() : key; +} + +// "Mod+K", "Shift+F1", "?". Mod is Cmd on macOS, Ctrl elsewhere +function parseCombo(combo: string): Combo { + const parts = combo.split('+'); + const key = normalizeKey(parts.pop() ?? ''); + const mods = new Set(parts.map((p) => p.toLowerCase())); + const mod = mods.has('mod'); + const mac = platform.os === 'macos'; + const symbol = + key.length === 1 && key.toUpperCase() === key.toLowerCase() && key !== ' '; + return { + key, + ctrl: mods.has('ctrl') || (mod && !mac), + alt: mods.has('alt'), + meta: mods.has('meta') || (mod && mac), + shift: symbol && !mods.has('shift') ? null : mods.has('shift'), + }; +} + +function matches(c: Combo, e: KeyboardEvent): boolean { + return ( + normalizeKey(e.key) === c.key && + e.ctrlKey === c.ctrl && + e.altKey === c.alt && + e.metaKey === c.meta && + (c.shift === null || e.shiftKey === c.shift) + ); +} + +const [registered, setRegistered] = createSignal([]); +const captures: ((e: KeyboardEvent) => void)[] = []; + +// Cheatsheet source +export function shortcuts(): ShortcutInfo[] { + return registered().flatMap((s) => + s.label ? [{ combo: s.combo, scope: s.scope, label: s.label }] : [] + ); +} + +export function useShortcut( + combo: string, + fn: (e: KeyboardEvent) => void, + options: ShortcutOptions = {} +) { + const shortcut: Shortcut = { + combo, + parsed: parseCombo(combo), + fn, + scope: options.scope ?? 'page', + label: options.label, + inTextEntry: options.inTextEntry ?? false, + }; + if (import.meta.env.DEV) { + const same = registered().find( + (s) => + s.scope === shortcut.scope && + JSON.stringify(s.parsed) === JSON.stringify(shortcut.parsed) + ); + if (same) + console.warn(`Shortcut ${combo} registered twice in scope ${shortcut.scope}`); + } + setRegistered((list) => [...list, shortcut]); + onCleanup(() => setRegistered((list) => list.filter((s) => s !== shortcut))); +} + +export function captureKeys(fn: (e: KeyboardEvent) => void): () => void { + captures.push(fn); + return () => { + const i = captures.lastIndexOf(fn); + if (i >= 0) captures.splice(i, 1); + }; +} + +export function isCapturing(): boolean { + return captures.length > 0; +} + +function onCapturePhase(e: KeyboardEvent) { + const capture = captures.at(-1); + if (!capture) return; + e.preventDefault(); + e.stopPropagation(); + capture(e); +} + +function onBubblePhase(e: KeyboardEvent) { + if (e.defaultPrevented || isCapturing()) return; + + if (e.key === 'Escape' && !e.ctrlKey && !e.altKey && !e.metaKey && !e.shiftKey) { + // Never history: desktop Escape does not go to the previous page + if (dismiss()) e.preventDefault(); + return; + } + + const typing = isTextEntry(e.target); + const suspended = modalOpen(); + // Latest registration wins + for (const s of [...registered()].reverse()) { + if (!matches(s.parsed, e)) continue; + if (typing && !s.inTextEntry) continue; + if (s.scope === 'page' && suspended) continue; + e.preventDefault(); + s.fn(e); + return; + } +} + +export function initKeyboard(target: Window = window): () => void { + target.addEventListener('keydown', onCapturePhase, true); + target.addEventListener('keydown', onBubblePhase); + return () => { + target.removeEventListener('keydown', onCapturePhase, true); + target.removeEventListener('keydown', onBubblePhase); + }; +} diff --git a/gui/app-next/src/lib/l10n/index.ts b/gui/app-next/src/lib/l10n/index.ts index 3463c8d12..96f666d35 100644 --- a/gui/app-next/src/lib/l10n/index.ts +++ b/gui/app-next/src/lib/l10n/index.ts @@ -5,11 +5,6 @@ export { type MessageArgs, type MessageId, } from '@/lib/l10n/translate'; -export { - Localized, - type LocalizedElems, - type LocalizedProps, -} from '@/lib/l10n/localized'; export { DEFAULT_LOCALE, availableLocales, diff --git a/gui/app-next/src/pages/design/design-page.tsx b/gui/app-next/src/pages/design/design-page.tsx index 0d4fa732b..ea3af8925 100644 --- a/gui/app-next/src/pages/design/design-page.tsx +++ b/gui/app-next/src/pages/design/design-page.tsx @@ -1,5 +1,6 @@ import { For } from 'solid-js'; import { IconGallery } from './icon-gallery'; +import { MotionDemo } from './motion-demo'; // Dev only token and primitive showcase @@ -116,6 +117,7 @@ export function DesignPage() { + ); diff --git a/gui/app-next/src/pages/design/icon-gallery.tsx b/gui/app-next/src/pages/design/icon-gallery.tsx index 9ee3a7c6f..825fb35b7 100644 --- a/gui/app-next/src/pages/design/icon-gallery.tsx +++ b/gui/app-next/src/pages/design/icon-gallery.tsx @@ -130,7 +130,10 @@ const ICONS: IconEntry[] = [ ['material-symbols/head-mounted-device-rounded', HeadMountedDeviceIcon], ['slime/hip', HipIcon], ['material-symbols/home', HomeIcon], - ['material-symbols/horizontal-align-center-rounded', HorizontalAlignCenterIcon], + [ + 'material-symbols/horizontal-align-center-rounded', + HorizontalAlignCenterIcon, + ], ['slime/layout', LayoutIcon], ['material-symbols/lightbulb-rounded', LightbulbIcon], ['slime/lower-arm', LowerArmIcon], @@ -218,11 +221,16 @@ export function IconGallery() { {([path, icon]) => (
- {path.slice(path.indexOf('/') + 1)} + + {path.slice(path.indexOf('/') + 1)} +
)}
diff --git a/gui/app-next/src/pages/design/motion-demo.tsx b/gui/app-next/src/pages/design/motion-demo.tsx new file mode 100644 index 000000000..9c075ea4d --- /dev/null +++ b/gui/app-next/src/pages/design/motion-demo.tsx @@ -0,0 +1,234 @@ +/* eslint-disable no-restricted-imports -- dev demo registers raw elements, primitives come later */ +import { createSignal, For, type JSX, onCleanup, Show } from 'solid-js'; +import { canHandleBack, setBackFallback, useBack } from '@/lib/back-stack'; +import { useShortcut } from '@/lib/keyboard'; +import { + type Direction, + MotionGrid, + MotionList, + MotionRegion, + MotionToolbar, + motionActive, + motionEditing, + onBump, + type MotionItemOptions, + useMotionItem, +} from '@/ui/motion'; + +// Dev only playground for arrows, Ctrl/Alt+Arrow, Tab and gamepad + +const CONTROL = + 'bg-surface-control hover:bg-surface-hover rounded-md px-md py-xs text-left'; + +function DemoButton( + props: { children: JSX.Element; onClick?: () => void } & MotionItemOptions +) { + let ref!: HTMLButtonElement; + useMotionItem(() => ref, props); + return ( + + ); +} + +function DemoInput(props: { type: string; label: string } & MotionItemOptions) { + let ref!: HTMLInputElement; + useMotionItem(() => ref, props); + return ( + + ); +} + +// Pad: A enters edit mode, then left/right change the value. Keyboard: owns left/right. +function DemoDial() { + let ref!: HTMLButtonElement; + const [value, setValue] = createSignal(0); + const { editing } = useMotionItem(() => ref, { + owns: 'horizontal', + edit: true, + }); + function onKeyDown(e: KeyboardEvent) { + if (e.key !== 'ArrowLeft' && e.key !== 'ArrowRight') return; + e.preventDefault(); + setValue((v) => v + (e.key === 'ArrowLeft' ? -1 : 1)); + } + return ( + + ); +} + +function Status() { + const [bump, setBump] = createSignal(null); + const [shortcutHits, setShortcutHits] = createSignal(0); + onCleanup(onBump(setBump)); + useShortcut('Mod+K', () => setShortcutHits((n) => n + 1)); + return ( +
+ active: {String(motionActive())} + editing: {motionEditing() ? 'yes' : 'no'} + last bump: {bump() ?? '-'} + Mod+K hits: {shortcutHits()} +
+ ); +} + +// Inline stand-ins for overlays until dialogs exist. Closing puts focus back on the opener. +function DemoOverlay(props: { + title: string; + modal?: boolean; + onClose: () => void; + children?: JSX.Element; +}) { + const opener = document.activeElement; + function close() { + props.onClose(); + if (opener instanceof HTMLElement) opener.focus(); + } + useBack(close, { + get modal() { + return props.modal; + }, + }); + return ( + + + {props.title} {props.modal ? '(modal: Mod+K suspended)' : ''} + + + {props.children} + close + + + ); +} + +function BackStackDemo() { + const [page, setPage] = createSignal(1); + const [panel, setPanel] = createSignal(false); + const [dialog, setDialog] = createSignal(false); + const [log, setLog] = createSignal([]); + + function record(line: string) { + setLog((list) => [line, ...list].slice(0, 5)); + } + + // Fake router history under the overlays: pad B goes back, Escape does not + setBackFallback({ + can: () => page() > 1, + back: () => { + record(`history: page ${page()} -> ${page() - 1}`); + setPage((p) => p - 1); + }, + }); + onCleanup(() => setBackFallback(null)); + + return ( +
+ + page {page()}, can handle back: {String(canHandleBack())} + + + setPage((p) => p + 1)}>next page + setPanel(true)}>open panel + + + { + record('panel closed'); + setPanel(false); + }} + > + + setDialog(true)}> + open dialog on top + + + + + { + record('dialog closed'); + setDialog(false); + }} + /> + +
    + {(line) =>
  1. {line}
  2. }
    +
+
+ ); +} + +export function MotionDemo() { + return ( +
+ motion + +
+ + + {(name) => {name}} + + + + + + + {(name) => {name}} + + + + + i + 1)}> + {(n) => card {n}} + + + + + + + + + + + + + + i + 1)}> + {(n) => scroll row {n}} + + + + + trapped region: moves bump, leave with Tab or the mouse + + ok + cancel + + + +
+
+ ); +} diff --git a/gui/app-next/src/styles.css b/gui/app-next/src/styles.css index 1de6657c6..18a560d5e 100644 --- a/gui/app-next/src/styles.css +++ b/gui/app-next/src/styles.css @@ -580,6 +580,10 @@ outline-offset: 2px; } + .motion-active :focus-visible { + outline: none; + } + ::-webkit-scrollbar { width: 8px; height: 8px; diff --git a/gui/app-next/src/lib/l10n/localized.test.tsx b/gui/app-next/src/ui/localized.test.tsx similarity index 91% rename from gui/app-next/src/lib/l10n/localized.test.tsx rename to gui/app-next/src/ui/localized.test.tsx index 51880b146..f3a45de42 100644 --- a/gui/app-next/src/lib/l10n/localized.test.tsx +++ b/gui/app-next/src/ui/localized.test.tsx @@ -1,12 +1,7 @@ import { render } from '@solidjs/testing-library'; import { describe, expect, it } from 'vitest'; -import { - createBundle, - setL10nBundles, - Localized, - type LocalizedElems, -} from '@/lib/l10n'; -import { splitMarkup } from '@/lib/l10n/localized'; +import { createBundle, setL10nBundles } from '@/lib/l10n'; +import { Localized, type LocalizedElems, splitMarkup } from '@/ui/localized'; function renderLocalized(id: string, elems: LocalizedElems) { return render(() => ); diff --git a/gui/app-next/src/lib/l10n/localized.tsx b/gui/app-next/src/ui/localized.tsx similarity index 93% rename from gui/app-next/src/lib/l10n/localized.tsx rename to gui/app-next/src/ui/localized.tsx index 9adcd4c80..948e64fb1 100644 --- a/gui/app-next/src/lib/l10n/localized.tsx +++ b/gui/app-next/src/ui/localized.tsx @@ -1,5 +1,5 @@ import type { JSX } from 'solid-js'; -import { t, type MessageArgs, type MessageId } from '@/lib/l10n/translate'; +import { t, type MessageArgs, type MessageId } from '@/lib/l10n'; export type LocalizedElems = Partial< Record JSX.Element> diff --git a/gui/app-next/src/ui/motion/containers.tsx b/gui/app-next/src/ui/motion/containers.tsx new file mode 100644 index 000000000..5f872a6ca --- /dev/null +++ b/gui/app-next/src/ui/motion/containers.tsx @@ -0,0 +1,83 @@ +import { + createContext, + type JSX, + mergeProps, + onCleanup, + splitProps, + useContext, +} from 'solid-js'; +import { + attachContainer, + createContainer, + type MotionContainer, + type MotionEntry, + type MotionLayout, + type MotionOrientation, +} from './core'; + +export const MotionParent = createContext(null); + +export interface MotionContainerProps extends JSX.HTMLAttributes { + entry?: MotionEntry; +} + +type ContainerElementProps = MotionContainerProps & { + orientation?: MotionOrientation; + trap?: boolean; +}; + +function renderContainer(layout: MotionLayout, props: ContainerElementProps) { + const [local, rest] = splitProps(props, [ + 'orientation', + 'trap', + 'entry', + 'children', + ]); + const parent = useContext(MotionParent); + const container = createContainer(layout, parent, { + orientation: () => local.orientation ?? 'vertical', + entry: () => local.entry ?? 'last', + trap: () => local.trap ?? false, + }); + if (parent) onCleanup(attachContainer(container)); + + return ( +
(container.el = el)}> + + {local.children} + +
+ ); +} + +// Children in DOM order along one axis, bumps at the ends +export function MotionList( + props: MotionContainerProps & { orientation?: MotionOrientation } +) { + return renderContainer('list', props); +} + +export function MotionToolbar(props: MotionContainerProps) { + return renderContainer( + 'list', + mergeProps({ role: 'toolbar' as const }, props, { + orientation: 'horizontal' as const, + }) + ); +} + +// Moves to the aligned child in the next row or column, bumps at the edges +export function MotionGrid(props: MotionContainerProps) { + return renderContainer('grid', props); +} + +// A screen area (rail, page, dialog). Its children form a list, moves out of it +// pick the nearest sibling region by geometry. `trap` keeps moves inside. +export function MotionRegion( + props: MotionContainerProps & { + orientation?: MotionOrientation; + trap?: boolean; + } +) { + return renderContainer('region', props); +} diff --git a/gui/app-next/src/ui/motion/core.ts b/gui/app-next/src/ui/motion/core.ts new file mode 100644 index 000000000..97351a506 --- /dev/null +++ b/gui/app-next/src/ui/motion/core.ts @@ -0,0 +1,547 @@ +import { createSignal } from 'solid-js'; +import { handleBack, pushBack } from '@/lib/back-stack'; +import { isCapturing, isTextEntry } from '@/lib/keyboard'; +import { motionTuning } from './tuning'; + +export type Direction = 'up' | 'down' | 'left' | 'right'; +// Which arrow directions the focused item keeps for itself +export type MotionOwns = 'none' | 'horizontal' | 'all'; +// Where focus lands when a move enters a container +export type MotionEntry = 'last' | 'first' | 'nearest'; +export type MotionLayout = 'list' | 'grid' | 'region' | 'root'; +export type MotionOrientation = 'vertical' | 'horizontal'; + +export interface MotionItem { + kind: 'item'; + el: HTMLElement; + parent: MotionContainer; + owns(): MotionOwns; + // Pad only: directions reach the widget after A enters edit mode + edit(): boolean; +} + +export interface MotionContainer { + kind: MotionLayout; + el: HTMLElement | null; + parent: MotionContainer | null; + readonly orientation: MotionOrientation; + readonly entry: MotionEntry; + // Moves never leave it (dialogs) + readonly trap: boolean; + children: Set; + last: MotionNode | null; +} + +export type MotionNode = MotionItem | MotionContainer; + +interface Rect { + left: number; + top: number; + right: number; + bottom: number; +} + +const ZERO: Rect = { left: 0, top: 0, right: 0, bottom: 0 }; + +const ARROW: Record = { + up: 'ArrowUp', + down: 'ArrowDown', + left: 'ArrowLeft', + right: 'ArrowRight', +}; + +const KEY_DIR: Record = { + ArrowUp: 'up', + ArrowDown: 'down', + ArrowLeft: 'left', + ArrowRight: 'right', +}; + +const items = new WeakMap(); +const synthetic = new WeakSet(); +const bumpListeners = new Set<(dir: Direction) => void>(); +let root: MotionContainer | null = null; +// Last focused rect, so a move after focus was lost resumes nearby +let origin: Rect | null = null; +let releaseEdit: (() => void) | null = null; + +const [active, setActive] = createSignal(false); +const [editing, setEditing] = createSignal(null); + +// Directional motion in use: the ring is shown +export const motionActive = active; +export const motionEditing = editing; + +export function setMotionActive(on: boolean) { + setActive(on); + if (!on) exitEdit(); +} + +export function onBump(cb: (dir: Direction) => void): () => void { + bumpListeners.add(cb); + return () => bumpListeners.delete(cb); +} + +export function createContainer( + kind: MotionLayout, + parent: MotionContainer | null, + options: { + orientation?: () => MotionOrientation; + entry?: () => MotionEntry; + trap?: () => boolean; + } = {} +): MotionContainer { + return { + kind, + el: null, + parent, + get orientation() { + return options.orientation?.() ?? 'vertical'; + }, + get entry() { + return options.entry?.() ?? 'last'; + }, + get trap() { + return options.trap?.() ?? false; + }, + children: new Set(), + last: null, + }; +} + +export function setMotionRoot(container: MotionContainer | null) { + root = container; +} + +export function attachContainer(container: MotionContainer): () => void { + container.parent?.children.add(container); + return () => { + const parent = container.parent; + if (!parent) return; + parent.children.delete(container); + if (parent.last === container) parent.last = null; + }; +} + +export function registerItem( + parent: MotionContainer, + el: HTMLElement, + owns: () => MotionOwns, + edit: () => boolean +): () => void { + const item: MotionItem = { kind: 'item', el, parent, owns, edit }; + items.set(el, item); + parent.children.add(item); + return () => { + items.delete(el); + parent.children.delete(item); + if (parent.last === item) parent.last = null; + if (editing() === item) exitEdit(); + }; +} + +function elOf(node: MotionNode): HTMLElement | null { + return node.el; +} + +function rectOf(node: MotionNode): Rect { + return elOf(node)?.getBoundingClientRect() ?? ZERO; +} + +function visible(el: HTMLElement): boolean { + if (!el.isConnected || el.closest('[inert]')) return false; + return typeof el.checkVisibility === 'function' ? el.checkVisibility() : true; +} + +function navigable(node: MotionNode): boolean { + if (node.kind === 'item') { + return ( + visible(node.el) && (node.el as Partial).disabled !== true + ); + } + if (node.el && !visible(node.el)) return false; + for (const child of node.children) if (navigable(child)) return true; + return false; +} + +function domOrder(a: MotionNode, b: MotionNode): number { + const ea = elOf(a); + const eb = elOf(b); + if (!ea || !eb || ea === eb) return 0; + return ea.compareDocumentPosition(eb) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1; +} + +function ordered(container: MotionContainer): MotionNode[] { + return [...container.children].filter(navigable).sort(domOrder); +} + +function isVertical(dir: Direction): boolean { + return dir === 'up' || dir === 'down'; +} + +function isBackward(dir: Direction): boolean { + return dir === 'up' || dir === 'left'; +} + +// Gap along the move axis, or null when `to` is not in that direction +function gapToward(from: Rect, to: Rect, dir: Direction): number | null { + const gap = { + up: from.top - to.bottom, + down: to.top - from.bottom, + left: from.left - to.right, + right: to.left - from.right, + }[dir]; + return gap >= -1 ? Math.max(0, gap) : null; +} + +function crossOverlap(from: Rect, to: Rect, dir: Direction): number { + return isVertical(dir) + ? Math.min(from.right, to.right) - Math.max(from.left, to.left) + : Math.min(from.bottom, to.bottom) - Math.max(from.top, to.top); +} + +function crossDistance(from: Rect, to: Rect, dir: Direction): number { + return isVertical(dir) + ? Math.abs(from.left + from.right - to.left - to.right) / 2 + : Math.abs(from.top + from.bottom - to.top - to.bottom) / 2; +} + +function lessThan(a: number[], b: number[]): boolean { + for (let i = 0; i < a.length; i++) { + if (a[i] !== b[i]) return a[i]! < b[i]!; + } + return false; +} + +// Cross-axis alignment first, then distance along the axis, then off-axis distance +function pickInDirection( + from: Rect, + candidates: MotionNode[], + dir: Direction, + alignedOnly: boolean +): MotionNode | null { + let best: MotionNode | null = null; + let bestScore: number[] = []; + for (const candidate of candidates) { + const rect = rectOf(candidate); + const gap = gapToward(from, rect, dir); + if (gap === null) continue; + const aligned = crossOverlap(from, rect, dir) > 0; + if (alignedOnly && !aligned) continue; + const score = [aligned ? 0 : 1, gap, crossDistance(from, rect, dir)]; + if (best === null || lessThan(score, bestScore)) { + best = candidate; + bestScore = score; + } + } + return best; +} + +function nearest(from: Rect, candidates: MotionNode[]): MotionNode | null { + let best: MotionNode | null = null; + let bestDistance = Infinity; + for (const candidate of candidates) { + const r = rectOf(candidate); + const dx = Math.max(0, r.left - from.right, from.left - r.right); + const dy = Math.max(0, r.top - from.bottom, from.top - r.bottom); + const distance = Math.hypot(dx, dy); + if (distance < bestDistance) { + best = candidate; + bestDistance = distance; + } + } + return best; +} + +// Next sibling inside `container`, or null to bubble up +function step( + container: MotionContainer, + node: MotionNode, + dir: Direction +): MotionNode | null { + const siblings = ordered(container); + if (container.kind === 'grid') { + return pickInDirection( + rectOf(node), + siblings.filter((s) => s !== node), + dir, + true + ); + } + if (isVertical(dir) !== (container.orientation === 'vertical')) return null; + const i = siblings.indexOf(node); + if (i < 0) return null; + return siblings[i + (isBackward(dir) ? -1 : 1)] ?? null; +} + +// The item focus lands on when entering `node` +function enter(node: MotionNode, from: Rect): MotionItem | null { + if (node.kind === 'item') return node; + const children = ordered(node); + if (!children.length) return null; + let pick: MotionNode | null = null; + if (node.entry === 'last' && node.last && children.includes(node.last)) + pick = node.last; + else if (node.entry === 'first') pick = children[0]!; + pick ??= nearest(from, children) ?? children[0]!; + return enter(pick, from); +} + +// Item to container to parent; geometry only between regions +function resolve(item: MotionItem, dir: Direction): MotionItem | null { + const from = item.el.getBoundingClientRect(); + let node: MotionNode = item; + for ( + let container: MotionContainer | null = item.parent; + container; + container = container.parent + ) { + const next = + node.kind === 'region' + ? pickInDirection( + rectOf(node), + ordered(container).filter((s) => s !== node), + dir, + false + ) + : step(container, node, dir); + const target = next && enter(next, from); + if (target) return target; + if (container.trap) return null; + node = container; + } + return null; +} + +function scrollableToward(el: HTMLElement, dir: Direction): HTMLElement | null { + const vertical = isVertical(dir); + for (let n = el.parentElement; n; n = n.parentElement) { + const style = getComputedStyle(n); + const overflow = vertical ? style.overflowY : style.overflowX; + if (overflow !== 'auto' && overflow !== 'scroll') continue; + const pos = vertical ? n.scrollTop : n.scrollLeft; + const span = vertical ? n.clientHeight : n.clientWidth; + const max = vertical + ? n.scrollHeight - n.clientHeight + : n.scrollWidth - n.clientWidth; + // A vertical column reports a few px of sideways overflow (scrollbar, scaled child) + if (max <= Math.max(8, span * 0.1)) continue; + const atEdge = isBackward(dir) ? pos <= 1 : pos >= max - 1; + if (!atEdge) return n; + } + return null; +} + +function focused(): HTMLElement | null { + const el = document.activeElement; + return el instanceof HTMLElement && el !== document.body ? el : null; +} + +function focusItem(item: MotionItem) { + item.el.focus({ preventScroll: true }); + item.el.scrollIntoView?.({ block: 'nearest', inline: 'nearest' }); +} + +export function move(dir: Direction) { + const el = focused(); + const item = el ? items.get(el) : undefined; + // Not on an item: resume at the remembered item, or nearest to where focus was last + if (!item) { + placeCursor(); + return; + } + const target = resolve(item, dir); + + // Scroll the region the cursor sits in rather than leaving it early + const scroller = scrollableToward(item.el, dir); + if (scroller && (!target || !scroller.contains(target.el))) { + const span = isVertical(dir) ? scroller.clientHeight : scroller.clientWidth; + const by = (isBackward(dir) ? -1 : 1) * span * motionTuning.scrollFraction; + scroller.scrollBy(isVertical(dir) ? { top: by } : { left: by }); + return; + } + if (!target) { + for (const cb of bumpListeners) cb(dir); + return; + } + focusItem(target); +} + +// Dispatch a keydown so the widget runs its own logic; true when it was consumed +function synthKey(el: HTMLElement, key: string): boolean { + const event = new KeyboardEvent('keydown', { + key, + code: key, + bubbles: true, + cancelable: true, + }); + synthetic.add(event); + el.dispatchEvent(event); + return event.defaultPrevented; +} + +function press(el: HTMLElement) { + if (el.getAttribute('aria-disabled') === 'true') return; + if (!synthKey(el, 'Enter')) el.click(); +} + +function ownsOf(el: HTMLElement): MotionOwns { + return items.get(el)?.owns() ?? 'none'; +} + +function ownsDirection(owns: MotionOwns, dir: Direction): boolean { + return owns === 'all' || (owns === 'horizontal' && !isVertical(dir)); +} + +function enterEdit(item: MotionItem) { + exitEdit(); + setEditing(item); + releaseEdit = pushBack(exitEdit); +} + +function exitEdit() { + releaseEdit?.(); + releaseEdit = null; + setEditing(null); +} + +function placeCursor() { + const target = root && enter(root, origin ?? ZERO); + if (target) focusItem(target); +} + +// A pad's first press after pointer use only reveals the ring +function reveal(): boolean { + if (active()) return false; + setActive(true); + if (focused()) return true; + placeCursor(); + return true; +} + +export function padMove(dir: Direction) { + if (reveal()) return; + const el = focused(); + if (el) { + const edited = editing(); + if (edited?.el === el) { + synthKey(el, ARROW[dir]); + return; + } + const item = items.get(el); + if (!item?.edit() && ownsDirection(ownsOf(el), dir) && synthKey(el, ARROW[dir])) + return; + } + move(dir); +} + +export function padActivate() { + if (reveal()) return; + const el = focused(); + if (!el) return; + if (editing()) { + exitEdit(); + return; + } + const item = items.get(el); + if (item?.edit()) { + enterEdit(item); + return; + } + press(el); +} + +export function padBack() { + setActive(true); + handleBack(); +} + +export function padConnected() { + setActive(true); + if (!focused()) placeCursor(); +} + +// Ctrl/Alt+Arrow moves from anywhere, Ctrl/Alt+Enter/Space activates. +// Ctrl/Alt+Left/Right in a text field stay word jumps. +function onForceKey(e: KeyboardEvent) { + if (synthetic.has(e) || isCapturing()) return; + if (!(e.ctrlKey || e.altKey) || e.metaKey || e.shiftKey) return; + const dir = KEY_DIR[e.key]; + if (dir) { + if (!isVertical(dir) && isTextEntry(e.target)) return; + e.preventDefault(); + e.stopPropagation(); + setActive(true); + exitEdit(); + move(dir); + return; + } + const el = focused(); + if ((e.key === 'Enter' || e.key === ' ') && el) { + e.preventDefault(); + e.stopPropagation(); + setActive(true); + press(el); + } +} + +// Plain arrows move focus unless the focused item owns that axis +function onKey(e: KeyboardEvent) { + if (synthetic.has(e) || e.defaultPrevented || isCapturing()) return; + if (e.key === 'Tab') { + setActive(true); + return; + } + const dir = KEY_DIR[e.key]; + if (!dir || e.ctrlKey || e.altKey || e.metaKey || e.shiftKey) return; + const el = focused(); + if (el && (editing()?.el === el || ownsDirection(ownsOf(el), dir))) return; + e.preventDefault(); + setActive(true); + move(dir); +} + +function onFocusIn(e: FocusEvent) { + const item = e.target instanceof HTMLElement ? items.get(e.target) : undefined; + if (editing() && editing() !== item) exitEdit(); + if (!item) return; + let node: MotionNode = item; + for ( + let container: MotionContainer | null = item.parent; + container; + container = container.parent + ) { + container.last = node; + node = container; + } +} + +// Still measurable during the blur, so a later move can resume +function onFocusOut(e: FocusEvent) { + const el = e.target; + if (!(el instanceof HTMLElement) || !el.getClientRects().length) return; + const r = el.getBoundingClientRect(); + origin = { left: r.left, top: r.top, right: r.right, bottom: r.bottom }; +} + +function onPointerDown(e: PointerEvent) { + if (e.isTrusted) setMotionActive(false); +} + +export function initMotion(): () => void { + window.addEventListener('keydown', onForceKey, true); + window.addEventListener('keydown', onKey); + window.addEventListener('pointerdown', onPointerDown, true); + document.addEventListener('focusin', onFocusIn); + document.addEventListener('focusout', onFocusOut, true); + return () => { + window.removeEventListener('keydown', onForceKey, true); + window.removeEventListener('keydown', onKey); + window.removeEventListener('pointerdown', onPointerDown, true); + document.removeEventListener('focusin', onFocusIn); + document.removeEventListener('focusout', onFocusOut, true); + exitEdit(); + setActive(false); + origin = null; + }; +} diff --git a/gui/app-next/src/ui/motion/gamepad.test.ts b/gui/app-next/src/ui/motion/gamepad.test.ts new file mode 100644 index 000000000..36dabcbcd --- /dev/null +++ b/gui/app-next/src/ui/motion/gamepad.test.ts @@ -0,0 +1,26 @@ +import { describe, expect, it } from 'vitest'; +import { repeatInterval, resolveStick } from './gamepad'; +import { motionTuning } from './tuning'; + +describe('resolveStick', () => { + it('commits above the enter deadzone and holds down to the exit one', () => { + expect(resolveStick(0.3, 0, null)).toBeNull(); + expect(resolveStick(0.4, 0, null)).toBe('right'); + expect(resolveStick(0.3, 0, 'right')).toBe('right'); + expect(resolveStick(0.2, 0, 'right')).toBeNull(); + }); + + it('keeps the held axis on a diagonal until the other clearly leads', () => { + expect(resolveStick(0.6, 0.7, 'right')).toBe('right'); + expect(resolveStick(0.4, 0.8, 'right')).toBe('down'); + expect(resolveStick(-0.7, -0.6, 'up')).toBe('up'); + }); +}); + +describe('repeatInterval', () => { + it('ramps down to the minimum', () => { + expect(repeatInterval(0)).toBe(motionTuning.repeatStartMs); + expect(repeatInterval(1)).toBeLessThan(motionTuning.repeatStartMs); + expect(repeatInterval(100)).toBe(motionTuning.repeatMinMs); + }); +}); diff --git a/gui/app-next/src/ui/motion/gamepad.ts b/gui/app-next/src/ui/motion/gamepad.ts new file mode 100644 index 000000000..9a81f501b --- /dev/null +++ b/gui/app-next/src/ui/motion/gamepad.ts @@ -0,0 +1,169 @@ +import type { Direction } from './core'; +import { motionTuning } from './tuning'; + +const BUTTON_A = 0; +const BUTTON_B = 1; + +const DPAD: Record = { + 12: 'up', + 13: 'down', + 14: 'left', + 15: 'right', +}; + +export interface GamepadFrame { + buttons: Set; + axX: number; + axY: number; +} + +export interface PadCommands { + move(dir: Direction): void; + activate(): void; + back(): void; + connected(): void; +} + +export function decodeInput(pads: readonly (Gamepad | null)[]): GamepadFrame { + const buttons = new Set(); + const stronger = (a: number, b: number) => (Math.abs(a) > Math.abs(b) ? a : b); + let axX = 0; + let axY = 0; + for (const pad of pads) { + if (!pad) continue; + pad.buttons.forEach((b, i) => { + if (b.pressed) buttons.add(i); + }); + axX = stronger(pad.axes[0] ?? 0, axX); + axY = stronger(pad.axes[1] ?? 0, axY); + } + return { buttons, axX, axY }; +} + +export function resolveStick( + axX: number, + axY: number, + prev: Direction | null +): Direction | null { + const ax = Math.abs(axX); + const ay = Math.abs(axY); + const mag = Math.max(ax, ay); + if (mag < motionTuning.deadzoneExit) return null; + if (mag < motionTuning.deadzoneEnter && !prev) return null; + + const ratio = motionTuning.axisSwitchRatio; + let horizontal = ax > ay; + if (prev === 'left' || prev === 'right') horizontal = ax * ratio >= ay; + else if (prev === 'up' || prev === 'down') horizontal = ax >= ay * ratio; + + if (horizontal) return axX > 0 ? 'right' : 'left'; + return axY > 0 ? 'down' : 'up'; +} + +export function pressedDirections( + frame: GamepadFrame, + stickDir: Direction | null +): Set { + const dirs = new Set(); + for (const i of frame.buttons) { + const dir = DPAD[i]; + if (dir) dirs.add(dir); + } + if (stickDir) dirs.add(stickDir); + return dirs; +} + +export function repeatInterval(repeats: number): number { + return Math.max( + motionTuning.repeatMinMs, + motionTuning.repeatStartMs - motionTuning.repeatRampMs * repeats + ); +} + +interface Held { + firedAt: number; + repeats: number; +} + +export function startGamepad(commands: PadCommands): () => void { + if (typeof navigator === 'undefined' || !navigator.getGamepads) return () => {}; + + const pads = new Set(); + const held = new Map(); + let prevButtons = new Set(); + let stickDir: Direction | null = null; + let rafId = 0; + + function resetHeld() { + held.clear(); + prevButtons = new Set(); + stickDir = null; + } + + function pressDir(dir: Direction, now: number) { + const state = held.get(dir); + if (!state) { + held.set(dir, { firedAt: now, repeats: 0 }); + commands.move(dir); + return; + } + const wait = + state.repeats === 0 ? motionTuning.repeatDelayMs : repeatInterval(state.repeats); + if (now - state.firedAt < wait) return; + state.firedAt = now; + state.repeats++; + commands.move(dir); + } + + function poll() { + const now = performance.now(); + const frame = decodeInput(navigator.getGamepads()); + stickDir = resolveStick(frame.axX, frame.axY, stickDir); + const dirs = pressedDirections(frame, stickDir); + + const { buttons } = frame; + if (buttons.has(BUTTON_A) && !prevButtons.has(BUTTON_A)) commands.activate(); + if (buttons.has(BUTTON_B) && !prevButtons.has(BUTTON_B)) commands.back(); + prevButtons = buttons; + + for (const dir of dirs) pressDir(dir, now); + for (const dir of [...held.keys()]) { + if (!dirs.has(dir)) held.delete(dir); + } + rafId = pads.size > 0 ? requestAnimationFrame(poll) : 0; + } + + function startLoop() { + if (!rafId) rafId = requestAnimationFrame(poll); + } + + function onConnect(e: GamepadEvent) { + pads.add(e.gamepad.index); + startLoop(); + commands.connected(); + } + + function onDisconnect(e: GamepadEvent) { + pads.delete(e.gamepad.index); + } + + window.addEventListener('gamepadconnected', onConnect); + window.addEventListener('gamepaddisconnected', onDisconnect); + window.addEventListener('blur', resetHeld); + document.addEventListener('visibilitychange', resetHeld); + for (const pad of navigator.getGamepads()) { + if (pad) pads.add(pad.index); + } + if (pads.size) startLoop(); + + return () => { + if (rafId) cancelAnimationFrame(rafId); + rafId = 0; + window.removeEventListener('gamepadconnected', onConnect); + window.removeEventListener('gamepaddisconnected', onDisconnect); + window.removeEventListener('blur', resetHeld); + document.removeEventListener('visibilitychange', resetHeld); + resetHeld(); + pads.clear(); + }; +} diff --git a/gui/app-next/src/ui/motion/index.ts b/gui/app-next/src/ui/motion/index.ts new file mode 100644 index 000000000..d4ac2b39b --- /dev/null +++ b/gui/app-next/src/ui/motion/index.ts @@ -0,0 +1,21 @@ +export { + MotionGrid, + MotionList, + MotionRegion, + MotionToolbar, + type MotionContainerProps, +} from './containers'; +export { + type Direction, + move, + motionActive, + motionEditing, + type MotionEntry, + type MotionOrientation, + type MotionOwns, + onBump, + setMotionActive, +} from './core'; +export { controllerMotionPref, MotionRoot } from './motion-root'; +export { motionTuning } from './tuning'; +export { type MotionItemOptions, useMotionItem } from './use-motion-item'; diff --git a/gui/app-next/src/ui/motion/motion-ring.tsx b/gui/app-next/src/ui/motion/motion-ring.tsx new file mode 100644 index 000000000..0d6bee2ef --- /dev/null +++ b/gui/app-next/src/ui/motion/motion-ring.tsx @@ -0,0 +1,113 @@ +import { createEffect, createSignal, onCleanup, onMount } from 'solid-js'; +import { type Direction, motionActive, motionEditing, onBump } from './core'; +import { motionTuning } from './tuning'; + +const BUMP: Record = { + up: [0, -1], + down: [0, 1], + left: [-1, 0], + right: [1, 0], +}; + +function reducedMotion(): boolean { + return ( + window.matchMedia?.('(prefers-reduced-motion: reduce)').matches ?? false + ); +} + +// Overlay that glides to the focused element while directional motion is in use +export function MotionRing() { + let ring!: HTMLDivElement; + let frame = 0; + // Element the ring currently sits on, null while hidden + let placedOn: HTMLElement | null = null; + const [target, setTarget] = createSignal(null); + + function place() { + cancelAnimationFrame(frame); + frame = 0; + const el = target(); + if (!el || !el.isConnected || !motionActive()) { + ring.style.opacity = '0'; + placedOn = null; + return; + } + const r = el.getBoundingClientRect(); + const pad = motionTuning.ringPaddingPx; + // Glide only to a new target; appearing, scrolling and resizing snap + const glide = placedOn !== null && placedOn !== el; + ring.style.transitionDuration = glide + ? `${motionTuning.ringGlideMs}ms` + : '0ms'; + ring.style.transform = `translate(${r.left - pad}px, ${r.top - pad}px)`; + ring.style.width = `${r.width + pad * 2}px`; + ring.style.height = `${r.height + pad * 2}px`; + ring.style.opacity = '1'; + placedOn = el; + } + + function schedule() { + if (!frame) frame = requestAnimationFrame(place); + } + + function onFocusIn(e: FocusEvent) { + setTarget(e.target instanceof HTMLElement ? e.target : null); + } + + function onFocusOut(e: FocusEvent) { + if (!e.relatedTarget) setTarget(null); + } + + onMount(() => { + const active = document.activeElement; + if (active instanceof HTMLElement && active !== document.body) + setTarget(active); + document.addEventListener('focusin', onFocusIn); + document.addEventListener('focusout', onFocusOut); + window.addEventListener('scroll', place, true); + window.addEventListener('resize', place); + const stopBump = onBump((dir) => { + if (!placedOn || reducedMotion() || !ring.animate) return; + const [x, y] = BUMP[dir]; + const px = motionTuning.bumpPx; + ring.animate( + [ + { translate: '0 0' }, + { translate: `${x * px}px ${y * px}px` }, + { translate: '0 0' }, + ], + { duration: motionTuning.bumpMs, easing: 'ease-out' } + ); + }); + onCleanup(() => { + document.removeEventListener('focusin', onFocusIn); + document.removeEventListener('focusout', onFocusOut); + window.removeEventListener('scroll', place, true); + window.removeEventListener('resize', place); + stopBump(); + cancelAnimationFrame(frame); + }); + }); + + createEffect(() => { + const el = target(); + motionActive(); + schedule(); + if (!el || typeof ResizeObserver === 'undefined') return; + const observer = new ResizeObserver(schedule); + observer.observe(el); + onCleanup(() => observer.disconnect()); + }); + + return ( +
+ ); +} diff --git a/gui/app-next/src/ui/motion/motion-root.tsx b/gui/app-next/src/ui/motion/motion-root.tsx new file mode 100644 index 000000000..7b96defda --- /dev/null +++ b/gui/app-next/src/ui/motion/motion-root.tsx @@ -0,0 +1,53 @@ +import { createEffect, type JSX, onCleanup, onMount } from 'solid-js'; +import * as v from 'valibot'; +import { definePref } from '@/lib/storage'; +import { MotionParent } from './containers'; +import { + createContainer, + initMotion, + motionActive, + padActivate, + padBack, + padConnected, + padMove, + setMotionRoot, +} from './core'; +import { startGamepad } from './gamepad'; +import { MotionRing } from './motion-ring'; + +export const controllerMotionPref = definePref( + 'controllerNav', + v.boolean(), + true +); + +export function MotionRoot(props: { children: JSX.Element }) { + const root = createContainer('root', null); + setMotionRoot(root); + onCleanup(() => setMotionRoot(null)); + + onMount(() => onCleanup(initMotion())); + + createEffect(() => { + if (!controllerMotionPref()) return; + onCleanup( + startGamepad({ + move: padMove, + activate: padActivate, + back: padBack, + connected: padConnected, + }) + ); + }); + + createEffect(() => + document.documentElement.classList.toggle('motion-active', motionActive()) + ); + + return ( + + {props.children} + + + ); +} diff --git a/gui/app-next/src/ui/motion/motion.test.tsx b/gui/app-next/src/ui/motion/motion.test.tsx new file mode 100644 index 000000000..ca7ed301c --- /dev/null +++ b/gui/app-next/src/ui/motion/motion.test.tsx @@ -0,0 +1,253 @@ +import { cleanup, render, screen } from '@solidjs/testing-library'; +import type { JSX } from 'solid-js'; +import { afterEach, describe, expect, it, vi } from 'vitest'; +import { handleBack } from '@/lib/back-stack'; +import { + type Direction, + motionEditing, + onBump, + padActivate, + padMove, + setMotionActive, +} from './core'; +import { MotionList, MotionRegion, MotionToolbar } from './containers'; +import { MotionRoot } from './motion-root'; +import { type MotionItemOptions, useMotionItem } from './use-motion-item'; + +afterEach(() => { + setMotionActive(false); + cleanup(); +}); + +function Item(props: { name: string } & MotionItemOptions) { + let ref!: HTMLButtonElement; + useMotionItem(() => ref, props); + return ; +} + +function Field(props: { name: string } & MotionItemOptions) { + let ref!: HTMLInputElement; + useMotionItem(() => ref, props); + return ; +} + +function setup(tree: () => JSX.Element) { + render(() => {tree()}); +} + +const KEYS: Record = { + up: 'ArrowUp', + down: 'ArrowDown', + left: 'ArrowLeft', + right: 'ArrowRight', +}; + +function arrow(dir: Direction, init: KeyboardEventInit = {}) { + const target = document.activeElement ?? document.body; + const event = new KeyboardEvent('keydown', { + key: KEYS[dir], + bubbles: true, + cancelable: true, + ...init, + }); + target.dispatchEvent(event); + return event; +} + +function button(name: string) { + return screen.getByRole('button', { name }); +} + +function focused() { + return document.activeElement; +} + +// jsdom has no layout +function place( + el: HTMLElement, + left: number, + top: number, + width: number, + height: number +) { + vi.spyOn(el, 'getBoundingClientRect').mockReturnValue({ + left, + top, + width, + height, + right: left + width, + bottom: top + height, + x: left, + y: top, + toJSON: () => ({}), + }); +} + +describe('motion moves', () => { + it('steps along a list and bubbles out of a nested toolbar', () => { + setup(() => ( + + + + + + + + + )); + button('a').focus(); + arrow('down'); + expect(focused()).toBe(button('b1')); + arrow('right'); + expect(focused()).toBe(button('b2')); + arrow('down'); + expect(focused()).toBe(button('c')); + // Re-entering the toolbar lands on the remembered item + arrow('up'); + expect(focused()).toBe(button('b2')); + }); + + it('bumps at the end instead of wrapping', () => { + const bumps: Direction[] = []; + const stop = onBump((dir) => bumps.push(dir)); + setup(() => ( + + + + + )); + button('b').focus(); + arrow('down'); + arrow('right'); + stop(); + expect(focused()).toBe(button('b')); + expect(bumps).toEqual(['down', 'right']); + }); + + it('leaves owned axes to the widget', () => { + setup(() => ( + + + + + )); + const field = screen.getByLabelText('field'); + field.focus(); + expect(arrow('left').defaultPrevented).toBe(false); + expect(focused()).toBe(field); + expect(arrow('down').defaultPrevented).toBe(true); + expect(focused()).toBe(button('next')); + }); + + it('force moves with Ctrl+Arrow out of a widget that owns everything', () => { + setup(() => ( + + + + + )); + screen.getByLabelText('field').focus(); + arrow('down'); + expect(focused()).toBe(screen.getByLabelText('field')); + arrow('down', { ctrlKey: true }); + expect(focused()).toBe(button('next')); + }); + + it('crosses between regions by geometry', () => { + setup(() => ( + <> + + + + + + + + + )); + place(screen.getByTestId('rail'), 0, 0, 100, 500); + place(button('rail'), 10, 10, 80, 40); + place(screen.getByTestId('page'), 100, 0, 400, 500); + place(button('p1'), 110, 10, 200, 40); + place(button('p2'), 110, 60, 200, 40); + button('p2').focus(); + arrow('left'); + expect(focused()).toBe(button('rail')); + arrow('right'); + // Remembered item of the page region + expect(focused()).toBe(button('p2')); + }); + + it('keeps moves inside a trapped region', () => { + const bumps: Direction[] = []; + const stop = onBump((dir) => bumps.push(dir)); + setup(() => ( + <> + + + + + + + + )); + place(screen.getByTestId('page'), 0, 0, 500, 500); + place(button('page'), 10, 10, 80, 40); + place(screen.getByTestId('dialog'), 100, 100, 200, 100); + place(button('ok'), 110, 110, 80, 40); + button('ok').focus(); + arrow('up'); + stop(); + expect(focused()).toBe(button('ok')); + expect(bumps).toEqual(['up']); + }); +}); + +describe('pad', () => { + it('only reveals on the first press', () => { + setup(() => ( + + + + + )); + button('a').focus(); + padMove('down'); + expect(focused()).toBe(button('a')); + padMove('down'); + expect(focused()).toBe(button('b')); + }); + + it('edit mode sends directions to the widget until back', () => { + const keys: string[] = []; + function Dial() { + let ref!: HTMLButtonElement; + useMotionItem(() => ref, { edit: true }); + return ( + + ); + } + setup(() => ( + + + + + )); + button('dial').focus(); + setMotionActive(true); + padMove('down'); + expect(focused()).toBe(button('b')); + button('dial').focus(); + padActivate(); + expect(motionEditing()?.el).toBe(button('dial')); + padMove('down'); + expect(focused()).toBe(button('dial')); + expect(keys).toEqual(['ArrowDown']); + expect(handleBack()).toBe(true); + expect(motionEditing()).toBeNull(); + padMove('down'); + expect(focused()).toBe(button('b')); + }); +}); diff --git a/gui/app-next/src/ui/motion/tuning.ts b/gui/app-next/src/ui/motion/tuning.ts new file mode 100644 index 000000000..5b96ce2cd --- /dev/null +++ b/gui/app-next/src/ui/motion/tuning.ts @@ -0,0 +1,19 @@ +// Every feel value of directional motion lives here +export const motionTuning = { + // Held direction: first repeat after the delay, then the interval shrinks per repeat down to the minimum + repeatDelayMs: 350, + repeatStartMs: 100, + repeatMinMs: 50, + repeatRampMs: 10, + // Stick deadzone with hysteresis: commit above enter, release below exit + deadzoneEnter: 0.35, + deadzoneExit: 0.25, + // A held diagonal switches axis only when the other axis leads by this much + axisSwitchRatio: 1.4, + // Part of the visible span scrolled when a move stays inside a scroller + scrollFraction: 0.6, + ringGlideMs: 120, + ringPaddingPx: 3, + bumpPx: 4, + bumpMs: 160, +}; diff --git a/gui/app-next/src/ui/motion/use-motion-item.ts b/gui/app-next/src/ui/motion/use-motion-item.ts new file mode 100644 index 000000000..bf2b44f50 --- /dev/null +++ b/gui/app-next/src/ui/motion/use-motion-item.ts @@ -0,0 +1,36 @@ +import { type Accessor, onCleanup, onMount, useContext } from 'solid-js'; +import { motionEditing, type MotionOwns, registerItem } from './core'; +import { MotionParent } from './containers'; + +export interface MotionItemOptions { + // passthrough (none), owns-horizontal, owns-all + owns?: MotionOwns | Accessor; + // Pad: A enters edit mode, then every direction goes to the widget + edit?: boolean | Accessor; +} + +function read(value: T | Accessor | undefined, fallback: T): T { + if (value === undefined) return fallback; + return typeof value === 'function' ? (value as Accessor)() : value; +} + +// Registers a focusable element with the enclosing motion container. No-op outside MotionRoot. +export function useMotionItem( + ref: () => HTMLElement | undefined, + options: MotionItemOptions = {} +) { + const parent = useContext(MotionParent); + onMount(() => { + const el = ref(); + if (!parent || !el) return; + onCleanup( + registerItem( + parent, + el, + () => read(options.owns, 'none'), + () => read(options.edit, false) + ) + ); + }); + return { editing: () => motionEditing()?.el === ref() }; +} diff --git a/gui/shared/src/interface.ts b/gui/shared/src/interface.ts index 2981f35c6..c92ad3dac 100644 --- a/gui/shared/src/interface.ts +++ b/gui/shared/src/interface.ts @@ -1,4 +1,4 @@ -import { +import type { OpenDialogOptions, OpenDialogReturnValue, SaveDialogOptions, diff --git a/gui/shared/src/ipc.ts b/gui/shared/src/ipc.ts index 57737372b..da04aeab4 100644 --- a/gui/shared/src/ipc.ts +++ b/gui/shared/src/ipc.ts @@ -1,10 +1,10 @@ -import { +import type { OpenDialogOptions, OpenDialogReturnValue, SaveDialogOptions, SaveDialogReturnValue, } from 'electron'; -import { +import type { CrashReportKind, DiscordPresence, ErrorReportingState, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index be1c25156..5cf693c87 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -432,9 +432,15 @@ importers: eslint-import-resolver-typescript: specifier: ^4.4.4 version: 4.4.5(eslint-plugin-import@2.32.0)(eslint@10.13.0(jiti@1.21.7)(supports-color@7.2.0))(supports-color@7.2.0) + eslint-plugin-better-tailwindcss: + specifier: 4.10.0 + version: 4.10.0(eslint@10.13.0(jiti@1.21.7)(supports-color@7.2.0))(tailwindcss@4.3.3)(typescript@6.0.3) eslint-plugin-boundaries: specifier: 7.3.0 version: 7.3.0(@typescript-eslint/parser@8.72.0(eslint@10.13.0(jiti@1.21.7)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint-import-resolver-typescript@4.4.5)(eslint@10.13.0(jiti@1.21.7)(supports-color@7.2.0))(supports-color@7.2.0) + eslint-plugin-jsx-a11y: + specifier: 6.10.2 + version: 6.10.2(eslint@10.13.0(jiti@1.21.7)(supports-color@7.2.0)) eslint-plugin-solid: specifier: 0.18.1 version: 0.18.1(eslint@10.13.0(jiti@1.21.7)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) @@ -447,15 +453,9 @@ importers: prettier: specifier: 3.9.10 version: 3.9.10 - svgo: - specifier: 4.1.0 - version: 4.1.0 tailwindcss: specifier: 4.3.3 version: 4.3.3 - tsx: - specifier: 4.23.15 - version: 4.23.15 typescript: specifier: ~6.0.3 version: 6.0.3 @@ -762,6 +762,9 @@ packages: resolution: {integrity: sha512-3LKP7F2+atl9vJFhaBjn4nOaSWahZ/yWjOvA4e5pnXkt2qyXRCHLxoBQy81GFtLGCq7K9lPm9R517M1U+/90Qg==} engines: {node: '>=18'} + '@dual-bundle/import-meta-resolve@4.2.1': + resolution: {integrity: sha512-id+7YRUgoUX6CgV0DtuhirQWodeeA7Lf4i2x71JS/vtA5pRb/hIGWlw+G6MeXvsM+MXrz0VAydTGElX1rAfgPg==} + '@dword-design/dedent@0.7.0': resolution: {integrity: sha512-OFmAmzKiDUh9m7WRMYcoEOPI7b5tS5hdqQmtKDwF+ZssVJv8a+GHo9VOtFsmlw3h8Roh/9QzFWIsjSFZyQUMdg==} @@ -1319,6 +1322,10 @@ packages: resolution: {integrity: sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==} engines: {node: ^20.19.0 || ^22.13.0 || >=24} + '@eslint/css-tree@4.1.2': + resolution: {integrity: sha512-rVcxLmwSkEL3aWS3vAgsTRrQHoYE1b0XcgDtKHDJ92XOkyUpcbS/g0tUJKhvCtlEhYzgKBWsgDd+Z/aPhd166w==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + '@eslint/eslintrc@3.3.5': resolution: {integrity: sha512-4IlJx0X0qftVsN5E+/vGujTRIFtwuLbNsVUe7TO6zYPDR1O6nFwvwhIKEKSrl6dZchmYBITazxKoUYOjdtjlRg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -2845,6 +2852,11 @@ packages: cpu: [x64] os: [win32] + '@valibot/to-json-schema@1.8.0': + resolution: {integrity: sha512-a0M+uwCuQZEPAo65NYkFSJ14O5c213KoSZmPdoCfuFvUhfULi4T2Z6Tpjv6lTVMW9RoLm74RpRAjNEa43KcN+g==} + peerDependencies: + valibot: ^1.5.0 + '@vitejs/plugin-react@4.7.0': resolution: {integrity: sha512-gUu9hwfWvvEDBBmgtAowQCojwZmJ5mcLn3aufeCsitijs3+f2NsrPtlAWIR6OPiqljl96GVCUbLe0HyqIpVaoA==} engines: {node: ^14.18.0 || >=16.0.0} @@ -3008,6 +3020,9 @@ packages: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} + ast-types-flow@0.0.8: + resolution: {integrity: sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==} + astral-regex@2.0.0: resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} engines: {node: '>=8'} @@ -3048,6 +3063,14 @@ packages: aws4@1.13.2: resolution: {integrity: sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==} + axe-core@4.14.0: + resolution: {integrity: sha512-9WTZxEjsZ7b13TH8JPmbV2z8CHbl80/2hm3XPEG4JgNdQLK81IBRXmSxHfMAOkSqQeRxT/0dwNDz2GOm3zzpcQ==} + engines: {node: '>=4'} + + axobject-query@4.1.0: + resolution: {integrity: sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==} + engines: {node: '>= 0.4'} + babel-plugin-add-module-exports@1.0.4: resolution: {integrity: sha512-g+8yxHUZ60RcyaUpfNzy56OtWW+x9cyEe9j+CranqLiqbju2yf/Cy6ZtYK40EZxtrdHllzlVZgLmcOUCTlJ7Jg==} @@ -3096,9 +3119,6 @@ packages: bluebird@3.7.2: resolution: {integrity: sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==} - boolbase@1.0.0: - resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} - boolean@3.2.0: resolution: {integrity: sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==} deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. @@ -3312,10 +3332,6 @@ packages: comma-separated-tokens@2.0.3: resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==} - commander@11.1.0: - resolution: {integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==} - engines: {node: '>=16'} - commander@13.1.0: resolution: {integrity: sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==} engines: {node: '>=18'} @@ -3374,21 +3390,10 @@ packages: css-mediaquery@0.1.2: resolution: {integrity: sha512-COtn4EROW5dBGlE/4PiKnh6rZpAPxDeFLaEEwt4i10jpDMFt2EhQGS79QmmrO+iKCHv0PU/HrOWEhijFd1x99Q==} - css-select@6.0.0: - resolution: {integrity: sha512-rZZVSLle8v0+EY8QAkDWrKhpgt6SA5OtHsgBnsj6ZaLb5dmDVOWUDtQitd9ydxxvEjhewNudS6eTVU7uOyzvXw==} - - css-tree@2.2.1: - resolution: {integrity: sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==} - engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0, npm: '>=7.0.0'} - css-tree@3.2.1: resolution: {integrity: sha512-X7sjQzceUhu1u7Y/ylrRZFU2FS6LRiFVp6rKLPg23y3x3c3DOKAwuXGDp+PAGjh6CSnCjYeAul8pcT8bAl+lSA==} engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0} - css-what@7.0.0: - resolution: {integrity: sha512-wD5oz5xibMOPHzy13CyGmogB3phdvcDaB5t0W/Nr5Z2O/agcB8YwOz6e2Lsp10pNDzBoDO9nVa3RGs/2BttpHQ==} - engines: {node: '>= 6'} - css.escape@1.5.1: resolution: {integrity: sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==} @@ -3397,13 +3402,12 @@ packages: engines: {node: '>=4'} hasBin: true - csso@5.0.5: - resolution: {integrity: sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==} - engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0, npm: '>=7.0.0'} - csstype@3.2.3: resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} + damerau-levenshtein@1.0.8: + resolution: {integrity: sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==} + data-urls@8.0.0: resolution: {integrity: sha512-JQUCCK+/CAGbGGx618PlFZMXH81Jtj7t73CHv9dd/zVWvxgGT2zLFRjnKb+Ng46GIwcy+f7f88qd4duqllK+WQ==} engines: {node: ^22.14.0 || >=24.0.0} @@ -3546,19 +3550,6 @@ packages: dom-accessibility-api@0.6.3: resolution: {integrity: sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==} - dom-serializer@2.0.0: - resolution: {integrity: sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==} - - domelementtype@2.3.0: - resolution: {integrity: sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==} - - domhandler@5.0.3: - resolution: {integrity: sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==} - engines: {node: '>= 4'} - - domutils@3.2.2: - resolution: {integrity: sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==} - dotenv-expand@11.0.7: resolution: {integrity: sha512-zIHwmZPRshsCdpMDyVsqGmgyP0yT8GAgXUnkdAoJisxvf33k7yO6OuoKmcTGuXPWSsm8Oh88nZicRLA9Y0rUeA==} engines: {node: '>=12'} @@ -3630,6 +3621,9 @@ packages: emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + emoji-regex@9.2.2: + resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} + encoding@0.1.13: resolution: {integrity: sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==} @@ -3640,10 +3634,6 @@ packages: resolution: {integrity: sha512-9vhedylFonb2YGogzUKX6+Ja72gOJbN1QHAqdrvqLwhdl/QWbKopzoUC9EbQNVsAns/bx/4uyqalrQAoy1IByw==} engines: {node: '>=10.13.0'} - entities@4.5.0: - resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} - engines: {node: '>=0.12'} - entities@6.0.1: resolution: {integrity: sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==} engines: {node: '>=0.12'} @@ -3809,6 +3799,19 @@ packages: eslint-import-resolver-webpack: optional: true + eslint-plugin-better-tailwindcss@4.10.0: + resolution: {integrity: sha512-EvcfEScF7N39LXuqX8fDnDsgylhbBZe5bbNb+6oN8ht06ou3MvwfPQ5hVgm2LWIPLOB5LBwNDCY6gBQGW4KHGA==} + engines: {node: ^20.19.0 || ^22.12.0 || >=23.0.0} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 + oxlint: ^1.35.0 + tailwindcss: ^3.3.0 || ^4.1.17 + peerDependenciesMeta: + eslint: + optional: true + oxlint: + optional: true + eslint-plugin-boundaries@7.3.0: resolution: {integrity: sha512-NzzcW1FN7LEuHEdEPuPGzpqADfO0r6VL3z57gqDfasiU5pEUqKCF7PeUpbyuLW7qHfLR4QQcXSBRjJf/nYl5Bw==} engines: {node: '>=18.18'} @@ -3825,6 +3828,12 @@ packages: '@typescript-eslint/parser': optional: true + eslint-plugin-jsx-a11y@6.10.2: + resolution: {integrity: sha512-scB3nz4WmG75pV8+3eRUQOHZlNSUhFNq37xnpgRkCCELU3XMvXAxLk1eqWWyE22Ki4Q01Fnsw9BA3cJHDPgn2Q==} + engines: {node: '>=4.0'} + peerDependencies: + eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9 + eslint-plugin-prettier@5.5.6: resolution: {integrity: sha512-ifetmTcxWfz+4qRW3pH/ujdTq2jQIj59AxJMIN26K5avYgU8dxycUETQonWiW+wPrYXA0j3Try0l1CnwVQtDqQ==} engines: {node: ^14.18.0 || >=16.0.0} @@ -4699,6 +4708,13 @@ packages: known-css-properties@0.30.0: resolution: {integrity: sha512-VSWXYUnsPu9+WYKkfmJyLKtIvaRJi1kXUqVmBACORXZQxT5oZDsoZ2vQP+bQFDnWtpI/4eq3MLoRMjI2fnLzTQ==} + language-subtag-registry@0.3.23: + resolution: {integrity: sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ==} + + language-tags@1.0.9: + resolution: {integrity: sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA==} + engines: {node: '>=0.10'} + lazy-val@1.0.5: resolution: {integrity: sha512-0/BnGCCfyUMkBpeDgWihanIAF9JmZhHBgUhEqzvf+adhNGLoP6TaiI5oF8oyb3I45P+PcnrqihSf01M0l0G5+Q==} @@ -5000,12 +5016,12 @@ packages: mdast-util-to-string@4.0.0: resolution: {integrity: sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==} - mdn-data@2.0.28: - resolution: {integrity: sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==} - mdn-data@2.27.1: resolution: {integrity: sha512-9Yubnt3e8A0OKwxYSXyhLymGW4sCufcLG6VdiDdUGVkPhpqLxlvP5vl1983gQjJl3tqbrM731mjaZaP68AgosQ==} + mdn-data@2.37.2: + resolution: {integrity: sha512-rz9YOBGItdSbe7HcSArUbhiAv4SB/4DKRYg96CSFS2CcIYMbUvBtZlzA1NCbk2AdgbmYwMqwNblLpR441lLeiQ==} + merge-anything@5.1.7: resolution: {integrity: sha512-eRtbOb1N5iyH0tkQDAoQ4Ipsp/5qSR79Dzrz8hEPxRX10RWWR/iQXdoKmBSRCThY1Fh5EhISDtpSc93fpxUniQ==} engines: {node: '>=12.13'} @@ -5288,9 +5304,6 @@ packages: resolution: {integrity: sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - nth-check@2.1.1: - resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} - oas-kit-common@1.0.8: resolution: {integrity: sha512-pJTS2+T0oGIwgjGpw7sIRU8RQMcUoKCDWFLdBqKB2BNmGpbBMH2sdqAaOXUg8OzonZHU0L7vfJu1mJFEiYDWOQ==} @@ -5965,10 +5978,6 @@ packages: resolution: {integrity: sha512-6R3J5M4AcbtLUdZmRv2SygeVaM7IhrLXu9BmnOGmmACak8fiUtOsYNWUS4uK7upbmHIBbLBeFeI//477BKLBzA==} engines: {node: '>=11.0.0'} - sax@1.6.1: - resolution: {integrity: sha512-42tBVwLWnaQvW5zc4HbZrTuWccECCZfBi92FDuwtqxasH+JbPB3/FOKb1m222K42R4WxuxzzMsTswfzgtSu64Q==} - engines: {node: '>=11.0.0'} - saxes@6.0.0: resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==} engines: {node: '>=v12.22.7'} @@ -6189,6 +6198,10 @@ packages: resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} engines: {node: '>=18'} + string.prototype.includes@2.0.1: + resolution: {integrity: sha512-o7+c9bW6zpAdJHTtujeePODAhkuicdAryFsfVKwA+wGw89wJ4GTY484WTucM9hLtDEOpOvI+aHnzqnC5lHp4Rg==} + engines: {node: '>= 0.4'} + string.prototype.matchall@4.0.12: resolution: {integrity: sha512-6CC9uyBL+/48dYizRf7H7VAYCMCNTBeM78x/VTUe9bFEaxBepPJDa1Ow99LqI/1yF7kuy7Q3cQsYMrcjGUcskA==} engines: {node: '>= 0.4'} @@ -6273,11 +6286,6 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - svgo@4.1.0: - resolution: {integrity: sha512-bkxnTg1kSU0guhIBmibA6UUhrQmPVA1XsQLN+ylCd+UWzbnLkySOcXpyk1mrl05f+pcaCx2eHb+sp6BgMZWX+Q==} - engines: {node: '>=16'} - hasBin: true - swagger2openapi@7.0.8: resolution: {integrity: sha512-upi/0ZGkYgEcLeGieoz8gT74oWHA0E7JivX7aN9mAf+Tc7BQoRBvnIGHoPDw+f9TXTW4s6kGYCZJtauP6OYp7g==} hasBin: true @@ -6286,6 +6294,19 @@ packages: resolution: {integrity: sha512-eNRKgb3z66Yp3D2CixVujOUvXLFUTij/zVnV8KRyvFdQwpz7I5DS8UfRkTeLzb64u+dkzDSdelE24izu+zSSUg==} engines: {node: ^14.18.0 || >=16.0.0} + synckit@0.12.3: + resolution: {integrity: sha512-U+/AXT6LWsxnj2vz9HeUuPWBNgdWxjyIEjEPdbJARC9txmgPzo2VEdqnFo4hHaNyMPtycyVJrSaQYeQv/PoyyA==} + engines: {node: ^14.18.0 || >=16.0.0} + + tailwind-csstree@0.3.3: + resolution: {integrity: sha512-je9J5UYRsTJqAjYrIBMMlge8T/rreRd44pJxgG5Zx/zeo4kAC/liUKqzztRZrGlYRJLvIf2Cb1DVJMTXSzEShA==} + engines: {node: '>=18.18'} + peerDependencies: + '@eslint/css': '>=1.0.0' + peerDependenciesMeta: + '@eslint/css': + optional: true + tailwind-gradient-mask-image@1.2.0: resolution: {integrity: sha512-tUJaGhvqbJFiVKJu6EU5n//KvGdVvY3L3VOFNqjztk13+ifAk00pcSNHBTgHfUiBGOEzDn0gFRbSmsftUV1lXA==} @@ -6407,9 +6428,17 @@ packages: ts-pattern@5.9.0: resolution: {integrity: sha512-6s5V71mX8qBUmlgbrfL33xDUwO0fq48rxAu2LBE11WBeGdpCPOsXksQbZJHvHwhrd3QjUusd3mAOM5Gg0mFBLg==} + tsconfig-paths-webpack-plugin@4.2.0: + resolution: {integrity: sha512-zbem3rfRS8BgeNK50Zz5SIQgXzLafiHjOwUAvk/38/o1jHn/V5QAgVUcz884or7WYcPaH3N2CIfUc2u0ul7UcA==} + engines: {node: '>=10.13.0'} + tsconfig-paths@3.15.0: resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==} + tsconfig-paths@4.2.0: + resolution: {integrity: sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==} + engines: {node: '>=6'} + tslib@1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} @@ -7202,6 +7231,8 @@ snapshots: dependencies: discord-api-types: 0.38.46 + '@dual-bundle/import-meta-resolve@4.2.1': {} + '@dword-design/dedent@0.7.0': dependencies: babel-plugin-add-module-exports: 1.0.4 @@ -7614,6 +7645,11 @@ snapshots: dependencies: '@types/json-schema': 7.0.15 + '@eslint/css-tree@4.1.2': + dependencies: + mdn-data: 2.37.2 + source-map-js: 1.2.2 + '@eslint/eslintrc@3.3.5(supports-color@7.2.0)': dependencies: ajv: 6.14.0 @@ -9004,6 +9040,10 @@ snapshots: '@unrs/resolver-binding-win32-x64-msvc@1.11.1': optional: true + '@valibot/to-json-schema@1.8.0(valibot@1.5.0(typescript@6.0.3))': + dependencies: + valibot: 1.5.0(typescript@6.0.3) + '@vitejs/plugin-react@4.7.0(supports-color@7.2.0)(vite@5.4.21(@types/node@24.12.2)(lightningcss@1.33.0)(sass@1.99.0))': dependencies: '@babel/core': 7.29.0(supports-color@7.2.0) @@ -9242,6 +9282,8 @@ snapshots: assertion-error@2.0.1: {} + ast-types-flow@0.0.8: {} + astral-regex@2.0.0: {} async-exit-hook@2.0.1: {} @@ -9271,6 +9313,10 @@ snapshots: aws4@1.13.2: {} + axe-core@4.14.0: {} + + axobject-query@4.1.0: {} + babel-plugin-add-module-exports@1.0.4: {} babel-plugin-jsx-dom-expressions@0.40.11(@babel/core@7.29.0(supports-color@7.2.0)): @@ -9315,8 +9361,6 @@ snapshots: bluebird@3.7.2: {} - boolbase@1.0.0: {} - boolean@3.2.0: optional: true @@ -9555,8 +9599,6 @@ snapshots: comma-separated-tokens@2.0.3: {} - commander@11.1.0: {} - commander@13.1.0: {} commander@14.0.3: {} @@ -9599,36 +9641,19 @@ snapshots: css-mediaquery@0.1.2: {} - css-select@6.0.0: - dependencies: - boolbase: 1.0.0 - css-what: 7.0.0 - domhandler: 5.0.3 - domutils: 3.2.2 - nth-check: 2.1.1 - - css-tree@2.2.1: - dependencies: - mdn-data: 2.0.28 - source-map-js: 1.2.2 - css-tree@3.2.1: dependencies: mdn-data: 2.27.1 source-map-js: 1.2.2 - css-what@7.0.0: {} - css.escape@1.5.1: {} cssesc@3.0.0: {} - csso@5.0.5: - dependencies: - css-tree: 2.2.1 - csstype@3.2.3: {} + damerau-levenshtein@1.0.8: {} + data-urls@8.0.0(@noble/hashes@2.2.0): dependencies: whatwg-mimetype: 5.0.0 @@ -9785,24 +9810,6 @@ snapshots: dom-accessibility-api@0.6.3: {} - dom-serializer@2.0.0: - dependencies: - domelementtype: 2.3.0 - domhandler: 5.0.3 - entities: 4.5.0 - - domelementtype@2.3.0: {} - - domhandler@5.0.3: - dependencies: - domelementtype: 2.3.0 - - domutils@3.2.2: - dependencies: - dom-serializer: 2.0.0 - domelementtype: 2.3.0 - domhandler: 5.0.3 - dotenv-expand@11.0.7: dependencies: dotenv: 16.6.1 @@ -9908,6 +9915,8 @@ snapshots: emoji-regex@8.0.0: {} + emoji-regex@9.2.2: {} + encoding@0.1.13: dependencies: iconv-lite: 0.6.3 @@ -9922,8 +9931,6 @@ snapshots: graceful-fs: 4.2.11 tapable: 2.3.3 - entities@4.5.0: {} - entities@6.0.1: {} entities@8.1.0: {} @@ -10141,6 +10148,7 @@ snapshots: '@esbuild/win32-arm64': 0.28.2 '@esbuild/win32-ia32': 0.28.2 '@esbuild/win32-x64': 0.28.2 + optional: true escalade@3.2.0: {} @@ -10239,6 +10247,23 @@ snapshots: transitivePeerDependencies: - supports-color + eslint-plugin-better-tailwindcss@4.10.0(eslint@10.13.0(jiti@1.21.7)(supports-color@7.2.0))(tailwindcss@4.3.3)(typescript@6.0.3): + dependencies: + '@eslint/css-tree': 4.1.2 + '@valibot/to-json-schema': 1.8.0(valibot@1.5.0(typescript@6.0.3)) + enhanced-resolve: 5.26.0 + jiti: 2.7.0 + synckit: 0.12.3 + tailwind-csstree: 0.3.3 + tailwindcss: 4.3.3 + tsconfig-paths-webpack-plugin: 4.2.0 + valibot: 1.5.0(typescript@6.0.3) + optionalDependencies: + eslint: 10.13.0(jiti@1.21.7)(supports-color@7.2.0) + transitivePeerDependencies: + - '@eslint/css' + - typescript + eslint-plugin-boundaries@7.3.0(@typescript-eslint/parser@8.72.0(eslint@10.13.0(jiti@1.21.7)(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint-import-resolver-typescript@4.4.5)(eslint@10.13.0(jiti@1.21.7)(supports-color@7.2.0))(supports-color@7.2.0): dependencies: '@boundaries/elements': 3.2.0 @@ -10312,6 +10337,25 @@ snapshots: - eslint-import-resolver-webpack - supports-color + eslint-plugin-jsx-a11y@6.10.2(eslint@10.13.0(jiti@1.21.7)(supports-color@7.2.0)): + dependencies: + aria-query: 5.3.2 + array-includes: 3.1.9 + array.prototype.flatmap: 1.3.3 + ast-types-flow: 0.0.8 + axe-core: 4.14.0 + axobject-query: 4.1.0 + damerau-levenshtein: 1.0.8 + emoji-regex: 9.2.2 + eslint: 10.13.0(jiti@1.21.7)(supports-color@7.2.0) + hasown: 2.0.4 + jsx-ast-utils: 3.3.5 + language-tags: 1.0.9 + minimatch: 3.1.5 + object.fromentries: 2.0.8 + safe-regex-test: 1.1.0 + string.prototype.includes: 2.0.1 + eslint-plugin-prettier@5.5.6(eslint-config-prettier@10.1.8(eslint@9.39.4(jiti@1.21.7)(supports-color@7.2.0)))(eslint@9.39.4(jiti@1.21.7)(supports-color@7.2.0))(prettier@3.9.10): dependencies: eslint: 9.39.4(jiti@1.21.7)(supports-color@7.2.0) @@ -11277,6 +11321,12 @@ snapshots: known-css-properties@0.30.0: {} + language-subtag-registry@0.3.23: {} + + language-tags@1.0.9: + dependencies: + language-subtag-registry: 0.3.23 + lazy-val@1.0.5: {} levn@0.4.1: @@ -11643,10 +11693,10 @@ snapshots: dependencies: '@types/mdast': 4.0.4 - mdn-data@2.0.28: {} - mdn-data@2.27.1: {} + mdn-data@2.37.2: {} + merge-anything@5.1.7: dependencies: is-what: 4.1.16 @@ -12005,10 +12055,6 @@ snapshots: dependencies: path-key: 4.0.0 - nth-check@2.1.1: - dependencies: - boolbase: 1.0.0 - oas-kit-common@1.0.8: dependencies: fast-safe-stringify: 2.1.1 @@ -12819,8 +12865,6 @@ snapshots: sax@1.6.0: {} - sax@1.6.1: {} - saxes@6.0.0: dependencies: xmlchars: 2.2.0 @@ -13054,6 +13098,12 @@ snapshots: get-east-asian-width: 1.5.0 strip-ansi: 7.2.0 + string.prototype.includes@2.0.1: + dependencies: + call-bind: 1.0.9 + define-properties: 1.2.1 + es-abstract: 1.24.2 + string.prototype.matchall@4.0.12: dependencies: call-bind: 1.0.9 @@ -13163,16 +13213,6 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} - svgo@4.1.0: - dependencies: - commander: 11.1.0 - css-select: 6.0.0 - css-tree: 3.2.1 - css-what: 7.0.0 - csso: 5.0.5 - picocolors: 1.1.1 - sax: 1.6.1 - swagger2openapi@7.0.8(encoding@0.1.13): dependencies: call-me-maybe: 1.0.2 @@ -13193,6 +13233,13 @@ snapshots: dependencies: '@pkgr/core': 0.3.6 + synckit@0.12.3: + dependencies: + '@dual-bundle/import-meta-resolve': 4.2.1 + '@pkgr/core': 0.3.6 + + tailwind-csstree@0.3.3: {} + tailwind-gradient-mask-image@1.2.0: {} tailwindcss@3.4.19(tsx@4.23.15)(yaml@2.8.3): @@ -13334,6 +13381,13 @@ snapshots: ts-pattern@5.9.0: {} + tsconfig-paths-webpack-plugin@4.2.0: + dependencies: + chalk: 4.1.2 + enhanced-resolve: 5.26.0 + tapable: 2.3.3 + tsconfig-paths: 4.2.0 + tsconfig-paths@3.15.0: dependencies: '@types/json5': 0.0.29 @@ -13341,6 +13395,12 @@ snapshots: minimist: 1.2.8 strip-bom: 3.0.0 + tsconfig-paths@4.2.0: + dependencies: + json5: 2.2.3 + minimist: 1.2.8 + strip-bom: 3.0.0 + tslib@1.14.1: {} tslib@2.8.1: {} @@ -13355,6 +13415,7 @@ snapshots: esbuild: 0.28.2 optionalDependencies: fsevents: 2.3.3 + optional: true typanion@3.14.0: {}