react-os-shell 0.3.10 → 0.3.11
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 +14 -1
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -948,6 +948,19 @@ declare function useInfiniteScroll<T>({ queryKey, fetchFn, extraParams, pageSize
|
|
|
948
948
|
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<_tanstack_query_core.InfiniteData<PaginatedResponse<T>, unknown>, Error>>;
|
|
949
949
|
};
|
|
950
950
|
|
|
951
|
+
/**
|
|
952
|
+
* Tiny sort-state hook used by list pages. Returns:
|
|
953
|
+
* - `sort` — current `{ field, direction }`
|
|
954
|
+
* - `onSort(field)` — toggle direction if same field, else activate asc
|
|
955
|
+
* - `ordering` — DRF-style string (`'-mid'` for desc, `'mid'` for asc) ready
|
|
956
|
+
* to drop into a query-string param.
|
|
957
|
+
*/
|
|
958
|
+
declare function useSort(defaultField: string, defaultDir?: 'asc' | 'desc'): {
|
|
959
|
+
sort: SortState;
|
|
960
|
+
onSort: (field: string) => void;
|
|
961
|
+
ordering: string;
|
|
962
|
+
};
|
|
963
|
+
|
|
951
964
|
/** Package version, injected by tsup at build time. Stays as an empty
|
|
952
965
|
* string when the source is consumed without a build (e.g. tests). */
|
|
953
966
|
declare const VERSION: string;
|
|
@@ -1117,4 +1130,4 @@ declare function useNewHotkey(callback: () => void): void;
|
|
|
1117
1130
|
*/
|
|
1118
1131
|
declare function useEditHotkey(callback: (() => void) | null): void;
|
|
1119
1132
|
|
|
1120
|
-
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, useTableNav, useWidgetSettings, useWindowManager, useWindowMenuItem, useWindowTitle };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -915,7 +915,7 @@ function StatusBadge({ status }) {
|
|
|
915
915
|
}
|
|
916
916
|
|
|
917
917
|
// src/version.ts
|
|
918
|
-
var VERSION = "0.3.
|
|
918
|
+
var VERSION = "0.3.11" ;
|
|
919
919
|
var APP_VERSION = VERSION;
|
|
920
920
|
|
|
921
921
|
// src/changelog.ts
|
|
@@ -5743,6 +5743,16 @@ function useInfiniteScroll({
|
|
|
5743
5743
|
refetch: query.refetch
|
|
5744
5744
|
};
|
|
5745
5745
|
}
|
|
5746
|
+
function useSort(defaultField, defaultDir = "asc") {
|
|
5747
|
+
const [sort, setSort] = useState({ field: defaultField, direction: defaultDir });
|
|
5748
|
+
const onSort = (field) => {
|
|
5749
|
+
setSort(
|
|
5750
|
+
(prev) => prev.field === field ? { field, direction: prev.direction === "asc" ? "desc" : "asc" } : { field, direction: "asc" }
|
|
5751
|
+
);
|
|
5752
|
+
};
|
|
5753
|
+
const ordering = sort.direction === "desc" ? `-${sort.field}` : sort.field;
|
|
5754
|
+
return { sort, onSort, ordering };
|
|
5755
|
+
}
|
|
5746
5756
|
var EntityFetcherContext = createContext(null);
|
|
5747
5757
|
function ShellEntityFetcherProvider({
|
|
5748
5758
|
value,
|
|
@@ -5789,6 +5799,6 @@ function useEditHotkey(callback) {
|
|
|
5789
5799
|
}, [callback, isActive]);
|
|
5790
5800
|
}
|
|
5791
5801
|
|
|
5792
|
-
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, useTableNav };
|
|
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 };
|
|
5793
5803
|
//# sourceMappingURL=index.js.map
|
|
5794
5804
|
//# sourceMappingURL=index.js.map
|