react-os-shell 3.24.0 → 3.28.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/README.md +15 -1
- package/dist/{Browser-MU2LBUTA.js → Browser-AR4QP23G.js} +5 -6
- package/dist/Browser-AR4QP23G.js.map +1 -0
- package/dist/{Calculator-BFRUXV7E.js → Calculator-7MRLC77Q.js} +4 -5
- package/dist/Calculator-7MRLC77Q.js.map +1 -0
- package/dist/ConfirmDialog-2BV43KSW.js +4 -0
- package/dist/{ConfirmDialog-BEALMXZM.js.map → ConfirmDialog-2BV43KSW.js.map} +1 -1
- package/dist/{CurrencyConverter-543D5YHO.js → CurrencyConverter-6UTL2ZBY.js} +4 -5
- package/dist/CurrencyConverter-6UTL2ZBY.js.map +1 -0
- package/dist/{Documents-UGITESQI.js → Documents-FQKIQ4GH.js} +5 -6
- package/dist/Documents-FQKIQ4GH.js.map +1 -0
- package/dist/{Files-6E3RNGNQ.js → Files-NTUFLWY3.js} +5 -6
- package/dist/Files-NTUFLWY3.js.map +1 -0
- package/dist/{Notepad-LFLER4N2.js → Notepad-MQQSDSLT.js} +5 -6
- package/dist/Notepad-MQQSDSLT.js.map +1 -0
- package/dist/{PomodoroTimer-V4FCRP35.js → PomodoroTimer-YI4D7OLV.js} +5 -6
- package/dist/PomodoroTimer-YI4D7OLV.js.map +1 -0
- package/dist/{Preview-6SVV4EVG.js → Preview-2GUM6NO7.js} +5 -6
- package/dist/Preview-2GUM6NO7.js.map +1 -0
- package/dist/{Spreadsheet-OVFTWCJ6.js → Spreadsheet-6JWSE5NC.js} +5 -6
- package/dist/Spreadsheet-6JWSE5NC.js.map +1 -0
- package/dist/{Stock-UVBHR5NW.js → Stock-KQA6QWZ2.js} +4 -5
- package/dist/Stock-KQA6QWZ2.js.map +1 -0
- package/dist/{Weather-3GHOQR2B.js → Weather-45REOKUY.js} +4 -5
- package/dist/Weather-45REOKUY.js.map +1 -0
- package/dist/{WorldClock-B5ZW37KG.js → WorldClock-EJNEFDWZ.js} +4 -5
- package/dist/WorldClock-EJNEFDWZ.js.map +1 -0
- package/dist/apps/index.js +15 -16
- package/dist/apps/index.js.map +1 -1
- package/dist/chunk-CZW7CTI6.js +7 -0
- package/dist/{chunk-TGEZDU6N.js.map → chunk-CZW7CTI6.js.map} +1 -1
- package/dist/{chunk-JDGURXTZ.js → chunk-EWRKU7EF.js} +3 -3
- package/dist/{chunk-JDGURXTZ.js.map → chunk-EWRKU7EF.js.map} +1 -1
- package/dist/{chunk-L3RPWMS4.js → chunk-GHGD4GKR.js} +4 -4
- package/dist/{chunk-L3RPWMS4.js.map → chunk-GHGD4GKR.js.map} +1 -1
- package/dist/{chunk-2YTZ6COH.js → chunk-IU7MSBRI.js} +2964 -2589
- package/dist/chunk-IU7MSBRI.js.map +1 -0
- package/dist/{chunk-WNZH4GVY.js → chunk-WWT4XQJL.js} +3 -3
- package/dist/{chunk-WNZH4GVY.js.map → chunk-WWT4XQJL.js.map} +1 -1
- package/dist/index.d.ts +151 -5
- package/dist/index.js +711 -71
- package/dist/index.js.map +1 -1
- package/package.json +5 -2
- package/dist/Browser-MU2LBUTA.js.map +0 -1
- package/dist/Calculator-BFRUXV7E.js.map +0 -1
- package/dist/ConfirmDialog-BEALMXZM.js +0 -3
- package/dist/CurrencyConverter-543D5YHO.js.map +0 -1
- package/dist/Documents-UGITESQI.js.map +0 -1
- package/dist/Files-6E3RNGNQ.js.map +0 -1
- package/dist/Notepad-LFLER4N2.js.map +0 -1
- package/dist/PomodoroTimer-V4FCRP35.js.map +0 -1
- package/dist/Preview-6SVV4EVG.js.map +0 -1
- package/dist/Spreadsheet-OVFTWCJ6.js.map +0 -1
- package/dist/Stock-UVBHR5NW.js.map +0 -1
- package/dist/Weather-3GHOQR2B.js.map +0 -1
- package/dist/WorldClock-B5ZW37KG.js.map +0 -1
- package/dist/chunk-2YTZ6COH.js.map +0 -1
- package/dist/chunk-TGEZDU6N.js +0 -7
- package/dist/chunk-UBN4IUDE.js +0 -229
- package/dist/chunk-UBN4IUDE.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { toast_default } from './chunk-VENYVK3L.js';
|
|
2
|
-
import { useShellPrefs } from './chunk-
|
|
2
|
+
import { useShellPrefs } from './chunk-IU7MSBRI.js';
|
|
3
3
|
import { useSyncExternalStore, useCallback, useMemo } from 'react';
|
|
4
4
|
|
|
5
5
|
// src/shell/pomodoroStore.ts
|
|
@@ -545,5 +545,5 @@ function migratePomodoroTasksOnce(currentTasks, setAllTasks) {
|
|
|
545
545
|
}
|
|
546
546
|
|
|
547
547
|
export { ALARM_OPTIONS, FOCUS_SOUND_OPTIONS, getPomoSnapshot, migratePomodoroTasksOnce, playAlarm, pomoPause, pomoStart, pomoSwitchMode, previewFocusSound, setPomoAlarm, setPomoAlarmConfig, setPomoBehaviour, setPomoDurations, setPomoFocusSound, setShellTodoProvider, subscribePomo, useTodoTasks };
|
|
548
|
-
//# sourceMappingURL=chunk-
|
|
549
|
-
//# sourceMappingURL=chunk-
|
|
548
|
+
//# sourceMappingURL=chunk-WWT4XQJL.js.map
|
|
549
|
+
//# sourceMappingURL=chunk-WWT4XQJL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/shell/pomodoroStore.ts","../src/apps/_todoStore.ts"],"names":[],"mappings":";;;;;AA8DO,IAAM,aAAA,GAA0E;AAAA,EACrF,EAAE,EAAA,EAAI,MAAA,EAAe,KAAA,EAAO,MAAA,EAAiB,aAAa,6BAAA,EAA8B;AAAA,EACxF,EAAE,EAAA,EAAI,OAAA,EAAe,KAAA,EAAO,OAAA,EAAiB,aAAa,0BAAA,EAA2B;AAAA,EACrF,EAAE,EAAA,EAAI,MAAA,EAAe,KAAA,EAAO,cAAA,EAAiB,aAAa,4BAAA,EAA6B;AAAA,EACvF,EAAE,EAAA,EAAI,aAAA,EAAe,KAAA,EAAO,aAAA,EAAiB,aAAa,+BAAA,EAAgC;AAAA,EA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AA,CAAO,CAAA,CAAE,IAAI,CAAA;AAAA,MACnB,IAAA,EAAM,CAAC,CAAC,CAAA,CAAE,IAAA;AAAA,MACV,WAAW,OAAO,CAAA,CAAE,SAAA,KAAc,QAAA,GAAW,EAAE,SAAA,GAAY,KAAA,CAAA;AAAA,MAC3D,WAAW,OAAO,CAAA,CAAE,SAAA,KAAc,QAAA,GAAW,EAAE,SAAA,GAAY,KAAA,CAAA;AAAA,MAC3D,SAAA,EAAW,EAAA;AAAA,MACX,SAAA,EAAW;AAAA,KACb,CAAE,CAAA;AACJ,IAAA,MAAM,WAAA,GAAc,IAAI,GAAA,CAAI,YAAA,CAAa,IAAI,CAAA,CAAA,KAAK,CAAA,CAAE,EAAE,CAAC,CAAA;AACvD,IAAA,MAAM,SAAA,GAAY,SAAS,MAAA,CAAO,CAAA,CAAA,KAAK,CAAC,WAAA,CAAY,GAAA,CAAI,CAAA,CAAE,EAAE,CAAC,CAAA;AAC7D,IAAA,WAAA,CAAY,CAAC,GAAG,SAAA,EAAW,GAAG,YAAY,CAAC,CAAA;AAC3C,IAAA,YAAA,CAAa,WAAW,mBAAmB,CAAA;AAC3C,IAAA,YAAA,CAAa,OAAA,CAAQ,+BAA+B,GAAG,CAAA;AAAA,EACzD,CAAA,CAAA,MAAQ;AACN,IAAA,IAAI;AAAE,MAAA,YAAA,CAAa,OAAA,CAAQ,+BAA+B,GAAG,CAAA;AAAA,IAAG,CAAA,CAAA,MAAQ;AAAA,IAAC;AAAA,EAC3E;AACF","file":"chunk-WNZH4GVY.js","sourcesContent":["/**\n * Pomodoro store — module-level singleton that owns the timer state and\n * tick loop. Lifting the state above the widget means:\n *\n * 1. The taskbar indicator (`TaskbarPomodoro`) can subscribe even when\n * the widget itself is closed.\n * 2. The timer keeps running if the user closes / reopens the widget;\n * no progress is lost mid-session.\n *\n * The widget acts as a pure controller: it reads the snapshot via\n * `useSyncExternalStore` and calls the action functions below to drive\n * state transitions.\n *\n * The alarm sound on session-end is synthesised through the WebAudio API\n * (no audio file assets to bundle / license). All the presets are tuned\n * to be soft — gentle decay, low peak gain — so they don't startle. The\n * focus-time ambient sound (white / pink / brown noise) is synthesised\n * the same way and looped through an AudioBufferSourceNode.\n */\n\nimport toast from './toast';\n\nexport type Mode = 'focus' | 'short' | 'long';\nexport type AlarmSound = 'bell' | 'chime' | 'bowl' | 'wind-chimes' | 'off';\nexport type FocusSound =\n | 'none'\n | 'white' | 'pink' | 'brown'\n | 'tick-fast' | 'tick-slow'\n | 'rain' | 'fireplace';\n\nexport interface PomoDurations {\n /** Focus block, in seconds. */\n focus: number;\n /** Short break, in seconds. */\n short: number;\n /** Long break, in seconds. Triggered every Nth focus where N is\n * `longBreakInterval` from `setPomoBehaviour`. */\n long: number;\n}\n\nexport interface PomoBehaviour {\n /** When a focus block ends, automatically start the break. */\n autoStartBreaks: boolean;\n /** When a break ends, automatically start the next focus block. */\n autoStartPomodoros: boolean;\n /** Long break is taken after every Nth focus block. Default 4. */\n longBreakInterval: number;\n}\n\nexport interface PomoSnapshot {\n running: boolean;\n /** Seconds remaining in the current block. */\n remaining: number;\n mode: Mode;\n /** Seconds in the full current block — used for progress %. */\n total: number;\n /** Pomodoros completed since the page loaded. */\n streak: number;\n /** Today's lifetime count (persisted to localStorage). */\n count: number;\n}\n\nexport const ALARM_OPTIONS: { id: AlarmSound; label: string; description: string }[] = [\n { id: 'bell', label: 'Bell', description: 'Soft bell with one harmonic' },\n { id: 'chime', label: 'Chime', description: 'Two-note ascending chime' },\n { id: 'bowl', label: 'Singing Bowl', description: 'Long-decay meditation tone' },\n { id: 'wind-chimes', label: 'Wind Chimes', description: 'Four soft tones in succession' },\n { id: 'off', label: 'Off (silent)', description: 'No sound — only desktop notification' },\n];\n\nexport const FOCUS_SOUND_OPTIONS: { id: FocusSound; label: string }[] = [\n { id: 'none', label: 'None' },\n { id: 'tick-fast', label: 'Ticking Fast' },\n { id: 'tick-slow', label: 'Ticking Slow' },\n { id: 'rain', label: 'Rain' },\n { id: 'fireplace', label: 'Fireplace' },\n { id: 'white', label: 'White Noise' },\n { id: 'pink', label: 'Pink Noise' },\n { id: 'brown', label: 'Brown Noise' },\n];\n\nconst todayKey = () => `pomodoro-${new Date().toISOString().slice(0, 10)}`;\nconst loadCount = () => {\n try { return parseInt(localStorage.getItem(todayKey()) || '0', 10) || 0; } catch { return 0; }\n};\nconst saveCount = (n: number) => {\n try { localStorage.setItem(todayKey(), String(n)); } catch {}\n};\n\nlet _durations: PomoDurations = { focus: 25 * 60, short: 5 * 60, long: 15 * 60 };\nlet _alarm: AlarmSound = 'bell';\nlet _alarmVolume = 100; // 0–100\nlet _alarmRepeat = 1; // 1–5\nlet _focusSoundType: FocusSound = 'none';\nlet _focusVolume = 50; // 0–100\nlet _behaviour: PomoBehaviour = { autoStartBreaks: false, autoStartPomodoros: false, longBreakInterval: 4 };\n\nlet _state: PomoSnapshot = {\n running: false,\n remaining: _durations.focus,\n mode: 'focus',\n total: _durations.focus,\n streak: 0,\n count: typeof localStorage !== 'undefined' ? loadCount() : 0,\n};\n\nlet _intervalId: ReturnType<typeof setInterval> | null = null;\nconst _listeners = new Set<() => void>();\n\nconst _notify = () => _listeners.forEach(l => l());\nconst _set = (s: Partial<PomoSnapshot>) => { _state = { ..._state, ...s }; _notify(); };\n\nexport function getPomoSnapshot(): PomoSnapshot { return _state; }\nexport function subscribePomo(l: () => void) { _listeners.add(l); return () => { _listeners.delete(l); }; }\n\nexport function setPomoDurations(d: PomoDurations) {\n _durations = d;\n // If the user changed durations while not running and at the start of the\n // block, sync the visible time to the new value.\n if (!_state.running && _state.remaining === _state.total) {\n _set({ remaining: d[_state.mode], total: d[_state.mode] });\n }\n}\nexport function getPomoDurations(): PomoDurations { return _durations; }\n\nexport function setPomoAlarm(a: AlarmSound) { _alarm = a; }\nexport function getPomoAlarm(): AlarmSound { return _alarm; }\n\n/** Configure the alarm playback volume (0–100) and repeat count (1–5).\n * Used at session-end. The standalone `playAlarm()` preview button can\n * still pass overrides. */\nexport function setPomoAlarmConfig(volume: number, repeat: number) {\n _alarmVolume = Math.max(0, Math.min(100, Math.round(volume)));\n _alarmRepeat = Math.max(1, Math.min(5, Math.round(repeat)));\n}\nexport function getPomoAlarmConfig() { return { volume: _alarmVolume, repeat: _alarmRepeat }; }\n\nexport function setPomoBehaviour(b: PomoBehaviour) {\n _behaviour = {\n autoStartBreaks: !!b.autoStartBreaks,\n autoStartPomodoros: !!b.autoStartPomodoros,\n longBreakInterval: Math.max(1, Math.min(20, Math.round(b.longBreakInterval || 4))),\n };\n}\nexport function getPomoBehaviour(): PomoBehaviour { return _behaviour; }\n\n/** Configure the ambient focus-time sound. If a focus block is currently\n * running the audio is hot-swapped to the new settings. */\nexport function setPomoFocusSound(type: FocusSound, volume: number) {\n _focusSoundType = type;\n _focusVolume = Math.max(0, Math.min(100, Math.round(volume)));\n // Hot-swap if focus mode is currently running.\n if (_state.running && _state.mode === 'focus') {\n stopFocusAudio();\n startFocusAudio();\n } else if (type === 'none' || _focusVolume === 0) {\n stopFocusAudio();\n }\n}\nexport function getPomoFocusSound() { return { type: _focusSoundType, volume: _focusVolume }; }\n\nexport function pomoStart() {\n if (_state.running) return;\n _set({ running: true });\n _intervalId = setInterval(_tick, 1000);\n if (_state.mode === 'focus') startFocusAudio();\n}\nexport function pomoPause() {\n if (!_state.running && _intervalId === null) return;\n if (_intervalId !== null) { clearInterval(_intervalId); _intervalId = null; }\n _set({ running: false });\n stopFocusAudio();\n}\nexport function pomoReset() {\n pomoPause();\n _set({ remaining: _durations[_state.mode], total: _durations[_state.mode] });\n}\nexport function pomoSwitchMode(m: Mode) {\n pomoPause();\n _set({ mode: m, remaining: _durations[m], total: _durations[m] });\n}\n\nfunction _tick() {\n if (_state.remaining <= 1) {\n _onSessionEnd();\n return;\n }\n _set({ remaining: _state.remaining - 1 });\n}\n\nfunction _onSessionEnd() {\n if (_intervalId !== null) { clearInterval(_intervalId); _intervalId = null; }\n stopFocusAudio();\n playAlarm(_alarm, { volume: _alarmVolume, repeat: _alarmRepeat });\n\n // Notify the user three ways so they don't miss it:\n // 1. The alarm sound (already fired above).\n // 2. A native OS notification — fires even when the tab is in the\n // background, but only if the user granted permission.\n // 3. The in-app toast — guaranteed to render whenever the page is\n // open, regardless of OS permission state.\n const justFinishedFocus = _state.mode === 'focus';\n const headline = justFinishedFocus ? 'Pomodoro complete — time for a break! 🍅' : 'Break\\'s over — back to work!';\n if (typeof Notification !== 'undefined' && Notification.permission === 'granted') {\n try { new Notification(headline); } catch {}\n }\n try { toast.info(headline); } catch {}\n\n if (_state.mode === 'focus') {\n const nextStreak = _state.streak + 1;\n const newCount = _state.count + 1;\n saveCount(newCount);\n const nextMode: Mode = nextStreak % _behaviour.longBreakInterval === 0 ? 'long' : 'short';\n _set({\n running: false,\n streak: nextStreak,\n count: newCount,\n mode: nextMode,\n remaining: _durations[nextMode],\n total: _durations[nextMode],\n });\n if (_behaviour.autoStartBreaks) setTimeout(() => pomoStart(), 50);\n } else {\n _set({\n running: false,\n mode: 'focus',\n remaining: _durations.focus,\n total: _durations.focus,\n });\n if (_behaviour.autoStartPomodoros) setTimeout(() => pomoStart(), 50);\n }\n}\n\n/** Synthesise the chosen alarm via WebAudio. All presets are tuned soft —\n * exponential decay to near-silence, peak gain ≤ 0.22. The `volume`\n * option scales the peak (0-100). The `repeat` option plays the cue\n * several times with a 2.5 s gap between starts. */\nexport function playAlarm(kind: AlarmSound = _alarm, opts: { volume?: number; repeat?: number } = {}) {\n if (kind === 'off') return;\n const volScale = Math.max(0, Math.min(100, opts.volume ?? 100)) / 100;\n if (volScale === 0) return;\n const repeat = Math.max(1, Math.min(5, opts.repeat ?? 1));\n for (let i = 0; i < repeat; i++) {\n setTimeout(() => _playAlarmOnce(kind, volScale), i * 2500);\n }\n}\n\nfunction _playAlarmOnce(kind: AlarmSound, volScale: number) {\n try {\n const Ctor: typeof AudioContext = (window as any).AudioContext || (window as any).webkitAudioContext;\n if (!Ctor) return;\n const ctx = new Ctor();\n const playNote = (freq: number, start: number, duration: number, vol = 0.22, type: OscillatorType = 'sine') => {\n const osc = ctx.createOscillator();\n const gain = ctx.createGain();\n osc.connect(gain); gain.connect(ctx.destination);\n osc.type = type;\n osc.frequency.value = freq;\n const t0 = ctx.currentTime + start;\n gain.gain.setValueAtTime(0, t0);\n gain.gain.linearRampToValueAtTime(vol * volScale, t0 + 0.03);\n gain.gain.exponentialRampToValueAtTime(0.0001, t0 + duration);\n osc.start(t0);\n osc.stop(t0 + duration);\n };\n let totalDuration = 2;\n if (kind === 'bell') {\n playNote(880, 0, 1.8);\n playNote(1320, 0, 1.4, 0.10);\n totalDuration = 2;\n } else if (kind === 'chime') {\n playNote(659.25, 0, 0.7); // E5\n playNote(880, 0.20, 1.3); // A5\n totalDuration = 2;\n } else if (kind === 'bowl') {\n playNote(440, 0, 3.4, 0.22);\n playNote(660, 0, 3.0, 0.08);\n playNote(880, 0.05, 2.8, 0.05);\n totalDuration = 4;\n } else if (kind === 'wind-chimes') {\n playNote(1175, 0, 1.1, 0.16); // D6\n playNote(880, 0.15, 1.3, 0.16); // A5\n playNote(1318, 0.30, 1.5, 0.16); // E6\n playNote(1047, 0.50, 1.7, 0.13); // C6\n totalDuration = 3;\n }\n setTimeout(() => { try { ctx.close(); } catch {} }, totalDuration * 1000 + 500);\n } catch {}\n}\n\n// ── Ambient focus-time sound ──\nlet _focusAudio: { ctx: AudioContext; src: AudioBufferSourceNode; gain: GainNode } | null = null;\n\n/** Per-type volume cap. Sparse signals (ticking, fireplace pops) need a\n * higher gain to perceive at the same loudness as a continuous noise\n * texture. The user-facing slider always shows 0–100; this multiplier\n * is the headroom mapping. */\nconst FOCUS_VOL_CAP: Record<FocusSound, number> = {\n none: 0,\n white: 0.30,\n pink: 0.30,\n brown: 0.30,\n 'tick-fast': 0.60,\n 'tick-slow': 0.60,\n rain: 0.40,\n fireplace: 0.50,\n};\n\nfunction _makeNoiseBuffer(ctx: AudioContext, type: FocusSound): AudioBuffer | null {\n if (type === 'none') return null;\n const sr = ctx.sampleRate;\n // Noise textures use a 2 s loop. Ticking, rain, and fireplace use 4 s\n // so multiple ticks / pops fit in one cycle and the loop seam is masked\n // by the texture itself.\n const dur = (type === 'white' || type === 'pink' || type === 'brown') ? 2 : 4;\n const len = sr * dur;\n const buffer = ctx.createBuffer(1, len, sr);\n const data = buffer.getChannelData(0);\n\n if (type === 'white') {\n for (let i = 0; i < len; i++) data[i] = (Math.random() * 2 - 1) * 0.5;\n\n } else if (type === 'pink') {\n // Paul Kellet's filter — cheap pink-noise approximation.\n let b0 = 0, b1 = 0, b2 = 0, b3 = 0, b4 = 0, b5 = 0, b6 = 0;\n for (let i = 0; i < len; i++) {\n const w = Math.random() * 2 - 1;\n b0 = 0.99886 * b0 + w * 0.0555179;\n b1 = 0.99332 * b1 + w * 0.0750759;\n b2 = 0.96900 * b2 + w * 0.1538520;\n b3 = 0.86650 * b3 + w * 0.3104856;\n b4 = 0.55000 * b4 + w * 0.5329522;\n b5 = -0.7616 * b5 - w * 0.0168980;\n data[i] = (b0 + b1 + b2 + b3 + b4 + b5 + b6 + w * 0.5362) * 0.11 * 0.55;\n b6 = w * 0.115926;\n }\n\n } else if (type === 'brown') {\n // 1/f² — leaky integrator on white noise.\n let last = 0;\n for (let i = 0; i < len; i++) {\n const w = Math.random() * 2 - 1;\n last = (last + 0.02 * w) / 1.02;\n data[i] = last * 3.5 * 0.5;\n }\n\n } else if (type === 'tick-fast' || type === 'tick-slow') {\n // Wall-clock tick: brief noise burst with a sharp exponential decay.\n // Two intervals are even divisors of the 4 s buffer, so the loop is\n // perfectly seamless.\n const intervalSec = type === 'tick-fast' ? 0.5 : 1.0;\n const tickSamples = Math.floor(sr * 0.045);\n for (let t = 0; t < dur; t += intervalSec) {\n const start = Math.floor(t * sr);\n for (let i = 0; i < tickSamples && start + i < len; i++) {\n const env = Math.exp(-i / sr * 180); // ~5 ms attack, ~25 ms decay tail\n const noise = Math.random() * 2 - 1;\n // Mix sharp click (filtered noise) with a faint sine to add body.\n const tone = Math.sin(2 * Math.PI * 1100 * (i / sr));\n data[start + i] += (noise * 0.7 + tone * 0.25) * env * 0.55;\n }\n }\n\n } else if (type === 'rain') {\n // High-pass filtered white noise (the \"patter\") plus a slow tremolo\n // for occasional gusts.\n let prev = 0;\n for (let i = 0; i < len; i++) {\n const w = Math.random() * 2 - 1;\n const filtered = w - prev * 0.93; // high-pass\n prev = w;\n const gust = 0.7 + 0.3 * Math.sin((i / sr) * 2 * Math.PI * 0.25);\n data[i] = filtered * gust * 0.4;\n }\n\n } else if (type === 'fireplace') {\n // Brown-noise rumble underneath, plus randomly-spaced \"pops\" (short\n // noise transients with sharp decay) for the crackle.\n let last = 0;\n for (let i = 0; i < len; i++) {\n const w = Math.random() * 2 - 1;\n last = (last + 0.02 * w) / 1.02;\n data[i] = last * 1.6;\n }\n let next = Math.random() * 0.4 * sr;\n while (next < len) {\n const popLen = Math.floor((0.012 + Math.random() * 0.05) * sr);\n const popVol = 0.35 + Math.random() * 0.45;\n const popPos = Math.floor(next);\n for (let i = 0; i < popLen && popPos + i < len; i++) {\n const env = Math.exp(-i / sr * 90);\n data[popPos + i] += (Math.random() * 2 - 1) * env * popVol;\n }\n // Next pop somewhere between 80 ms and 700 ms later.\n next += (0.08 + Math.random() * 0.62) * sr;\n }\n }\n\n return buffer;\n}\n\nfunction startFocusAudio() {\n if (_focusAudio) return;\n if (_focusSoundType === 'none' || _focusVolume === 0) return;\n try {\n const Ctor: typeof AudioContext = (window as any).AudioContext || (window as any).webkitAudioContext;\n if (!Ctor) return;\n const ctx = new Ctor();\n const buffer = _makeNoiseBuffer(ctx, _focusSoundType);\n if (!buffer) { try { ctx.close(); } catch {} return; }\n const src = ctx.createBufferSource();\n src.buffer = buffer;\n src.loop = true;\n const gain = ctx.createGain();\n gain.gain.value = (_focusVolume / 100) * FOCUS_VOL_CAP[_focusSoundType];\n src.connect(gain).connect(ctx.destination);\n src.start();\n _focusAudio = { ctx, src, gain };\n } catch {}\n}\n\nfunction stopFocusAudio() {\n if (!_focusAudio) return;\n try { _focusAudio.src.stop(); } catch {}\n try { _focusAudio.ctx.close(); } catch {}\n _focusAudio = null;\n}\n\n/** Play the configured ambient focus sound for ~3 s as a preview. Used by\n * the Settings UI when the user adjusts the dropdown / volume slider. */\nexport function previewFocusSound(type: FocusSound, volume: number) {\n if (type === 'none' || volume === 0) return;\n try {\n const Ctor: typeof AudioContext = (window as any).AudioContext || (window as any).webkitAudioContext;\n if (!Ctor) return;\n const ctx = new Ctor();\n const buffer = _makeNoiseBuffer(ctx, type);\n if (!buffer) { try { ctx.close(); } catch {} return; }\n const src = ctx.createBufferSource();\n src.buffer = buffer;\n src.loop = true;\n const gain = ctx.createGain();\n gain.gain.value = (volume / 100) * FOCUS_VOL_CAP[type];\n src.connect(gain).connect(ctx.destination);\n src.start();\n setTimeout(() => {\n try { src.stop(); } catch {}\n try { ctx.close(); } catch {}\n }, 3000);\n } catch {}\n}\n","/**\n * Shared task store for the Todo List app and the Pomodoro widget — both\n * read/write the same list via `useTodoTasks()`.\n *\n * Two backends:\n * • Default: `useShellPrefs()` → `prefs.todo_tasks` (per-user prefs blob).\n * • Opt-in: a consumer-supplied `TodoProvider` registered with\n * `setShellTodoProvider(...)`. When set, the three apps read/write through\n * it instead — letting an ERP make the shell's tasks the SAME records as\n * its own task table, and tag each with a `contextLabel` badge (e.g.\n * \"Deal: Acme\"). Mirrors `setShellApiClient`.\n *\n * `migratePomodoroTasksOnce()` folds legacy `localStorage.pomodoro_tasks`\n * into the prefs store on first Pomodoro mount (no-op in provider mode).\n */\nimport { useCallback, useMemo, useSyncExternalStore } from 'react';\nimport { useShellPrefs } from '../shell/ShellPrefs';\nimport type { TodoTask } from './_todoTypes';\n\nconst POMODORO_LEGACY_KEY = 'pomodoro_tasks';\nconst POMODORO_LEGACY_MIGRATED_FLAG = 'pomodoro_tasks_migrated';\n\nfunction uid(): string {\n return Math.random().toString(36).slice(2, 11);\n}\n\nfunction nowIso(): string {\n return new Date().toISOString();\n}\n\nexport interface UseTodoTasks {\n tasks: TodoTask[];\n /** Add a new task. Returns the id of the freshly-added task. */\n addTask: (input: Partial<Omit<TodoTask, 'id' | 'createdAt' | 'updatedAt'>> & { name: string }) => string;\n /** Patch any subset of fields on a task by id. `updatedAt` is auto-bumped. */\n updateTask: (id: string, patch: Partial<TodoTask>) => void;\n /** Remove a task by id. Used by both Pomodoro's kebab menu and TodoList's delete action. */\n removeTask: (id: string) => void;\n /** Flip `done`. Same as `updateTask(id, { done: !done })` but faster to type at call sites. */\n toggleDone: (id: string) => void;\n /** Replace the entire list. Used by Google Tasks sync after a pull. */\n setAllTasks: (tasks: TodoTask[]) => void;\n}\n\n/**\n * A consumer-supplied task backend. Registering one (opt-in) routes every\n * shell task surface through it instead of the prefs blob. Methods map to/from\n * the shell's `TodoTask` shape, including the optional `source`/`contextLabel`.\n */\nexport interface TodoProvider {\n list(): Promise<TodoTask[]>;\n create(input: Partial<Omit<TodoTask, 'id' | 'createdAt' | 'updatedAt'>> & { name: string }): Promise<TodoTask>;\n update(id: string, patch: Partial<TodoTask>): Promise<TodoTask>;\n remove(id: string): Promise<void>;\n}\n\n// ── Module-level provider store (shared across all consumers) ──\nlet provider: TodoProvider | null = null;\nlet cache: TodoTask[] = [];\nlet loaded = false;\nlet inflight: Promise<void> | null = null;\nconst listeners = new Set<() => void>();\n\nfunction emit(): void {\n for (const l of listeners) l();\n}\n\nfunction setCache(next: TodoTask[]): void {\n cache = next;\n emit();\n}\n\nfunction refresh(): Promise<void> {\n const p = provider;\n if (!p) {\n cache = [];\n loaded = true;\n emit();\n return Promise.resolve();\n }\n inflight = p\n .list()\n .then(rows => {\n if (provider === p) {\n cache = rows;\n loaded = true;\n emit();\n }\n })\n .catch(() => {\n if (provider === p) {\n loaded = true;\n emit();\n }\n })\n .finally(() => {\n inflight = null;\n });\n return inflight;\n}\n\n/** Register (or clear with `null`) the backend task provider. Opt-in. */\nexport function setShellTodoProvider(next: TodoProvider | null): void {\n provider = next;\n cache = [];\n loaded = false;\n if (next) refresh();\n else emit();\n}\n\nexport function hasShellTodoProvider(): boolean {\n return provider !== null;\n}\n\nfunction subscribe(cb: () => void): () => void {\n listeners.add(cb);\n if (provider && !loaded && !inflight) refresh();\n return () => {\n listeners.delete(cb);\n };\n}\n\nfunction getSnapshot(): TodoTask[] {\n return cache;\n}\n\n// ── Prefs-backed implementation (default / fallback) ──\nfunction usePrefsTodoTasks(): UseTodoTasks {\n const { prefs, save } = useShellPrefs();\n const tasks: TodoTask[] = useMemo(() => {\n const raw = prefs.todo_tasks;\n return Array.isArray(raw) ? (raw as TodoTask[]) : [];\n }, [prefs.todo_tasks]);\n\n const writeTasks = useCallback((next: TodoTask[]) => {\n save({ todo_tasks: next });\n }, [save]);\n\n const addTask = useCallback<UseTodoTasks['addTask']>((input) => {\n const id = uid();\n const ts = nowIso();\n const task: TodoTask = { done: false, ...input, name: input.name.trim(), id, createdAt: ts, updatedAt: ts };\n writeTasks([...tasks, task]);\n return id;\n }, [tasks, writeTasks]);\n\n const updateTask = useCallback<UseTodoTasks['updateTask']>((id, patch) => {\n writeTasks(tasks.map(t => (t.id === id ? { ...t, ...patch, id: t.id, updatedAt: nowIso() } : t)));\n }, [tasks, writeTasks]);\n\n const removeTask = useCallback<UseTodoTasks['removeTask']>((id) => {\n writeTasks(tasks.filter(t => t.id !== id));\n }, [tasks, writeTasks]);\n\n const toggleDone = useCallback<UseTodoTasks['toggleDone']>((id) => {\n const target = tasks.find(t => t.id === id);\n if (target) updateTask(id, { done: !target.done });\n }, [tasks, updateTask]);\n\n return { tasks, addTask, updateTask, removeTask, toggleDone, setAllTasks: writeTasks };\n}\n\n// ── Public hook (provider-aware) ──\nexport function useTodoTasks(): UseTodoTasks {\n // Both hooks always run (rules of hooks); the active impl is chosen below.\n const prefsImpl = usePrefsTodoTasks();\n const providerTasks = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);\n\n const addTask = useCallback<UseTodoTasks['addTask']>((input) => {\n const p = provider;\n if (!p) return prefsImpl.addTask(input);\n const tempId = 'tmp-' + uid();\n const ts = nowIso();\n const optimistic: TodoTask = { done: false, ...input, name: input.name.trim(), id: tempId, createdAt: ts, updatedAt: ts };\n setCache([...cache, optimistic]);\n p.create({ ...input, name: input.name.trim() })\n // Merge so server-owned fields win but client-only fields (estimated/\n // completed/notes the backend may not persist) survive the round-trip.\n .then(saved => setCache(cache.map(t => (t.id === tempId ? { ...optimistic, ...saved } : t))))\n .catch(() => setCache(cache.filter(t => t.id !== tempId)));\n return tempId;\n }, [prefsImpl]);\n\n const updateTask = useCallback<UseTodoTasks['updateTask']>((id, patch) => {\n const p = provider;\n if (!p) return prefsImpl.updateTask(id, patch);\n setCache(cache.map(t => (t.id === id ? { ...t, ...patch, id, updatedAt: nowIso() } : t)));\n p.update(id, patch).catch(() => { refresh(); });\n }, [prefsImpl]);\n\n const removeTask = useCallback<UseTodoTasks['removeTask']>((id) => {\n const p = provider;\n if (!p) return prefsImpl.removeTask(id);\n const prev = cache;\n setCache(cache.filter(t => t.id !== id));\n p.remove(id).catch(() => setCache(prev));\n }, [prefsImpl]);\n\n const toggleDone = useCallback<UseTodoTasks['toggleDone']>((id) => {\n if (!provider) return prefsImpl.toggleDone(id);\n const target = cache.find(t => t.id === id);\n if (target) updateTask(id, { done: !target.done });\n }, [prefsImpl, updateTask]);\n\n const setAllTasks = useCallback<UseTodoTasks['setAllTasks']>((next) => {\n // Provider owns persistence — bulk replace (Google Tasks sync) is a no-op there.\n if (!provider) prefsImpl.setAllTasks(next);\n }, [prefsImpl]);\n\n if (!hasShellTodoProvider()) return prefsImpl;\n return { tasks: providerTasks, addTask, updateTask, removeTask, toggleDone, setAllTasks };\n}\n\n/**\n * One-time migration: pull any tasks the Pomodoro widget previously\n * persisted to `localStorage.pomodoro_tasks` into the shared store.\n * No-op when a provider is registered (the provider owns persistence).\n */\nexport function migratePomodoroTasksOnce(\n currentTasks: TodoTask[],\n setAllTasks: (next: TodoTask[]) => void,\n): void {\n try {\n if (localStorage.getItem(POMODORO_LEGACY_MIGRATED_FLAG)) return;\n const raw = localStorage.getItem(POMODORO_LEGACY_KEY);\n if (!raw) {\n localStorage.setItem(POMODORO_LEGACY_MIGRATED_FLAG, '1');\n return;\n }\n const legacy: Array<{ id?: string; name?: string; estimated?: number; completed?: number; done?: boolean }>\n = JSON.parse(raw);\n if (!Array.isArray(legacy) || legacy.length === 0) {\n localStorage.removeItem(POMODORO_LEGACY_KEY);\n localStorage.setItem(POMODORO_LEGACY_MIGRATED_FLAG, '1');\n return;\n }\n const ts = nowIso();\n const migrated: TodoTask[] = legacy\n .filter(t => typeof t?.name === 'string')\n .map(t => ({\n id: t.id || uid(),\n name: String(t.name),\n done: !!t.done,\n estimated: typeof t.estimated === 'number' ? t.estimated : undefined,\n completed: typeof t.completed === 'number' ? t.completed : undefined,\n createdAt: ts,\n updatedAt: ts,\n }));\n const existingIds = new Set(currentTasks.map(t => t.id));\n const additions = migrated.filter(t => !existingIds.has(t.id));\n setAllTasks([...additions, ...currentTasks]);\n localStorage.removeItem(POMODORO_LEGACY_KEY);\n localStorage.setItem(POMODORO_LEGACY_MIGRATED_FLAG, '1');\n } catch {\n try { localStorage.setItem(POMODORO_LEGACY_MIGRATED_FLAG, '1'); } catch {}\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/shell/pomodoroStore.ts","../src/apps/_todoStore.ts"],"names":[],"mappings":";;;;;AA8DO,IAAM,aAAA,GAA0E;AAAA,EACrF,EAAE,EAAA,EAAI,MAAA,EAAe,KAAA,EAAO,MAAA,EAAiB,aAAa,6BAAA,EAA8B;AAAA,EACxF,EAAE,EAAA,EAAI,OAAA,EAAe,KAAA,EAAO,OAAA,EAAiB,aAAa,0BAAA,EAA2B;AAAA,EACrF,EAAE,EAAA,EAAI,MAAA,EAAe,KAAA,EAAO,cAAA,EAAiB,aAAa,4BAAA,EAA6B;AAAA,EACvF,EAAE,EAAA,EAAI,aAAA,EAAe,KAAA,EAAO,aAAA,EAAiB,aAAa,+BAAA,EAA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AA,EAAM,MAAA,CAAO,CAAA,CAAE,IAAI,CAAA;AAAA,MACnB,IAAA,EAAM,CAAC,CAAC,CAAA,CAAE,IAAA;AAAA,MACV,WAAW,OAAO,CAAA,CAAE,SAAA,KAAc,QAAA,GAAW,EAAE,SAAA,GAAY,KAAA,CAAA;AAAA,MAC3D,WAAW,OAAO,CAAA,CAAE,SAAA,KAAc,QAAA,GAAW,EAAE,SAAA,GAAY,KAAA,CAAA;AAAA,MAC3D,SAAA,EAAW,EAAA;AAAA,MACX,SAAA,EAAW;AAAA,KACb,CAAE,CAAA;AACJ,IAAA,MAAM,WAAA,GAAc,IAAI,GAAA,CAAI,YAAA,CAAa,IAAI,CAAA,CAAA,KAAK,CAAA,CAAE,EAAE,CAAC,CAAA;AACvD,IAAA,MAAM,SAAA,GAAY,SAAS,MAAA,CAAO,CAAA,CAAA,KAAK,CAAC,WAAA,CAAY,GAAA,CAAI,CAAA,CAAE,EAAE,CAAC,CAAA;AAC7D,IAAA,WAAA,CAAY,CAAC,GAAG,SAAA,EAAW,GAAG,YAAY,CAAC,CAAA;AAC3C,IAAA,YAAA,CAAa,WAAW,mBAAmB,CAAA;AAC3C,IAAA,YAAA,CAAa,OAAA,CAAQ,+BAA+B,GAAG,CAAA;AAAA,EACzD,CAAA,CAAA,MAAQ;AACN,IAAA,IAAI;AAAE,MAAA,YAAA,CAAa,OAAA,CAAQ,+BAA+B,GAAG,CAAA;AAAA,IAAG,CAAA,CAAA,MAAQ;AAAA,IAAC;AAAA,EAC3E;AACF","file":"chunk-WWT4XQJL.js","sourcesContent":["/**\n * Pomodoro store — module-level singleton that owns the timer state and\n * tick loop. Lifting the state above the widget means:\n *\n * 1. The taskbar indicator (`TaskbarPomodoro`) can subscribe even when\n * the widget itself is closed.\n * 2. The timer keeps running if the user closes / reopens the widget;\n * no progress is lost mid-session.\n *\n * The widget acts as a pure controller: it reads the snapshot via\n * `useSyncExternalStore` and calls the action functions below to drive\n * state transitions.\n *\n * The alarm sound on session-end is synthesised through the WebAudio API\n * (no audio file assets to bundle / license). All the presets are tuned\n * to be soft — gentle decay, low peak gain — so they don't startle. The\n * focus-time ambient sound (white / pink / brown noise) is synthesised\n * the same way and looped through an AudioBufferSourceNode.\n */\n\nimport toast from './toast';\n\nexport type Mode = 'focus' | 'short' | 'long';\nexport type AlarmSound = 'bell' | 'chime' | 'bowl' | 'wind-chimes' | 'off';\nexport type FocusSound =\n | 'none'\n | 'white' | 'pink' | 'brown'\n | 'tick-fast' | 'tick-slow'\n | 'rain' | 'fireplace';\n\nexport interface PomoDurations {\n /** Focus block, in seconds. */\n focus: number;\n /** Short break, in seconds. */\n short: number;\n /** Long break, in seconds. Triggered every Nth focus where N is\n * `longBreakInterval` from `setPomoBehaviour`. */\n long: number;\n}\n\nexport interface PomoBehaviour {\n /** When a focus block ends, automatically start the break. */\n autoStartBreaks: boolean;\n /** When a break ends, automatically start the next focus block. */\n autoStartPomodoros: boolean;\n /** Long break is taken after every Nth focus block. Default 4. */\n longBreakInterval: number;\n}\n\nexport interface PomoSnapshot {\n running: boolean;\n /** Seconds remaining in the current block. */\n remaining: number;\n mode: Mode;\n /** Seconds in the full current block — used for progress %. */\n total: number;\n /** Pomodoros completed since the page loaded. */\n streak: number;\n /** Today's lifetime count (persisted to localStorage). */\n count: number;\n}\n\nexport const ALARM_OPTIONS: { id: AlarmSound; label: string; description: string }[] = [\n { id: 'bell', label: 'Bell', description: 'Soft bell with one harmonic' },\n { id: 'chime', label: 'Chime', description: 'Two-note ascending chime' },\n { id: 'bowl', label: 'Singing Bowl', description: 'Long-decay meditation tone' },\n { id: 'wind-chimes', label: 'Wind Chimes', description: 'Four soft tones in succession' },\n { id: 'off', label: 'Off (silent)', description: 'No sound — only desktop notification' },\n];\n\nexport const FOCUS_SOUND_OPTIONS: { id: FocusSound; label: string }[] = [\n { id: 'none', label: 'None' },\n { id: 'tick-fast', label: 'Ticking Fast' },\n { id: 'tick-slow', label: 'Ticking Slow' },\n { id: 'rain', label: 'Rain' },\n { id: 'fireplace', label: 'Fireplace' },\n { id: 'white', label: 'White Noise' },\n { id: 'pink', label: 'Pink Noise' },\n { id: 'brown', label: 'Brown Noise' },\n];\n\nconst todayKey = () => `pomodoro-${new Date().toISOString().slice(0, 10)}`;\nconst loadCount = () => {\n try { return parseInt(localStorage.getItem(todayKey()) || '0', 10) || 0; } catch { return 0; }\n};\nconst saveCount = (n: number) => {\n try { localStorage.setItem(todayKey(), String(n)); } catch {}\n};\n\nlet _durations: PomoDurations = { focus: 25 * 60, short: 5 * 60, long: 15 * 60 };\nlet _alarm: AlarmSound = 'bell';\nlet _alarmVolume = 100; // 0–100\nlet _alarmRepeat = 1; // 1–5\nlet _focusSoundType: FocusSound = 'none';\nlet _focusVolume = 50; // 0–100\nlet _behaviour: PomoBehaviour = { autoStartBreaks: false, autoStartPomodoros: false, longBreakInterval: 4 };\n\nlet _state: PomoSnapshot = {\n running: false,\n remaining: _durations.focus,\n mode: 'focus',\n total: _durations.focus,\n streak: 0,\n count: typeof localStorage !== 'undefined' ? loadCount() : 0,\n};\n\nlet _intervalId: ReturnType<typeof setInterval> | null = null;\nconst _listeners = new Set<() => void>();\n\nconst _notify = () => _listeners.forEach(l => l());\nconst _set = (s: Partial<PomoSnapshot>) => { _state = { ..._state, ...s }; _notify(); };\n\nexport function getPomoSnapshot(): PomoSnapshot { return _state; }\nexport function subscribePomo(l: () => void) { _listeners.add(l); return () => { _listeners.delete(l); }; }\n\nexport function setPomoDurations(d: PomoDurations) {\n _durations = d;\n // If the user changed durations while not running and at the start of the\n // block, sync the visible time to the new value.\n if (!_state.running && _state.remaining === _state.total) {\n _set({ remaining: d[_state.mode], total: d[_state.mode] });\n }\n}\nexport function getPomoDurations(): PomoDurations { return _durations; }\n\nexport function setPomoAlarm(a: AlarmSound) { _alarm = a; }\nexport function getPomoAlarm(): AlarmSound { return _alarm; }\n\n/** Configure the alarm playback volume (0–100) and repeat count (1–5).\n * Used at session-end. The standalone `playAlarm()` preview button can\n * still pass overrides. */\nexport function setPomoAlarmConfig(volume: number, repeat: number) {\n _alarmVolume = Math.max(0, Math.min(100, Math.round(volume)));\n _alarmRepeat = Math.max(1, Math.min(5, Math.round(repeat)));\n}\nexport function getPomoAlarmConfig() { return { volume: _alarmVolume, repeat: _alarmRepeat }; }\n\nexport function setPomoBehaviour(b: PomoBehaviour) {\n _behaviour = {\n autoStartBreaks: !!b.autoStartBreaks,\n autoStartPomodoros: !!b.autoStartPomodoros,\n longBreakInterval: Math.max(1, Math.min(20, Math.round(b.longBreakInterval || 4))),\n };\n}\nexport function getPomoBehaviour(): PomoBehaviour { return _behaviour; }\n\n/** Configure the ambient focus-time sound. If a focus block is currently\n * running the audio is hot-swapped to the new settings. */\nexport function setPomoFocusSound(type: FocusSound, volume: number) {\n _focusSoundType = type;\n _focusVolume = Math.max(0, Math.min(100, Math.round(volume)));\n // Hot-swap if focus mode is currently running.\n if (_state.running && _state.mode === 'focus') {\n stopFocusAudio();\n startFocusAudio();\n } else if (type === 'none' || _focusVolume === 0) {\n stopFocusAudio();\n }\n}\nexport function getPomoFocusSound() { return { type: _focusSoundType, volume: _focusVolume }; }\n\nexport function pomoStart() {\n if (_state.running) return;\n _set({ running: true });\n _intervalId = setInterval(_tick, 1000);\n if (_state.mode === 'focus') startFocusAudio();\n}\nexport function pomoPause() {\n if (!_state.running && _intervalId === null) return;\n if (_intervalId !== null) { clearInterval(_intervalId); _intervalId = null; }\n _set({ running: false });\n stopFocusAudio();\n}\nexport function pomoReset() {\n pomoPause();\n _set({ remaining: _durations[_state.mode], total: _durations[_state.mode] });\n}\nexport function pomoSwitchMode(m: Mode) {\n pomoPause();\n _set({ mode: m, remaining: _durations[m], total: _durations[m] });\n}\n\nfunction _tick() {\n if (_state.remaining <= 1) {\n _onSessionEnd();\n return;\n }\n _set({ remaining: _state.remaining - 1 });\n}\n\nfunction _onSessionEnd() {\n if (_intervalId !== null) { clearInterval(_intervalId); _intervalId = null; }\n stopFocusAudio();\n playAlarm(_alarm, { volume: _alarmVolume, repeat: _alarmRepeat });\n\n // Notify the user three ways so they don't miss it:\n // 1. The alarm sound (already fired above).\n // 2. A native OS notification — fires even when the tab is in the\n // background, but only if the user granted permission.\n // 3. The in-app toast — guaranteed to render whenever the page is\n // open, regardless of OS permission state.\n const justFinishedFocus = _state.mode === 'focus';\n const headline = justFinishedFocus ? 'Pomodoro complete — time for a break! 🍅' : 'Break\\'s over — back to work!';\n if (typeof Notification !== 'undefined' && Notification.permission === 'granted') {\n try { new Notification(headline); } catch {}\n }\n try { toast.info(headline); } catch {}\n\n if (_state.mode === 'focus') {\n const nextStreak = _state.streak + 1;\n const newCount = _state.count + 1;\n saveCount(newCount);\n const nextMode: Mode = nextStreak % _behaviour.longBreakInterval === 0 ? 'long' : 'short';\n _set({\n running: false,\n streak: nextStreak,\n count: newCount,\n mode: nextMode,\n remaining: _durations[nextMode],\n total: _durations[nextMode],\n });\n if (_behaviour.autoStartBreaks) setTimeout(() => pomoStart(), 50);\n } else {\n _set({\n running: false,\n mode: 'focus',\n remaining: _durations.focus,\n total: _durations.focus,\n });\n if (_behaviour.autoStartPomodoros) setTimeout(() => pomoStart(), 50);\n }\n}\n\n/** Synthesise the chosen alarm via WebAudio. All presets are tuned soft —\n * exponential decay to near-silence, peak gain ≤ 0.22. The `volume`\n * option scales the peak (0-100). The `repeat` option plays the cue\n * several times with a 2.5 s gap between starts. */\nexport function playAlarm(kind: AlarmSound = _alarm, opts: { volume?: number; repeat?: number } = {}) {\n if (kind === 'off') return;\n const volScale = Math.max(0, Math.min(100, opts.volume ?? 100)) / 100;\n if (volScale === 0) return;\n const repeat = Math.max(1, Math.min(5, opts.repeat ?? 1));\n for (let i = 0; i < repeat; i++) {\n setTimeout(() => _playAlarmOnce(kind, volScale), i * 2500);\n }\n}\n\nfunction _playAlarmOnce(kind: AlarmSound, volScale: number) {\n try {\n const Ctor: typeof AudioContext = (window as any).AudioContext || (window as any).webkitAudioContext;\n if (!Ctor) return;\n const ctx = new Ctor();\n const playNote = (freq: number, start: number, duration: number, vol = 0.22, type: OscillatorType = 'sine') => {\n const osc = ctx.createOscillator();\n const gain = ctx.createGain();\n osc.connect(gain); gain.connect(ctx.destination);\n osc.type = type;\n osc.frequency.value = freq;\n const t0 = ctx.currentTime + start;\n gain.gain.setValueAtTime(0, t0);\n gain.gain.linearRampToValueAtTime(vol * volScale, t0 + 0.03);\n gain.gain.exponentialRampToValueAtTime(0.0001, t0 + duration);\n osc.start(t0);\n osc.stop(t0 + duration);\n };\n let totalDuration = 2;\n if (kind === 'bell') {\n playNote(880, 0, 1.8);\n playNote(1320, 0, 1.4, 0.10);\n totalDuration = 2;\n } else if (kind === 'chime') {\n playNote(659.25, 0, 0.7); // E5\n playNote(880, 0.20, 1.3); // A5\n totalDuration = 2;\n } else if (kind === 'bowl') {\n playNote(440, 0, 3.4, 0.22);\n playNote(660, 0, 3.0, 0.08);\n playNote(880, 0.05, 2.8, 0.05);\n totalDuration = 4;\n } else if (kind === 'wind-chimes') {\n playNote(1175, 0, 1.1, 0.16); // D6\n playNote(880, 0.15, 1.3, 0.16); // A5\n playNote(1318, 0.30, 1.5, 0.16); // E6\n playNote(1047, 0.50, 1.7, 0.13); // C6\n totalDuration = 3;\n }\n setTimeout(() => { try { ctx.close(); } catch {} }, totalDuration * 1000 + 500);\n } catch {}\n}\n\n// ── Ambient focus-time sound ──\nlet _focusAudio: { ctx: AudioContext; src: AudioBufferSourceNode; gain: GainNode } | null = null;\n\n/** Per-type volume cap. Sparse signals (ticking, fireplace pops) need a\n * higher gain to perceive at the same loudness as a continuous noise\n * texture. The user-facing slider always shows 0–100; this multiplier\n * is the headroom mapping. */\nconst FOCUS_VOL_CAP: Record<FocusSound, number> = {\n none: 0,\n white: 0.30,\n pink: 0.30,\n brown: 0.30,\n 'tick-fast': 0.60,\n 'tick-slow': 0.60,\n rain: 0.40,\n fireplace: 0.50,\n};\n\nfunction _makeNoiseBuffer(ctx: AudioContext, type: FocusSound): AudioBuffer | null {\n if (type === 'none') return null;\n const sr = ctx.sampleRate;\n // Noise textures use a 2 s loop. Ticking, rain, and fireplace use 4 s\n // so multiple ticks / pops fit in one cycle and the loop seam is masked\n // by the texture itself.\n const dur = (type === 'white' || type === 'pink' || type === 'brown') ? 2 : 4;\n const len = sr * dur;\n const buffer = ctx.createBuffer(1, len, sr);\n const data = buffer.getChannelData(0);\n\n if (type === 'white') {\n for (let i = 0; i < len; i++) data[i] = (Math.random() * 2 - 1) * 0.5;\n\n } else if (type === 'pink') {\n // Paul Kellet's filter — cheap pink-noise approximation.\n let b0 = 0, b1 = 0, b2 = 0, b3 = 0, b4 = 0, b5 = 0, b6 = 0;\n for (let i = 0; i < len; i++) {\n const w = Math.random() * 2 - 1;\n b0 = 0.99886 * b0 + w * 0.0555179;\n b1 = 0.99332 * b1 + w * 0.0750759;\n b2 = 0.96900 * b2 + w * 0.1538520;\n b3 = 0.86650 * b3 + w * 0.3104856;\n b4 = 0.55000 * b4 + w * 0.5329522;\n b5 = -0.7616 * b5 - w * 0.0168980;\n data[i] = (b0 + b1 + b2 + b3 + b4 + b5 + b6 + w * 0.5362) * 0.11 * 0.55;\n b6 = w * 0.115926;\n }\n\n } else if (type === 'brown') {\n // 1/f² — leaky integrator on white noise.\n let last = 0;\n for (let i = 0; i < len; i++) {\n const w = Math.random() * 2 - 1;\n last = (last + 0.02 * w) / 1.02;\n data[i] = last * 3.5 * 0.5;\n }\n\n } else if (type === 'tick-fast' || type === 'tick-slow') {\n // Wall-clock tick: brief noise burst with a sharp exponential decay.\n // Two intervals are even divisors of the 4 s buffer, so the loop is\n // perfectly seamless.\n const intervalSec = type === 'tick-fast' ? 0.5 : 1.0;\n const tickSamples = Math.floor(sr * 0.045);\n for (let t = 0; t < dur; t += intervalSec) {\n const start = Math.floor(t * sr);\n for (let i = 0; i < tickSamples && start + i < len; i++) {\n const env = Math.exp(-i / sr * 180); // ~5 ms attack, ~25 ms decay tail\n const noise = Math.random() * 2 - 1;\n // Mix sharp click (filtered noise) with a faint sine to add body.\n const tone = Math.sin(2 * Math.PI * 1100 * (i / sr));\n data[start + i] += (noise * 0.7 + tone * 0.25) * env * 0.55;\n }\n }\n\n } else if (type === 'rain') {\n // High-pass filtered white noise (the \"patter\") plus a slow tremolo\n // for occasional gusts.\n let prev = 0;\n for (let i = 0; i < len; i++) {\n const w = Math.random() * 2 - 1;\n const filtered = w - prev * 0.93; // high-pass\n prev = w;\n const gust = 0.7 + 0.3 * Math.sin((i / sr) * 2 * Math.PI * 0.25);\n data[i] = filtered * gust * 0.4;\n }\n\n } else if (type === 'fireplace') {\n // Brown-noise rumble underneath, plus randomly-spaced \"pops\" (short\n // noise transients with sharp decay) for the crackle.\n let last = 0;\n for (let i = 0; i < len; i++) {\n const w = Math.random() * 2 - 1;\n last = (last + 0.02 * w) / 1.02;\n data[i] = last * 1.6;\n }\n let next = Math.random() * 0.4 * sr;\n while (next < len) {\n const popLen = Math.floor((0.012 + Math.random() * 0.05) * sr);\n const popVol = 0.35 + Math.random() * 0.45;\n const popPos = Math.floor(next);\n for (let i = 0; i < popLen && popPos + i < len; i++) {\n const env = Math.exp(-i / sr * 90);\n data[popPos + i] += (Math.random() * 2 - 1) * env * popVol;\n }\n // Next pop somewhere between 80 ms and 700 ms later.\n next += (0.08 + Math.random() * 0.62) * sr;\n }\n }\n\n return buffer;\n}\n\nfunction startFocusAudio() {\n if (_focusAudio) return;\n if (_focusSoundType === 'none' || _focusVolume === 0) return;\n try {\n const Ctor: typeof AudioContext = (window as any).AudioContext || (window as any).webkitAudioContext;\n if (!Ctor) return;\n const ctx = new Ctor();\n const buffer = _makeNoiseBuffer(ctx, _focusSoundType);\n if (!buffer) { try { ctx.close(); } catch {} return; }\n const src = ctx.createBufferSource();\n src.buffer = buffer;\n src.loop = true;\n const gain = ctx.createGain();\n gain.gain.value = (_focusVolume / 100) * FOCUS_VOL_CAP[_focusSoundType];\n src.connect(gain).connect(ctx.destination);\n src.start();\n _focusAudio = { ctx, src, gain };\n } catch {}\n}\n\nfunction stopFocusAudio() {\n if (!_focusAudio) return;\n try { _focusAudio.src.stop(); } catch {}\n try { _focusAudio.ctx.close(); } catch {}\n _focusAudio = null;\n}\n\n/** Play the configured ambient focus sound for ~3 s as a preview. Used by\n * the Settings UI when the user adjusts the dropdown / volume slider. */\nexport function previewFocusSound(type: FocusSound, volume: number) {\n if (type === 'none' || volume === 0) return;\n try {\n const Ctor: typeof AudioContext = (window as any).AudioContext || (window as any).webkitAudioContext;\n if (!Ctor) return;\n const ctx = new Ctor();\n const buffer = _makeNoiseBuffer(ctx, type);\n if (!buffer) { try { ctx.close(); } catch {} return; }\n const src = ctx.createBufferSource();\n src.buffer = buffer;\n src.loop = true;\n const gain = ctx.createGain();\n gain.gain.value = (volume / 100) * FOCUS_VOL_CAP[type];\n src.connect(gain).connect(ctx.destination);\n src.start();\n setTimeout(() => {\n try { src.stop(); } catch {}\n try { ctx.close(); } catch {}\n }, 3000);\n } catch {}\n}\n","/**\n * Shared task store for the Todo List app and the Pomodoro widget — both\n * read/write the same list via `useTodoTasks()`.\n *\n * Two backends:\n * • Default: `useShellPrefs()` → `prefs.todo_tasks` (per-user prefs blob).\n * • Opt-in: a consumer-supplied `TodoProvider` registered with\n * `setShellTodoProvider(...)`. When set, the three apps read/write through\n * it instead — letting an ERP make the shell's tasks the SAME records as\n * its own task table, and tag each with a `contextLabel` badge (e.g.\n * \"Deal: Acme\"). Mirrors `setShellApiClient`.\n *\n * `migratePomodoroTasksOnce()` folds legacy `localStorage.pomodoro_tasks`\n * into the prefs store on first Pomodoro mount (no-op in provider mode).\n */\nimport { useCallback, useMemo, useSyncExternalStore } from 'react';\nimport { useShellPrefs } from '../shell/ShellPrefs';\nimport type { TodoTask } from './_todoTypes';\n\nconst POMODORO_LEGACY_KEY = 'pomodoro_tasks';\nconst POMODORO_LEGACY_MIGRATED_FLAG = 'pomodoro_tasks_migrated';\n\nfunction uid(): string {\n return Math.random().toString(36).slice(2, 11);\n}\n\nfunction nowIso(): string {\n return new Date().toISOString();\n}\n\nexport interface UseTodoTasks {\n tasks: TodoTask[];\n /** Add a new task. Returns the id of the freshly-added task. */\n addTask: (input: Partial<Omit<TodoTask, 'id' | 'createdAt' | 'updatedAt'>> & { name: string }) => string;\n /** Patch any subset of fields on a task by id. `updatedAt` is auto-bumped. */\n updateTask: (id: string, patch: Partial<TodoTask>) => void;\n /** Remove a task by id. Used by both Pomodoro's kebab menu and TodoList's delete action. */\n removeTask: (id: string) => void;\n /** Flip `done`. Same as `updateTask(id, { done: !done })` but faster to type at call sites. */\n toggleDone: (id: string) => void;\n /** Replace the entire list. Used by Google Tasks sync after a pull. */\n setAllTasks: (tasks: TodoTask[]) => void;\n}\n\n/**\n * A consumer-supplied task backend. Registering one (opt-in) routes every\n * shell task surface through it instead of the prefs blob. Methods map to/from\n * the shell's `TodoTask` shape, including the optional `source`/`contextLabel`.\n */\nexport interface TodoProvider {\n list(): Promise<TodoTask[]>;\n create(input: Partial<Omit<TodoTask, 'id' | 'createdAt' | 'updatedAt'>> & { name: string }): Promise<TodoTask>;\n update(id: string, patch: Partial<TodoTask>): Promise<TodoTask>;\n remove(id: string): Promise<void>;\n}\n\n// ── Module-level provider store (shared across all consumers) ──\nlet provider: TodoProvider | null = null;\nlet cache: TodoTask[] = [];\nlet loaded = false;\nlet inflight: Promise<void> | null = null;\nconst listeners = new Set<() => void>();\n\nfunction emit(): void {\n for (const l of listeners) l();\n}\n\nfunction setCache(next: TodoTask[]): void {\n cache = next;\n emit();\n}\n\nfunction refresh(): Promise<void> {\n const p = provider;\n if (!p) {\n cache = [];\n loaded = true;\n emit();\n return Promise.resolve();\n }\n inflight = p\n .list()\n .then(rows => {\n if (provider === p) {\n cache = rows;\n loaded = true;\n emit();\n }\n })\n .catch(() => {\n if (provider === p) {\n loaded = true;\n emit();\n }\n })\n .finally(() => {\n inflight = null;\n });\n return inflight;\n}\n\n/** Register (or clear with `null`) the backend task provider. Opt-in. */\nexport function setShellTodoProvider(next: TodoProvider | null): void {\n provider = next;\n cache = [];\n loaded = false;\n if (next) refresh();\n else emit();\n}\n\nexport function hasShellTodoProvider(): boolean {\n return provider !== null;\n}\n\nfunction subscribe(cb: () => void): () => void {\n listeners.add(cb);\n if (provider && !loaded && !inflight) refresh();\n return () => {\n listeners.delete(cb);\n };\n}\n\nfunction getSnapshot(): TodoTask[] {\n return cache;\n}\n\n// ── Prefs-backed implementation (default / fallback) ──\nfunction usePrefsTodoTasks(): UseTodoTasks {\n const { prefs, save } = useShellPrefs();\n const tasks: TodoTask[] = useMemo(() => {\n const raw = prefs.todo_tasks;\n return Array.isArray(raw) ? (raw as TodoTask[]) : [];\n }, [prefs.todo_tasks]);\n\n const writeTasks = useCallback((next: TodoTask[]) => {\n save({ todo_tasks: next });\n }, [save]);\n\n const addTask = useCallback<UseTodoTasks['addTask']>((input) => {\n const id = uid();\n const ts = nowIso();\n const task: TodoTask = { done: false, ...input, name: input.name.trim(), id, createdAt: ts, updatedAt: ts };\n writeTasks([...tasks, task]);\n return id;\n }, [tasks, writeTasks]);\n\n const updateTask = useCallback<UseTodoTasks['updateTask']>((id, patch) => {\n writeTasks(tasks.map(t => (t.id === id ? { ...t, ...patch, id: t.id, updatedAt: nowIso() } : t)));\n }, [tasks, writeTasks]);\n\n const removeTask = useCallback<UseTodoTasks['removeTask']>((id) => {\n writeTasks(tasks.filter(t => t.id !== id));\n }, [tasks, writeTasks]);\n\n const toggleDone = useCallback<UseTodoTasks['toggleDone']>((id) => {\n const target = tasks.find(t => t.id === id);\n if (target) updateTask(id, { done: !target.done });\n }, [tasks, updateTask]);\n\n return { tasks, addTask, updateTask, removeTask, toggleDone, setAllTasks: writeTasks };\n}\n\n// ── Public hook (provider-aware) ──\nexport function useTodoTasks(): UseTodoTasks {\n // Both hooks always run (rules of hooks); the active impl is chosen below.\n const prefsImpl = usePrefsTodoTasks();\n const providerTasks = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);\n\n const addTask = useCallback<UseTodoTasks['addTask']>((input) => {\n const p = provider;\n if (!p) return prefsImpl.addTask(input);\n const tempId = 'tmp-' + uid();\n const ts = nowIso();\n const optimistic: TodoTask = { done: false, ...input, name: input.name.trim(), id: tempId, createdAt: ts, updatedAt: ts };\n setCache([...cache, optimistic]);\n p.create({ ...input, name: input.name.trim() })\n // Merge so server-owned fields win but client-only fields (estimated/\n // completed/notes the backend may not persist) survive the round-trip.\n .then(saved => setCache(cache.map(t => (t.id === tempId ? { ...optimistic, ...saved } : t))))\n .catch(() => setCache(cache.filter(t => t.id !== tempId)));\n return tempId;\n }, [prefsImpl]);\n\n const updateTask = useCallback<UseTodoTasks['updateTask']>((id, patch) => {\n const p = provider;\n if (!p) return prefsImpl.updateTask(id, patch);\n setCache(cache.map(t => (t.id === id ? { ...t, ...patch, id, updatedAt: nowIso() } : t)));\n p.update(id, patch).catch(() => { refresh(); });\n }, [prefsImpl]);\n\n const removeTask = useCallback<UseTodoTasks['removeTask']>((id) => {\n const p = provider;\n if (!p) return prefsImpl.removeTask(id);\n const prev = cache;\n setCache(cache.filter(t => t.id !== id));\n p.remove(id).catch(() => setCache(prev));\n }, [prefsImpl]);\n\n const toggleDone = useCallback<UseTodoTasks['toggleDone']>((id) => {\n if (!provider) return prefsImpl.toggleDone(id);\n const target = cache.find(t => t.id === id);\n if (target) updateTask(id, { done: !target.done });\n }, [prefsImpl, updateTask]);\n\n const setAllTasks = useCallback<UseTodoTasks['setAllTasks']>((next) => {\n // Provider owns persistence — bulk replace (Google Tasks sync) is a no-op there.\n if (!provider) prefsImpl.setAllTasks(next);\n }, [prefsImpl]);\n\n if (!hasShellTodoProvider()) return prefsImpl;\n return { tasks: providerTasks, addTask, updateTask, removeTask, toggleDone, setAllTasks };\n}\n\n/**\n * One-time migration: pull any tasks the Pomodoro widget previously\n * persisted to `localStorage.pomodoro_tasks` into the shared store.\n * No-op when a provider is registered (the provider owns persistence).\n */\nexport function migratePomodoroTasksOnce(\n currentTasks: TodoTask[],\n setAllTasks: (next: TodoTask[]) => void,\n): void {\n try {\n if (localStorage.getItem(POMODORO_LEGACY_MIGRATED_FLAG)) return;\n const raw = localStorage.getItem(POMODORO_LEGACY_KEY);\n if (!raw) {\n localStorage.setItem(POMODORO_LEGACY_MIGRATED_FLAG, '1');\n return;\n }\n const legacy: Array<{ id?: string; name?: string; estimated?: number; completed?: number; done?: boolean }>\n = JSON.parse(raw);\n if (!Array.isArray(legacy) || legacy.length === 0) {\n localStorage.removeItem(POMODORO_LEGACY_KEY);\n localStorage.setItem(POMODORO_LEGACY_MIGRATED_FLAG, '1');\n return;\n }\n const ts = nowIso();\n const migrated: TodoTask[] = legacy\n .filter(t => typeof t?.name === 'string')\n .map(t => ({\n id: t.id || uid(),\n name: String(t.name),\n done: !!t.done,\n estimated: typeof t.estimated === 'number' ? t.estimated : undefined,\n completed: typeof t.completed === 'number' ? t.completed : undefined,\n createdAt: ts,\n updatedAt: ts,\n }));\n const existingIds = new Set(currentTasks.map(t => t.id));\n const additions = migrated.filter(t => !existingIds.has(t.id));\n setAllTasks([...additions, ...currentTasks]);\n localStorage.removeItem(POMODORO_LEGACY_KEY);\n localStorage.setItem(POMODORO_LEGACY_MIGRATED_FLAG, '1');\n } catch {\n try { localStorage.setItem(POMODORO_LEGACY_MIGRATED_FLAG, '1'); } catch {}\n }\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1175,6 +1175,14 @@ interface EntityListProps<T> {
|
|
|
1175
1175
|
isLoading: boolean;
|
|
1176
1176
|
emptyState: ReactNode;
|
|
1177
1177
|
totalCount?: number;
|
|
1178
|
+
/** When true and no rows have loaded yet, render {@link ListLoadError}
|
|
1179
|
+
* (with a retry) instead of `emptyState` — so a failed fetch reads as an
|
|
1180
|
+
* error, not "nothing here". Wire `useInfiniteScroll`'s `isError`. A
|
|
1181
|
+
* mid-scroll next-page failure (rows already loaded) keeps the list.
|
|
1182
|
+
* Defaults to unset → behaviour unchanged for existing callers. */
|
|
1183
|
+
isError?: boolean;
|
|
1184
|
+
/** Retry handler for the error state — wire the data source's `refetch`. */
|
|
1185
|
+
onRetry?: () => void;
|
|
1178
1186
|
tableId: string;
|
|
1179
1187
|
columns: EntityListColumn[];
|
|
1180
1188
|
renderCell: (item: T, colKey: string) => ReactNode;
|
|
@@ -1366,6 +1374,26 @@ interface ListFooterProps {
|
|
|
1366
1374
|
*/
|
|
1367
1375
|
declare function ListFooter({ selectedCount, loadedCount, totalCount, label, isFetchingMore, extra, }: ListFooterProps): react_jsx_runtime.JSX.Element;
|
|
1368
1376
|
|
|
1377
|
+
interface ListLoadErrorProps {
|
|
1378
|
+
/** Bold heading. Defaults to "Couldn't load this list". */
|
|
1379
|
+
title?: string;
|
|
1380
|
+
/** Muted explanatory line. Defaults to a generic connection/retry message. */
|
|
1381
|
+
message?: string;
|
|
1382
|
+
/** When provided, renders a "Try again" button that calls it (wire the
|
|
1383
|
+
* data source's `refetch`). Omit for a static, non-retryable error. */
|
|
1384
|
+
onRetry?: () => void;
|
|
1385
|
+
/** Frame around the content, mirroring {@link EmptyState}: `dashed`
|
|
1386
|
+
* (default), `card` (bordered surface), or `none`. */
|
|
1387
|
+
variant?: 'dashed' | 'card' | 'none';
|
|
1388
|
+
}
|
|
1389
|
+
/**
|
|
1390
|
+
* ListLoadError — the error counterpart to `EmptyState` for data lists. Shown
|
|
1391
|
+
* when a list's fetch fails (5xx, auth expiry, network) so an outage reads as
|
|
1392
|
+
* an error with a retry affordance instead of a misleading "nothing here"
|
|
1393
|
+
* empty state. Visual language mirrors `EmptyState`, tinted for error.
|
|
1394
|
+
*/
|
|
1395
|
+
declare function ListLoadError({ title, message, onRetry, variant, }: ListLoadErrorProps): react_jsx_runtime.JSX.Element;
|
|
1396
|
+
|
|
1369
1397
|
/**
|
|
1370
1398
|
* Keyboard + shift-click navigation for table rows.
|
|
1371
1399
|
*
|
|
@@ -1439,6 +1467,8 @@ declare function useInfiniteScroll<T>({ queryKey, fetchFn, extraParams, pageSize
|
|
|
1439
1467
|
items: T[];
|
|
1440
1468
|
totalCount: number;
|
|
1441
1469
|
isLoading: boolean;
|
|
1470
|
+
isError: boolean;
|
|
1471
|
+
error: Error | null;
|
|
1442
1472
|
isFetchingNextPage: boolean;
|
|
1443
1473
|
hasNextPage: boolean;
|
|
1444
1474
|
sentinelRef: react.RefObject<HTMLDivElement>;
|
|
@@ -1535,6 +1565,13 @@ interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'onC
|
|
|
1535
1565
|
invalid?: boolean;
|
|
1536
1566
|
className?: string;
|
|
1537
1567
|
}
|
|
1568
|
+
/**
|
|
1569
|
+
* Raw native `<select>` styled to match the kit's inputs. This is the original
|
|
1570
|
+
* Select — kept as the mobile rendering and exported for callers that need a
|
|
1571
|
+
* real `HTMLSelectElement` (form posts, native attribute spread, focus).
|
|
1572
|
+
*/
|
|
1573
|
+
declare const NativeSelect: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<HTMLSelectElement>>;
|
|
1574
|
+
/** Smart Select: native `<select>` on touch, custom listbox on desktop. */
|
|
1538
1575
|
declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<HTMLSelectElement>>;
|
|
1539
1576
|
|
|
1540
1577
|
interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'onChange' | 'checked' | 'className'> {
|
|
@@ -1925,9 +1962,15 @@ interface FilterBarProps {
|
|
|
1925
1962
|
children?: ReactNode;
|
|
1926
1963
|
}
|
|
1927
1964
|
/**
|
|
1928
|
-
* FilterBar — a horizontal row of filter controls. Each filter renders a
|
|
1929
|
-
*
|
|
1930
|
-
* filters" button appears when any filter is active. Pair with
|
|
1965
|
+
* FilterBar — a horizontal row of filter controls. Each filter renders a custom
|
|
1966
|
+
* listbox dropdown or, for long lists, a glass-styled searchable dropdown; a
|
|
1967
|
+
* "Clear filters" button appears when any filter is active. Pair with
|
|
1968
|
+
* `useFilters`.
|
|
1969
|
+
*
|
|
1970
|
+
* The short-list path used to render a native `<select>`, but a native select's
|
|
1971
|
+
* OS popup swallows every key event while open — so list-page hotkeys died
|
|
1972
|
+
* until it closed (BG#00421). PlainFilter is a custom listbox that keeps key
|
|
1973
|
+
* events flowing to the page.
|
|
1931
1974
|
*/
|
|
1932
1975
|
declare function FilterBar({ filters, values, onChange, onClear, children }: FilterBarProps): react_jsx_runtime.JSX.Element;
|
|
1933
1976
|
/** Local filter-state helper: tracks active filter values + derived params. */
|
|
@@ -1938,6 +1981,51 @@ declare function useFilters(): {
|
|
|
1938
1981
|
filterParams: Record<string, string>;
|
|
1939
1982
|
};
|
|
1940
1983
|
|
|
1984
|
+
/**
|
|
1985
|
+
* Severity — the health subset of the shell's status vocabulary.
|
|
1986
|
+
*
|
|
1987
|
+
* The shell already speaks `success | warning | danger` everywhere status has a
|
|
1988
|
+
* colour (`StatusBadge`'s `SemanticGroup`, `Banner`'s `BannerTone`,
|
|
1989
|
+
* `ConfirmDialog`'s `variant`). Health surfaces reuse those three words rather
|
|
1990
|
+
* than introducing an ok/warn/crit dialect that would mean the same thing in a
|
|
1991
|
+
* different language — a consumer mapping one to the other is a bug waiting to
|
|
1992
|
+
* happen. The type is deliberately narrower than `SemanticGroup`: an alarm
|
|
1993
|
+
* marker has exactly three things to say.
|
|
1994
|
+
*
|
|
1995
|
+
* "No severity" is expressed as the ABSENCE of a tone (`undefined`/`null`), not
|
|
1996
|
+
* as a fourth member. Two different facts collapse into it — no reading at all,
|
|
1997
|
+
* and a reading with nothing to judge it against — and both must render as
|
|
1998
|
+
* "unknown" rather than borrowing the calm green of a measured healthy value.
|
|
1999
|
+
* See `MetricBar`, which keeps them apart.
|
|
2000
|
+
*
|
|
2001
|
+
* A severity usually arrives from a backend rollup, so it crosses a JSON
|
|
2002
|
+
* boundary where the compiler cannot follow it. `resolveSeverity` is what the
|
|
2003
|
+
* components call: a token the shell does not recognise renders a LOUD unknown
|
|
2004
|
+
* marker and logs, it never renders nothing. An alarm surface that silently
|
|
2005
|
+
* stops alarming is the one failure these components exist to prevent, so it is
|
|
2006
|
+
* also the one failure they must not have themselves.
|
|
2007
|
+
*/
|
|
2008
|
+
/** Health tone. Same three words the rest of the shell uses for status colour. */
|
|
2009
|
+
type SeverityTone = 'success' | 'warning' | 'danger';
|
|
2010
|
+
/** True when `value` is one of the three tones. Exported so a consumer can
|
|
2011
|
+
* validate a rollup at the fetch boundary — where a bad token can still be
|
|
2012
|
+
* reported against its payload — rather than discovering it as a wrong pixel. */
|
|
2013
|
+
declare function isSeverityTone(value: unknown): value is SeverityTone;
|
|
2014
|
+
/**
|
|
2015
|
+
* Severity of `value` against its bounds, or `null` when nothing can be said.
|
|
2016
|
+
*
|
|
2017
|
+
* Both bounds are INCLUSIVE (`>=`): a disk at exactly its `crit` number is
|
|
2018
|
+
* `danger`. Either bound may be omitted — a metric with only a `crit` still
|
|
2019
|
+
* judges — but with neither the answer is `null`, never `success`: no threshold
|
|
2020
|
+
* is hardcoded here, not even as a fallback, so with nothing to measure against
|
|
2021
|
+
* there is no verdict to report.
|
|
2022
|
+
*
|
|
2023
|
+
* A non-finite bound counts as omitted, not as a bound that nothing exceeds.
|
|
2024
|
+
* `NaN >= NaN` is false, so an unguarded `warn={NaN}` would have quietly
|
|
2025
|
+
* returned `success` — a verdict invented out of a missing threshold.
|
|
2026
|
+
*/
|
|
2027
|
+
declare function severityOf(value: number | null | undefined, warn?: number | null, crit?: number | null): SeverityTone | null;
|
|
2028
|
+
|
|
1941
2029
|
/**
|
|
1942
2030
|
* Presentational building blocks for SidebarLayout filter sidebars (status
|
|
1943
2031
|
* buckets, categories, …) — the same item + group-label markup every list
|
|
@@ -1946,13 +2034,71 @@ declare function useFilters(): {
|
|
|
1946
2034
|
declare function SidebarGroupLabel({ children }: {
|
|
1947
2035
|
children: ReactNode;
|
|
1948
2036
|
}): react_jsx_runtime.JSX.Element;
|
|
1949
|
-
declare function SidebarNavItem({ label, count, active, onClick }: {
|
|
2037
|
+
declare function SidebarNavItem({ label, count, active, onClick, severity }: {
|
|
1950
2038
|
label: string;
|
|
1951
2039
|
count?: number;
|
|
1952
2040
|
active: boolean;
|
|
1953
2041
|
onClick: () => void;
|
|
2042
|
+
/**
|
|
2043
|
+
* Optional health marker — a small dot before the label, in the shell's
|
|
2044
|
+
* status vocabulary (`success | warning | danger`). For sidebars that double
|
|
2045
|
+
* as an alarm surface: a problem several levels down inside a section stays
|
|
2046
|
+
* visible on the always-on nav item that leads to it, without the operator
|
|
2047
|
+
* having to open anything.
|
|
2048
|
+
*
|
|
2049
|
+
* Roll the tone up in the consuming app (worst-of its children) — the item
|
|
2050
|
+
* renders a severity, it never computes one. Omitting it is not a claim of
|
|
2051
|
+
* health, it is no claim at all, and renders exactly as an item did before
|
|
2052
|
+
* this prop existed.
|
|
2053
|
+
*
|
|
2054
|
+
* A tone that arrives from a backend rollup has not been near the compiler,
|
|
2055
|
+
* so an unrecognised token (`'crit'`, `'critical'`, a stale enum) renders a
|
|
2056
|
+
* visible "unknown severity" marker and logs — never nothing. This item is
|
|
2057
|
+
* often the ONLY place a deep alarm surfaces; a marker that quietly vanishes
|
|
2058
|
+
* on a bad token would turn the safety feature into the outage.
|
|
2059
|
+
*/
|
|
2060
|
+
severity?: SeverityTone;
|
|
1954
2061
|
}): react_jsx_runtime.JSX.Element;
|
|
1955
2062
|
|
|
2063
|
+
interface MetricBarProps {
|
|
2064
|
+
/** Row label — `CPU`, `Memory`, `Disk`. Rendered in a fixed-width column so
|
|
2065
|
+
* a stack of rows aligns. */
|
|
2066
|
+
label?: ReactNode;
|
|
2067
|
+
/** The measured value. `null` / `undefined` means NO READING — rendered as
|
|
2068
|
+
* unknown, never as 0. */
|
|
2069
|
+
value: number | null | undefined;
|
|
2070
|
+
/** Value mapped to a full bar. Default 100. Must be a positive finite number:
|
|
2071
|
+
* it is the divisor, so `0`, a negative or `NaN` is not a scale. Given one,
|
|
2072
|
+
* the row prints the value but draws no proportional bar and no ticks —
|
|
2073
|
+
* there is nothing truthful to draw them against. */
|
|
2074
|
+
max?: number;
|
|
2075
|
+
/** Warning bound, in the same unit as `value`. Inclusive (`>=`). */
|
|
2076
|
+
warn?: number | null;
|
|
2077
|
+
/** Critical bound, in the same unit as `value`. Inclusive (`>=`). */
|
|
2078
|
+
crit?: number | null;
|
|
2079
|
+
/** Forces the tone when the caller judges severity itself (e.g. a rollup
|
|
2080
|
+
* served by the backend). Overrides `warn`/`crit` for colour; the ticks
|
|
2081
|
+
* still render wherever `warn`/`crit` say. */
|
|
2082
|
+
severity?: SeverityTone;
|
|
2083
|
+
/** Trailing secondary text — `10.9 / 16 GiB`, `4 vCPU`. Hidden when there is
|
|
2084
|
+
* no reading, where the row has something more important to say. */
|
|
2085
|
+
detail?: ReactNode;
|
|
2086
|
+
/** Formats the printed value. Default: one decimal plus `%` on the default
|
|
2087
|
+
* 0–100 scale, the bare number on any other `max` (a custom scale is not a
|
|
2088
|
+
* percentage, and printing one would be a lie). */
|
|
2089
|
+
formatValue?: (value: number) => string;
|
|
2090
|
+
/** Wording for "no reading". Default `no data`. */
|
|
2091
|
+
emptyLabel?: string;
|
|
2092
|
+
/** `sm` (default) — the compact row that stacks three to a card.
|
|
2093
|
+
* `md` — bigger value type for a standalone stat. Neither draws a frame;
|
|
2094
|
+
* wrap in a `Card` (or your own) if you want one. */
|
|
2095
|
+
size?: 'sm' | 'md';
|
|
2096
|
+
/** Accessible name for the meter. Defaults to `label` when it's a string. */
|
|
2097
|
+
ariaLabel?: string;
|
|
2098
|
+
className?: string;
|
|
2099
|
+
}
|
|
2100
|
+
declare function MetricBar({ label, value, max, warn, crit, severity, detail, formatValue, emptyLabel, size, ariaLabel, className, }: MetricBarProps): react_jsx_runtime.JSX.Element;
|
|
2101
|
+
|
|
1956
2102
|
/**
|
|
1957
2103
|
* Semantic role of a column, used to auto-map CSV columns to fields and to
|
|
1958
2104
|
* format the per-column totals. The first column is always the merge "key"
|
|
@@ -2528,4 +2674,4 @@ declare function useNewHotkey(callback: () => void): void;
|
|
|
2528
2674
|
*/
|
|
2529
2675
|
declare function useEditHotkey(callback: (() => void) | null): void;
|
|
2530
2676
|
|
|
2531
|
-
export { ALT, ALT_SHIFT_D, ALT_SHIFT_E, ALT_SHIFT_N, Accordion, type AccordionItem, type AccordionProps, AuthScreen, type AuthScreenProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, type AvatarSize, type AvatarStatus, Banner, type BannerProps, type BannerTone, BarChart, type BarChartProps, BehaviorPanel, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, type BulkColumn, type BulkColumnKind, BulkImportGrid, type BulkImportGridProps, type BulkRow, Button, type ButtonProps, type ButtonSize, type ButtonVariant, CMD_A, CMD_DOT, CMD_ENTER, CMD_K, CMD_S, CancelButton, Card, type CardProps, type CellStyle, ChangePasswordForm, type ChangePasswordFormProps, type ChangelogEntry, ChatTemplate, Checkbox, type CheckboxProps, CheckoutTemplate, type ClockCalendarConfig, ColoredBadge, type ColoredBadgeProps, type ColumnDef, ConfirmProvider, ContainerFillChart, type ContainerFillChartProps, type ContainerFillItem, CopyButton, Customization, type CustomizationOmitSection, type CustomizationProps, type CustomizationSection, DEV_BANNER_TEXT, DashboardTemplate, DataTablePage, Desktop, type DesktopContextMenuItem, type DesktopHostConfig, DesktopHostProvider, DevIndicator, DocFavStar, DonutChart, type DonutChartProps, type DonutSegment, type DuplicateGroup, ENTER, EditableGrid, type EditableGridProps, EmailTemplate, EmptyState, type EmptyStateProps, type EntityFetcher, EntityList, type EntityListColumn, type EntityListContextAction, type EntityListProps, ErrorPage, type ErrorPageProps, FilterBar, type FilterOption, FormField, type FormFieldProps, FormLayoutPage, GLASS_DIVIDER, GLASS_INPUT_BG, GalleryTemplate, GlobalSearch, type GridColumn, type HealthCheckResult, HelpCenter, type HelpCenterDoc, type HelpCenterProps, INPUT_BASE, ImageAnnotator, type ImageAnnotatorHandle, type ImageAnnotatorProps, Input, type InputProps, Kanban, type KanbanColumn, type KanbanProps, Label, type LabelProps, Layout, type LayoutProps, ListFooter, LoadingSpinner, type LoadingSpinnerProps, MOD, Markdown, type MarkdownProps, MediaUploadField, type MediaUploadFieldProps, MediaUploadGrid, type MediaUploadGridItem, type MediaUploadGridProps, type MergeBulkOptions, type MergeBulkResult, type Milestone, type MilestoneKind, MilestoneTimeline, type MilestoneTimelineProps, Modal, ModalActions, NotificationBell, type NotificationsConfig, PageHeader, type PageHeaderProps, type PaginatedResponse, Pagination, type PaginationProps, PdfActionButton, type PdfActionButtonProps, PopupMenu, PopupMenuDivider, PopupMenuItem, PopupMenuLabel, Radio, type RadioProps, ResizableTable, SHIFT, type SearchConfig, type SearchProvider, type SearchResult, type SearchableOption, SearchableSelect, type SearchableSelectProps, Select, type SelectOption, type SelectProps, type SemanticGroup, ServerStatusIndicator, type ServerStatusIndicatorProps, type ServerStatusUser, type ShellAuth, ShellAuthProvider, ShellEntityFetcherProvider, type ShellNotification, type ShellPrefsAdapter, ShellPrefsProvider, ShortcutHelp, SidebarActionButton, type SidebarActionButtonProps, SidebarGroupLabel, SidebarLayout, type SidebarLayoutProps, SidebarNavItem, type SortState, SoundsPanel, Sparkline, type SparklineProps, StartMenu, StatCard, type StatCardProps, StatusBadge, StatusBadgeProvider, type StickyEntityRef, type StickyResolver, SystemPreferences, type SystemPreferencesProps, type SystemPreferencesSection, type TabItem, Tabs, type TabsProps, Textarea, type TextareaProps, type TodoProvider, type TodoTask, Tooltip, type TooltipProps, TopNav, type TopNavItem, type TopNavProps, VERSION, WidgetManager, WindowCrashedFallback, WindowErrorBoundary, WindowManagerProvider, WindowRegistry, WindowTitle, applyDevTitle, commitExposeHighlight, confirm, confirmDestructive, createWindowRegistry, exitExposeMode, findDuplicateKeys, formatDate, getActiveWindowRoute, getExposeHighlight, getWindowPosition, glassStyle, inputClasses, isDevEnv, isMac, mediaFileName, mergeBulkItems, prompt, registerModalEscapeInterceptor, setExposeHighlight, setShellApiClient, setShellAuthBridge, setShellNavIcons, setShellTodoProvider, setWindowDefaultPosition, setWindowPosition, subscribeExposeHighlight, toast, toggleExposeMode, useClickOutside, useColumnConfig, useDesktopHost, useEditHotkey, useFilters, useInfiniteScroll, useLocalStoragePrefs, useModalActive, useNewHotkey, useShellAuth, useShellEntityFetcher, useShellPrefs, useSort, useTableNav, useWidgetSettings, useWindowManager, useWindowMenuItem, useWindowTitle };
|
|
2677
|
+
export { ALT, ALT_SHIFT_D, ALT_SHIFT_E, ALT_SHIFT_N, Accordion, type AccordionItem, type AccordionProps, AuthScreen, type AuthScreenProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, type AvatarSize, type AvatarStatus, Banner, type BannerProps, type BannerTone, BarChart, type BarChartProps, BehaviorPanel, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, type BulkColumn, type BulkColumnKind, BulkImportGrid, type BulkImportGridProps, type BulkRow, Button, type ButtonProps, type ButtonSize, type ButtonVariant, CMD_A, CMD_DOT, CMD_ENTER, CMD_K, CMD_S, CancelButton, Card, type CardProps, type CellStyle, ChangePasswordForm, type ChangePasswordFormProps, type ChangelogEntry, ChatTemplate, Checkbox, type CheckboxProps, CheckoutTemplate, type ClockCalendarConfig, ColoredBadge, type ColoredBadgeProps, type ColumnDef, ConfirmProvider, ContainerFillChart, type ContainerFillChartProps, type ContainerFillItem, CopyButton, Customization, type CustomizationOmitSection, type CustomizationProps, type CustomizationSection, DEV_BANNER_TEXT, DashboardTemplate, DataTablePage, Desktop, type DesktopContextMenuItem, type DesktopHostConfig, DesktopHostProvider, DevIndicator, DocFavStar, DonutChart, type DonutChartProps, type DonutSegment, type DuplicateGroup, ENTER, EditableGrid, type EditableGridProps, EmailTemplate, EmptyState, type EmptyStateProps, type EntityFetcher, EntityList, type EntityListColumn, type EntityListContextAction, type EntityListProps, ErrorPage, type ErrorPageProps, FilterBar, type FilterOption, FormField, type FormFieldProps, FormLayoutPage, GLASS_DIVIDER, GLASS_INPUT_BG, GalleryTemplate, GlobalSearch, type GridColumn, type HealthCheckResult, HelpCenter, type HelpCenterDoc, type HelpCenterProps, INPUT_BASE, ImageAnnotator, type ImageAnnotatorHandle, type ImageAnnotatorProps, Input, type InputProps, Kanban, type KanbanColumn, type KanbanProps, Label, type LabelProps, Layout, type LayoutProps, ListFooter, ListLoadError, type ListLoadErrorProps, LoadingSpinner, type LoadingSpinnerProps, MOD, Markdown, type MarkdownProps, MediaUploadField, type MediaUploadFieldProps, MediaUploadGrid, type MediaUploadGridItem, type MediaUploadGridProps, type MergeBulkOptions, type MergeBulkResult, MetricBar, type MetricBarProps, type Milestone, type MilestoneKind, MilestoneTimeline, type MilestoneTimelineProps, Modal, ModalActions, NativeSelect, NotificationBell, type NotificationsConfig, PageHeader, type PageHeaderProps, type PaginatedResponse, Pagination, type PaginationProps, PdfActionButton, type PdfActionButtonProps, PopupMenu, PopupMenuDivider, PopupMenuItem, PopupMenuLabel, Radio, type RadioProps, ResizableTable, SHIFT, type SearchConfig, type SearchProvider, type SearchResult, type SearchableOption, SearchableSelect, type SearchableSelectProps, Select, type SelectOption, type SelectProps, type SemanticGroup, ServerStatusIndicator, type ServerStatusIndicatorProps, type ServerStatusUser, type SeverityTone, type ShellAuth, ShellAuthProvider, ShellEntityFetcherProvider, type ShellNotification, type ShellPrefsAdapter, ShellPrefsProvider, ShortcutHelp, SidebarActionButton, type SidebarActionButtonProps, SidebarGroupLabel, SidebarLayout, type SidebarLayoutProps, SidebarNavItem, type SortState, SoundsPanel, Sparkline, type SparklineProps, StartMenu, StatCard, type StatCardProps, StatusBadge, StatusBadgeProvider, type StickyEntityRef, type StickyResolver, SystemPreferences, type SystemPreferencesProps, type SystemPreferencesSection, type TabItem, Tabs, type TabsProps, Textarea, type TextareaProps, type TodoProvider, type TodoTask, Tooltip, type TooltipProps, TopNav, type TopNavItem, type TopNavProps, VERSION, WidgetManager, WindowCrashedFallback, WindowErrorBoundary, WindowManagerProvider, WindowRegistry, WindowTitle, applyDevTitle, commitExposeHighlight, confirm, confirmDestructive, createWindowRegistry, exitExposeMode, findDuplicateKeys, formatDate, getActiveWindowRoute, getExposeHighlight, getWindowPosition, glassStyle, inputClasses, isDevEnv, isMac, isSeverityTone, mediaFileName, mergeBulkItems, prompt, registerModalEscapeInterceptor, setExposeHighlight, setShellApiClient, setShellAuthBridge, setShellNavIcons, setShellTodoProvider, setWindowDefaultPosition, setWindowPosition, severityOf, subscribeExposeHighlight, toast, toggleExposeMode, useClickOutside, useColumnConfig, useDesktopHost, useEditHotkey, useFilters, useInfiniteScroll, useLocalStoragePrefs, useModalActive, useNewHotkey, useShellAuth, useShellEntityFetcher, useShellPrefs, useSort, useTableNav, useWidgetSettings, useWindowManager, useWindowMenuItem, useWindowTitle };
|