decord/source/modules/markup/native/Spoiler.tsx
github-actions 4f02868c60 chore: update source for alpha 346.4
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4792.js (118.4 MB)
2026-09-11 10:30:06 +00:00

164 lines
6.2 KiB
TypeScript

// Module ID: 10218
// Function ID: 10219
// Name: Spoiler
// Dependencies: [19, 17, 1074, 10209, 21, 4607, 1115, 576, 4317, 1178, 2]
// Module 10218 (Spoiler)
import nativeDefault from "native" /* 576 */;
import noop from "module_19" /* 19 */;
let require = fn;
get_ActivityIndicator = fn(17);
({ View: c3, StyleSheet: closure_4 } = get_ActivityIndicator);
const EMOJI_CHAT_SIZE = fn(1074).EMOJI_CHAT_SIZE;
const jsx = fn(21).jsx;
const createStyles = fn(4607);
const PlatformUtils = fn(1115);
let str = "transparent";
if (PlatformUtils.isAndroid()) {
str = "rgba(0,0,0,0.0019607844)";
}
const obj3 = { spoiler: { color: str, backgroundColor: nativeDefault.colors.SPOILER_HIDDEN_BACKGROUND }, placeholder: null, spoilerRevealed: null, muted: null };
let size = { width: EMOJI_CHAT_SIZE, height: EMOJI_CHAT_SIZE, backgroundColor: nativeDefault.colors.SPOILER_HIDDEN_BACKGROUND };
obj3.placeholder = size;
const obj4 = { color: str, backgroundColor: nativeDefault.colors.SPOILER_HIDDEN_BACKGROUND };
obj3.spoilerRevealed = { color: nativeDefault.colors.TEXT_DEFAULT, backgroundColor: nativeDefault.colors.SPOILER_REVEALED_BACKGROUND };
obj3.muted = { opacity: fn(10209).MUTED_OPACITY_CONTENT };
let closure_6 = createStyles.createLegacyClassComponentStyles(obj3);
const PureComponent = noop.PureComponent;
class Spoiler extends PureComponent {
constructor() {
applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
closure_0 = applyArgumentsResult;
applyArgumentsResult.state = { revealed: false };
applyArgumentsResult.handleTap = function handleTap() {
if (!tmp) {
const obj2 = { revealed: !obj.state.revealed };
obj.setState(obj2);
}
};
return applyArgumentsResult;
}
}
Spoiler.prototype["render"] = function render() {
const self = this;
let tmp = closure_6(this.context);
_require = tmp;
const revealed = this.state.revealed;
const children = this.props.children;
if (revealed) {
let items = [tmp.spoilerRevealed, tmp3];
let items1 = items;
} else {
items1 = [tmp.spoiler, tmp2];
}
let Children = noop.Children;
if (0 === Children.count(children)) {
return null;
} else {
const Children1 = tmp4.Children;
let mapped = Children1.map(children, (type) => {
let map = noop;
if (!noop.isValidElement(type)) {
return type;
} else {
if ("Image" === type.type.displayName) {
if (!revealed) {
let obj = { style: placeholder.placeholder };
const tmp7 = <React3 style={placeholder.placeholder} />;
}
} else {
const props = type.props;
let source;
if (props != null) {
source = props.source;
}
}
let mapped = type;
if (null != type.props) {
mapped = type;
if (!revealed) {
const Children = map.Children;
map = Children.map;
mapped = map(type, (props) => {
if (validElement.isValidElement(props)) {
const style = props.props.style;
const _Array = Array;
let flattenResult = style;
if (Array.isArray(style)) {
flattenResult = closure_2_4.flatten(style);
}
const obj = { children: null, style: null, onPress: "Array" };
({ Children, cloneElement } = tmp);
obj.children = Children.map(props.props.children, (props) => {
if (validElement.isValidElement(props)) {
const style = props.props.style;
const _Array = Array;
let flattenResult = style;
if (Array.isArray(style)) {
flattenResult = closure_2_4.flatten(style);
}
const obj = { children: null, style: null, onPress: "Array" };
({ Children, cloneElement } = tmp);
obj.children = Children.map(props.props.children, (props) => {
if (validElement.isValidElement(props)) {
const style = props.props.style;
const _Array = Array;
let flattenResult = style;
if (Array.isArray(style)) {
flattenResult = closure_2_4.flatten(style);
}
const obj = { children: null, style: null, onPress: "Array" };
({ Children, cloneElement } = tmp);
obj.children = Children.map(props.props.children, () => { ... });
const items = [flattenResult, spoiler.spoiler];
obj.style = items;
return cloneElement(props, obj);
} else {
return props;
}
tmp = validElement;
});
const items = [flattenResult, spoiler.spoiler];
obj.style = items;
return cloneElement(props, obj);
} else {
return props;
}
tmp = validElement;
});
const items = [flattenResult, spoiler.spoiler];
obj.style = items;
return cloneElement(props, obj);
} else {
return props;
}
tmp = validElement;
});
}
}
}
});
const items2 = [items1, ];
let muted = self.props.muted;
if (muted) {
muted = tmp.muted;
}
let obj = { accessibilityRole: "button", style: null, onPress: null, children: null };
items2[1] = muted;
obj.style = items2;
let handleTap;
if (!self.props.disableReveal) {
handleTap = self.handleTap;
}
obj.onPress = handleTap;
obj.children = mapped;
return jsx(require("native").LegacyText, { accessibilityRole: "button", style: null, onPress: null, children: null });
}
tmp4 = noop;
};
Spoiler.contextType = fn(4317).ThemeContext;
size = fn(2);
const result = size.fileFinishedImporting("modules/markup/native/Spoiler.tsx");
export default Spoiler;