@decky/ui 4.10.3 → 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');
|
|
@@ -42,7 +42,7 @@ export interface ConfirmModalProps extends ModalRootProps {
|
|
|
42
42
|
bMiddleDisabled?: boolean;
|
|
43
43
|
}
|
|
44
44
|
export declare const ConfirmModal: FC<ConfirmModalProps>;
|
|
45
|
-
export declare const ModalRoot:
|
|
45
|
+
export declare const ModalRoot: any;
|
|
46
46
|
interface SimpleModalProps {
|
|
47
47
|
active?: boolean;
|
|
48
48
|
children: ReactNode;
|
package/dist/components/Modal.js
CHANGED
|
@@ -10,16 +10,17 @@ export const showModal = (modal, parent, props = {
|
|
|
10
10
|
});
|
|
11
11
|
};
|
|
12
12
|
export const ConfirmModal = findModuleExport((e) => e?.toString()?.includes('bUpdateDisabled') && e?.toString()?.includes('closeModal') && e?.toString()?.includes('onGamepadCancel'));
|
|
13
|
-
export const ModalRoot =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
export const ModalRoot = findModuleExport((e) => typeof e === 'function' && e.toString().includes('Either closeModal or onCancel should be passed to GenericDialog. Classes: ')) ||
|
|
14
|
+
Object.values(findModule((m) => {
|
|
15
|
+
if (typeof m !== 'object')
|
|
16
|
+
return false;
|
|
17
|
+
for (let prop in m) {
|
|
18
|
+
if (m[prop]?.m_mapModalManager && Object.values(m)?.find((x) => x?.type)) {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
19
21
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}) || {})?.find((x) => x?.type?.toString?.()?.includes('((function(){'));
|
|
22
|
+
return false;
|
|
23
|
+
}) || {})?.find((x) => x?.type?.toString?.()?.includes('((function(){'));
|
|
23
24
|
const [ModalModule, _ModalPosition] = findModuleDetailsByExport((e) => e?.toString().includes('.ModalPosition'), 5);
|
|
24
25
|
const ModalModuleProps = ModalModule ? Object.values(ModalModule) : [];
|
|
25
26
|
export const SimpleModal = ModalModuleProps.find((prop) => {
|
package/package.json
CHANGED
package/src/components/Dialog.ts
CHANGED
|
@@ -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
|
-
|
|
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>;
|
package/src/components/Modal.ts
CHANGED
|
@@ -86,19 +86,23 @@ export const ConfirmModal = findModuleExport(
|
|
|
86
86
|
(e: Export) => e?.toString()?.includes('bUpdateDisabled') && e?.toString()?.includes('closeModal') && e?.toString()?.includes('onGamepadCancel'),
|
|
87
87
|
) as FC<ConfirmModalProps>;
|
|
88
88
|
|
|
89
|
-
export const ModalRoot =
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
89
|
+
export const ModalRoot =
|
|
90
|
+
// new
|
|
91
|
+
findModuleExport((e: Export) => typeof e === 'function' && e.toString().includes('Either closeModal or onCancel should be passed to GenericDialog. Classes: ')) ||
|
|
92
|
+
// old
|
|
93
|
+
Object.values(
|
|
94
|
+
findModule((m: any) => {
|
|
95
|
+
if (typeof m !== 'object') return false;
|
|
96
|
+
|
|
97
|
+
for (let prop in m) {
|
|
98
|
+
if (m[prop]?.m_mapModalManager && Object.values(m)?.find((x: any) => x?.type)) {
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
96
101
|
}
|
|
97
|
-
}
|
|
98
102
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
)?.find((x: any) => x?.type?.toString?.()?.includes('((function(){')) as FC<ModalRootProps>;
|
|
103
|
+
return false;
|
|
104
|
+
}) || {},
|
|
105
|
+
)?.find((x: any) => x?.type?.toString?.()?.includes('((function(){')) as FC<ModalRootProps>;
|
|
102
106
|
|
|
103
107
|
interface SimpleModalProps {
|
|
104
108
|
active?: boolean;
|