react-os-shell 4.63.0 → 4.74.0

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.
Files changed (64) hide show
  1. package/README.md +3 -0
  2. package/dist/{Browser-SPTNLEMR.js → Browser-ZF5X2FON.js} +7 -7
  3. package/dist/{Browser-SPTNLEMR.js.map → Browser-ZF5X2FON.js.map} +1 -1
  4. package/dist/{Calculator-XMOPPCK3.js → Calculator-SA62H5S3.js} +6 -6
  5. package/dist/{Calculator-XMOPPCK3.js.map → Calculator-SA62H5S3.js.map} +1 -1
  6. package/dist/ConfirmDialog-SREDNTIB.js +3 -0
  7. package/dist/{ConfirmDialog-EEH4CWSW.js.map → ConfirmDialog-SREDNTIB.js.map} +1 -1
  8. package/dist/{CurrencyConverter-24HNX6C6.js → CurrencyConverter-BMCRLZLY.js} +6 -6
  9. package/dist/{CurrencyConverter-24HNX6C6.js.map → CurrencyConverter-BMCRLZLY.js.map} +1 -1
  10. package/dist/{Documents-GMRVVCH7.js → Documents-2TGJPV2Y.js} +8 -8
  11. package/dist/{Documents-GMRVVCH7.js.map → Documents-2TGJPV2Y.js.map} +1 -1
  12. package/dist/{Files-ITH4SVML.js → Files-Z3ONKUA6.js} +9 -9
  13. package/dist/{Files-ITH4SVML.js.map → Files-Z3ONKUA6.js.map} +1 -1
  14. package/dist/{Notepad-GE5P55TL.js → Notepad-JWZS5YKJ.js} +8 -8
  15. package/dist/{Notepad-GE5P55TL.js.map → Notepad-JWZS5YKJ.js.map} +1 -1
  16. package/dist/{PomodoroTimer-ER5STVKM.js → PomodoroTimer-DRM5W25H.js} +8 -8
  17. package/dist/{PomodoroTimer-ER5STVKM.js.map → PomodoroTimer-DRM5W25H.js.map} +1 -1
  18. package/dist/{Preview-UXVDXCDJ.js → Preview-7O7W7OMQ.js} +9 -9
  19. package/dist/{Preview-UXVDXCDJ.js.map → Preview-7O7W7OMQ.js.map} +1 -1
  20. package/dist/{Spreadsheet-B32JQVX4.js → Spreadsheet-CLTZSW3T.js} +7 -7
  21. package/dist/{Spreadsheet-B32JQVX4.js.map → Spreadsheet-CLTZSW3T.js.map} +1 -1
  22. package/dist/{Stock-FSFPFDQT.js → Stock-CO5N3N2M.js} +6 -6
  23. package/dist/{Stock-FSFPFDQT.js.map → Stock-CO5N3N2M.js.map} +1 -1
  24. package/dist/{Weather-HXOERJJV.js → Weather-IEGJX7RI.js} +6 -6
  25. package/dist/{Weather-HXOERJJV.js.map → Weather-IEGJX7RI.js.map} +1 -1
  26. package/dist/{WorldClock-2FUGLIUZ.js → WorldClock-FLW3QZYG.js} +6 -6
  27. package/dist/{WorldClock-2FUGLIUZ.js.map → WorldClock-FLW3QZYG.js.map} +1 -1
  28. package/dist/apps/index.js +17 -17
  29. package/dist/{chunk-TK6HI2U4.js → chunk-2VM2FRZJ.js} +42 -11
  30. package/dist/chunk-2VM2FRZJ.js.map +1 -0
  31. package/dist/{chunk-ECE3B3FZ.js → chunk-AXWC3332.js} +3 -3
  32. package/dist/{chunk-ECE3B3FZ.js.map → chunk-AXWC3332.js.map} +1 -1
  33. package/dist/{chunk-ZCDFNZQS.js → chunk-BLLINYDD.js} +97 -5
  34. package/dist/chunk-BLLINYDD.js.map +1 -0
  35. package/dist/{chunk-OXLLRKBC.js → chunk-CDR2Q64Q.js} +38 -22
  36. package/dist/chunk-CDR2Q64Q.js.map +1 -0
  37. package/dist/{chunk-TO6ZZHJK.js → chunk-EG3WEQBH.js} +4 -4
  38. package/dist/{chunk-TO6ZZHJK.js.map → chunk-EG3WEQBH.js.map} +1 -1
  39. package/dist/{chunk-JMESET3G.js → chunk-G7IHPEJE.js} +138 -39
  40. package/dist/chunk-G7IHPEJE.js.map +1 -0
  41. package/dist/chunk-NJDH5PHA.js +7 -0
  42. package/dist/{chunk-WCGHIJZR.js.map → chunk-NJDH5PHA.js.map} +1 -1
  43. package/dist/{chunk-LYQVLRWQ.js → chunk-RUAZJ54W.js} +3 -3
  44. package/dist/{chunk-LYQVLRWQ.js.map → chunk-RUAZJ54W.js.map} +1 -1
  45. package/dist/{chunk-CWA27IGB.js → chunk-S6K37RLY.js} +781 -344
  46. package/dist/chunk-S6K37RLY.js.map +1 -0
  47. package/dist/{chunk-IOCOH2QQ.js → chunk-TT2WNTDS.js} +4 -4
  48. package/dist/{chunk-IOCOH2QQ.js.map → chunk-TT2WNTDS.js.map} +1 -1
  49. package/dist/{chunk-3OCL3DB4.js → chunk-TT56U4GY.js} +3 -3
  50. package/dist/{chunk-3OCL3DB4.js.map → chunk-TT56U4GY.js.map} +1 -1
  51. package/dist/{index-Ka32s3Ij.d.ts → index-DVekeidu.d.ts} +258 -27
  52. package/dist/index.d.ts +2 -2
  53. package/dist/index.js +121 -35
  54. package/dist/index.js.map +1 -1
  55. package/dist/ui/index.d.ts +1 -1
  56. package/dist/ui/index.js +5 -5
  57. package/package.json +2 -2
  58. package/dist/ConfirmDialog-EEH4CWSW.js +0 -3
  59. package/dist/chunk-CWA27IGB.js.map +0 -1
  60. package/dist/chunk-JMESET3G.js.map +0 -1
  61. package/dist/chunk-OXLLRKBC.js.map +0 -1
  62. package/dist/chunk-TK6HI2U4.js.map +0 -1
  63. package/dist/chunk-WCGHIJZR.js +0 -7
  64. package/dist/chunk-ZCDFNZQS.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/shell/focusTrap.ts","../src/shell/escapeInterceptors.ts","../src/shell/Dialog.tsx","../src/shell/ConfirmDialog.tsx"],"names":["useEffect","jsx","useRef","jsxs"],"mappings":";;;;AAiBA,IAAM,SAAA,GAAY;AAAA,EAChB,SAAA;AAAA,EACA,wBAAA;AAAA,EACA,uBAAA;AAAA,EACA,wBAAA;AAAA,EACA,0BAAA;AAAA,EACA;AACF,CAAA,CAAE,KAAK,GAAG,CAAA;AAEV,SAAS,UAAU,IAAA,EAAkC;AACnD,EAAA,OAAO,KAAA,CAAM,IAAA,CAAK,IAAA,CAAK,gBAAA,CAA8B,SAAS,CAAC,CAAA,CAG5D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,cACzC,SAAA,EAAW,CAAC,CAAA,KAAM;AAChB,gBAAA,IAAI,CAAA,CAAE,GAAA,KAAQ,OAAA,EAAS,YAAA,CAAa,IAAI,CAAA;AAAA,qBAAA,IAC/B,CAAA,CAAE,GAAA,KAAQ,QAAA,EAAU,YAAA,CAAa,KAAK,CAAA;AAAA,cACjD,CAAA;AAAA,cACA,OAAA,EAAS,CAAC,CAAA,KAAM,CAAA,CAAE,OAAO,MAAA,EAAO;AAAA,cAChC,aAAa,QAAA,CAAS,WAAA;AAAA,cACtB,SAAA,EAAU;AAAA;AAAA;AACZ;AAAA;AAAA;AACF,GAAA,EACF,CAAA;AAEJ","file":"chunk-OXLLRKBC.js","sourcesContent":["/**\n * Focus containment and scroll locking for a modal surface — the two things\n * Headless UI was doing for `ConfirmDialog` before it was rewritten to import\n * nothing.\n *\n * Both are small, and both are the kind of small that is wrong in a way nobody\n * notices until someone navigates by keyboard: focus tabbing out of a dialog\n * onto the page behind it reads as the dialog having closed, and a page that\n * scrolls under a fixed overlay loses the user's place when it reopens.\n */\nimport { useEffect, type RefObject } from 'react';\n\n/**\n * Focusable candidates, in DOM order. Deliberately excludes anything with\n * `tabindex=\"-1\"` — that attribute means \"focusable by script, skipped by Tab\",\n * and treating it as a stop is the usual bug in a hand-rolled trap.\n */\nconst FOCUSABLE = [\n 'a[href]',\n 'button:not([disabled])',\n 'input:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n].join(',');\n\nfunction focusable(root: HTMLElement): HTMLElement[] {\n return Array.from(root.querySelectorAll<HTMLElement>(FOCUSABLE))\n // A hidden element still matches the selector. offsetParent is null for\n // anything display:none or inside it — cheap, and right for our markup.\n .filter(el => el.offsetParent !== null || el === document.activeElement);\n}\n\n/**\n * While `active`, keep Tab inside `ref`, move focus in on open, and restore it\n * to wherever it came from on close.\n *\n * Restoring matters more than trapping: a dialog opened from a button in a\n * toolbar should hand focus back to that button, or a keyboard user is dumped\n * at the top of the document and has to find their place again.\n */\nexport function useFocusTrap(\n ref: RefObject<HTMLElement | null>,\n active: boolean,\n initialFocus?: RefObject<HTMLElement | null>,\n): void {\n useEffect(() => {\n if (!active) return;\n const root = ref.current;\n if (!root) return;\n\n const previous = document.activeElement as HTMLElement | null;\n\n // Focus the requested element, else the first natural stop, else the\n // container itself so the trap has somewhere to hold focus at all.\n const first = initialFocus?.current ?? focusable(root)[0] ?? root;\n if (first === root && !root.hasAttribute('tabindex')) root.setAttribute('tabindex', '-1');\n first.focus();\n\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key !== 'Tab') return;\n const stops = focusable(root);\n if (stops.length === 0) { e.preventDefault(); return; }\n const firstStop = stops[0];\n const lastStop = stops[stops.length - 1];\n const current = document.activeElement;\n\n // Wrap at both ends. Also catches focus having escaped the dialog\n // entirely (current is outside root), which happens if something inside\n // was removed while focused.\n if (e.shiftKey && (current === firstStop || !root.contains(current))) {\n e.preventDefault();\n lastStop.focus();\n } else if (!e.shiftKey && (current === lastStop || !root.contains(current))) {\n e.preventDefault();\n firstStop.focus();\n }\n };\n\n document.addEventListener('keydown', onKeyDown, true);\n return () => {\n document.removeEventListener('keydown', onKeyDown, true);\n // Only take focus back if it is still inside the dialog. If something\n // else claimed it in the meantime, stealing it back is the rude option.\n if (!root.contains(document.activeElement) && document.activeElement !== document.body) return;\n previous?.focus?.();\n };\n }, [ref, active, initialFocus]);\n}\n\n/**\n * While `active`, stop the document behind the overlay from scrolling.\n *\n * Compensates for the scrollbar's width so the page does not visibly jump\n * sideways as it locks — the artefact that makes a dialog feel cheap. Nested\n * locks are counted, so two stacked dialogs unlock exactly once.\n */\nlet lockCount = 0;\nlet restore: { overflow: string; paddingRight: string } | null = null;\n\nexport function useScrollLock(active: boolean): void {\n useEffect(() => {\n if (!active) return;\n const body = document.body;\n if (lockCount === 0) {\n restore = { overflow: body.style.overflow, paddingRight: body.style.paddingRight };\n const gap = window.innerWidth - document.documentElement.clientWidth;\n body.style.overflow = 'hidden';\n if (gap > 0) body.style.paddingRight = `${gap}px`;\n }\n lockCount += 1;\n return () => {\n lockCount -= 1;\n if (lockCount === 0 && restore) {\n body.style.overflow = restore.overflow;\n body.style.paddingRight = restore.paddingRight;\n restore = null;\n }\n };\n }, [active]);\n}\n","/**\n * The Escape-interceptor seam — deliberately a leaf that imports NOTHING.\n *\n * This lived inside `shell/Modal.tsx` until 4.16.0, and that one detail decided\n * what the whole package cost to import. `forms/Select.tsx` registers an\n * interceptor so Escape closes its portaled listbox instead of the window\n * around it — a two-line need — and reaching it through Modal pulled the entire\n * window manager into any bundle containing a dropdown: react-router-dom,\n * @tanstack/react-query, axios, @headlessui/react and @heroicons/react, plus\n * Modal's module-scope `localStorage` reads, which run at import time. An app\n * that wanted a text field and a select paid for a desktop it never rendered.\n *\n * Splitting the Set out is the whole fix: Modal and Select now both import this\n * file, and neither imports the other. `registerModalEscapeInterceptor` is\n * re-exported from Modal (and so from the package root) with the same binding\n * identity, so nothing downstream changes.\n *\n * NOTHING may be imported here — not React, not a type, not a sibling. The\n * moment it has an edge, every consumer of `react-os-shell/ui` inherits that\n * edge's transitive graph, which is exactly the failure this module exists to\n * prevent. `tests/uiEntryIsPeerFree.test.ts` enforces it.\n *\n * ── Escape interceptors ────────────────────────────────────────────────────\n * Window content can claim an Escape press before the topmost-modal handler\n * closes the window — e.g. the DXF Preview's measure tool exits AutoCAD-style\n * (clear the command input, then the tool, and only a further Esc closes the\n * window). Interceptors run in REVERSE registration order — most recently\n * registered first — and the first to return true consumes the event (the\n * modal neither closes nor sees it). An interceptor is global, so it must\n * check it belongs to the *active* modal itself (via `getActiveModalId()`)\n * before consuming.\n *\n * Reverse, because registration order tracks stacking order and Escape belongs\n * to whatever is on top. Two stacked `Dialog`s each register one; oldest-first\n * would hand Escape to the dialog UNDERNEATH and dismiss the wrong surface,\n * leaving the one the user is looking at on screen. This was invisible while\n * `ConfirmDialog` was the only multi-dialog registrant, because it registered\n * a single interceptor and hand-ordered its three dialogs inside it.\n *\n * Registrants that check `getActiveModalId()` are unaffected: at most one of\n * them can consume, so the order they are offered the event in cannot change\n * which one takes it.\n *\n * ── Draining the Set with no shell present ────────────────────────────────\n * This used to say that nothing draining the Set was fine, because a component\n * would handle Escape itself. That holds for `Select`, which has its own\n * `onKeyDown`. It did NOT hold for `Dialog`, which registers here and has no\n * other handler — so on a till or a routed portal, the two places `Dialog`\n * exists to serve, Escape did nothing at all.\n *\n * So the Set drains itself. The first registration attaches one document-level\n * capture listener; the last removal takes it away.\n *\n * It cannot double-fire when a shell IS present. `Modal` listens on `window`\n * in the capture phase, and capture runs window before document: Modal's\n * handler goes first, calls `runEscapeInterceptors`, and stops propagation when\n * one consumes — so this listener never sees the event. When Modal declines\n * (it is not the topmost window), this runs and the dialog floating above it\n * still gets its Escape, which is the right outcome anyway.\n *\n * Ordering across stacked dialogs is unchanged, because it is still the same\n * reverse walk deciding who consumes — not the listener that started it.\n */\nconst escapeInterceptors = new Set<(e: KeyboardEvent) => boolean>();\n\n/**\n * The self-drain listener, attached while at least one interceptor is\n * registered. Kept in module scope rather than per-registration so N dialogs\n * share one listener and the reverse walk stays the only thing deciding who\n * consumes.\n */\nlet detachDrain: (() => void) | null = null;\n\nfunction attachDrain(): void {\n // `document` is absent when this module is imported on a server; there is no\n // Escape to handle there, and registration still works for when it hydrates.\n if (detachDrain || typeof document === 'undefined') return;\n const onKeyDown = (e: KeyboardEvent): void => {\n if (e.key !== 'Escape') return;\n if (runEscapeInterceptors(e)) {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n document.addEventListener('keydown', onKeyDown, true);\n detachDrain = () => document.removeEventListener('keydown', onKeyDown, true);\n}\n\n/** Register an Escape interceptor; returns an unregister function. */\nexport function registerModalEscapeInterceptor(fn: (e: KeyboardEvent) => boolean): () => void {\n escapeInterceptors.add(fn);\n attachDrain();\n return () => {\n escapeInterceptors.delete(fn);\n if (escapeInterceptors.size === 0 && detachDrain) {\n detachDrain();\n detachDrain = null;\n }\n };\n}\n\n/** Run the registered interceptors, most recent first; true if one consumed\n * the event. Internal to the shell — the window key handler calls this,\n * consumers never do. */\nexport function runEscapeInterceptors(e: KeyboardEvent): boolean {\n // A Set iterates in insertion order and has no reverse iterator, so snapshot\n // it. The copy also makes the walk safe against an interceptor that\n // unregisters itself while handling the event — which is exactly what a\n // dialog closing on Escape does.\n const ordered = Array.from(escapeInterceptors);\n for (let i = ordered.length - 1; i >= 0; i--) {\n try {\n if (ordered[i](e)) return true;\n } catch { /* a broken interceptor must not block closing */ }\n }\n return false;\n}\n","/**\n * Dialog — a modal sheet that is NOT a shell window.\n *\n * The distinction matters. `Modal` is a window: it has a title bar, it can be\n * minimised, dragged, stacked and restored, and it lives in the window manager's\n * activation order. This is the other thing — an overlay that interrupts, is\n * answered, and goes away. A till has no desktop to put a window on, and a\n * routed portal page has no window manager either, so both need this one.\n *\n * It imports nothing but React, which is the point: it is what lets\n * `ConfirmDialog` — and every consumer of `react-os-shell/ui` — stop depending\n * on Headless UI and Heroicons. Focus containment and scroll locking come from\n * `./focusTrap` rather than a library.\n */\nimport { useEffect, useId, useRef, type ReactNode, type RefObject } from 'react';\nimport { useFocusTrap, useScrollLock } from './focusTrap';\nimport { registerModalEscapeInterceptor } from './escapeInterceptors';\n\nexport type DialogSize = 'sm' | 'md' | 'lg';\n\nexport interface DialogProps {\n open: boolean;\n /** Called for Escape, a backdrop click, and the close control. */\n onClose: () => void;\n title?: ReactNode;\n children?: ReactNode;\n /** Action row, right-aligned below the body. */\n footer?: ReactNode;\n /**\n * Escape and backdrop clicks do nothing — the only way out is an action in\n * the footer. For a state the user must actually resolve rather than dismiss,\n * such as a sale whose outcome is unknown. Use it sparingly: a dialog that\n * cannot be dismissed is a dead end if its actions ever fail to render.\n */\n blocking?: boolean;\n size?: DialogSize;\n /**\n * Element to focus on open. Defaults to the first focusable thing in the\n * dialog — which for a destructive confirm should be Cancel, not the button\n * that does the irreversible thing.\n */\n initialFocus?: RefObject<HTMLElement | null>;\n className?: string;\n}\n\nconst SIZES: Record<DialogSize, string> = {\n sm: 'max-w-sm',\n md: 'max-w-md',\n lg: 'max-w-lg',\n};\n\nexport default function Dialog({\n open, onClose, title, children, footer, blocking = false, size = 'md', initialFocus, className = '',\n}: DialogProps) {\n const panelRef = useRef<HTMLDivElement>(null);\n const bodyId = useId();\n\n useFocusTrap(panelRef, open, initialFocus);\n useScrollLock(open);\n\n // Escape goes through the shell's interceptor rather than a local listener.\n // A dialog floats above every shell window but is absent from the window\n // activation order, so an unclaimed Escape reaches the frontmost Modal and\n // closes the WINDOW BEHIND the dialog. Claiming it here means the dialog\n // closes and the window does not. With no shell present nothing else is\n // listening and this is simply where Escape is handled.\n useEffect(() => {\n if (!open) return;\n return registerModalEscapeInterceptor(() => {\n if (blocking) return true; // claimed, but deliberately does nothing\n onClose();\n return true;\n });\n }, [open, blocking, onClose]);\n\n if (!open) return null;\n\n return (\n <div className=\"fixed inset-0 z-[9999]\" role=\"presentation\">\n <div\n className=\"fixed inset-0 bg-black/30\"\n onClick={blocking ? undefined : onClose}\n aria-hidden=\"true\"\n />\n <div className=\"fixed inset-0 flex items-center justify-center p-4\">\n <div\n ref={panelRef}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={typeof title === 'string' ? title : undefined}\n // The body is the dialog's description, and saying so is what makes a\n // screen reader read the question along with the title when focus\n // lands here. Without it the user hears \"Cancel order, dialog\" and\n // has to go looking for what cancelling actually does.\n aria-describedby={children ? bodyId : undefined}\n className={`relative w-full ${SIZES[size]} rounded-lg bg-white p-6 shadow-xl ${className}`.trim()}\n >\n {title && <h2 className=\"text-base font-semibold text-gray-900\">{title}</h2>}\n {children && <div id={bodyId} className=\"mt-2 text-sm text-gray-600\">{children}</div>}\n {footer && <div className=\"mt-6 flex justify-end gap-3\">{footer}</div>}\n </div>\n </div>\n </div>\n );\n}\n","/**\n * confirm / confirmDestructive / prompt — the imperative dialogs, callable from\n * any click handler without a hook.\n *\n * Rebuilt on `./Dialog` in 4.18.0. It previously rendered Headless UI, which\n * meant every consumer of `react-os-shell/ui` inherited `@headlessui/react` and\n * `@heroicons/react` to ask someone a yes/no question. Focus containment and\n * scroll locking now come from `./focusTrap`; the icons are inline SVG. The\n * three dialogs' behaviour is otherwise unchanged, with two deliberate\n * exceptions noted below.\n *\n * FAIL-CLOSED. Each global starts as a function resolving to false/null, so a\n * `confirm()` with no provider mounted answers \"no\" rather than hanging or\n * throwing. A dialog nobody can see must never resolve true — that is the\n * difference between a no-op and a deletion.\n *\n * CONFIRMS QUEUE, they do not drop. A second `confirm()` while one is open\n * waits its turn and shows afterwards. Dropping it would silently resolve a\n * question the user was never asked, and the caller cannot tell that from a\n * genuine \"no\".\n */\nimport { createContext, useContext, useState, useCallback, useRef, useEffect } from 'react';\nimport Dialog from './Dialog';\n\ninterface ConfirmOptions {\n title?: string;\n message: string;\n confirmLabel?: string;\n cancelLabel?: string;\n variant?: 'danger' | 'warning' | 'info';\n}\n\ntype ConfirmFn = (options: ConfirmOptions | string) => Promise<boolean>;\ninterface PendingConfirm {\n id: number;\n options: ConfirmOptions;\n resolve: (value: boolean) => void;\n}\n\nconst ConfirmContext = createContext<ConfirmFn>(() => Promise.resolve(false));\n\nexport const useConfirm = () => useContext(ConfirmContext);\n\n// Global callable — works without a hook, usable from any click handler\nlet globalConfirmFn: ConfirmFn = () => Promise.resolve(false);\nexport const confirm = (opts: ConfirmOptions | string) => globalConfirmFn(opts);\n\ninterface DestructiveConfirmOptions {\n title?: string;\n message: string;\n /**\n * Require typing this word (case-sensitive) before the action is enabled —\n * for something genuinely irreversible at scale, like dropping a tenant.\n *\n * OPTIONAL since 4.18.0. Omit it for a plain two-button destructive confirm.\n * Type-to-confirm assumes a keyboard, and a touch device that has none (a\n * till, a warehouse scanner) cannot satisfy it at all — the dialog becomes an\n * unanswerable question. Ask for a word when the cost of a mis-tap is high\n * enough to justify making the user work; not by default.\n */\n confirmWord?: string;\n /** Label for the action button when there is no `confirmWord`. */\n confirmLabel?: string;\n cancelLabel?: string;\n variant?: 'danger' | 'warning';\n}\ntype DestructiveConfirmFn = (options: DestructiveConfirmOptions) => Promise<boolean>;\nlet globalDestructiveConfirmFn: DestructiveConfirmFn = () => Promise.resolve(false);\nexport const confirmDestructive = (opts: DestructiveConfirmOptions) => globalDestructiveConfirmFn(opts);\n\n// Prompt — windowed replacement for native window.prompt(). Resolves to the\n// trimmed string, or null if the user cancelled. Empty input counts as\n// cancel by default; pass `allowEmpty: true` to opt in.\ninterface PromptOptions {\n title?: string;\n message?: string;\n defaultValue?: string;\n placeholder?: string;\n confirmLabel?: string;\n cancelLabel?: string;\n allowEmpty?: boolean;\n}\ntype PromptFn = (options: PromptOptions | string) => Promise<string | null>;\nlet globalPromptFn: PromptFn = () => Promise.resolve(null);\nexport const prompt = (opts: PromptOptions | string) => globalPromptFn(opts);\n\nconst TONE: Record<'danger' | 'warning' | 'info', { icon: string; button: string }> = {\n danger: { icon: 'text-red-600 bg-red-100', button: 'bg-red-600 hover:bg-red-700 text-white' },\n warning: { icon: 'text-yellow-600 bg-yellow-100', button: 'bg-yellow-600 hover:bg-yellow-700 text-white' },\n info: { icon: 'text-blue-600 bg-blue-100', button: 'bg-blue-600 hover:bg-blue-700 text-white' },\n};\n\nconst CANCEL_BTN =\n 'bg-white text-gray-700 border border-gray-300 px-4 py-2 text-sm font-medium rounded-lg hover:bg-gray-50';\n\n/** Inline replacements for the two Heroicons this file used to import. */\nfunction WarningIcon() {\n return (\n <svg className=\"h-5 w-5\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={1.5} aria-hidden=\"true\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z\" />\n </svg>\n );\n}\n\nfunction CloseIcon() {\n return (\n <svg className=\"h-5 w-5\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={1.5} aria-hidden=\"true\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n );\n}\n\nexport function ConfirmProvider({ children }: { children: React.ReactNode }) {\n const [open, setOpen] = useState(false);\n const [options, setOptions] = useState<ConfirmOptions>({ message: '' });\n const [confirmId, setConfirmId] = useState(0);\n const resolveRef = useRef<(value: boolean) => void>();\n const activeConfirmIdRef = useRef<number | null>(null);\n const nextConfirmIdRef = useRef(0);\n const confirmQueueRef = useRef<PendingConfirm[]>([]);\n\n // Cancel is the default focus target in every dialog here. The destructive\n // action sits on the RIGHT and is never what Enter or a stray keypress hits.\n const cancelRef = useRef<HTMLButtonElement>(null);\n const dCancelRef = useRef<HTMLButtonElement>(null);\n\n const showConfirm = useCallback((request: PendingConfirm) => {\n activeConfirmIdRef.current = request.id;\n resolveRef.current = request.resolve;\n setConfirmId(request.id);\n setOptions(request.options);\n setOpen(true);\n }, []);\n\n const confirmFn: ConfirmFn = useCallback((opts) => {\n const normalized = typeof opts === 'string' ? { message: opts } : opts;\n return new Promise<boolean>((resolve) => {\n const request = { id: ++nextConfirmIdRef.current, options: normalized, resolve };\n if (activeConfirmIdRef.current === null) showConfirm(request);\n else confirmQueueRef.current.push(request);\n });\n }, [showConfirm]);\n\n // Destructive confirm state\n const [dOpen, setDOpen] = useState(false);\n const [dOptions, setDOptions] = useState<DestructiveConfirmOptions>({ message: '' });\n const [dInput, setDInput] = useState('');\n const dResolveRef = useRef<(value: boolean) => void>();\n\n const destructiveConfirmFn: DestructiveConfirmFn = useCallback((opts) => {\n setDOptions(opts);\n setDInput('');\n setDOpen(true);\n return new Promise<boolean>((resolve) => {\n dResolveRef.current = resolve;\n });\n }, []);\n\n // Prompt state\n const [pOpen, setPOpen] = useState(false);\n const [pOptions, setPOptions] = useState<PromptOptions>({});\n const [pInput, setPInput] = useState('');\n const pResolveRef = useRef<(value: string | null) => void>();\n\n const promptFn: PromptFn = useCallback((opts) => {\n const normalized = typeof opts === 'string' ? { message: opts } : opts;\n setPOptions(normalized);\n setPInput(normalized.defaultValue ?? '');\n setPOpen(true);\n return new Promise<string | null>((resolve) => {\n pResolveRef.current = resolve;\n });\n }, []);\n\n useEffect(() => {\n globalConfirmFn = confirmFn;\n globalDestructiveConfirmFn = destructiveConfirmFn;\n globalPromptFn = promptFn;\n }, [confirmFn, destructiveConfirmFn, promptFn]);\n\n const handleClose = (id: number, result: boolean) => {\n // A callback captured by the previous dialog must never settle the next\n // queued request after the active request advances.\n if (activeConfirmIdRef.current !== id) return;\n const resolve = resolveRef.current;\n const next = confirmQueueRef.current.shift();\n if (next) showConfirm(next);\n else {\n activeConfirmIdRef.current = null;\n resolveRef.current = undefined;\n setOpen(false);\n }\n resolve?.(result);\n };\n\n const handleDClose = (result: boolean) => {\n setDOpen(false);\n setDInput('');\n dResolveRef.current?.(result);\n };\n\n const handlePClose = (commit: boolean) => {\n if (commit) {\n const trimmed = pInput.trim();\n if (!trimmed && !pOptions.allowEmpty) {\n // Empty + not opted-in to allow empty: treat Save as Cancel.\n setPOpen(false);\n pResolveRef.current?.(null);\n return;\n }\n setPOpen(false);\n pResolveRef.current?.(trimmed);\n } else {\n setPOpen(false);\n pResolveRef.current?.(null);\n }\n };\n\n // Escape is claimed by each Dialog itself now, and interceptors run most\n // recent first, so a stack of these dismisses top-down without the provider\n // hand-ordering them the way it used to.\n\n const variant = options.variant || (options.confirmLabel?.toLowerCase().includes('delete') || options.message.toLowerCase().includes('delete') ? 'danger' : 'info');\n const tone = TONE[variant];\n const dTone = TONE[dOptions.variant === 'warning' ? 'warning' : 'danger'];\n const dWord = dOptions.confirmWord;\n const dSatisfied = dWord == null || dInput === dWord;\n\n return (\n <ConfirmContext.Provider value={confirmFn}>\n {children}\n\n <Dialog\n open={open}\n onClose={() => handleClose(confirmId, false)}\n initialFocus={cancelRef}\n footer={\n <>\n <button ref={cancelRef} type=\"button\" onClick={() => handleClose(confirmId, false)} className={CANCEL_BTN}>\n {options.cancelLabel || 'Cancel'}\n </button>\n <button type=\"button\" onClick={() => handleClose(confirmId, true)}\n className={`px-4 py-2 text-sm font-medium rounded-lg ${tone.button}`}>\n {options.confirmLabel || 'OK'}\n </button>\n </>\n }\n >\n <div className=\"flex gap-4\">\n <div className={`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${tone.icon}`}>\n <WarningIcon />\n </div>\n <div className=\"flex-1\">\n <h2 className=\"text-base font-semibold text-gray-900\">{options.title || 'Confirm'}</h2>\n <p className=\"mt-2 text-sm text-gray-600\">{options.message}</p>\n </div>\n </div>\n </Dialog>\n\n {/* Destructive confirm — optionally gated on typing a word */}\n <Dialog\n open={dOpen}\n onClose={() => handleDClose(false)}\n // With a word to type, focus the input: that is the task. Without one,\n // focus Cancel, so the irreversible button is never one Enter away.\n initialFocus={dWord != null ? undefined : dCancelRef}\n footer={\n <>\n <button ref={dCancelRef} type=\"button\" onClick={() => handleDClose(false)} className={CANCEL_BTN}>\n {dOptions.cancelLabel || 'Dismiss'}\n </button>\n <button type=\"button\" onClick={() => handleDClose(true)} disabled={!dSatisfied}\n className={`px-4 py-2 text-sm font-medium rounded-lg disabled:opacity-40 ${dTone.button}`}>\n {dWord ?? dOptions.confirmLabel ?? 'Delete'}\n </button>\n </>\n }\n >\n <button\n type=\"button\"\n onClick={() => handleDClose(false)}\n aria-label=\"Close\"\n className=\"absolute right-4 top-4 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600\"\n >\n <CloseIcon />\n </button>\n <div className=\"flex gap-4\">\n <div className={`shrink-0 w-10 h-10 rounded-full flex items-center justify-center ${dTone.icon}`}>\n <WarningIcon />\n </div>\n <div className=\"flex-1\">\n <h2 className=\"text-base font-semibold text-gray-900 pr-6\">{dOptions.title || 'Confirm Action'}</h2>\n <p className=\"mt-2 text-sm text-gray-600\">{dOptions.message}</p>\n {dWord != null && (\n <>\n <p className=\"mt-3 text-sm text-gray-700\">\n Type <kbd className=\"rounded border border-gray-300 bg-gray-50 px-1.5 py-0.5 text-xs font-bold text-red-600 font-mono\">{dWord}</kbd> to confirm:\n </p>\n <input\n autoFocus\n type=\"text\"\n value={dInput}\n onChange={e => setDInput(e.target.value)}\n onKeyDown={e => { if (e.key === 'Enter' && dInput === dWord) handleDClose(true); }}\n placeholder={dWord}\n className=\"mt-2 w-full rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-red-500 focus:ring-red-500\"\n />\n </>\n )}\n </div>\n </div>\n </Dialog>\n\n {/* Prompt — windowed replacement for window.prompt() */}\n <Dialog\n open={pOpen}\n onClose={() => handlePClose(false)}\n title={pOptions.title || 'Enter a value'}\n footer={\n <>\n <button type=\"button\" onClick={() => handlePClose(false)} className={CANCEL_BTN}>\n {pOptions.cancelLabel || 'Cancel'}\n </button>\n <button type=\"button\" onClick={() => handlePClose(true)}\n disabled={!pOptions.allowEmpty && !pInput.trim()}\n className=\"bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 text-sm font-medium rounded-lg disabled:opacity-40\">\n {pOptions.confirmLabel || 'OK'}\n </button>\n </>\n }\n >\n {pOptions.message && <p className=\"text-sm text-gray-600\">{pOptions.message}</p>}\n <input\n autoFocus\n type=\"text\"\n value={pInput}\n onChange={(e) => setPInput(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === 'Enter') handlePClose(true);\n else if (e.key === 'Escape') handlePClose(false);\n }}\n onFocus={(e) => e.target.select()}\n placeholder={pOptions.placeholder}\n className=\"mt-3 w-full rounded-md border border-gray-300 px-3 py-2 text-sm focus:border-blue-500 focus:ring-1 focus:ring-blue-500 focus:outline-none\"\n />\n </Dialog>\n </ConfirmContext.Provider>\n );\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/shell/toast.ts"],"names":[],"mappings":";AAaA,IAAM,kBAAA,GAAqB,iBAAA;AAC3B,IAAM,yBAAA,GAA4B,wBAAA;AAClC,IAAM,kBA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C,OAAA,EAAiB,SAAwB,SAAA,CAAU,SAAA,EAAW,SAAS,IAAI,CAAA;AAAA,EACrF,OAAO,CAAC,OAAA,EAAiB,SAAwB,SAAA,CAAU,OAAA,EAAS,SAAS,IAAI,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMjF,SAAS,CAAC,OAAA,EAAiB,SAAwB,SAAA,CAAU,SAAA,EAAW,SAAS,IAAI,CAAA;AAAA,EACrF,MAAM,CAAC,OAAA,EAAiB,SAAwB,SAAA,CAAU,MAAA,EAAQ,SAAS,IAAI,CAAA;AAAA;AAAA,EAE/E,QAAQ,CAAC,OAAA,EAAiB,IAAA,KAAiC,gBAAA,CAAiB,SAAS,IAAI,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMzF,SAAA,EAAW,CAAC,IAAA,KAAuB;AAAE,IAAA,QAAA,GAAW,EAAE,GAAG,IAAA,EAAK;AAAA,EAAG;AAC/D,CAAA;AAEA,IAAO,aAAA,GAAQ","file":"chunk-TK6HI2U4.js","sourcesContent":["/**\n * Two presentations:\n *\n * 1. toast.success / error / info — brief operation feedback, top-center,\n * auto-dismiss (success/error ~3s, info ~4.5s). The everyday \"what just\n * happened\" feedback — most messages want this.\n * 2. toast.notify — system notification, top-right card, stays 10s, dismissible.\n * For an alert worth lingering on; reach for it deliberately, not by default.\n *\n * (Historically `toast.info` rendered the top-right notification card; it now\n * renders a brief toast — that persistent card moved to `toast.notify`.)\n */\n\nconst TOAST_CONTAINER_ID = 'toast-container';\nconst TOAST_BOTTOM_CONTAINER_ID = 'toast-container-bottom';\nconst NOTIF_CONTAINER_ID = 'notif-container';\nconst FADE_MS = 300;\n\nexport type ToastPlacement = 'top' | 'bottom';\n\nexport interface ToastOptions {\n /** Milliseconds before auto-dismiss. Ignored when `sticky`. */\n duration?: number;\n /**\n * Stay until dismissed. For a message the user must actually act on — the\n * kind that must not scroll past while they are looking at a customer.\n * Implies tap-to-dismiss is the only way out, which it already is.\n */\n sticky?: boolean;\n /**\n * `bottom` centres toasts along the bottom edge. On a till the top of the\n * screen is the cart total and the bottom is nearest the hand.\n */\n placement?: ToastPlacement;\n /**\n * Drop a message identical to one already showing, and RESTART its timer\n * rather than stacking a second copy. A failing poll otherwise writes the\n * same sentence a dozen times. The restart matters: the user asked twice, so\n * the message should persist, not expire on the first one's schedule.\n */\n dedupe?: boolean;\n}\n\n/**\n * Defaults for every subsequent toast, set once at app startup — the same\n * \"consumer wires this once\" shape as `setShellApiClient`/`setShellNavIcons`.\n * A till calls `toast.configure({ placement: 'bottom', duration: 6000,\n * dedupe: true })` instead of repeating those options at 40 call sites.\n * Per-call options still win.\n */\nlet defaults: ToastOptions = {};\n\n/** Live toasts by dedupe key, so a repeat can find and refresh its own. */\nconst live = new Map<string, { el: HTMLElement; restart: () => void }>();\n\nfunction getOrCreate(id: string, className: string): HTMLElement {\n let el = document.getElementById(id);\n if (!el) {\n el = document.createElement('div');\n el.id = id;\n el.className = className;\n document.body.appendChild(el);\n }\n return el;\n}\n\nfunction getMenuOpacity(): number {\n try {\n const val = getComputedStyle(document.documentElement).getPropertyValue('--menu-opacity')?.trim();\n if (val) return parseFloat(val);\n } catch {}\n return 0.95;\n}\n\nfunction glassBackground(o: number): string {\n return `linear-gradient(135deg, rgba(255,255,255,${o * 0.85}) 0%, rgba(255,255,255,${o * 0.65}) 50%, rgba(255,255,255,${o * 0.75}) 100%)`;\n}\n\nconst GLASS_COMMON = `\n backdrop-filter: blur(40px) saturate(1.8); -webkit-backdrop-filter: blur(40px) saturate(1.8);\n border: 1px solid rgba(255,255,255,0.35);\n box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 8px 32px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.08);\n`;\n\n// ── Toast (operation feedback) — top-center, brief ──\n\nfunction showToast(variant: 'success' | 'error' | 'warning' | 'info', message: string,\n opts?: ToastOptions) {\n const opts_ = { ...defaults, ...opts };\n const placement: ToastPlacement = opts_.placement ?? 'top';\n const sticky = opts_.sticky ?? false;\n\n // A repeat of a message already on screen refreshes it instead of stacking.\n const key = `${placement}|${variant}|${message}`;\n if (opts_.dedupe) {\n const existing = live.get(key);\n if (existing) { existing.restart(); return; }\n }\n\n import('../utils/sounds').then(s => {\n if (variant === 'success') s.playSuccess();\n else if (variant === 'error') s.playError();\n else s.playNotification();\n }).catch(() => {});\n\n const container = placement === 'bottom'\n ? getOrCreate(TOAST_BOTTOM_CONTAINER_ID, 'fixed bottom-4 left-1/2 -translate-x-1/2 z-[9999] flex flex-col-reverse gap-2 items-center pointer-events-none')\n : getOrCreate(TOAST_CONTAINER_ID, 'fixed top-4 left-1/2 -translate-x-1/2 z-[9999] flex flex-col gap-2 items-center pointer-events-none');\n const o = getMenuOpacity();\n const color =\n variant === 'success' ? '#22c55e' :\n variant === 'error' ? '#ef4444' :\n // Amber, and deliberately not the error red: a warning is something the\n // user should read before continuing, not something that failed. Painting\n // both red teaches people to ignore the colour.\n variant === 'warning' ? '#f59e0b' :\n '#3b82f6';\n const icons = {\n success: '<svg class=\"h-4 w-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"' + color + '\" stroke-width=\"2\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M5 13l4 4L19 7\"/></svg>',\n error: '<svg class=\"h-4 w-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"' + color + '\" stroke-width=\"2\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\"/></svg>',\n warning: '<svg class=\"h-4 w-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"' + color + '\" stroke-width=\"2\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z\"/></svg>',\n info: '<svg class=\"h-4 w-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"' + color + '\" stroke-width=\"2\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z\"/></svg>',\n };\n const icon = icons[variant];\n\n // Enter from the edge the toast is anchored to, so it reads as arriving from\n // off-screen rather than drifting in from the wrong direction.\n const offscreen = placement === 'bottom' ? 'translateY(10px)' : 'translateY(-10px)';\n\n const el = document.createElement('div');\n el.className = 'pointer-events-auto cursor-pointer';\n el.style.cssText = `\n padding: 8px 20px; border-radius: 12px;\n background: ${glassBackground(o)}; ${GLASS_COMMON}\n opacity: 0; transform: ${offscreen} scale(0.95);\n transition: opacity ${FADE_MS}ms ease, transform ${FADE_MS}ms ease;\n display: flex; align-items: center; gap: 8px;\n font-size: 13px; font-weight: 500; color: rgb(55,65,81);\n max-width: min(90vw, 460px);\n `;\n // A toast IS a status message, and it appears without the user moving focus\n // — so without a live region it is announced to nobody. `alert` is\n // assertive and interrupts whatever is being read, which is right for a\n // failure and wrong for a confirmation the user already expected.\n el.setAttribute('role', variant === 'error' ? 'alert' : 'status');\n // Read the whole toast, not the word that changed. Without it a repeat that\n // only alters a number announces the number alone.\n el.setAttribute('aria-atomic', 'true');\n\n el.innerHTML = icon;\n const span = document.createElement('span');\n span.textContent = message;\n el.appendChild(span);\n\n container.appendChild(el);\n requestAnimationFrame(() => { el.style.opacity = '1'; el.style.transform = 'translateY(0) scale(1)'; });\n\n let timer: ReturnType<typeof setTimeout> | undefined;\n let gone = false;\n const dismiss = () => {\n if (gone) return;\n gone = true;\n if (timer) clearTimeout(timer);\n live.delete(key);\n el.style.opacity = '0';\n el.style.transform = `${offscreen} scale(0.95)`;\n setTimeout(() => el.remove(), FADE_MS);\n };\n\n // Info messages are usually a sentence (\"no matches — check X\"); give them a\n // beat longer to read than the terse success/error confirmations.\n const duration = opts_.duration ?? (variant === 'info' ? 4500 : 3000);\n const restart = () => {\n if (timer) clearTimeout(timer);\n if (!sticky) timer = setTimeout(dismiss, duration);\n };\n restart();\n\n // Hold the timer while the pointer rests on it. Three seconds is enough to\n // read a confirmation and not enough to read an address someone leaned in\n // for — and a toast that vanishes as you reach for it cannot be re-read at\n // all, since there is no history to open.\n el.addEventListener('mouseenter', () => { if (timer) clearTimeout(timer); });\n el.addEventListener('mouseleave', () => { if (!gone) restart(); });\n\n // Tap anywhere on the toast to dismiss it. A toast has no other click\n // affordance, and a sticky one has no other exit at all — `notify` has\n // behaved this way since it existed.\n el.addEventListener('click', dismiss);\n\n live.set(key, { el, restart });\n}\n\n// ── Notification (system alert) — top-right, stays longer ──\n\nfunction showNotification(message: string, opts?: { duration?: number }) {\n import('../utils/sounds').then(s => s.playNotification()).catch(() => {});\n\n const container = getOrCreate(NOTIF_CONTAINER_ID, 'fixed top-4 right-4 z-[9999] flex flex-col gap-3 items-end pointer-events-none');\n const o = getMenuOpacity();\n\n const el = document.createElement('div');\n el.className = 'pointer-events-auto cursor-pointer';\n el.style.cssText = `\n min-width: 280px; max-width: 380px; padding: 12px 16px; border-radius: 16px;\n background: ${glassBackground(o)}; ${GLASS_COMMON}\n opacity: 0; transform: translateX(30px) scale(0.95);\n transition: opacity ${FADE_MS}ms cubic-bezier(0.4,0,0.2,1), transform ${FADE_MS}ms cubic-bezier(0.4,0,0.2,1);\n display: flex; align-items: flex-start; gap: 12px;\n `;\n\n el.innerHTML = `\n <div style=\"width: 36px; height: 36px; border-radius: 10px; background: rgba(59,130,246,0.15); display: flex; align-items: center; justify-content: center; flex-shrink: 0;\">\n <svg class=\"h-5 w-5\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"#3b82f6\" stroke-width=\"2\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0\"/></svg>\n </div>\n <div style=\"flex: 1; min-width: 0;\">\n <div style=\"font-size: 11px; font-weight: 600; color: #3b82f6; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px;\">Notification</div>\n <div class=\"notif-msg\" style=\"font-size: 13px; font-weight: 500; color: rgb(55,65,81); line-height: 1.4;\"></div>\n </div>\n <button style=\"flex-shrink: 0; padding: 4px; color: rgb(156,163,175); font-size: 18px; line-height: 1; transition: color 0.2s;\" onmouseenter=\"this.style.color='rgb(75,85,99)'\" onmouseleave=\"this.style.color='rgb(156,163,175)'\">&times;</button>\n `;\n\n const msgEl = el.querySelector('.notif-msg');\n if (msgEl) msgEl.textContent = message;\n\n const dismiss = () => {\n el.style.opacity = '0';\n el.style.transform = 'translateX(30px) scale(0.95)';\n setTimeout(() => el.remove(), FADE_MS);\n };\n\n el.querySelector('button')?.addEventListener('click', (e) => { e.stopPropagation(); dismiss(); });\n el.addEventListener('click', dismiss);\n\n container.appendChild(el);\n requestAnimationFrame(() => { el.style.opacity = '1'; el.style.transform = 'translateX(0) scale(1)'; });\n\n setTimeout(dismiss, opts?.duration ?? 10000);\n}\n\nconst toast = {\n success: (message: string, opts?: ToastOptions) => showToast('success', message, opts),\n error: (message: string, opts?: ToastOptions) => showToast('error', message, opts),\n /**\n * Something the user should read before continuing — a partial success, a\n * setting that will not apply until they do something else. Distinct from\n * `error`, which is \"this did not happen\".\n */\n warning: (message: string, opts?: ToastOptions) => showToast('warning', message, opts),\n info: (message: string, opts?: ToastOptions) => showToast('info', message, opts),\n // Persistent top-right notification card (the old toast.info presentation).\n notify: (message: string, opts?: { duration?: number }) => showNotification(message, opts),\n /**\n * Set defaults for every subsequent toast. Call once at app startup; later\n * calls replace the whole object rather than merging, so a consumer sets its\n * policy in one place. Per-call options still take precedence.\n */\n configure: (next: ToastOptions) => { defaults = { ...next }; },\n};\n\nexport default toast;\n"]}
@@ -1,7 +0,0 @@
1
- // src/version.ts
2
- var VERSION = "4.63.0" ;
3
- var APP_VERSION = VERSION;
4
-
5
- export { APP_VERSION, VERSION };
6
- //# sourceMappingURL=chunk-WCGHIJZR.js.map
7
- //# sourceMappingURL=chunk-WCGHIJZR.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/shell/useIsMobile.ts","../src/shell/PopupMenu.tsx","../src/shell/ShellPrefs.tsx"],"names":["PopupMenuItem","jsx"],"mappings":";;;;;AAaA,IAAM,KAAA,GAAQ,uCAAA;AAEd,SAAS,WAAA,GAAuB;AAC9B,EAAA,IAAI,OAAO,MAAA,KAAW,WAAA,IAAe,CAAC,MAAA,CAAO,YAAY,OAAO,KAAA;AAChE,EAAA,OAAO,MAAA,CAAO,UAAA,CAAW,KAAK,CAAA,CAAE,OAAA;AAClC;AAEA,SAAS,iBAAA,GAA6B;AACpC,EAAA,OAAO,KAAA;AACT;AAEA,SAAS,UAAU,EAAA,EAA4B;AAC7C,EAAA,IAAI,OAAO,MAAA,KAAW,WAAA,IAAe,CAAC,MAAA,CAAO,UAAA,SAAmB,MAAM;AAAA,EAAC,CAAA;AACvE,EAAA,MAAM,GAAA,GAAM,MAAA,CAAO,UAAA,CAAW,KAAK,CAAA;AAEnC,EAAA,IAAI,IAAI,gBAAA,EAAkB;AACxB,IAAA,GAAA,CAAI,gBAAA,CAAiB,UAAU,EAAE,CAAA;AACjC,IAAA,OAAO,MAAM,GAAA,CAAI,mBAAA,CAAoB,QAAA,EAAU,EAAE,CAAA;AAAA,EACnD;AACA,EAAA,GAAA,CAAI,YAAY,EAAE,CAAA;AAClB,EAAA,OAAO,MAAM,GAAA,CAAI,cAAA,CAAe,EAAE,CAAA;AACpC;AAEO,SAAS,WAAA,GAAuB;AACrC,EAAA,OAAO,oBAAA,CAAqB,SAAA,EAAW,WAAA,EAAa,iBAAiB,CAAA;AACvE;ACdA,SAAS,UAAA,GAA2C;AAClD,EAAA,OAAQ,gBAAA,CAAiB,SAAS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AAI,GAAG,MAAA,EAAO;AAAA,IAC1C,CAAA,CAAA,MAAQ;AAAE,MAAA,OAAO,EAAE,GAAI,QAAA,IAAY,EAAC,EAAG;AAAA,IAAG;AAAA,EAC5C,CAAC,CAAA;AACD,EAAA,MAAM,IAAA,GAAO,WAAA,CAAY,CAAC,KAAA,KAA+B;AACvD,IAAA,QAAA,CAAS,CAAA,IAAA,KAAQ;AACf,MAAA,MAAM,IAAA,GAAO,EAAE,GAAG,IAAA,EAAM,GAAG,KAAA,EAAM;AACjC,MAAA,IAAI;AAAE,QAAA,YAAA,CAAa,OAAA,CAAQ,UAAA,EAAY,IAAA,CAAK,SAAA,CAAU,IAAI,CAAC,CAAA;AAAA,MAAG,CAAA,CAAA,MAAQ;AAAA,MAAC;AACvE,MAAA,OAAO,IAAA;AAAA,IACT,CAAC,CAAA;AAAA,EACH,CAAA,EAAG,CAAC,UAAU,CAAC,CAAA;AACf,EAAA,OAAO,EAAE,OAAO,IAAA,EAAK;AACvB;AAKO,SAAS,aAAA,GAAmC;AACjD,EAAA,MAAM,GAAA,GAAM,WAAW,iBAAiB,CAAA;AACxC,EAAA,IAAI,KAAK,OAAO,GAAA;AAChB,EAAA,OAAO,EAAE,KAAA,EAAO,EAAC,EAAG,MAAM,MAAM;AAAA,EAAC,CAAA,EAAE;AACrC","file":"chunk-ZCDFNZQS.js","sourcesContent":["/**\n * Mobile breakpoint hook — single source of truth for \"is this a phone/tablet\n * portrait viewport?\" Drives whether <Layout> renders the desktop chrome\n * (windows / taskbar / start menu sidebar) or the <MobileAppLanding> screen\n * that points the user at the consumer-wired mobile app. A handful of\n * primitives (Modal, ResizableTable) also read it to adapt touch behaviour.\n *\n * Locked at 768 px so iPad portrait counts as mobile. Also OR's with\n * `pointer: coarse` so touch-only devices that happen to be wider (e.g. an\n * Android tablet in landscape) still get touch-appropriate UI.\n */\nimport { useSyncExternalStore } from 'react';\n\nconst QUERY = '(max-width: 767px), (pointer: coarse)';\n\nfunction getSnapshot(): boolean {\n if (typeof window === 'undefined' || !window.matchMedia) return false;\n return window.matchMedia(QUERY).matches;\n}\n\nfunction getServerSnapshot(): boolean {\n return false;\n}\n\nfunction subscribe(cb: () => void): () => void {\n if (typeof window === 'undefined' || !window.matchMedia) return () => {};\n const mql = window.matchMedia(QUERY);\n // Older Safari uses addListener; modern browsers use addEventListener.\n if (mql.addEventListener) {\n mql.addEventListener('change', cb);\n return () => mql.removeEventListener('change', cb);\n }\n mql.addListener(cb);\n return () => mql.removeListener(cb);\n}\n\nexport function useIsMobile(): boolean {\n return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n}\n","import { forwardRef, useEffect, useRef, type ReactNode, type CSSProperties } from 'react';\nimport { createPortal } from 'react-dom';\nimport { glassStyle, GLASS_DIVIDER } from '../utils/glass';\n\n/**\n * Unified popup menu component — used for all context menus, dropdowns, and flyouts.\n * Reads --menu-density CSS variable: 'tight', 'normal' (default), or 'large'.\n */\n\nexport interface PopupMenuProps {\n children: ReactNode;\n style?: CSSProperties;\n className?: string;\n onClose?: () => void;\n minWidth?: number;\n /** Render into document.body instead of in place. Required when the menu\n * is opened from INSIDE a window: the window panel is a transformed /\n * backdrop-filtered `overflow-hidden` container, which both re-anchors\n * `position: fixed` descendants to itself and clips them — a menu\n * positioned at viewport coordinates ends up offset or invisible.\n * Portaling restores true viewport positioning. */\n portal?: boolean;\n}\n\nfunction getDensity(): 'tight' | 'normal' | 'large' {\n return (getComputedStyle(document.documentElement).getPropertyValue('--menu-density')?.trim() as any) || 'normal';\n}\n\n/** Container for a popup menu — auto-clamps to stay within viewport */\nexport function PopupMenu({ children, style, className = '', onClose, minWidth = 180, portal = false }: PopupMenuProps) {\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (!onClose) return;\n const handleClick = (e: PointerEvent | MouseEvent) => {\n if ((e.target as HTMLElement).closest('[data-menu-toggle]')) return;\n if (ref.current && !ref.current.contains(e.target as Node)) onClose();\n };\n const handleKey = (e: KeyboardEvent) => { if (e.key === 'Escape') onClose(); };\n window.addEventListener('pointerdown', handleClick);\n window.addEventListener('keydown', handleKey);\n return () => { window.removeEventListener('pointerdown', handleClick); window.removeEventListener('keydown', handleKey); };\n }, [onClose]);\n\n // After render, clamp position to viewport boundaries\n useEffect(() => {\n const el = ref.current;\n if (!el) return;\n requestAnimationFrame(() => {\n const rect = el.getBoundingClientRect();\n const margin = 8;\n // Clamp right edge\n if (rect.right > window.innerWidth - margin) {\n const overflow = rect.right - window.innerWidth + margin;\n if (el.style.left) {\n el.style.left = `${parseFloat(el.style.left) - overflow}px`;\n } else if (!el.style.right) {\n el.style.left = `${rect.left - overflow}px`;\n }\n }\n // Clamp left edge\n if (rect.left < margin) {\n if (el.style.left) {\n el.style.left = `${margin}px`;\n } else if (el.style.right) {\n el.style.right = `${window.innerWidth - rect.width - margin}px`;\n }\n }\n // Clamp bottom edge\n if (rect.bottom > window.innerHeight - margin) {\n const overflow = rect.bottom - window.innerHeight + margin;\n if (el.style.top) {\n el.style.top = `${parseFloat(el.style.top) - overflow}px`;\n } else if (el.style.bottom) {\n // Already anchored to bottom, just clamp\n el.style.bottom = `${margin}px`;\n } else {\n el.style.top = `${rect.top - overflow}px`;\n }\n }\n // Clamp top edge\n if (rect.top < margin) {\n if (el.style.top) {\n el.style.top = `${margin}px`;\n } else if (el.style.bottom) {\n el.style.bottom = `${window.innerHeight - rect.height - margin}px`;\n }\n }\n });\n });\n\n const density = getDensity();\n\n const menu = (\n <div ref={ref}\n className={`fixed z-[400] rounded-2xl ${density === 'tight' ? 'py-1' : density === 'large' ? 'py-2' : 'py-1.5'} ${className}`}\n style={{ minWidth, animation: 'popup-in 0.12s ease-out', ...glassStyle(), ...style }}>\n {children}\n <style>{`@keyframes popup-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }`}</style>\n </div>\n );\n\n return portal ? createPortal(menu, document.body) : menu;\n}\n\n/** A clickable menu item */\nexport interface PopupMenuItemProps {\n onClick?: () => void;\n children: ReactNode;\n className?: string;\n danger?: boolean;\n disabled?: boolean;\n /**\n * The menu semantics, when this item is part of one.\n *\n * A context menu on the desktop is a list of buttons and needs none of this;\n * a dropdown attached to a trigger is a `menu` whose items are `menuitem`s\n * with one tab stop between them. Both draw the same item, so the styling\n * lives here rather than being copied into whichever one is newer.\n */\n role?: 'menuitem';\n tabIndex?: number;\n id?: string;\n onMouseEnter?: () => void;\n}\n\n/**\n * `forwardRef`, not a `ref` prop.\n *\n * Taking `ref` as an ordinary prop is React 19 only. This package's peer range\n * is `react: \">=18\"`, and React 18 strips `ref` from a function component's\n * props and warns — so on an 18 consumer the ref would silently never attach,\n * `DropdownMenu`'s `itemRefs` would all be null, and its arrow keys would move\n * `tabIndex` while DOM focus stayed put. A keyboard-dead menu with no error.\n */\nexport const PopupMenuItem = forwardRef<HTMLButtonElement, PopupMenuItemProps>(function PopupMenuItem({\n onClick, children, className = '', danger, disabled,\n role, tabIndex, id, onMouseEnter,\n}, ref) {\n const density = getDensity();\n // Vertical gap between items. `normal` sits a little tighter than the raw\n // size padding; `large` adds a bit more room. Floored at the tight value so\n // the reduced `normal` never drops below `tight` at the smallest menu size.\n const itemPadY = density === 'tight' ? '0.25rem'\n : density === 'large' ? '0.6rem'\n : 'max(0.25rem, calc(var(--menu-padding-y, 0.5rem) - 0.1rem))';\n return (\n <button\n ref={ref}\n id={id}\n role={role}\n tabIndex={tabIndex}\n onClick={onClick}\n onMouseEnter={onMouseEnter}\n disabled={disabled}\n className={`w-full flex items-center gap-2 text-left transition-colors rounded-lg mx-auto\n ${danger ? 'text-red-600 hover:bg-red-50' : 'text-gray-700 hover:bg-blue-50 hover:text-blue-700'}\n ${disabled ? 'opacity-40 cursor-not-allowed' : ''}\n ${className}`}\n style={{\n width: 'calc(100% - 8px)',\n marginLeft: 4,\n marginRight: 4,\n fontSize: 'var(--menu-font-size, 14px)',\n paddingLeft: 'var(--menu-padding-x, 1rem)',\n paddingRight: 'var(--menu-padding-x, 1rem)',\n paddingTop: itemPadY,\n paddingBottom: itemPadY,\n }}\n >\n {children}\n </button>\n );\n});\n\n/** A divider line between menu items */\nexport function PopupMenuDivider() {\n const density = getDensity();\n return <div className={`border-t ${GLASS_DIVIDER} ${density === 'tight' ? 'my-0.5' : density === 'large' ? 'my-1.5' : 'my-1'} mx-3`} />;\n}\n\n/** A section header label */\nexport function PopupMenuLabel({ children }: { children: ReactNode }) {\n const density = getDensity();\n const labelPadY = density === 'tight' ? '0.125rem' : density === 'large' ? '0.375rem' : '0.25rem';\n return (\n <div\n className=\"text-[10px] font-medium text-gray-400 uppercase tracking-wider\"\n style={{\n paddingLeft: 'var(--menu-padding-x, 1rem)',\n paddingRight: 'var(--menu-padding-x, 1rem)',\n paddingTop: labelPadY,\n paddingBottom: labelPadY,\n }}\n >\n {children}\n </div>\n );\n}\n\n/** An icon helper */\nexport function MenuIcon({ d, className = 'h-4 w-4 text-gray-400' }: { d: string; className?: string }) {\n return (\n <svg className={className} fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={1.5}>\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d={d} />\n </svg>\n );\n}\n","/**\n * Shell-side user-preferences surface — the package never owns where prefs\n * live. The consumer supplies a hook returning the current prefs object plus\n * a save callback; the shell reads keys it knows about (theme,\n * taskbar_position, taskbar_size, world_clocks, favorite_documents,\n * desktop_folders, desktop_snap, notepad_notes, …) and patches them.\n *\n * When no provider is mounted, the shell falls back to localStorage scoped\n * by `storageKey` — so the package works out of the box for a backend-less\n * consumer.\n */\nimport { createContext, useContext, useState, useCallback, type ReactNode } from 'react';\n\nexport interface ShellPrefsAdapter {\n /** The current prefs object. The shell reads its known keys directly off\n * this; consumer-private keys are ignored. */\n prefs: Record<string, any>;\n /** Patch a subset of prefs. The shell calls this with shallow diffs. */\n save: (patch: Record<string, any>) => Promise<void> | void;\n}\n\nconst ShellPrefsContext = createContext<ShellPrefsAdapter | null>(null);\n\nexport function ShellPrefsProvider({\n value,\n children,\n}: { value: ShellPrefsAdapter; children: ReactNode }) {\n return <ShellPrefsContext.Provider value={value}>{children}</ShellPrefsContext.Provider>;\n}\n\n/** Default localStorage-backed adapter — useful when the consumer doesn't\n * ship a backend. Pass the result into <ShellPrefsProvider value={…}>.\n *\n * `defaults` are merged behind whatever's already stored, so they only\n * apply for keys the user hasn't set yet. Useful for opting out of bundled\n * features (e.g. `{ show_desktop_version: false }`). */\nexport function useLocalStoragePrefs(\n storageKey = 'react-os-shell:prefs',\n defaults?: Record<string, any>,\n): ShellPrefsAdapter {\n const [prefs, setPrefs] = useState<Record<string, any>>(() => {\n try {\n const stored = JSON.parse(localStorage.getItem(storageKey) || '{}');\n return { ...(defaults ?? {}), ...stored };\n } catch { return { ...(defaults ?? {}) }; }\n });\n const save = useCallback((patch: Record<string, any>) => {\n setPrefs(prev => {\n const next = { ...prev, ...patch };\n try { localStorage.setItem(storageKey, JSON.stringify(next)); } catch {}\n return next;\n });\n }, [storageKey]);\n return { prefs, save };\n}\n\n/** Returns the active prefs adapter. When no provider is mounted, returns a\n * no-op adapter that reads as empty and silently drops saves — components\n * still render, but persistence is a no-op. */\nexport function useShellPrefs(): ShellPrefsAdapter {\n const ctx = useContext(ShellPrefsContext);\n if (ctx) return ctx;\n return { prefs: {}, save: () => {} };\n}\n"]}