@decky/ui 4.7.2 → 4.7.4
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/components/DialogCheckbox.js +7 -14
- package/dist/components/Modal.js +3 -3
- package/dist/components/SliderField.js +1 -1
- package/dist/components/ToggleField.js +1 -1
- package/package.json +1 -1
- package/src/components/DialogCheckbox.ts +12 -16
- package/src/components/Modal.ts +3 -5
- package/src/components/SliderField.ts +2 -1
- package/src/components/ToggleField.ts +2 -1
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export const DialogCheckbox =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
return false;
|
|
10
|
-
})).find((m) => m.contextType &&
|
|
11
|
-
m.prototype?.render.toString().includes('fallback:') &&
|
|
12
|
-
m?.prototype?.SetChecked &&
|
|
13
|
-
m?.prototype?.Toggle &&
|
|
14
|
-
m?.prototype?.GetPanelElementProps);
|
|
1
|
+
import { findModuleExport } from '../webpack';
|
|
2
|
+
export const DialogCheckbox = findModuleExport(e => e.prototype &&
|
|
3
|
+
"GetPanelElementProps" in e?.prototype &&
|
|
4
|
+
"SetChecked" in e?.prototype &&
|
|
5
|
+
"Toggle" in e?.prototype &&
|
|
6
|
+
(e?.prototype?.render?.toString().includes('="DialogCheckbox"') || (e.contextType &&
|
|
7
|
+
e.prototype?.render?.toString().includes('fallback:'))));
|
package/dist/components/Modal.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { findSP } from '../utils';
|
|
2
|
-
import { findModule,
|
|
2
|
+
import { findModule, findModuleDetailsByExport, findModuleExport } from '../webpack';
|
|
3
3
|
const showModalRaw = findModuleExport((e) => typeof e === 'function' && e.toString().includes('props.bDisableBackgroundDismiss') && !e?.prototype?.Cancel);
|
|
4
4
|
export const showModal = (modal, parent, props = {
|
|
5
5
|
strTitle: 'Decky Dialog',
|
|
@@ -20,10 +20,10 @@ export const ModalRoot = Object.values(findModule((m) => {
|
|
|
20
20
|
}
|
|
21
21
|
return false;
|
|
22
22
|
}) || {})?.find((x) => x?.type?.toString()?.includes('((function(){'));
|
|
23
|
-
const ModalModule =
|
|
23
|
+
const [ModalModule, _ModalPosition] = findModuleDetailsByExport((e) => e?.toString().includes('.ModalPosition'), 5);
|
|
24
24
|
const ModalModuleProps = ModalModule ? Object.values(ModalModule) : [];
|
|
25
25
|
export const SimpleModal = ModalModuleProps.find((prop) => {
|
|
26
26
|
const string = prop?.toString();
|
|
27
27
|
return string?.includes('.ShowPortalModal()') && string?.includes('.OnElementReadyCallbacks.Register(');
|
|
28
28
|
});
|
|
29
|
-
export const ModalPosition =
|
|
29
|
+
export const ModalPosition = _ModalPosition;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { CommonUIModule } from '../webpack';
|
|
2
|
-
export const SliderField = Object.values(CommonUIModule).find((mod) => mod?.toString()?.includes('SliderField,fallback'));
|
|
2
|
+
export const SliderField = Object.values(CommonUIModule).find((mod) => mod?.toString()?.includes('SliderField,fallback') || mod?.toString()?.includes("SliderField\","));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { CommonUIModule } from '../webpack';
|
|
2
|
-
export const ToggleField = Object.values(CommonUIModule).find((mod) => mod?.render?.toString()?.includes('ToggleField,fallback'));
|
|
2
|
+
export const ToggleField = Object.values(CommonUIModule).find((mod) => mod?.render?.toString()?.includes('ToggleField,fallback') || mod?.render?.toString()?.includes("ToggleField\","));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { findModuleExport } from '../webpack';
|
|
4
4
|
import { DialogCommonProps } from './Dialog';
|
|
5
5
|
import { FooterLegendProps } from './FooterLegend';
|
|
6
6
|
|
|
@@ -18,19 +18,15 @@ export interface DialogCheckboxProps extends DialogCommonProps, FooterLegendProp
|
|
|
18
18
|
onClick?(evt: Event): void;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
m.prototype?.render.toString().includes('fallback:') &&
|
|
33
|
-
m?.prototype?.SetChecked &&
|
|
34
|
-
m?.prototype?.Toggle &&
|
|
35
|
-
m?.prototype?.GetPanelElementProps,
|
|
21
|
+
// Do not access KeyDown, SetChecked, Toggle here as they are getters and accessing them outside of a render breaks them globally
|
|
22
|
+
export const DialogCheckbox = findModuleExport(e =>
|
|
23
|
+
e.prototype &&
|
|
24
|
+
"GetPanelElementProps" in e?.prototype &&
|
|
25
|
+
"SetChecked" in e?.prototype &&
|
|
26
|
+
"Toggle" in e?.prototype &&
|
|
27
|
+
// beta || stable as of oct 2 2024
|
|
28
|
+
(e?.prototype?.render?.toString().includes('="DialogCheckbox"') || (
|
|
29
|
+
e.contextType &&
|
|
30
|
+
e.prototype?.render?.toString().includes('fallback:')
|
|
31
|
+
))
|
|
36
32
|
) as FC<DialogCheckboxProps>;
|
package/src/components/Modal.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
import { findSP } from '../utils';
|
|
4
|
-
import { Export, findModule,
|
|
4
|
+
import { Export, findModule, findModuleDetailsByExport, findModuleExport } from '../webpack';
|
|
5
5
|
|
|
6
6
|
// All of the popout options + strTitle are related. Proper usage is not yet known...
|
|
7
7
|
export interface ShowModalProps {
|
|
@@ -105,7 +105,7 @@ interface SimpleModalProps {
|
|
|
105
105
|
children: ReactNode;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
const ModalModule =
|
|
108
|
+
const [ModalModule, _ModalPosition] = findModuleDetailsByExport((e: Export) => e?.toString().includes('.ModalPosition'), 5)
|
|
109
109
|
|
|
110
110
|
const ModalModuleProps = ModalModule ? Object.values(ModalModule) : [];
|
|
111
111
|
|
|
@@ -114,6 +114,4 @@ export const SimpleModal = ModalModuleProps.find((prop) => {
|
|
|
114
114
|
return string?.includes('.ShowPortalModal()') && string?.includes('.OnElementReadyCallbacks.Register(');
|
|
115
115
|
}) as FC<SimpleModalProps>;
|
|
116
116
|
|
|
117
|
-
export const ModalPosition =
|
|
118
|
-
prop?.toString().includes('.ModalPosition,fallback:'),
|
|
119
|
-
) as FC<SimpleModalProps>;
|
|
117
|
+
export const ModalPosition = _ModalPosition as FC<SimpleModalProps>;
|
|
@@ -29,5 +29,6 @@ export interface SliderFieldProps extends ItemProps {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
export const SliderField = Object.values(CommonUIModule).find((mod: any) =>
|
|
32
|
-
|
|
32
|
+
// stable || beta as of oct 2 2024
|
|
33
|
+
mod?.toString()?.includes('SliderField,fallback') || mod?.toString()?.includes("SliderField\",")
|
|
33
34
|
) as FC<SliderFieldProps>;
|
|
@@ -11,5 +11,6 @@ export interface ToggleFieldProps extends ItemProps {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export const ToggleField = Object.values(CommonUIModule).find((mod: any) =>
|
|
14
|
-
|
|
14
|
+
// stable || beta as of oct 2 2024
|
|
15
|
+
mod?.render?.toString()?.includes('ToggleField,fallback') || mod?.render?.toString()?.includes("ToggleField\",")
|
|
15
16
|
) as FC<ToggleFieldProps>;
|