react-os-shell 2.7.0 → 2.8.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.
Files changed (34) hide show
  1. package/dist/{Browser-YEOBTPST.js → Browser-RNO4KYSE.js} +4 -4
  2. package/dist/{Browser-YEOBTPST.js.map → Browser-RNO4KYSE.js.map} +1 -1
  3. package/dist/{Documents-D7UN7W6P.js → Documents-L7CTOPIN.js} +3 -3
  4. package/dist/{Documents-D7UN7W6P.js.map → Documents-L7CTOPIN.js.map} +1 -1
  5. package/dist/{Files-VXHZY7NY.js → Files-FJL2BZDI.js} +7 -7
  6. package/dist/{Files-VXHZY7NY.js.map → Files-FJL2BZDI.js.map} +1 -1
  7. package/dist/{Notepad-THWCG35G.js → Notepad-2OJ53Q7M.js} +3 -3
  8. package/dist/{Notepad-THWCG35G.js.map → Notepad-2OJ53Q7M.js.map} +1 -1
  9. package/dist/Preview-65VPPGWD.js +9 -0
  10. package/dist/{Preview-5SOLJFFK.js.map → Preview-65VPPGWD.js.map} +1 -1
  11. package/dist/{Sidebar-BW7SYNBA.js → Sidebar-PY762ANK.js} +3 -3
  12. package/dist/Sidebar-PY762ANK.js.map +1 -0
  13. package/dist/{Spreadsheet-UVBEPLQB.js → Spreadsheet-VIYNZ6KJ.js} +4 -4
  14. package/dist/{Spreadsheet-UVBEPLQB.js.map → Spreadsheet-VIYNZ6KJ.js.map} +1 -1
  15. package/dist/apps/index.js +12 -12
  16. package/dist/{chunk-FX77XLQZ.js → chunk-5HXHD62G.js} +4 -4
  17. package/dist/{chunk-FX77XLQZ.js.map → chunk-5HXHD62G.js.map} +1 -1
  18. package/dist/{chunk-MJIMKMSJ.js → chunk-IXW6775F.js} +3 -3
  19. package/dist/{chunk-MJIMKMSJ.js.map → chunk-IXW6775F.js.map} +1 -1
  20. package/dist/{chunk-AAKIF7SW.js → chunk-V6N2NXHQ.js} +3 -3
  21. package/dist/{chunk-AAKIF7SW.js.map → chunk-V6N2NXHQ.js.map} +1 -1
  22. package/dist/{chunk-UATWDGLV.js → chunk-WG3PMYDQ.js} +3 -3
  23. package/dist/{chunk-UATWDGLV.js.map → chunk-WG3PMYDQ.js.map} +1 -1
  24. package/dist/{chunk-LD2JBHD3.js → chunk-YQWFKXWH.js} +3 -3
  25. package/dist/{chunk-LD2JBHD3.js.map → chunk-YQWFKXWH.js.map} +1 -1
  26. package/dist/{chunk-YZEQWMO5.js → chunk-ZEMXT6BR.js} +4 -4
  27. package/dist/{chunk-YZEQWMO5.js.map → chunk-ZEMXT6BR.js.map} +1 -1
  28. package/dist/index.js +99 -64
  29. package/dist/index.js.map +1 -1
  30. package/dist/styles.css +187 -2
  31. package/dist/themes.css +244 -0
  32. package/package.json +4 -3
  33. package/dist/Preview-5SOLJFFK.js +0 -9
  34. package/dist/Sidebar-BW7SYNBA.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,17 +1,17 @@
1
1
  import { subscribePomo, getPomoSnapshot } from './chunk-P75EON66.js';
2
2
  export { setShellTodoProvider } from './chunk-P75EON66.js';
3
- import { PREVIEW_OPENED_EVENT, publishDesktopFolders, requestFilesTrashView, FolderGlyph, openPreviewFile, requestFilesDesktopFolderView, FileIconTile, hashGradient } from './chunk-YZEQWMO5.js';
4
- export { Breadcrumbs } from './chunk-YZEQWMO5.js';
3
+ import { PREVIEW_OPENED_EVENT, publishDesktopFolders, requestFilesTrashView, FolderGlyph, openPreviewFile, requestFilesDesktopFolderView, FileIconTile, hashGradient } from './chunk-ZEMXT6BR.js';
4
+ export { Breadcrumbs } from './chunk-ZEMXT6BR.js';
5
5
  import { SidebarLayout } from './chunk-VGTEM5RZ.js';
6
6
  export { SidebarLayout } from './chunk-VGTEM5RZ.js';
7
7
  import { playNotification, playStartup, soundsEnabled, getSoundConfig, SOUND_PACK_KEYS, SOUND_PACKS, SOUND_TYPES, SOUND_TYPE_LABELS, setSoundForType, previewSound, setAllSounds, playLogout } from './chunk-D7PYW2QS.js';
8
- import { setPdfPreview } from './chunk-UATWDGLV.js';
8
+ import { setPdfPreview } from './chunk-WG3PMYDQ.js';
9
9
  import './chunk-KUIPWCTJ.js';
10
10
  import { toast_default } from './chunk-WIJ45SYD.js';
11
11
  export { toast_default as toast } from './chunk-WIJ45SYD.js';
12
- export { EditableGrid } from './chunk-AAKIF7SW.js';
13
- import { APP_VERSION } from './chunk-MJIMKMSJ.js';
14
- export { VERSION } from './chunk-MJIMKMSJ.js';
12
+ export { EditableGrid } from './chunk-V6N2NXHQ.js';
13
+ import { APP_VERSION } from './chunk-IXW6775F.js';
14
+ export { VERSION } from './chunk-IXW6775F.js';
15
15
  import { useWindowManager, PopupMenu, PopupMenuLabel, PopupMenuDivider, PopupMenuItem, Modal, WINDOW_REGISTRY, isPageEntry, useShellPrefs, useIsMobile, ModalActions, useModalActive, client_default, LoadingSpinner, setWindowPosition, ThumbCard, activateModal } from './chunk-JNF5VRPB.js';
16
16
  export { CancelButton, CopyButton, DocFavStar, Modal, ModalActions, PopupMenu, PopupMenuDivider, PopupMenuItem, PopupMenuLabel, ShellPrefsProvider, WindowCrashedFallback, WindowErrorBoundary, WindowManagerProvider, WindowTitle, commitExposeHighlight, exitExposeMode, getActiveWindowRoute, getExposeHighlight, getWindowPosition, isEntityEntry, isPageEntry, registerModalEscapeInterceptor, setExposeHighlight, setShellApiClient, setShellWindowRegistry, setWindowDefaultPosition, setWindowPosition, subscribeExposeHighlight, toggleExposeMode, useLocalStoragePrefs, useModalActive, useShellPrefs, useWidgetSettings, useWindowManager, useWindowMenuItem, useWindowTitle } from './chunk-JNF5VRPB.js';
17
17
  import { confirm } from './chunk-UBN4IUDE.js';
@@ -2882,6 +2882,64 @@ function hslToHex(h, s, l) {
2882
2882
  const toHex = (x) => Math.round(x * 255).toString(16).padStart(2, "0");
2883
2883
  return `#${toHex(f(0))}${toHex(f(8))}${toHex(f(4))}`;
2884
2884
  }
2885
+ function resolveTheme(theme) {
2886
+ const t = theme || "system";
2887
+ if (t === "system") return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
2888
+ return t;
2889
+ }
2890
+ function applyAccent(accentColor) {
2891
+ const root = document.documentElement;
2892
+ if (accentColor && /^#[0-9a-fA-F]{6}$/.test(accentColor)) {
2893
+ const [h, s, l] = hexToHsl(accentColor);
2894
+ root.setAttribute("data-custom-accent", "true");
2895
+ root.style.setProperty("--accent-600", accentColor);
2896
+ root.style.setProperty("--accent-700", hslToHex(h, s, Math.max(l - 10, 5)));
2897
+ root.style.setProperty("--accent-500", hslToHex(h, s, Math.min(l + 10, 95)));
2898
+ root.style.setProperty("--accent-400", hslToHex(h, s, Math.min(l + 20, 95)));
2899
+ root.style.setProperty("--accent-300", hslToHex(h, Math.min(s + 10, 100), Math.min(l + 30, 92)));
2900
+ root.style.setProperty("--accent-200", hslToHex(h, Math.min(s + 15, 100), Math.min(l + 38, 94)));
2901
+ root.style.setProperty("--accent-100", hslToHex(h, Math.min(s + 20, 100), Math.min(l + 42, 96)));
2902
+ root.style.setProperty("--accent-50", hslToHex(h, Math.min(s + 20, 100), Math.min(l + 46, 98)));
2903
+ } else {
2904
+ root.removeAttribute("data-custom-accent");
2905
+ ["--accent-600", "--accent-700", "--accent-500", "--accent-400", "--accent-300", "--accent-200", "--accent-100", "--accent-50"].forEach((p) => root.style.removeProperty(p));
2906
+ }
2907
+ }
2908
+ function applyCustomColors(accentColor, customBgColor, customTitleColor, customWindowColor, customButtonColor) {
2909
+ const root = document.documentElement;
2910
+ if (accentColor) {
2911
+ const hexToRgb = (hex) => {
2912
+ const r = parseInt(hex.slice(1, 3), 16);
2913
+ const g = parseInt(hex.slice(3, 5), 16);
2914
+ const b = parseInt(hex.slice(5, 7), 16);
2915
+ return `${r} ${g} ${b}`;
2916
+ };
2917
+ if (customBgColor) root.style.setProperty("--custom-bg-color", customBgColor);
2918
+ if (customTitleColor) {
2919
+ root.style.setProperty("--window-header-rgb", hexToRgb(customTitleColor));
2920
+ root.style.setProperty("--window-footer-rgb", hexToRgb(customTitleColor));
2921
+ }
2922
+ if (customWindowColor) root.style.setProperty("--window-content-rgb", hexToRgb(customWindowColor));
2923
+ if (customButtonColor) {
2924
+ root.style.setProperty("--custom-button-color", customButtonColor);
2925
+ const [h, s, l] = hexToHsl(customButtonColor);
2926
+ root.style.setProperty("--custom-button-hover", hslToHex(h, s, Math.max(l - 10, 5)));
2927
+ }
2928
+ } else {
2929
+ ["--custom-bg-color", "--custom-button-color", "--custom-button-hover"].forEach((p) => root.style.removeProperty(p));
2930
+ }
2931
+ }
2932
+ function applyThemePrefs(p) {
2933
+ document.documentElement.setAttribute("data-theme", resolveTheme(p.theme));
2934
+ applyAccent(p.accent_color ?? null);
2935
+ applyCustomColors(
2936
+ p.accent_color ?? null,
2937
+ p.custom_bg_color ?? null,
2938
+ p.custom_title_color ?? null,
2939
+ p.custom_window_color ?? null,
2940
+ p.custom_button_color ?? null
2941
+ );
2942
+ }
2885
2943
  function useTheme() {
2886
2944
  const { prefs } = useShellPrefs();
2887
2945
  const systemDark = useSyncExternalStore(subscribeMediaQuery, getSystemIsDark);
@@ -2897,46 +2955,10 @@ function useTheme() {
2897
2955
  return () => document.documentElement.removeAttribute("data-theme");
2898
2956
  }, [resolved]);
2899
2957
  useEffect(() => {
2900
- const root = document.documentElement;
2901
- if (accentColor && /^#[0-9a-fA-F]{6}$/.test(accentColor)) {
2902
- const [h, s, l] = hexToHsl(accentColor);
2903
- root.setAttribute("data-custom-accent", "true");
2904
- root.style.setProperty("--accent-600", accentColor);
2905
- root.style.setProperty("--accent-700", hslToHex(h, s, Math.max(l - 10, 5)));
2906
- root.style.setProperty("--accent-500", hslToHex(h, s, Math.min(l + 10, 95)));
2907
- root.style.setProperty("--accent-400", hslToHex(h, s, Math.min(l + 20, 95)));
2908
- root.style.setProperty("--accent-300", hslToHex(h, Math.min(s + 10, 100), Math.min(l + 30, 92)));
2909
- root.style.setProperty("--accent-200", hslToHex(h, Math.min(s + 15, 100), Math.min(l + 38, 94)));
2910
- root.style.setProperty("--accent-100", hslToHex(h, Math.min(s + 20, 100), Math.min(l + 42, 96)));
2911
- root.style.setProperty("--accent-50", hslToHex(h, Math.min(s + 20, 100), Math.min(l + 46, 98)));
2912
- } else {
2913
- root.removeAttribute("data-custom-accent");
2914
- ["--accent-600", "--accent-700", "--accent-500", "--accent-400", "--accent-300", "--accent-200", "--accent-100", "--accent-50"].forEach((p) => root.style.removeProperty(p));
2915
- }
2958
+ applyAccent(accentColor);
2916
2959
  }, [accentColor]);
2917
2960
  useEffect(() => {
2918
- const root = document.documentElement;
2919
- if (accentColor) {
2920
- const hexToRgb = (hex) => {
2921
- const r = parseInt(hex.slice(1, 3), 16);
2922
- const g = parseInt(hex.slice(3, 5), 16);
2923
- const b = parseInt(hex.slice(5, 7), 16);
2924
- return `${r} ${g} ${b}`;
2925
- };
2926
- if (customBgColor) root.style.setProperty("--custom-bg-color", customBgColor);
2927
- if (customTitleColor) {
2928
- root.style.setProperty("--window-header-rgb", hexToRgb(customTitleColor));
2929
- root.style.setProperty("--window-footer-rgb", hexToRgb(customTitleColor));
2930
- }
2931
- if (customWindowColor) root.style.setProperty("--window-content-rgb", hexToRgb(customWindowColor));
2932
- if (customButtonColor) {
2933
- root.style.setProperty("--custom-button-color", customButtonColor);
2934
- const [h, s, l] = hexToHsl(customButtonColor);
2935
- root.style.setProperty("--custom-button-hover", hslToHex(h, s, Math.max(l - 10, 5)));
2936
- }
2937
- } else {
2938
- ["--custom-bg-color", "--custom-button-color", "--custom-button-hover"].forEach((p) => root.style.removeProperty(p));
2939
- }
2961
+ applyCustomColors(accentColor, customBgColor, customTitleColor, customWindowColor, customButtonColor);
2940
2962
  }, [accentColor, customBgColor, customTitleColor, customWindowColor, customButtonColor]);
2941
2963
  return { theme: saved, resolved };
2942
2964
  }
@@ -4312,7 +4334,7 @@ function MobileBottomNav({
4312
4334
  }
4313
4335
  );
4314
4336
  }
4315
- var Sidebar = lazy(() => import('./Sidebar-BW7SYNBA.js'));
4337
+ var Sidebar = lazy(() => import('./Sidebar-PY762ANK.js'));
4316
4338
  function useFavorites(wallpapers) {
4317
4339
  const { prefs, save } = useShellPrefs();
4318
4340
  const favorites = prefs.favorite_pages || [];
@@ -4980,12 +5002,6 @@ var THEMES = [
4980
5002
  { key: "blue", label: "Ocean", bar1: "bg-[#bfdbfe]", bar2: "bg-[#bfdbfe]" }
4981
5003
  ];
4982
5004
  var DEFAULT_WALLPAPERS = [];
4983
- function resolveTheme(key) {
4984
- if (key === "system") {
4985
- return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
4986
- }
4987
- return key;
4988
- }
4989
5005
  function getVersion() {
4990
5006
  const now = /* @__PURE__ */ new Date();
4991
5007
  return `v${String(now.getDate()).padStart(2, "0")}${String(now.getMonth() + 1).padStart(2, "0")}.${String(now.getHours()).padStart(2, "0")}.${String(now.getMinutes()).padStart(2, "0")}.${now.getFullYear()}`;
@@ -5004,7 +5020,28 @@ function Customization({ omit, section } = {}) {
5004
5020
  const host = useDesktopHost();
5005
5021
  const WALLPAPERS = host.wallpapers && host.wallpapers.length > 0 ? host.wallpapers : DEFAULT_WALLPAPERS;
5006
5022
  const { prefs, save } = useShellPrefs();
5007
- const currentTheme = prefs.theme || "system";
5023
+ const [optimisticAppearance, setOptimisticAppearance] = useState({});
5024
+ const pref = (key) => key in optimisticAppearance ? optimisticAppearance[key] : prefs[key];
5025
+ useEffect(() => {
5026
+ setOptimisticAppearance((prev) => {
5027
+ const next = {};
5028
+ let settled = false;
5029
+ for (const k of Object.keys(prev)) {
5030
+ if (prefs[k] === prev[k]) settled = true;
5031
+ else next[k] = prev[k];
5032
+ }
5033
+ return settled ? next : prev;
5034
+ });
5035
+ }, [prefs]);
5036
+ const APPEARANCE_KEYS = ["theme", "accent_color", "custom_bg_color", "custom_title_color", "custom_window_color", "custom_button_color"];
5037
+ const setAppearance = (patch) => {
5038
+ const snapshot = { ...patch };
5039
+ for (const k of APPEARANCE_KEYS) if (!(k in snapshot)) snapshot[k] = pref(k);
5040
+ applyThemePrefs(snapshot);
5041
+ setOptimisticAppearance((prev) => ({ ...prev, ...patch }));
5042
+ save(patch);
5043
+ };
5044
+ const currentTheme = pref("theme") || "system";
5008
5045
  const resolved = resolveTheme(currentTheme);
5009
5046
  const rawBg = prefs.desktop_bg || (WALLPAPERS.length > 0 ? "random" : "none");
5010
5047
  const randomPickRef = useRef(WALLPAPERS.length > 0 ? WALLPAPERS[Math.floor(Math.random() * WALLPAPERS.length)].src : "none");
@@ -5084,7 +5121,7 @@ function Customization({ omit, section } = {}) {
5084
5121
  /* @__PURE__ */ jsx("div", { className: "flex gap-3 flex-wrap", children: [...THEMES, { key: "custom", label: "Custom", bar1: "bg-gray-200", bar2: "bg-gray-200" }].map((t) => {
5085
5122
  const isCustom2 = t.key === "custom";
5086
5123
  const r = isCustom2 ? "light" : resolveTheme(t.key);
5087
- const customColor = prefs.accent_color || "#8b5cf6";
5124
+ const customColor = pref("accent_color") || "#8b5cf6";
5088
5125
  const tAccent = isCustom2 ? "" : previewColor(r, "bg-[#2563eb]", "bg-[#3b82f6]", "bg-[#db2777]", "bg-[#16a34a]", "bg-[#374151]", "bg-[#1d4ed8]");
5089
5126
  const tBg = isCustom2 ? "bg-[#ffffff] border-[#d1d5db]" : previewColor(r, "bg-[#ffffff] border-[#d1d5db]", "bg-[#1e1e2e] border-[#45475a]", "bg-[#fdf2f8] border-[#f9a8d4]", "bg-[#f0fdf4] border-[#86efac]", "bg-[#e5e7eb] border-[#9ca3af]", "bg-[#eff6ff] border-[#93c5fd]");
5090
5127
  return /* @__PURE__ */ jsxs(
@@ -5092,14 +5129,12 @@ function Customization({ omit, section } = {}) {
5092
5129
  {
5093
5130
  onClick: () => {
5094
5131
  if (isCustom2) {
5095
- savePref("theme", "light");
5096
- if (!prefs.accent_color) savePref("accent_color", "#8b5cf6");
5132
+ setAppearance(pref("accent_color") ? { theme: "light" } : { theme: "light", accent_color: "#8b5cf6" });
5097
5133
  } else {
5098
- savePref("theme", t.key);
5099
- savePref("accent_color", null);
5134
+ setAppearance({ theme: t.key, accent_color: null });
5100
5135
  }
5101
5136
  },
5102
- className: `flex flex-col items-center gap-1.5 rounded-lg border-2 p-3 transition-all ${(isCustom2 ? !!prefs.accent_color : currentTheme === t.key && !prefs.accent_color) ? "border-blue-500 shadow-md" : "border-gray-200 hover:border-gray-300"}`,
5137
+ className: `flex flex-col items-center gap-1.5 rounded-lg border-2 p-3 transition-all ${(isCustom2 ? !!pref("accent_color") : currentTheme === t.key && !pref("accent_color")) ? "border-blue-500 shadow-md" : "border-gray-200 hover:border-gray-300"}`,
5103
5138
  children: [
5104
5139
  /* @__PURE__ */ jsx("div", { className: `w-20 h-14 rounded ${tBg} border overflow-hidden flex flex-col`, children: t.key === "system" ? /* @__PURE__ */ jsxs("div", { className: "flex-1 flex", children: [
5105
5140
  /* @__PURE__ */ jsxs("div", { className: "flex-1 flex flex-col bg-[#ffffff]", children: [
@@ -5138,13 +5173,13 @@ function Customization({ omit, section } = {}) {
5138
5173
  /* @__PURE__ */ jsx("div", { className: `h-1.5 rounded-sm w-1/2 ${t.bar2}` })
5139
5174
  ] }) })
5140
5175
  ] }) }),
5141
- /* @__PURE__ */ jsx("span", { className: `text-xs font-medium ${(isCustom2 ? !!prefs.accent_color : currentTheme === t.key && !prefs.accent_color) ? "text-blue-600" : "text-gray-600"}`, children: t.label })
5176
+ /* @__PURE__ */ jsx("span", { className: `text-xs font-medium ${(isCustom2 ? !!pref("accent_color") : currentTheme === t.key && !pref("accent_color")) ? "text-blue-600" : "text-gray-600"}`, children: t.label })
5142
5177
  ]
5143
5178
  },
5144
5179
  t.key
5145
5180
  );
5146
5181
  }) }),
5147
- prefs.accent_color && /* @__PURE__ */ jsx("div", { className: "mt-3 space-y-2", children: [
5182
+ pref("accent_color") && /* @__PURE__ */ jsx("div", { className: "mt-3 space-y-2", children: [
5148
5183
  { key: "custom_bg_color", label: "Background Color", defaultVal: "#f3f4f6" },
5149
5184
  { key: "custom_title_color", label: "Title Color", defaultVal: "#f9fafb" },
5150
5185
  { key: "custom_window_color", label: "Windows Background", defaultVal: "#ffffff" },
@@ -5156,19 +5191,19 @@ function Customization({ omit, section } = {}) {
5156
5191
  "label",
5157
5192
  {
5158
5193
  className: "w-8 h-8 rounded-lg border-2 border-gray-300 overflow-hidden cursor-pointer flex items-center justify-center shrink-0",
5159
- style: { backgroundColor: prefs[item.key] || item.defaultVal },
5194
+ style: { backgroundColor: pref(item.key) || item.defaultVal },
5160
5195
  children: /* @__PURE__ */ jsx(
5161
5196
  "input",
5162
5197
  {
5163
5198
  type: "color",
5164
- value: prefs[item.key] || item.defaultVal,
5165
- onChange: (e) => savePref(item.key, e.target.value),
5199
+ value: pref(item.key) || item.defaultVal,
5200
+ onChange: (e) => setAppearance({ [item.key]: e.target.value }),
5166
5201
  className: "opacity-0 absolute w-0 h-0"
5167
5202
  }
5168
5203
  )
5169
5204
  }
5170
5205
  ),
5171
- /* @__PURE__ */ jsx("span", { className: "text-xs text-gray-500 font-mono", children: prefs[item.key] || item.defaultVal })
5206
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-gray-500 font-mono", children: pref(item.key) || item.defaultVal })
5172
5207
  ] }, item.key)) })
5173
5208
  ] }),
5174
5209
  /* @__PURE__ */ jsxs("div", { children: [