@decky/ui 4.10.4 → 4.10.5

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.
@@ -11,7 +11,10 @@ const MappedDialogDivs = new Map(Object.values(CommonDialogDivs).map((m) => {
11
11
  return [null, null];
12
12
  }
13
13
  }));
14
- export const DialogHeader = MappedDialogDivs.get('DialogHeader');
14
+ export const DialogHeader = (MappedDialogDivs.get('DialogHeader') || Object.values(CommonUIModule).find((component) => {
15
+ const str = component?.render?.toString?.();
16
+ return str?.includes("role:\"heading\"") && str.includes(")(\"DialogHeader\",");
17
+ }));
15
18
  export const DialogSubHeader = MappedDialogDivs.get('DialogSubHeader');
16
19
  export const DialogFooter = MappedDialogDivs.get('DialogFooter');
17
20
  export const DialogLabel = MappedDialogDivs.get('DialogLabel');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decky/ui",
3
- "version": "4.10.4",
3
+ "version": "4.10.5",
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",
@@ -1,6 +1,6 @@
1
1
  import { CSSProperties, FC, ReactNode, RefAttributes } from 'react';
2
2
 
3
- import { CommonUIModule } from '../webpack';
3
+ import { CommonUIModule, Module } from '../webpack';
4
4
  import { FooterLegendProps } from './FooterLegend';
5
5
 
6
6
  export interface DialogCommonProps extends RefAttributes<HTMLDivElement> {
@@ -68,7 +68,12 @@ const MappedDialogDivs = new Map(
68
68
  }),
69
69
  );
70
70
 
71
- export const DialogHeader = MappedDialogDivs.get('DialogHeader') as FC<DialogCommonProps>;
71
+ // Old | New
72
+ export const DialogHeader = (MappedDialogDivs.get('DialogHeader') || Object.values(CommonUIModule).find((component: Module) => {
73
+ const str = component?.render?.toString?.();
74
+ return str?.includes("role:\"heading\"") && str.includes(")(\"DialogHeader\",");
75
+ })) as FC<DialogCommonProps>;
76
+
72
77
  export const DialogSubHeader = MappedDialogDivs.get('DialogSubHeader') as FC<DialogCommonProps>;
73
78
  export const DialogFooter = MappedDialogDivs.get('DialogFooter') as FC<DialogCommonProps>;
74
79
  export const DialogLabel = MappedDialogDivs.get('DialogLabel') as FC<DialogCommonProps>;