react-os-shell 2.8.0 → 2.9.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.
- package/dist/{Browser-LVWMQSR3.js → Browser-MMVOWX6V.js} +4 -4
- package/dist/{Browser-LVWMQSR3.js.map → Browser-MMVOWX6V.js.map} +1 -1
- package/dist/{Documents-AEZKXAW3.js → Documents-YOILVZTR.js} +4 -4
- package/dist/{Documents-AEZKXAW3.js.map → Documents-YOILVZTR.js.map} +1 -1
- package/dist/Files-DQPXOF2C.js +13 -0
- package/dist/{Files-3WHYRZI6.js.map → Files-DQPXOF2C.js.map} +1 -1
- package/dist/ImageAnnotator-55NPWJ2R.js +4 -0
- package/dist/{ImageAnnotator-CTTMAY5Z.js.map → ImageAnnotator-55NPWJ2R.js.map} +1 -1
- package/dist/{Notepad-R2OY27CY.js → Notepad-VWPY5QBS.js} +4 -4
- package/dist/{Notepad-R2OY27CY.js.map → Notepad-VWPY5QBS.js.map} +1 -1
- package/dist/{PomodoroTimer-M7MDQTVN.js → PomodoroTimer-CDAJC2NX.js} +4 -4
- package/dist/{PomodoroTimer-M7MDQTVN.js.map → PomodoroTimer-CDAJC2NX.js.map} +1 -1
- package/dist/Preview-OZBOKT2W.js +9 -0
- package/dist/{Preview-F75CICNY.js.map → Preview-OZBOKT2W.js.map} +1 -1
- package/dist/{Spreadsheet-P4MBJWSH.js → Spreadsheet-SFWYWPGX.js} +4 -4
- package/dist/{Spreadsheet-P4MBJWSH.js.map → Spreadsheet-SFWYWPGX.js.map} +1 -1
- package/dist/apps/index.js +15 -15
- package/dist/{chunk-ZW2JB5CK.js → chunk-6EUBB5B5.js} +3 -3
- package/dist/{chunk-ZW2JB5CK.js.map → chunk-6EUBB5B5.js.map} +1 -1
- package/dist/{chunk-SAKVRVNB.js → chunk-6XRORZDB.js} +5 -5
- package/dist/{chunk-SAKVRVNB.js.map → chunk-6XRORZDB.js.map} +1 -1
- package/dist/{chunk-BLYEAKGC.js → chunk-EMVVW7CY.js} +5 -5
- package/dist/{chunk-BLYEAKGC.js.map → chunk-EMVVW7CY.js.map} +1 -1
- package/dist/{chunk-P75EON66.js → chunk-FIUUGSGJ.js} +3 -3
- package/dist/{chunk-P75EON66.js.map → chunk-FIUUGSGJ.js.map} +1 -1
- package/dist/{chunk-KUIPWCTJ.js → chunk-NUPYEVU4.js} +3 -3
- package/dist/{chunk-KUIPWCTJ.js.map → chunk-NUPYEVU4.js.map} +1 -1
- package/dist/{chunk-4YBNDCJV.js → chunk-UXJKPSLC.js} +5 -5
- package/dist/{chunk-4YBNDCJV.js.map → chunk-UXJKPSLC.js.map} +1 -1
- package/dist/{chunk-WIJ45SYD.js → chunk-VENYVK3L.js} +18 -10
- package/dist/chunk-VENYVK3L.js.map +1 -0
- package/dist/{chunk-XGWARUR7.js → chunk-Y4FCCBR7.js} +3 -3
- package/dist/{chunk-XGWARUR7.js.map → chunk-Y4FCCBR7.js.map} +1 -1
- package/dist/{chunk-KQBZLA6K.js → chunk-YUZRECE6.js} +3 -3
- package/dist/{chunk-KQBZLA6K.js.map → chunk-YUZRECE6.js.map} +1 -1
- package/dist/index.d.ts +12 -3
- package/dist/index.js +104 -69
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/Files-3WHYRZI6.js +0 -13
- package/dist/ImageAnnotator-CTTMAY5Z.js +0 -4
- package/dist/Preview-F75CICNY.js +0 -9
- package/dist/chunk-WIJ45SYD.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -436,10 +436,16 @@ declare const ALT_SHIFT_E: string;
|
|
|
436
436
|
declare const ALT_SHIFT_N: string;
|
|
437
437
|
|
|
438
438
|
/**
|
|
439
|
-
* Two
|
|
439
|
+
* Two presentations:
|
|
440
440
|
*
|
|
441
|
-
* 1. toast.success/error — operation feedback, top-center,
|
|
442
|
-
*
|
|
441
|
+
* 1. toast.success / error / info — brief operation feedback, top-center,
|
|
442
|
+
* auto-dismiss (success/error ~3s, info ~4.5s). The everyday "what just
|
|
443
|
+
* happened" feedback — most messages want this.
|
|
444
|
+
* 2. toast.notify — system notification, top-right card, stays 10s, dismissible.
|
|
445
|
+
* For an alert worth lingering on; reach for it deliberately, not by default.
|
|
446
|
+
*
|
|
447
|
+
* (Historically `toast.info` rendered the top-right notification card; it now
|
|
448
|
+
* renders a brief toast — that persistent card moved to `toast.notify`.)
|
|
443
449
|
*/
|
|
444
450
|
declare const toast: {
|
|
445
451
|
success: (message: string) => void;
|
|
@@ -447,6 +453,9 @@ declare const toast: {
|
|
|
447
453
|
info: (message: string, opts?: {
|
|
448
454
|
duration?: number;
|
|
449
455
|
}) => void;
|
|
456
|
+
notify: (message: string, opts?: {
|
|
457
|
+
duration?: number;
|
|
458
|
+
}) => void;
|
|
450
459
|
};
|
|
451
460
|
|
|
452
461
|
interface GridColumn {
|
package/dist/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { subscribePomo, getPomoSnapshot } from './chunk-
|
|
2
|
-
export { setShellTodoProvider } from './chunk-
|
|
3
|
-
import { PREVIEW_OPENED_EVENT, publishDesktopFolders, requestFilesTrashView, FolderGlyph, openPreviewFile, requestFilesDesktopFolderView, FileIconTile, hashGradient } from './chunk-
|
|
4
|
-
export { Breadcrumbs } from './chunk-
|
|
1
|
+
import { subscribePomo, getPomoSnapshot } from './chunk-FIUUGSGJ.js';
|
|
2
|
+
export { setShellTodoProvider } from './chunk-FIUUGSGJ.js';
|
|
3
|
+
import { PREVIEW_OPENED_EVENT, publishDesktopFolders, requestFilesTrashView, FolderGlyph, openPreviewFile, requestFilesDesktopFolderView, FileIconTile, hashGradient } from './chunk-EMVVW7CY.js';
|
|
4
|
+
export { Breadcrumbs } from './chunk-EMVVW7CY.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-
|
|
9
|
-
import './chunk-
|
|
10
|
-
import { toast_default } from './chunk-
|
|
11
|
-
export { toast_default as toast } from './chunk-
|
|
12
|
-
export { EditableGrid } from './chunk-
|
|
13
|
-
import { APP_VERSION } from './chunk-
|
|
14
|
-
export { VERSION } from './chunk-
|
|
8
|
+
import { setPdfPreview } from './chunk-UXJKPSLC.js';
|
|
9
|
+
import './chunk-NUPYEVU4.js';
|
|
10
|
+
import { toast_default } from './chunk-VENYVK3L.js';
|
|
11
|
+
export { toast_default as toast } from './chunk-VENYVK3L.js';
|
|
12
|
+
export { EditableGrid } from './chunk-YUZRECE6.js';
|
|
13
|
+
import { APP_VERSION } from './chunk-Y4FCCBR7.js';
|
|
14
|
+
export { VERSION } from './chunk-Y4FCCBR7.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';
|
|
@@ -1221,7 +1221,7 @@ function BugReportProvider({ children }) {
|
|
|
1221
1221
|
)
|
|
1222
1222
|
] });
|
|
1223
1223
|
}
|
|
1224
|
-
var LazyImageAnnotator = lazy(() => import('./ImageAnnotator-
|
|
1224
|
+
var LazyImageAnnotator = lazy(() => import('./ImageAnnotator-55NPWJ2R.js'));
|
|
1225
1225
|
function UploadDropZone({ onSelect }) {
|
|
1226
1226
|
const inputRef = useRef(null);
|
|
1227
1227
|
const [hover, setHover] = useState(false);
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
}
|
|
@@ -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
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
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 ? !!
|
|
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 ? !!
|
|
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
|
-
|
|
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:
|
|
5194
|
+
style: { backgroundColor: pref(item.key) || item.defaultVal },
|
|
5160
5195
|
children: /* @__PURE__ */ jsx(
|
|
5161
5196
|
"input",
|
|
5162
5197
|
{
|
|
5163
5198
|
type: "color",
|
|
5164
|
-
value:
|
|
5165
|
-
onChange: (e) =>
|
|
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:
|
|
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: [
|