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

127 lines
4.3 KiB
TypeScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 4797
// Function ID: 4798
2026-07-20 16:05:17 +00:00
// Name: PressableBase
2026-08-05 07:35:12 +00:00
// Dependencies: [19, 17, 4673, 1301, 21, 4255, 712, 500, 4798, 2]
2026-07-20 16:05:17 +00:00
2026-08-05 07:35:12 +00:00
// Module 4797 (PressableBase)
2026-07-29 08:29:29 +00:00
import importAllResult from "noop";
2026-07-23 10:11:24 +00:00
import { Pressable } from "get ActivityIndicator";
import { IOS_POINTER_STYLE } from "IOS_POINTER_STYLE";
import { getThemedRippleConfig } from "semanticColor";
import { jsx } from "jsxProd";
2026-07-29 08:29:29 +00:00
import createCacheKey from "createCacheKey";
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function PressableBase(androidRippleConfig) {
let children;
let innerRef;
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-07-29 08:29:29 +00:00
items[2] = outer1_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-07-23 10:11:24 +00:00
return outer1_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-07-23 10:11:24 +00:00
return outer1_6(obj);
}
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 };
obj = { backgroundColor: require("Themes").colors.BACKGROUND_MOD_MUTED };
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-07-23 10:11:24 +00:00
const result = require("IOS_POINTER_STYLE").fileFinishedImporting("design/void/Pressables/native/Pressables.tsx");
2026-07-20 16:05:17 +00:00
export const PressableOpacity = forwardRefResult;
export const PressableHighlight = forwardRefResult1;