decord/source/design/void/Pressables/native/Pressables.tsx

126 lines
4.4 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 5438
// Function ID: 5439
2026-07-20 16:05:17 +00:00
// Name: PressableBase
2026-08-24 06:08:38 +00:00
// Dependencies: [19, 17, 4758, 1301, 21, 4668, 712, 500, 5439, 2]
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 5438 (PressableBase)
import ThemesDefault from "Themes" /* 712 */;
import importAllResult from "noop" /* 19 */;
import { Pressable } from "get ActivityIndicator" /* 17 */;
import { IOS_POINTER_STYLE } from "IOS_POINTER_STYLE" /* 4758 */;
import { getThemedRippleConfig } from "semanticColor" /* 1301 */;
import { jsx } from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4668 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function PressableBase(androidRippleConfig) {
androidRippleConfig = androidRippleConfig.androidRippleConfig;
const style = androidRippleConfig.style;
const type = androidRippleConfig.type;
const activeOpacity = androidRippleConfig.activeOpacity;
const underlayColor = androidRippleConfig.underlayColor;
({ children, innerRef } = androidRippleConfig);
2026-07-29 08:29:29 +00:00
let merged = Object.assign(androidRippleConfig, Object.create(null));
let backgroundColor;
backgroundColor = callback().pressedHighlight.backgroundColor;
2026-07-23 10:11:24 +00:00
let items = [type, activeOpacity, underlayColor, style, backgroundColor];
2026-07-20 16:05:17 +00:00
const items1 = [androidRippleConfig, style];
2026-07-23 10:11:24 +00:00
const memo = activeOpacity.useMemo(() => androidRippleConfig(type[7]).isAndroid() ? style : ((pressed) => {
2026-07-29 08:29:29 +00:00
const items = [closure_1, , ];
2026-07-20 16:05:17 +00:00
if (!pressed.pressed) {
items[1] = null;
2026-08-24 06:08:38 +00:00
items[2] = closure_1_5;
2026-07-20 16:05:17 +00:00
return items;
2026-07-29 08:29:29 +00:00
} else if ("highlight" === closure_2) {
let tmp2 = closure_4;
if (closure_4 == null) {
tmp2 = closure_5;
}
let obj = { backgroundColor: null };
obj[0] = tmp2;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
let num = closure_3;
if (closure_3 == null) {
num = 0.2;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj = { opacity: null };
obj[0] = num;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
}), items);
2026-07-29 08:29:29 +00:00
let obj = {
2026-07-23 10:11:24 +00:00
android_ripple: activeOpacity.useMemo(() => {
2026-07-20 16:05:17 +00:00
let obj = androidRippleConfig(type[7]);
if (obj.isAndroid()) {
2026-07-29 08:29:29 +00:00
obj = androidRippleConfig;
if (androidRippleConfig == null) {
obj = {};
}
const cornerRadius = obj.cornerRadius;
let tmp4 = cornerRadius;
2026-07-20 16:05:17 +00:00
if (null == cornerRadius) {
2026-07-29 08:29:29 +00:00
const styleProp = style(tmp[8]).getStyleProp(style, "borderRadius");
tmp4 = cornerRadius;
2026-07-20 16:05:17 +00:00
if (null != styleProp) {
2026-07-29 08:29:29 +00:00
tmp4 = styleProp;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const obj3 = style(tmp[8]);
2026-07-20 16:05:17 +00:00
}
obj = {};
2026-07-29 08:29:29 +00:00
const merged = Object.assign(tmp2);
obj.cornerRadius = tmp4;
2026-08-24 06:08:38 +00:00
return closure_1_6(obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp = type;
2026-07-20 16:05:17 +00:00
}, items1),
style: memo,
ref: innerRef
};
const merged1 = Object.assign(merged);
2026-07-29 08:29:29 +00:00
obj.children = children;
2026-07-23 10:11:24 +00:00
return <underlayColor android_ripple={activeOpacity.useMemo(() => {
let obj = androidRippleConfig(type[7]);
if (obj.isAndroid()) {
2026-07-29 08:29:29 +00:00
obj = androidRippleConfig;
if (androidRippleConfig == null) {
obj = {};
}
const cornerRadius = obj.cornerRadius;
let tmp4 = cornerRadius;
2026-07-23 10:11:24 +00:00
if (null == cornerRadius) {
2026-07-29 08:29:29 +00:00
const styleProp = style(tmp[8]).getStyleProp(style, "borderRadius");
tmp4 = cornerRadius;
2026-07-23 10:11:24 +00:00
if (null != styleProp) {
2026-07-29 08:29:29 +00:00
tmp4 = styleProp;
2026-07-23 10:11:24 +00:00
}
2026-07-29 08:29:29 +00:00
const obj3 = style(tmp[8]);
2026-07-23 10:11:24 +00:00
}
obj = {};
2026-07-29 08:29:29 +00:00
const merged = Object.assign(tmp2);
obj.cornerRadius = tmp4;
2026-08-24 06:08:38 +00:00
return closure_1_6(obj);
2026-07-23 10:11:24 +00:00
}
2026-07-29 08:29:29 +00:00
tmp = type;
2026-07-23 10:11:24 +00:00
}, items1)} style={memo} ref={innerRef} />;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let c3 = importAllResult;
let obj = { pressedHighlight: null };
2026-08-24 06:08:38 +00:00
obj = { backgroundColor: ThemesDefault.colors.BACKGROUND_MOD_MUTED };
2026-07-29 08:29:29 +00:00
obj[0] = obj;
let closure_8 = createCacheKey.createStyles(obj);
2026-07-20 16:05:17 +00:00
const forwardRefResult = importAllResult.forwardRef((activeOpacity, innerRef) => {
let num = activeOpacity.activeOpacity;
if (num === undefined) {
num = 0.2;
}
2026-07-29 08:29:29 +00:00
const merged = Object.assign(Object.assign(activeOpacity, Object.create(null)));
2026-07-23 10:11:24 +00:00
return <PressableBase innerRef={arg1} type="opacity" activeOpacity={num} />;
2026-07-20 16:05:17 +00:00
});
const forwardRefResult1 = importAllResult.forwardRef((underlayColor, innerRef) => {
2026-07-29 08:29:29 +00:00
const merged = Object.assign(Object.assign(underlayColor, Object.create(null)));
2026-07-23 10:11:24 +00:00
return <PressableBase innerRef={arg1} type="highlight" underlayColor={arg0.underlayColor} />;
2026-07-20 16:05:17 +00:00
});
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("design/void/Pressables/native/Pressables.tsx");
2026-07-20 16:05:17 +00:00
export const PressableOpacity = forwardRefResult;
export const PressableHighlight = forwardRefResult1;