react-os-shell 0.3.22 → 0.4.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/index.d.ts +74 -2
- package/dist/index.js +206 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -735,7 +735,79 @@ interface StartMenuProps {
|
|
|
735
735
|
}
|
|
736
736
|
declare function StartMenu({ open, onClose, openPage, profile, user, onLogout, taskbarPosition, taskbarH, taskbarW, size, navSections, navIcons, sectionIcons, categories, }: StartMenuProps): react_jsx_runtime.JSX.Element | null;
|
|
737
737
|
|
|
738
|
-
|
|
738
|
+
/** Sections that can be omitted from the inline Customization page when the
|
|
739
|
+
* consumer renders them elsewhere (e.g. as separate entries in SystemPreferences). */
|
|
740
|
+
type CustomizationOmitSection = 'behavior' | 'desktop';
|
|
741
|
+
interface CustomizationProps {
|
|
742
|
+
omit?: readonly CustomizationOmitSection[];
|
|
743
|
+
}
|
|
744
|
+
declare function Customization({ omit }?: CustomizationProps): react_jsx_runtime.JSX.Element;
|
|
745
|
+
|
|
746
|
+
/**
|
|
747
|
+
* Standalone Behavior settings panel — window position, double-click,
|
|
748
|
+
* default window size, plus the two desktop-related toggles
|
|
749
|
+
* (Show version on desktop, Enter full screen mode automatically).
|
|
750
|
+
*
|
|
751
|
+
* Reads/writes shell prefs via `useShellPrefs()`. Suitable for use as a
|
|
752
|
+
* section in `SystemPreferences` or rendered standalone.
|
|
753
|
+
*/
|
|
754
|
+
declare function BehaviorPanel(): react_jsx_runtime.JSX.Element;
|
|
755
|
+
|
|
756
|
+
/**
|
|
757
|
+
* Standalone Sounds settings panel — sound effects toggle + per-event
|
|
758
|
+
* sound-pack picker. Reads/writes the shell's `erp_sounds` and
|
|
759
|
+
* `erp_sound_config` localStorage keys. Plays a preview when a pack is
|
|
760
|
+
* picked. Suitable as a section in `SystemPreferences` or rendered
|
|
761
|
+
* standalone.
|
|
762
|
+
*/
|
|
763
|
+
declare function SoundsPanel(): react_jsx_runtime.JSX.Element;
|
|
764
|
+
|
|
765
|
+
/** One section in the SystemPreferences sidebar. */
|
|
766
|
+
interface SystemPreferencesSection {
|
|
767
|
+
/** Unique key, e.g. `'notifications'`, `'customization'`. */
|
|
768
|
+
key: string;
|
|
769
|
+
/** Sidebar label, e.g. "Notifications". */
|
|
770
|
+
label: string;
|
|
771
|
+
/** Short description shown under the label in the sidebar. */
|
|
772
|
+
description?: string;
|
|
773
|
+
/** Sidebar icon (any ReactNode — typically a 4×4 svg). */
|
|
774
|
+
icon?: ReactNode;
|
|
775
|
+
/** Body renderer. Receives no args; access shell prefs via your own hook. */
|
|
776
|
+
render: () => ReactNode;
|
|
777
|
+
}
|
|
778
|
+
interface SystemPreferencesProps {
|
|
779
|
+
/** Ordered sections — left sidebar lists these top-to-bottom, the matching
|
|
780
|
+
* body renders on the right. The first section is selected by default
|
|
781
|
+
* unless `defaultSelected` is supplied. */
|
|
782
|
+
sections: readonly SystemPreferencesSection[];
|
|
783
|
+
/** Key of the section to highlight on first render. Falls back to the first
|
|
784
|
+
* section in `sections`. */
|
|
785
|
+
defaultSelected?: string;
|
|
786
|
+
/** Optional className applied to the outer flex container. */
|
|
787
|
+
className?: string;
|
|
788
|
+
}
|
|
789
|
+
/**
|
|
790
|
+
* Two-pane settings window: a fixed sidebar of sections on the left, the
|
|
791
|
+
* active section's body on the right. Consumers compose by passing
|
|
792
|
+
* `sections` — each entry has a `key`, `label`, optional `icon` and
|
|
793
|
+
* `description`, and a `render()` callback that returns the body JSX.
|
|
794
|
+
*
|
|
795
|
+
* The shell exposes ready-made panels (`Customization`, `BehaviorPanel`,
|
|
796
|
+
* `SoundsPanel`) that can be used as section bodies directly; portals
|
|
797
|
+
* add their own sections (notification subscriptions, delivery defaults,
|
|
798
|
+
* personal formatting prefs, etc.) alongside.
|
|
799
|
+
*
|
|
800
|
+
* Example:
|
|
801
|
+
* ```tsx
|
|
802
|
+
* <SystemPreferences sections={[
|
|
803
|
+
* { key: 'notifications', label: 'Notifications', icon: <BellIcon />, render: () => <MyNotifications /> },
|
|
804
|
+
* { key: 'customization', label: 'Customization', icon: <PaintBrushIcon />, render: () => <Customization omit={['behavior','desktop']} /> },
|
|
805
|
+
* { key: 'behavior', label: 'Behavior', icon: <Cog6ToothIcon />, render: () => <BehaviorPanel /> },
|
|
806
|
+
* { key: 'sounds', label: 'Sounds', icon: <SpeakerWaveIcon />, render: () => <SoundsPanel /> },
|
|
807
|
+
* ]} />
|
|
808
|
+
* ```
|
|
809
|
+
*/
|
|
810
|
+
declare function SystemPreferences({ sections, defaultSelected, className, }: SystemPreferencesProps): react_jsx_runtime.JSX.Element;
|
|
739
811
|
|
|
740
812
|
interface EntityListColumn {
|
|
741
813
|
key: string;
|
|
@@ -1130,4 +1202,4 @@ declare function useNewHotkey(callback: () => void): void;
|
|
|
1130
1202
|
*/
|
|
1131
1203
|
declare function useEditHotkey(callback: (() => void) | null): void;
|
|
1132
1204
|
|
|
1133
|
-
export { ALT, ALT_SHIFT_D, ALT_SHIFT_E, ALT_SHIFT_N, type BugReport, type BugReportConfig, BugReportConfigProvider, BugReportDetail, type BugReportExtraField, type BugReportExtraSelectField, BugReportProvider, type BugReportSubmission, type BugReportSubmitPayload, CMD_A, CMD_DOT, CMD_ENTER, CMD_K, CMD_S, CancelButton, type CellStyle, type ChangelogEntry, type ColumnDef, ConfirmProvider, CopyButton, Customization, Desktop, type DesktopHostConfig, DesktopHostProvider, DocFavStar, ENTER, EditableGrid, type EditableGridProps, type EntityFetcher, EntityList, type EntityListColumn, type EntityListProps, GLASS_DIVIDER, GLASS_INPUT_BG, GlobalSearch, type GridColumn, Layout, type LayoutProps, ListFooter, type LoginPayload, MOD, type MailCapabilities, MailConnectModal, type MailUser, Modal, ModalActions, NotificationBell, type NotificationsConfig, type PaginatedResponse, PopupMenu, PopupMenuDivider, PopupMenuItem, PopupMenuLabel, type ReportType, ResizableTable, SHIFT, type SearchConfig, type SearchProvider, type SearchResult, type SemanticGroup, type ShellAuth, ShellAuthProvider, ShellEntityFetcherProvider, type ShellNotification, type ShellPrefsAdapter, ShellPrefsProvider, ShortcutHelp, type SortState, StartMenu, StatusBadge, StatusBadgeProvider, type StickyEntityRef, type StickyResolver, VERSION, WindowManagerProvider, WindowRegistry, WindowTitle, commitExposeHighlight, confirm, confirmDestructive, createWindowRegistry, exitExposeMode, formatDate, getActiveWindowRoute, getExposeHighlight, glassStyle, isMac, openBugReportDialog, prompt, reportBug, setExposeHighlight, setShellApiClient, setShellAuthBridge, setShellMailServer, setShellNavIcons, setWindowDefaultPosition, subscribeExposeHighlight, toast, toggleExposeMode, useBugReport, useClickOutside, useColumnConfig, useDesktopHost, useEditHotkey, useInfiniteScroll, useLocalStoragePrefs, useMailAuth, useModalActive, useNewHotkey, useShellAuth, useShellEntityFetcher, useShellPrefs, useSort, useTableNav, useWidgetSettings, useWindowManager, useWindowMenuItem, useWindowTitle };
|
|
1205
|
+
export { ALT, ALT_SHIFT_D, ALT_SHIFT_E, ALT_SHIFT_N, BehaviorPanel, type BugReport, type BugReportConfig, BugReportConfigProvider, BugReportDetail, type BugReportExtraField, type BugReportExtraSelectField, BugReportProvider, type BugReportSubmission, type BugReportSubmitPayload, CMD_A, CMD_DOT, CMD_ENTER, CMD_K, CMD_S, CancelButton, type CellStyle, type ChangelogEntry, type ColumnDef, ConfirmProvider, CopyButton, Customization, type CustomizationOmitSection, type CustomizationProps, Desktop, type DesktopHostConfig, DesktopHostProvider, DocFavStar, ENTER, EditableGrid, type EditableGridProps, type EntityFetcher, EntityList, type EntityListColumn, type EntityListProps, GLASS_DIVIDER, GLASS_INPUT_BG, GlobalSearch, type GridColumn, Layout, type LayoutProps, ListFooter, type LoginPayload, MOD, type MailCapabilities, MailConnectModal, type MailUser, Modal, ModalActions, NotificationBell, type NotificationsConfig, type PaginatedResponse, PopupMenu, PopupMenuDivider, PopupMenuItem, PopupMenuLabel, type ReportType, ResizableTable, SHIFT, type SearchConfig, type SearchProvider, type SearchResult, type SemanticGroup, type ShellAuth, ShellAuthProvider, ShellEntityFetcherProvider, type ShellNotification, type ShellPrefsAdapter, ShellPrefsProvider, ShortcutHelp, type SortState, SoundsPanel, StartMenu, StatusBadge, StatusBadgeProvider, type StickyEntityRef, type StickyResolver, SystemPreferences, type SystemPreferencesProps, type SystemPreferencesSection, VERSION, WindowManagerProvider, WindowRegistry, WindowTitle, commitExposeHighlight, confirm, confirmDestructive, createWindowRegistry, exitExposeMode, formatDate, getActiveWindowRoute, getExposeHighlight, glassStyle, isMac, openBugReportDialog, prompt, reportBug, setExposeHighlight, setShellApiClient, setShellAuthBridge, setShellMailServer, setShellNavIcons, setWindowDefaultPosition, subscribeExposeHighlight, toast, toggleExposeMode, useBugReport, useClickOutside, useColumnConfig, useDesktopHost, useEditHotkey, useInfiniteScroll, useLocalStoragePrefs, useMailAuth, useModalActive, useNewHotkey, useShellAuth, useShellEntityFetcher, useShellPrefs, useSort, useTableNav, useWidgetSettings, useWindowManager, useWindowMenuItem, useWindowTitle };
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { subscribePomo, getPomoSnapshot } from './chunk-MK3HLUO4.js';
|
|
|
7
7
|
import { useShellPrefs } from './chunk-36VM54SC.js';
|
|
8
8
|
export { ShellPrefsProvider, useLocalStoragePrefs, useShellPrefs } from './chunk-36VM54SC.js';
|
|
9
9
|
import { PREVIEW_OPENED_EVENT, openPreviewFile } from './chunk-LZCEK7JF.js';
|
|
10
|
-
import { playNotification, playStartup, soundsEnabled, getSoundConfig, SOUND_PACK_KEYS, SOUND_PACKS, SOUND_TYPES, SOUND_TYPE_LABELS,
|
|
10
|
+
import { playNotification, playStartup, soundsEnabled, getSoundConfig, SOUND_PACK_KEYS, SOUND_PACKS, SOUND_TYPES, SOUND_TYPE_LABELS, setSoundForType, previewSound, setAllSounds, playLogout } from './chunk-D7PYW2QS.js';
|
|
11
11
|
import { setPdfPreview } from './chunk-NRT2CU5Q.js';
|
|
12
12
|
import './chunk-KUIPWCTJ.js';
|
|
13
13
|
import { toast_default } from './chunk-WIJ45SYD.js';
|
|
@@ -915,7 +915,7 @@ function StatusBadge({ status }) {
|
|
|
915
915
|
}
|
|
916
916
|
|
|
917
917
|
// src/version.ts
|
|
918
|
-
var VERSION = "0.
|
|
918
|
+
var VERSION = "0.4.0" ;
|
|
919
919
|
var APP_VERSION = VERSION;
|
|
920
920
|
|
|
921
921
|
// src/changelog.ts
|
|
@@ -4614,7 +4614,8 @@ function previewColor(resolved, light, dark, pink, green, grey, blue) {
|
|
|
4614
4614
|
if (resolved === "blue") return blue ?? light;
|
|
4615
4615
|
return light;
|
|
4616
4616
|
}
|
|
4617
|
-
function Customization() {
|
|
4617
|
+
function Customization({ omit } = {}) {
|
|
4618
|
+
const omitSet = new Set(omit ?? []);
|
|
4618
4619
|
const host = useDesktopHost();
|
|
4619
4620
|
const WALLPAPERS = host.wallpapers && host.wallpapers.length > 0 ? host.wallpapers : DEFAULT_WALLPAPERS;
|
|
4620
4621
|
const { prefs, save } = useShellPrefs();
|
|
@@ -4951,7 +4952,7 @@ function Customization() {
|
|
|
4951
4952
|
] })
|
|
4952
4953
|
] })
|
|
4953
4954
|
] }),
|
|
4954
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
4955
|
+
!omitSet.has("behavior") && /* @__PURE__ */ jsxs("div", { children: [
|
|
4955
4956
|
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold text-gray-900 mb-3", children: "Behavior" }),
|
|
4956
4957
|
/* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
4957
4958
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
@@ -5003,7 +5004,7 @@ function Customization() {
|
|
|
5003
5004
|
] })
|
|
5004
5005
|
] })
|
|
5005
5006
|
] }),
|
|
5006
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
5007
|
+
!omitSet.has("desktop") && /* @__PURE__ */ jsxs("div", { children: [
|
|
5007
5008
|
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold text-gray-900 mb-3", children: "Desktop" }),
|
|
5008
5009
|
/* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [
|
|
5009
5010
|
/* @__PURE__ */ jsx(
|
|
@@ -5083,6 +5084,205 @@ function SoundSettings() {
|
|
|
5083
5084
|
] }) }) })
|
|
5084
5085
|
] });
|
|
5085
5086
|
}
|
|
5087
|
+
var WINDOW_POSITIONS = [
|
|
5088
|
+
{ key: "center", label: "Center" },
|
|
5089
|
+
{ key: "cascade", label: "Cascade" }
|
|
5090
|
+
];
|
|
5091
|
+
var DESKTOP_DBLCLICK = [
|
|
5092
|
+
{ key: "deactivate", label: "Deactivate all" },
|
|
5093
|
+
{ key: "nothing", label: "Do nothing" }
|
|
5094
|
+
];
|
|
5095
|
+
var WINDOW_SIZES = [
|
|
5096
|
+
{ key: "small", label: "Small" },
|
|
5097
|
+
{ key: "medium", label: "Medium" },
|
|
5098
|
+
{ key: "large", label: "Large" },
|
|
5099
|
+
{ key: "maximized", label: "Maximized" }
|
|
5100
|
+
];
|
|
5101
|
+
function BehaviorPanel() {
|
|
5102
|
+
const { prefs, save } = useShellPrefs();
|
|
5103
|
+
const savePref = (key, value) => save({ [key]: value });
|
|
5104
|
+
const windowPosition = prefs.window_position || "cascade";
|
|
5105
|
+
const desktopDblclick = prefs.desktop_dblclick || "deactivate";
|
|
5106
|
+
const defaultWindowSize = prefs.default_window_size || "large";
|
|
5107
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
5108
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
5109
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold text-gray-900 mb-3", children: "Behavior" }),
|
|
5110
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
5111
|
+
/* @__PURE__ */ jsx(
|
|
5112
|
+
Row,
|
|
5113
|
+
{
|
|
5114
|
+
label: "New window position",
|
|
5115
|
+
options: WINDOW_POSITIONS,
|
|
5116
|
+
value: windowPosition,
|
|
5117
|
+
onChange: (v) => savePref("window_position", v)
|
|
5118
|
+
}
|
|
5119
|
+
),
|
|
5120
|
+
/* @__PURE__ */ jsx(
|
|
5121
|
+
Row,
|
|
5122
|
+
{
|
|
5123
|
+
label: "Double-click desktop",
|
|
5124
|
+
options: DESKTOP_DBLCLICK,
|
|
5125
|
+
value: desktopDblclick,
|
|
5126
|
+
onChange: (v) => savePref("desktop_dblclick", v)
|
|
5127
|
+
}
|
|
5128
|
+
),
|
|
5129
|
+
/* @__PURE__ */ jsx(
|
|
5130
|
+
Row,
|
|
5131
|
+
{
|
|
5132
|
+
label: "Default window size",
|
|
5133
|
+
options: WINDOW_SIZES,
|
|
5134
|
+
value: defaultWindowSize,
|
|
5135
|
+
onChange: (v) => savePref("default_window_size", v)
|
|
5136
|
+
}
|
|
5137
|
+
)
|
|
5138
|
+
] })
|
|
5139
|
+
] }),
|
|
5140
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
5141
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold text-gray-900 mb-3", children: "Desktop" }),
|
|
5142
|
+
/* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [
|
|
5143
|
+
/* @__PURE__ */ jsx(
|
|
5144
|
+
"input",
|
|
5145
|
+
{
|
|
5146
|
+
type: "checkbox",
|
|
5147
|
+
checked: prefs.show_desktop_version ?? true,
|
|
5148
|
+
onChange: (e) => savePref("show_desktop_version", e.target.checked),
|
|
5149
|
+
className: "h-4 w-4 rounded border-gray-300 text-blue-600"
|
|
5150
|
+
}
|
|
5151
|
+
),
|
|
5152
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm text-gray-700", children: "Show version on desktop" })
|
|
5153
|
+
] }),
|
|
5154
|
+
/* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2 cursor-pointer mt-2", children: [
|
|
5155
|
+
/* @__PURE__ */ jsx(
|
|
5156
|
+
"input",
|
|
5157
|
+
{
|
|
5158
|
+
type: "checkbox",
|
|
5159
|
+
checked: prefs.auto_fullscreen ?? false,
|
|
5160
|
+
onChange: (e) => savePref("auto_fullscreen", e.target.checked),
|
|
5161
|
+
className: "h-4 w-4 rounded border-gray-300 text-blue-600"
|
|
5162
|
+
}
|
|
5163
|
+
),
|
|
5164
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm text-gray-700", children: "Enter full screen mode automatically" }),
|
|
5165
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-gray-400 ml-1", children: "\u2014 on login" })
|
|
5166
|
+
] })
|
|
5167
|
+
] }),
|
|
5168
|
+
/* @__PURE__ */ jsx(ModalActions, { children: /* @__PURE__ */ jsx("span", { className: "text-xs text-gray-400", children: "Changes are saved automatically" }) })
|
|
5169
|
+
] });
|
|
5170
|
+
}
|
|
5171
|
+
function Row({
|
|
5172
|
+
label,
|
|
5173
|
+
options,
|
|
5174
|
+
value,
|
|
5175
|
+
onChange
|
|
5176
|
+
}) {
|
|
5177
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
5178
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm text-gray-700 w-40 shrink-0", children: label }),
|
|
5179
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-2", children: options.map((o) => /* @__PURE__ */ jsx(
|
|
5180
|
+
"button",
|
|
5181
|
+
{
|
|
5182
|
+
type: "button",
|
|
5183
|
+
onClick: () => onChange(o.key),
|
|
5184
|
+
className: `px-3 py-1.5 text-xs font-medium rounded-lg border transition-colors ${value === o.key ? "bg-blue-600 text-white border-blue-600" : "bg-white text-gray-700 border-gray-300 hover:bg-gray-50"}`,
|
|
5185
|
+
children: o.label
|
|
5186
|
+
},
|
|
5187
|
+
o.key
|
|
5188
|
+
)) })
|
|
5189
|
+
] });
|
|
5190
|
+
}
|
|
5191
|
+
function SoundsPanel() {
|
|
5192
|
+
const [enabled, setEnabled] = useState(soundsEnabled());
|
|
5193
|
+
const [config, setConfig] = useState(getSoundConfig());
|
|
5194
|
+
const update = (soundType, packKey) => {
|
|
5195
|
+
setSoundForType(soundType, packKey);
|
|
5196
|
+
setConfig(getSoundConfig());
|
|
5197
|
+
previewSound(packKey, soundType);
|
|
5198
|
+
};
|
|
5199
|
+
const applyAll = (packKey) => {
|
|
5200
|
+
setAllSounds(packKey);
|
|
5201
|
+
setConfig(getSoundConfig());
|
|
5202
|
+
previewSound(packKey, "success");
|
|
5203
|
+
};
|
|
5204
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
5205
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold text-gray-900", children: "Sounds" }),
|
|
5206
|
+
/* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [
|
|
5207
|
+
/* @__PURE__ */ jsx(
|
|
5208
|
+
"input",
|
|
5209
|
+
{
|
|
5210
|
+
type: "checkbox",
|
|
5211
|
+
checked: enabled,
|
|
5212
|
+
onChange: (e) => {
|
|
5213
|
+
localStorage.setItem("erp_sounds", String(e.target.checked));
|
|
5214
|
+
setEnabled(e.target.checked);
|
|
5215
|
+
},
|
|
5216
|
+
className: "h-4 w-4 rounded border-gray-300 text-blue-600"
|
|
5217
|
+
}
|
|
5218
|
+
),
|
|
5219
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm text-gray-700", children: "Sound effects" })
|
|
5220
|
+
] }),
|
|
5221
|
+
enabled && /* @__PURE__ */ jsx("div", { className: "border border-gray-200 rounded-lg overflow-hidden", children: /* @__PURE__ */ jsxs("table", { className: "w-full text-[11px]", children: [
|
|
5222
|
+
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { className: "bg-gray-50", children: [
|
|
5223
|
+
/* @__PURE__ */ jsx("th", { className: "px-2 py-1.5 text-left font-medium text-gray-500 w-24" }),
|
|
5224
|
+
SOUND_PACK_KEYS.map((key) => /* @__PURE__ */ jsx("th", { className: "px-1 py-1.5 text-center", children: /* @__PURE__ */ jsx(
|
|
5225
|
+
"button",
|
|
5226
|
+
{
|
|
5227
|
+
onClick: () => applyAll(key),
|
|
5228
|
+
className: "font-medium text-gray-500 hover:text-blue-600 transition-colors",
|
|
5229
|
+
children: SOUND_PACKS[key].label
|
|
5230
|
+
}
|
|
5231
|
+
) }, key))
|
|
5232
|
+
] }) }),
|
|
5233
|
+
/* @__PURE__ */ jsx("tbody", { className: "divide-y divide-gray-100", children: SOUND_TYPES.map((soundType) => /* @__PURE__ */ jsxs("tr", { children: [
|
|
5234
|
+
/* @__PURE__ */ jsx("td", { className: "px-2 py-1.5 text-gray-700 font-medium", children: SOUND_TYPE_LABELS[soundType] }),
|
|
5235
|
+
SOUND_PACK_KEYS.map((packKey) => /* @__PURE__ */ jsx("td", { className: "px-1 py-1.5 text-center", children: /* @__PURE__ */ jsx(
|
|
5236
|
+
"button",
|
|
5237
|
+
{
|
|
5238
|
+
onClick: () => update(soundType, packKey),
|
|
5239
|
+
"aria-label": `${SOUND_TYPE_LABELS[soundType]} \u2014 ${SOUND_PACKS[packKey].label}`,
|
|
5240
|
+
"aria-pressed": config[soundType] === packKey,
|
|
5241
|
+
className: `w-4 h-4 rounded-full border-2 transition-colors ${config[soundType] === packKey ? "bg-blue-600 border-blue-600" : "border-gray-300 hover:border-blue-400"}`
|
|
5242
|
+
}
|
|
5243
|
+
) }, packKey))
|
|
5244
|
+
] }, soundType)) })
|
|
5245
|
+
] }) }),
|
|
5246
|
+
/* @__PURE__ */ jsx(ModalActions, { children: /* @__PURE__ */ jsx("span", { className: "text-xs text-gray-400", children: "Changes are saved automatically" }) })
|
|
5247
|
+
] });
|
|
5248
|
+
}
|
|
5249
|
+
function SystemPreferences({
|
|
5250
|
+
sections: sections2,
|
|
5251
|
+
defaultSelected,
|
|
5252
|
+
className
|
|
5253
|
+
}) {
|
|
5254
|
+
const initial = defaultSelected && sections2.some((s) => s.key === defaultSelected) ? defaultSelected : sections2[0]?.key ?? "";
|
|
5255
|
+
const [selected, setSelected] = useState(initial);
|
|
5256
|
+
const active = sections2.find((s) => s.key === selected) ?? sections2[0];
|
|
5257
|
+
return /* @__PURE__ */ jsxs("div", { className: `flex h-full gap-4 px-4 py-3 min-h-0 ${className ?? ""}`.trim(), children: [
|
|
5258
|
+
/* @__PURE__ */ jsx("aside", { className: "w-60 shrink-0 flex flex-col bg-white rounded-lg shadow overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto py-1", children: sections2.map((item) => {
|
|
5259
|
+
const isActive = item.key === selected;
|
|
5260
|
+
return /* @__PURE__ */ jsxs(
|
|
5261
|
+
"button",
|
|
5262
|
+
{
|
|
5263
|
+
type: "button",
|
|
5264
|
+
onClick: () => setSelected(item.key),
|
|
5265
|
+
className: `w-full text-left px-3 py-2.5 text-sm transition-colors flex items-start gap-2.5 ${isActive ? "bg-blue-50 text-blue-700" : "hover:bg-gray-50 text-gray-700"}`,
|
|
5266
|
+
children: [
|
|
5267
|
+
item.icon && /* @__PURE__ */ jsx("span", { className: `mt-0.5 ${isActive ? "text-blue-600" : "text-gray-400"}`, children: item.icon }),
|
|
5268
|
+
/* @__PURE__ */ jsxs("span", { className: "min-w-0", children: [
|
|
5269
|
+
/* @__PURE__ */ jsx(
|
|
5270
|
+
"span",
|
|
5271
|
+
{
|
|
5272
|
+
className: `block ${isActive ? "font-semibold text-blue-700" : "font-medium text-gray-800"}`,
|
|
5273
|
+
children: item.label
|
|
5274
|
+
}
|
|
5275
|
+
),
|
|
5276
|
+
item.description && /* @__PURE__ */ jsx("span", { className: "block text-[11px] text-gray-500 mt-0.5", children: item.description })
|
|
5277
|
+
] })
|
|
5278
|
+
]
|
|
5279
|
+
},
|
|
5280
|
+
item.key
|
|
5281
|
+
);
|
|
5282
|
+
}) }) }),
|
|
5283
|
+
/* @__PURE__ */ jsx("main", { className: "flex-1 min-w-0 flex flex-col min-h-0 overflow-auto pr-2", children: active?.render() })
|
|
5284
|
+
] });
|
|
5285
|
+
}
|
|
5086
5286
|
function useTableNav(items, onSelect, onToggle, onSelectAll, onSelectRange) {
|
|
5087
5287
|
const [focusIdx, setFocusIdx] = useState(-1);
|
|
5088
5288
|
const itemsRef = useRef(items);
|
|
@@ -5799,6 +5999,6 @@ function useEditHotkey(callback) {
|
|
|
5799
5999
|
}, [callback, isActive]);
|
|
5800
6000
|
}
|
|
5801
6001
|
|
|
5802
|
-
export { ALT, ALT_SHIFT_D, ALT_SHIFT_E, ALT_SHIFT_N, BugReportConfigProvider, BugReportDetail, BugReportProvider, CMD_A, CMD_DOT, CMD_ENTER, CMD_K, CMD_S, Customization, Desktop, DesktopHostProvider, ENTER, EntityList, GlobalSearch, Layout, ListFooter, MOD, MailConnectModal, NotificationBell, ResizableTable, SHIFT, ShellEntityFetcherProvider, ShortcutHelp, StartMenu, StatusBadge, StatusBadgeProvider, VERSION, createWindowRegistry, isMac, openBugReportDialog, reportBug, useBugReport, useClickOutside, useColumnConfig, useDesktopHost, useEditHotkey, useInfiniteScroll, useNewHotkey, useShellEntityFetcher, useSort, useTableNav };
|
|
6002
|
+
export { ALT, ALT_SHIFT_D, ALT_SHIFT_E, ALT_SHIFT_N, BehaviorPanel, BugReportConfigProvider, BugReportDetail, BugReportProvider, CMD_A, CMD_DOT, CMD_ENTER, CMD_K, CMD_S, Customization, Desktop, DesktopHostProvider, ENTER, EntityList, GlobalSearch, Layout, ListFooter, MOD, MailConnectModal, NotificationBell, ResizableTable, SHIFT, ShellEntityFetcherProvider, ShortcutHelp, SoundsPanel, StartMenu, StatusBadge, StatusBadgeProvider, SystemPreferences, VERSION, createWindowRegistry, isMac, openBugReportDialog, reportBug, useBugReport, useClickOutside, useColumnConfig, useDesktopHost, useEditHotkey, useInfiniteScroll, useNewHotkey, useShellEntityFetcher, useSort, useTableNav };
|
|
5803
6003
|
//# sourceMappingURL=index.js.map
|
|
5804
6004
|
//# sourceMappingURL=index.js.map
|