react-os-shell 4.2.0 → 4.2.2

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 (44) hide show
  1. package/dist/{Browser-XWYM2PEL.js → Browser-TPAIWPZX.js} +5 -5
  2. package/dist/{Browser-XWYM2PEL.js.map → Browser-TPAIWPZX.js.map} +1 -1
  3. package/dist/{Calculator-EIKUYW6O.js → Calculator-RCNLBRHK.js} +4 -4
  4. package/dist/{Calculator-EIKUYW6O.js.map → Calculator-RCNLBRHK.js.map} +1 -1
  5. package/dist/ConfirmDialog-QMBUHDXK.js +4 -0
  6. package/dist/{ConfirmDialog-C25OKJZP.js.map → ConfirmDialog-QMBUHDXK.js.map} +1 -1
  7. package/dist/{CurrencyConverter-PJUTWMCD.js → CurrencyConverter-CM5OTXWF.js} +4 -4
  8. package/dist/{CurrencyConverter-PJUTWMCD.js.map → CurrencyConverter-CM5OTXWF.js.map} +1 -1
  9. package/dist/{Documents-XA3VM4VJ.js → Documents-3BPIAGQT.js} +5 -5
  10. package/dist/{Documents-XA3VM4VJ.js.map → Documents-3BPIAGQT.js.map} +1 -1
  11. package/dist/{Files-42ON7ANG.js → Files-CR3L5C2L.js} +5 -5
  12. package/dist/{Files-42ON7ANG.js.map → Files-CR3L5C2L.js.map} +1 -1
  13. package/dist/{Notepad-QQINWDCQ.js → Notepad-C6JHCCF2.js} +5 -5
  14. package/dist/{Notepad-QQINWDCQ.js.map → Notepad-C6JHCCF2.js.map} +1 -1
  15. package/dist/{PomodoroTimer-K5NBAIVW.js → PomodoroTimer-EZMBYLQX.js} +5 -5
  16. package/dist/{PomodoroTimer-K5NBAIVW.js.map → PomodoroTimer-EZMBYLQX.js.map} +1 -1
  17. package/dist/{Preview-NKLLQUKW.js → Preview-TFDEMTSH.js} +5 -5
  18. package/dist/{Preview-NKLLQUKW.js.map → Preview-TFDEMTSH.js.map} +1 -1
  19. package/dist/{Spreadsheet-BDBABITI.js → Spreadsheet-FRUPALW4.js} +5 -5
  20. package/dist/{Spreadsheet-BDBABITI.js.map → Spreadsheet-FRUPALW4.js.map} +1 -1
  21. package/dist/{Stock-2XTWWH6K.js → Stock-HL42NPTM.js} +4 -4
  22. package/dist/{Stock-2XTWWH6K.js.map → Stock-HL42NPTM.js.map} +1 -1
  23. package/dist/{Weather-GCBITKTJ.js → Weather-N74AKS6V.js} +4 -4
  24. package/dist/{Weather-GCBITKTJ.js.map → Weather-N74AKS6V.js.map} +1 -1
  25. package/dist/{WorldClock-S52UINCL.js → WorldClock-A2EDB57H.js} +4 -4
  26. package/dist/{WorldClock-S52UINCL.js.map → WorldClock-A2EDB57H.js.map} +1 -1
  27. package/dist/apps/index.js +15 -15
  28. package/dist/{chunk-IGYB3NRR.js → chunk-5TU6DT3E.js} +3 -3
  29. package/dist/{chunk-IGYB3NRR.js.map → chunk-5TU6DT3E.js.map} +1 -1
  30. package/dist/chunk-D36OPVAT.js +7 -0
  31. package/dist/{chunk-ITOOPTGP.js.map → chunk-D36OPVAT.js.map} +1 -1
  32. package/dist/{chunk-QAVN7ZV5.js → chunk-QJXXSMPG.js} +3 -3
  33. package/dist/{chunk-QAVN7ZV5.js.map → chunk-QJXXSMPG.js.map} +1 -1
  34. package/dist/{chunk-3ORJ4J4J.js → chunk-RKNJSV2T.js} +4 -4
  35. package/dist/{chunk-3ORJ4J4J.js.map → chunk-RKNJSV2T.js.map} +1 -1
  36. package/dist/{chunk-URHWXWZE.js → chunk-SI4XHEMM.js} +35 -6
  37. package/dist/chunk-SI4XHEMM.js.map +1 -0
  38. package/dist/index.d.ts +3 -2
  39. package/dist/index.js +13 -6
  40. package/dist/index.js.map +1 -1
  41. package/package.json +1 -1
  42. package/dist/ConfirmDialog-C25OKJZP.js +0 -4
  43. package/dist/chunk-ITOOPTGP.js +0 -7
  44. package/dist/chunk-URHWXWZE.js.map +0 -1
@@ -1205,7 +1205,7 @@ function CancelButton({ onClick, children, className }) {
1205
1205
  const ctx = useContext(ModalActionsContext);
1206
1206
  const handleClick = async () => {
1207
1207
  if (ctx?.isDirty) {
1208
- const { confirm: confirm2 } = await import('./ConfirmDialog-C25OKJZP.js');
1208
+ const { confirm: confirm2 } = await import('./ConfirmDialog-QMBUHDXK.js');
1209
1209
  const ok = await confirm2({
1210
1210
  title: "Discard changes?",
1211
1211
  message: "You have unsaved changes. Are you sure you want to cancel? All changes will be lost.",
@@ -1832,6 +1832,8 @@ function Modal({ open, onClose, title, icon, copyText, size = "lg", dirty = fals
1832
1832
  const actionsRef = useRef(null);
1833
1833
  const actionsLeftRef = useRef(null);
1834
1834
  const [hasActions, setHasActions] = useState(false);
1835
+ const footerRef = useRef(null);
1836
+ const hasFooterContent = !!(footer || actions || actionsLeft) || hasActions;
1835
1837
  const fallbackIcon = /* @__PURE__ */ jsx("svg", { className: "h-4 w-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3.75 6.75A2.25 2.25 0 016 4.5h12a2.25 2.25 0 012.25 2.25v10.5A2.25 2.25 0 0118 19.5H6a2.25 2.25 0 01-2.25-2.25V6.75z M3.75 9h16.5" }) });
1836
1838
  const effectiveIcon = icon && isValidElement(icon) ? cloneElement(icon, {
1837
1839
  className: `h-4 w-4 ${icon.props?.className ?? ""}`.trim()
@@ -2123,12 +2125,17 @@ function Modal({ open, onClose, title, icon, copyText, size = "lg", dirty = fals
2123
2125
  }
2124
2126
  } else if (changed || freezeTimer === null) {
2125
2127
  if (freezeTimer) clearTimeout(freezeTimer);
2126
- freezeTimer = setTimeout(() => setAutoHeightResolved(true), 160);
2128
+ freezeTimer = setTimeout(() => {
2129
+ const before = lastH;
2130
+ measure();
2131
+ if (lastH === before) setAutoHeightResolved(true);
2132
+ }, 160);
2127
2133
  }
2128
2134
  }
2129
2135
  };
2130
2136
  const ro = new ResizeObserver(measure);
2131
2137
  measure();
2138
+ if (footerRef.current) ro.observe(footerRef.current);
2132
2139
  const mo = new MutationObserver(measure);
2133
2140
  mo.observe(body, { childList: true, subtree: true, characterData: true });
2134
2141
  return () => {
@@ -2136,7 +2143,28 @@ function Modal({ open, onClose, title, icon, copyText, size = "lg", dirty = fals
2136
2143
  mo.disconnect();
2137
2144
  if (freezeTimer) clearTimeout(freezeTimer);
2138
2145
  };
2139
- }, [autoHeightResolved, widget, autoMinHeight]);
2146
+ }, [autoHeightResolved, widget, autoMinHeight, hasFooterContent]);
2147
+ useLayoutEffect(() => {
2148
+ if (!autoHeight || !autoHeightResolved || widget || !open) return;
2149
+ const footerEl = footerRef.current;
2150
+ if (!footerEl) return;
2151
+ let lastFooterH = footerEl.offsetHeight;
2152
+ const ro = new ResizeObserver(() => {
2153
+ if (!footerEl.isConnected) return;
2154
+ const h = footerEl.offsetHeight;
2155
+ const delta = h - lastFooterH;
2156
+ const flipped = h > 0 !== lastFooterH > 0;
2157
+ lastFooterH = h;
2158
+ if (!flipped || delta === 0 || maximized) return;
2159
+ if (document.body.classList.contains("rosh-gesturing")) return;
2160
+ const floor = autoMinHeight ?? 240;
2161
+ const taskbarH = parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height")) || 0;
2162
+ const viewportCap = Math.max(floor, window.innerHeight - taskbarH - Math.max(0, boxRef.current.y) - 24);
2163
+ setBox((prev) => ({ ...prev, h: Math.min(Math.max(floor, prev.h + delta), viewportCap) }));
2164
+ });
2165
+ ro.observe(footerEl);
2166
+ return () => ro.disconnect();
2167
+ }, [autoHeight, autoHeightResolved, widget, open, maximized, autoMinHeight]);
2140
2168
  useEffect(() => {
2141
2169
  if (alwaysMaximized) {
2142
2170
  setMaximized(true);
@@ -2784,7 +2812,8 @@ function Modal({ open, onClose, title, icon, copyText, size = "lg", dirty = fals
2784
2812
  "div",
2785
2813
  {
2786
2814
  onPointerDown: startDrag,
2787
- className: `px-4 py-2 border-t border-gray-200 shrink-0 flex items-center justify-between text-xs select-none cursor-move${isActive ? " backdrop-blur-sm" : ""}${widget || compact || appStyle || isMobile || !footer && !hasActions && !actions && !actionsLeft ? " hidden" : ""}`,
2815
+ ref: footerRef,
2816
+ className: `px-4 py-2 border-t border-gray-200 shrink-0 flex items-center justify-between text-xs select-none cursor-move${isActive ? " backdrop-blur-sm" : ""}${widget || compact || appStyle || isMobile || !hasFooterContent ? " hidden" : ""}`,
2788
2817
  style: { touchAction: "none", backgroundColor: isActive ? `rgb(var(--window-footer-rgb) / var(--active-header-opacity, 0.8))` : `rgb(var(--window-footer-rgb) / var(--inactive-header-opacity, 0.7))` },
2789
2818
  children: [
2790
2819
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [
@@ -3179,5 +3208,5 @@ function ConfirmProvider({ children }) {
3179
3208
  }
3180
3209
 
3181
3210
  export { CancelButton, ConfirmProvider, CopyButton, DocFavStar, LoadingSpinner, Modal, ModalActions, PopupMenu, PopupMenuDivider, PopupMenuItem, PopupMenuLabel, SIDEBAR_STRIP_W, ShellPrefsProvider, WINDOW_REGISTRY, WindowCrashedFallback, WindowErrorBoundary, WindowManagerProvider, WindowTitle, client_default, commitExposeHighlight, confirm, confirmDestructive, exitExposeMode, forgetMaximizedWindowBoxes, getActiveModalId, getActiveWindowRoute, getExposeHighlight, getWindowPosition, isEntityEntry, isPageEntry, isShellApiClientConfigured, prompt, registerModalEscapeInterceptor, setExposeHighlight, setShellApiClient, setShellWindowRegistry, setWindowDefaultPosition, setWindowPosition, subscribeExposeHighlight, toggleExposeMode, useConfirm, useIsMobile, useLocalStoragePrefs, useModalActive, useShellPrefs, useWidgetSettings, useWindowManager, useWindowMenuItem, useWindowTitle };
3182
- //# sourceMappingURL=chunk-URHWXWZE.js.map
3183
- //# sourceMappingURL=chunk-URHWXWZE.js.map
3211
+ //# sourceMappingURL=chunk-SI4XHEMM.js.map
3212
+ //# sourceMappingURL=chunk-SI4XHEMM.js.map