@decky/ui 4.13.1 → 4.14.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.
@@ -10,4 +10,6 @@ export interface ItemProps {
10
10
  indentLevel?: number;
11
11
  tooltip?: string;
12
12
  highlightOnFocus?: boolean;
13
+ explainer?: ReactNode;
14
+ explainerTitle?: ReactNode;
13
15
  }
@@ -13,6 +13,7 @@ export interface ShowModalProps {
13
13
  }
14
14
  export interface ShowModalResult {
15
15
  Close: () => void;
16
+ ClosedPromise: Promise<void>;
16
17
  Update: (modal: ReactNode) => void;
17
18
  }
18
19
  export declare const showModal: (modal: ReactNode, parent?: EventTarget, props?: ShowModalProps) => ShowModalResult;
@@ -40,7 +40,7 @@ export function ReorderableList(props) {
40
40
  flexDirection: 'column',
41
41
  justifyContent: 'flex-start',
42
42
  alignContent: 'stretch',
43
- }, children: _jsx(Focusable, { onSecondaryButton: props.disableReordering ? undefined : toggleReorderEnabled, onSecondaryActionDescription: props.disableReordering ? undefined : reorderEnabled ? 'Save Order' : 'Reorder', onClick: props.disableReordering ? undefined : toggleReorderEnabled, onButtonDown: saveOnBackout, children: entryList.map((entry) => (_jsx(ReorderableItem, { animate: props.animate, listData: entryList, entryData: entry, reorderEntryFunc: setEntryList, reorderEnabled: reorderEnabled, fieldProps: props.fieldProps, children: props.interactables ? _jsx(props.interactables, { entry: entry }) : null }))) }) }) }));
43
+ }, children: _jsx(Focusable, { style: { display: 'flex', flexDirection: 'column', gap: '6px' }, onSecondaryButton: props.disableReordering ? undefined : toggleReorderEnabled, onSecondaryActionDescription: props.disableReordering ? undefined : reorderEnabled ? 'Save Order' : 'Reorder', onClick: props.disableReordering ? undefined : toggleReorderEnabled, onButtonDown: saveOnBackout, children: entryList.map((entry) => (_jsx(ReorderableItem, { animate: props.animate, listData: entryList, entryData: entry, reorderEntryFunc: setEntryList, reorderEnabled: reorderEnabled, fieldProps: props.fieldProps, children: props.interactables ? _jsx(props.interactables, { entry: entry }) : null }))) }) }) }));
44
44
  }
45
45
  function ReorderableItem(props) {
46
46
  const [isSelected, _setIsSelected] = useState(false);
@@ -84,7 +84,7 @@ export interface Apps {
84
84
  RequestLegacyCDKeysForApp(appId: number): void;
85
85
  RunGame(appId: string, launchOptions: string, param2: number, launchSource: ELaunchSource): void;
86
86
  SaveAchievementProgressCache(progress: string): Promise<void>;
87
- ScanForInstalledNonSteamApps(): Promise<NonSteamApp[]>;
87
+ ScanForInstalledNonSteamApps(includeExistingShortcuts: boolean): Promise<NonSteamApp[]>;
88
88
  SetAppAutoUpdateBehavior(appId: number, mode: EAppAutoUpdateBehavior): void;
89
89
  SetAppBackgroundDownloadsBehavior(appId: number, mode: EAppAllowDownloadsWhileRunningBehavior): void;
90
90
  SetAppCurrentLanguage(appId: number, language: string): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decky/ui",
3
- "version": "4.13.1",
3
+ "version": "4.14.0",
4
4
  "description": "A library for interacting with the Steam frontend in Decky plugins and elsewhere.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -11,4 +11,6 @@ export interface ItemProps {
11
11
  indentLevel?: number;
12
12
  tooltip?: string;
13
13
  highlightOnFocus?: boolean;
14
+ explainer?: ReactNode;
15
+ explainerTitle?: ReactNode;
14
16
  }
@@ -21,6 +21,9 @@ export interface ShowModalResult {
21
21
  // This method will not invoke any of the variations of "closeModal" callbacks!
22
22
  Close: () => void;
23
23
 
24
+ // This property resolves as soon as the modal closes
25
+ ClosedPromise: Promise<void>;
26
+
24
27
  // This method will replace the modal element completely and will not update the callback chains,
25
28
  // meaning that "closeModal" and etc. will not automatically close the modal anymore (also "fnOnClose"
26
29
  // will not be even called upon close anymore)! You have to manually call the "Close" method when, for example,
@@ -86,6 +86,7 @@ export function ReorderableList<T>(props: ReorderableListProps<T>) {
86
86
  }}
87
87
  >
88
88
  <Focusable
89
+ style={{ display: 'flex', flexDirection: 'column', gap: '6px' }}
89
90
  onSecondaryButton={props.disableReordering ? undefined : toggleReorderEnabled}
90
91
  onSecondaryActionDescription={props.disableReordering ? undefined : reorderEnabled ? 'Save Order' : 'Reorder'}
91
92
  onClick={props.disableReordering ? undefined : toggleReorderEnabled}
@@ -496,12 +496,13 @@ export interface Apps {
496
496
 
497
497
  /**
498
498
  * Scans the system for installed non-Steam applications.
499
+ * @param includeExistingShortcuts Include shortcuts already added to the Steam library.
499
500
  * @returns an array of NonSteamApp objects representing installed non-Steam applications.
500
- * @remarks This function scans the user's system for installed applications that are not part of the Steam library. It does not scan for shortcuts added to the Steam library.
501
+ * @remarks This function scans the user's system for installed applications that are not part of the Steam library. It does not scan for shortcuts added to the Steam library unless includeExistingShortcuts is set to true.
501
502
  *
502
503
  * On Linux, it scans inside /usr/share/applications and $XDG_DATA_HOME/applications.
503
504
  */
504
- ScanForInstalledNonSteamApps(): Promise<NonSteamApp[]>;
505
+ ScanForInstalledNonSteamApps(includeExistingShortcuts: boolean): Promise<NonSteamApp[]>;
505
506
 
506
507
  /**
507
508
  * Sets the automatic update behavior for a Steam application.