react-os-shell 0.2.60 → 0.2.63

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 (65) hide show
  1. package/dist/{Browser-P7TWQQYY.js → Browser-F7TJRHMK.js} +4 -3
  2. package/dist/Browser-F7TJRHMK.js.map +1 -0
  3. package/dist/{Calculator-PVTLAMJG.js → Calculator-FO3NUVCK.js} +5 -4
  4. package/dist/Calculator-FO3NUVCK.js.map +1 -0
  5. package/dist/{Calendar-UUBCO6DL.js → Calendar-ZGKMZ5TU.js} +4 -3
  6. package/dist/Calendar-ZGKMZ5TU.js.map +1 -0
  7. package/dist/{CurrencyConverter-C6YPYMKF.js → CurrencyConverter-IMHQD6XV.js} +5 -4
  8. package/dist/CurrencyConverter-IMHQD6XV.js.map +1 -0
  9. package/dist/{Documents-W2KVAGMZ.js → Documents-PHVXWN4S.js} +4 -3
  10. package/dist/Documents-PHVXWN4S.js.map +1 -0
  11. package/dist/{Email-LL5ABOWG.js → Email-VXTFMSS5.js} +5 -4
  12. package/dist/Email-VXTFMSS5.js.map +1 -0
  13. package/dist/Files-YO5YOKD7.js +9 -0
  14. package/dist/{Files-EJOCVUFL.js.map → Files-YO5YOKD7.js.map} +1 -1
  15. package/dist/{Minesweeper-A63TCDW2.js → Minesweeper-PX4DUPOE.js} +4 -3
  16. package/dist/Minesweeper-PX4DUPOE.js.map +1 -0
  17. package/dist/{Notepad-6J6NAWRN.js → Notepad-LFCZD2Y3.js} +4 -3
  18. package/dist/Notepad-LFCZD2Y3.js.map +1 -0
  19. package/dist/{PomodoroTimer-2O2YIXLM.js → PomodoroTimer-7Y36AEWF.js} +5 -4
  20. package/dist/PomodoroTimer-7Y36AEWF.js.map +1 -0
  21. package/dist/Preview-UMGXEYCV.js +8 -0
  22. package/dist/{Preview-GTN5ZMQA.js.map → Preview-UMGXEYCV.js.map} +1 -1
  23. package/dist/Sidebar-4V6NQROQ.js +234 -0
  24. package/dist/Sidebar-4V6NQROQ.js.map +1 -0
  25. package/dist/Spreadsheet-L2DOK2JK.js +7 -0
  26. package/dist/Spreadsheet-L2DOK2JK.js.map +1 -0
  27. package/dist/{Weather-LTHMP7VM.js → Weather-FDL7CFDL.js} +5 -4
  28. package/dist/Weather-FDL7CFDL.js.map +1 -0
  29. package/dist/{WorldClock-LKSGXQ4D.js → WorldClock-4PCYEMLF.js} +5 -4
  30. package/dist/WorldClock-4PCYEMLF.js.map +1 -0
  31. package/dist/apps/index.d.ts +9 -1
  32. package/dist/apps/index.js +20 -17
  33. package/dist/apps/index.js.map +1 -1
  34. package/dist/{chunk-YMXAXNA5.js → chunk-6JAAM5TA.js} +4 -4
  35. package/dist/{chunk-YMXAXNA5.js.map → chunk-6JAAM5TA.js.map} +1 -1
  36. package/dist/chunk-ADJ3CERD.js +31 -0
  37. package/dist/chunk-ADJ3CERD.js.map +1 -0
  38. package/dist/{chunk-7ZPVS3H2.js → chunk-E7ZO44KU.js} +3 -3
  39. package/dist/{chunk-7ZPVS3H2.js.map → chunk-E7ZO44KU.js.map} +1 -1
  40. package/dist/{Spreadsheet-T3AHYV5C.js → chunk-FJ6NSPYF.js} +46 -7
  41. package/dist/chunk-FJ6NSPYF.js.map +1 -0
  42. package/dist/{chunk-FBOBSZM5.js → chunk-ONQJGZCL.js} +34 -78
  43. package/dist/chunk-ONQJGZCL.js.map +1 -0
  44. package/dist/chunk-SSA762W5.js +71 -0
  45. package/dist/chunk-SSA762W5.js.map +1 -0
  46. package/dist/{chunk-6W6HAU2K.js → chunk-TRYZ75AV.js} +3 -3
  47. package/dist/{chunk-6W6HAU2K.js.map → chunk-TRYZ75AV.js.map} +1 -1
  48. package/dist/index.js +68 -38
  49. package/dist/index.js.map +1 -1
  50. package/package.json +1 -1
  51. package/dist/Browser-P7TWQQYY.js.map +0 -1
  52. package/dist/Calculator-PVTLAMJG.js.map +0 -1
  53. package/dist/Calendar-UUBCO6DL.js.map +0 -1
  54. package/dist/CurrencyConverter-C6YPYMKF.js.map +0 -1
  55. package/dist/Documents-W2KVAGMZ.js.map +0 -1
  56. package/dist/Email-LL5ABOWG.js.map +0 -1
  57. package/dist/Files-EJOCVUFL.js +0 -8
  58. package/dist/Minesweeper-A63TCDW2.js.map +0 -1
  59. package/dist/Notepad-6J6NAWRN.js.map +0 -1
  60. package/dist/PomodoroTimer-2O2YIXLM.js.map +0 -1
  61. package/dist/Preview-GTN5ZMQA.js +0 -7
  62. package/dist/Spreadsheet-T3AHYV5C.js.map +0 -1
  63. package/dist/Weather-LTHMP7VM.js.map +0 -1
  64. package/dist/WorldClock-LKSGXQ4D.js.map +0 -1
  65. package/dist/chunk-FBOBSZM5.js.map +0 -1
@@ -1,4 +1,5 @@
1
1
  import { confirm } from './chunk-PLGHQ7QW.js';
2
+ import { glassStyle, GLASS_DIVIDER, navIcons } from './chunk-SSA762W5.js';
2
3
  import 'axios';
3
4
  import { createContext, useRef, useEffect, useSyncExternalStore, useContext, useState, useCallback, isValidElement, cloneElement, useLayoutEffect, Suspense, useMemo } from 'react';
4
5
  import { useLocation } from 'react-router-dom';
@@ -7,36 +8,6 @@ import { useQueryClient, useQuery } from '@tanstack/react-query';
7
8
  import { XMarkIcon } from '@heroicons/react/24/outline';
8
9
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
9
10
 
10
- // src/shell/nav-types.ts
11
- function isSection(item) {
12
- return "items" in item;
13
- }
14
-
15
- // src/shell-config/nav.tsx
16
- var _navIcons = {};
17
- var navIcons = new Proxy(_navIcons, {
18
- get(_t, k) {
19
- return _navIcons[k];
20
- },
21
- has(_t, k) {
22
- return k in _navIcons;
23
- },
24
- ownKeys() {
25
- return Object.keys(_navIcons);
26
- },
27
- getOwnPropertyDescriptor(_t, k) {
28
- if (k in _navIcons) return { configurable: true, enumerable: true, value: _navIcons[k] };
29
- return void 0;
30
- }
31
- });
32
- function setShellNavIcons(icons) {
33
- for (const k of Object.keys(_navIcons)) delete _navIcons[k];
34
- Object.assign(_navIcons, icons);
35
- }
36
- var sectionIcons = {};
37
- var navSections = [];
38
- var startMenuCategories = { erp: [], system: [], virtual: [] };
39
-
40
11
  // src/windowRegistry/types.ts
41
12
  function isPageEntry(entry) {
42
13
  return "component" in entry;
@@ -92,44 +63,6 @@ var apiClient = new Proxy({}, {
92
63
  }
93
64
  });
94
65
  var client_default = apiClient;
95
-
96
- // src/utils/glass.ts
97
- function getMenuOpacity() {
98
- try {
99
- const val = getComputedStyle(document.documentElement).getPropertyValue("--menu-opacity")?.trim();
100
- if (val) return parseFloat(val);
101
- } catch {
102
- }
103
- return 0.95;
104
- }
105
- function isDarkTheme() {
106
- try {
107
- return document.documentElement.getAttribute("data-theme") === "dark";
108
- } catch {
109
- return false;
110
- }
111
- }
112
- function glassStyle(opacity) {
113
- const o = opacity ?? getMenuOpacity();
114
- if (isDarkTheme()) {
115
- return {
116
- background: `linear-gradient(135deg, rgba(30,30,46,${o * 0.85}) 0%, rgba(24,24,37,${o * 0.75}) 50%, rgba(30,30,46,${o * 0.85}) 100%)`,
117
- backdropFilter: "blur(40px) saturate(1.6)",
118
- WebkitBackdropFilter: "blur(40px) saturate(1.6)",
119
- border: "1px solid rgba(255,255,255,0.08)",
120
- boxShadow: "inset 0 1px 0 rgba(255,255,255,0.06), inset 0 -1px 0 rgba(0,0,0,0.4), 0 8px 32px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.3)"
121
- };
122
- }
123
- return {
124
- background: `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%)`,
125
- backdropFilter: "blur(40px) saturate(1.8)",
126
- WebkitBackdropFilter: "blur(40px) saturate(1.8)",
127
- border: "1px solid rgba(255,255,255,0.35)",
128
- boxShadow: "inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -1px 0 rgba(255,255,255,0.1), 0 8px 32px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.08)"
129
- };
130
- }
131
- var GLASS_DIVIDER = "border-white/20";
132
- var GLASS_INPUT_BG = "glass-input-bg";
133
66
  function getDensity() {
134
67
  return getComputedStyle(document.documentElement).getPropertyValue("--menu-density")?.trim() || "normal";
135
68
  }
@@ -900,9 +833,10 @@ function Modal({ open, onClose, title, icon, copyText, size = "lg", dirty = fals
900
833
  const taskbarH = parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-height")) || 0;
901
834
  const taskbarW = parseInt(getComputedStyle(document.documentElement).getPropertyValue("--taskbar-width")) || 0;
902
835
  const tbPos = getComputedStyle(document.documentElement).getPropertyValue("--taskbar-position")?.trim() || "bottom";
903
- const x = tbPos === "left" ? taskbarW : 0;
836
+ const sidebarW = parseInt(getComputedStyle(document.documentElement).getPropertyValue("--sidebar-width")) || 0;
837
+ const x = (tbPos === "left" ? taskbarW : 0) + sidebarW;
904
838
  const y = tbPos === "top" ? taskbarH : 0;
905
- const w = window.innerWidth - (tbPos === "left" || tbPos === "right" ? taskbarW : 0);
839
+ const w = window.innerWidth - (tbPos === "left" || tbPos === "right" ? taskbarW : 0) - sidebarW;
906
840
  const h = window.innerHeight - (tbPos === "top" || tbPos === "bottom" ? taskbarH : 0);
907
841
  return { x, y, w, h };
908
842
  }, []);
@@ -1008,9 +942,27 @@ function Modal({ open, onClose, title, icon, copyText, size = "lg", dirty = fals
1008
942
  }
1009
943
  return initialBox ? { x: initialBox.x, y: initialBox.y, w: initialBox.w, h: initialBox.h } : calcWindowed();
1010
944
  });
1011
- const [maximized, setMaximized] = useState(false);
945
+ const readAlwaysMaximizedFlag = () => {
946
+ if (typeof document === "undefined") return false;
947
+ const mode = getComputedStyle(document.documentElement).getPropertyValue("--layout-mode")?.trim();
948
+ return mode === "sidebar";
949
+ };
950
+ const [alwaysMaximizedRaw, setAlwaysMaximizedRaw] = useState(() => readAlwaysMaximizedFlag());
951
+ useEffect(() => {
952
+ const refresh = () => setAlwaysMaximizedRaw(readAlwaysMaximizedFlag());
953
+ window.addEventListener("react-os-shell:layout-mode-changed", refresh);
954
+ return () => window.removeEventListener("react-os-shell:layout-mode-changed", refresh);
955
+ }, []);
956
+ const alwaysMaximized = alwaysMaximizedRaw && !widget;
957
+ const [maximized, setMaximized] = useState(() => alwaysMaximized);
1012
958
  const boxRef = useRef(box);
1013
959
  boxRef.current = box;
960
+ useEffect(() => {
961
+ if (alwaysMaximized) {
962
+ setMaximized(true);
963
+ setBox(calcMaximized());
964
+ }
965
+ }, [alwaysMaximized, calcMaximized]);
1014
966
  useEffect(() => {
1015
967
  if (open && boxKey) {
1016
968
  _windowPositions[boxKey] = box;
@@ -1075,6 +1027,10 @@ function Modal({ open, onClose, title, icon, copyText, size = "lg", dirty = fals
1075
1027
  if (e.target.closest("button, input, a, kbd, select, textarea")) return;
1076
1028
  setWindowMenu(null);
1077
1029
  activateModal(modalId);
1030
+ if (alwaysMaximized) {
1031
+ e.preventDefault();
1032
+ return;
1033
+ }
1078
1034
  e.preventDefault();
1079
1035
  const sx = e.clientX, sy = e.clientY;
1080
1036
  const panel = panelRef.current;
@@ -1466,7 +1422,7 @@ function Modal({ open, onClose, title, icon, copyText, size = "lg", dirty = fals
1466
1422
  activeListeners.forEach((fn) => fn());
1467
1423
  window.dispatchEvent(new CustomEvent("modal-reorder"));
1468
1424
  }, title: "Minimize", className: "text-gray-400 hover:text-gray-600 px-1 py-0.5 rounded hover:bg-gray-200 text-xs leading-none", children: "\u2500" }),
1469
- /* @__PURE__ */ jsx("button", { onClick: () => {
1425
+ !alwaysMaximized && /* @__PURE__ */ jsx("button", { onClick: () => {
1470
1426
  if (maximized) {
1471
1427
  setMaximized(false);
1472
1428
  setBox(calcWindowed());
@@ -1512,7 +1468,7 @@ function Modal({ open, onClose, title, icon, copyText, size = "lg", dirty = fals
1512
1468
  activeListeners.forEach((fn) => fn());
1513
1469
  window.dispatchEvent(new CustomEvent("modal-reorder"));
1514
1470
  }, title: "Minimize", className: "text-gray-400 hover:text-gray-600 text-xs px-2 py-1 rounded hover:bg-gray-200", children: "\u2500" }),
1515
- /* @__PURE__ */ jsx("button", { onClick: () => {
1471
+ !alwaysMaximized && /* @__PURE__ */ jsx("button", { onClick: () => {
1516
1472
  if (maximized) {
1517
1473
  setMaximized(false);
1518
1474
  setBox(calcWindowed());
@@ -1642,7 +1598,7 @@ function Modal({ open, onClose, title, icon, copyText, size = "lg", dirty = fals
1642
1598
  /* @__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: "M19.5 12h-15" }) }),
1643
1599
  "Minimize"
1644
1600
  ] }),
1645
- maximized ? /* @__PURE__ */ jsxs(PopupMenuItem, { onClick: () => {
1601
+ !alwaysMaximized && (maximized ? /* @__PURE__ */ jsxs(PopupMenuItem, { onClick: () => {
1646
1602
  setMaximized(false);
1647
1603
  setBox(calcWindowed());
1648
1604
  setWindowMenu(null);
@@ -1655,7 +1611,7 @@ function Modal({ open, onClose, title, icon, copyText, size = "lg", dirty = fals
1655
1611
  }, children: [
1656
1612
  /* @__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 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15" }) }),
1657
1613
  "Maximize"
1658
- ] })
1614
+ ] }))
1659
1615
  ] }),
1660
1616
  allowPinOnTop && /* @__PURE__ */ jsxs(PopupMenuItem, { onClick: () => {
1661
1617
  setPinnedOnTop((p) => !p);
@@ -2316,6 +2272,6 @@ function WindowManagerProvider({ children }) {
2316
2272
  ] });
2317
2273
  }
2318
2274
 
2319
- export { CancelButton, CopyButton, DocFavStar, GLASS_DIVIDER, GLASS_INPUT_BG, LoadingSpinner, Modal, ModalActions, PopupMenu, PopupMenuDivider, PopupMenuItem, PopupMenuLabel, ThumbCard, WINDOW_REGISTRY, WindowManagerProvider, WindowTitle, activateModal, client_default, commitExposeHighlight, exitExposeMode, getActiveModalId, getActiveWindowRoute, getExposeHighlight, glassStyle, isEntityEntry, isPageEntry, isSection, navIcons, navSections, sectionIcons, setExposeHighlight, setShellApiClient, setShellNavIcons, setShellWindowRegistry, setWindowDefaultPosition, startMenuCategories, subscribeExposeHighlight, toggleExposeMode, useIsMobile, useModalActive, useWidgetSettings, useWindowManager, useWindowMenuItem, useWindowTitle };
2320
- //# sourceMappingURL=chunk-FBOBSZM5.js.map
2321
- //# sourceMappingURL=chunk-FBOBSZM5.js.map
2275
+ export { CancelButton, CopyButton, DocFavStar, LoadingSpinner, Modal, ModalActions, PopupMenu, PopupMenuDivider, PopupMenuItem, PopupMenuLabel, ThumbCard, WINDOW_REGISTRY, WindowManagerProvider, WindowTitle, activateModal, client_default, commitExposeHighlight, exitExposeMode, getActiveModalId, getActiveWindowRoute, getExposeHighlight, isEntityEntry, isPageEntry, setExposeHighlight, setShellApiClient, setShellWindowRegistry, setWindowDefaultPosition, subscribeExposeHighlight, toggleExposeMode, useIsMobile, useModalActive, useWidgetSettings, useWindowManager, useWindowMenuItem, useWindowTitle };
2276
+ //# sourceMappingURL=chunk-ONQJGZCL.js.map
2277
+ //# sourceMappingURL=chunk-ONQJGZCL.js.map