decord/source/4522_mapAppearanceToNativeProp.js

229 lines
8.2 KiB
JavaScript
Raw Normal View History

2026-07-23 10:11:24 +00:00
// Module ID: 4522
2026-07-24 07:16:23 +00:00
// Function ID: 39752
2026-07-20 16:05:17 +00:00
// Name: mapAppearanceToNativeProp
2026-07-23 10:11:24 +00:00
// Dependencies: [29, 57, 31, 27, 33, 4516, 4523, 4489, 4481, 4491]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-23 10:11:24 +00:00
// Module 4522 (mapAppearanceToNativeProp)
import _objectWithoutProperties from "_objectWithoutProperties";
import _slicedToArray from "_slicedToArray";
import result from "result";
import get_ActivityIndicator from "get ActivityIndicator";
import { jsx } from "jsxProd";
2026-07-20 16:05:17 +00:00
let Platform;
let StyleSheet;
2026-07-23 10:11:24 +00:00
let closure_7;
let closure_8;
let closure_9;
const require = arg1;
2026-07-20 16:05:17 +00:00
function mapAppearanceToNativeProp(scrollEdgeAppearance) {
let compactInline;
let inline;
let tabBarBackgroundColor;
let tabBarShadowColor;
if (scrollEdgeAppearance) {
const _Object = Object;
const obj = {};
({ inline, compactInline, tabBarBackgroundColor, tabBarShadowColor } = scrollEdgeAppearance);
obj.stacked = mapItemAppearanceToNativeProp(scrollEdgeAppearance.stacked);
obj.inline = mapItemAppearanceToNativeProp(inline);
obj.compactInline = mapItemAppearanceToNativeProp(compactInline);
2026-07-23 10:11:24 +00:00
obj.tabBarBackgroundColor = callback(tabBarBackgroundColor);
obj.tabBarShadowColor = callback(tabBarShadowColor);
2026-07-20 16:05:17 +00:00
return Object.assign({}, scrollEdgeAppearance, obj);
}
}
function mapItemAppearanceToNativeProp(compactInline) {
let disabled;
let focused;
let selected;
if (compactInline) {
const _Object = Object;
const obj = {};
({ selected, focused, disabled } = compactInline);
obj.normal = mapItemStateAppearanceToNativeProp(compactInline.normal);
obj.selected = mapItemStateAppearanceToNativeProp(selected);
obj.focused = mapItemStateAppearanceToNativeProp(focused);
obj.disabled = mapItemStateAppearanceToNativeProp(disabled);
return Object.assign({}, compactInline, obj);
}
}
function mapItemStateAppearanceToNativeProp(disabled) {
let tabBarItemBadgeBackgroundColor;
let tabBarItemIconColor;
if (disabled) {
const tabBarItemTitleFontWeight = disabled.tabBarItemTitleFontWeight;
const obj = {};
({ tabBarItemIconColor, tabBarItemBadgeBackgroundColor } = disabled);
2026-07-23 10:11:24 +00:00
obj.tabBarItemTitleFontColor = callback(disabled.tabBarItemTitleFontColor);
obj.tabBarItemIconColor = callback(tabBarItemIconColor);
obj.tabBarItemBadgeBackgroundColor = callback(tabBarItemBadgeBackgroundColor);
2026-07-20 16:05:17 +00:00
let StringResult;
if (undefined !== tabBarItemTitleFontWeight) {
const _String = String;
StringResult = String(tabBarItemTitleFontWeight);
}
obj.tabBarItemTitleFontWeight = StringResult;
return Object.assign({}, disabled, obj);
}
}
2026-07-23 10:11:24 +00:00
let closure_3 = ["onWillAppear", "onDidAppear", "onWillDisappear", "onDidDisappear", "isFocused", "freezeContents", "icon", "selectedIcon", "standardAppearance", "scrollEdgeAppearance", "scrollEdgeEffects", "experimental_userInterfaceStyle", "style"];
({ Image: closure_7, Platform, StyleSheet, findNodeHandle: closure_8, processColor: closure_9 } = get_ActivityIndicator);
const styles = StyleSheet.create({ fillParent: { position: "absolute", flex: 1, width: "100%", height: "100%" } });
2026-07-20 16:05:17 +00:00
export default function TabsScreen(onWillAppear) {
let experimental_userInterfaceStyle;
let freezeContents;
let icon;
let scrollEdgeAppearance;
let scrollEdgeEffects;
let selectedIcon;
let standardAppearance;
let style;
2026-07-23 10:11:24 +00:00
const ref = onDidDisappear.useRef(null);
const ref1 = onDidDisappear.useRef(-1);
const effect = onDidDisappear.useEffect(() => {
2026-07-20 16:05:17 +00:00
if (null != ref.current) {
2026-07-23 10:11:24 +00:00
const tmp5 = outer1_8(ref.current);
2026-07-20 16:05:17 +00:00
let num2 = -1;
if (null != tmp5) {
num2 = tmp5;
}
ref1.current = num2;
const tmp2 = ref1;
} else {
ref1.current = -1;
}
}, []);
2026-07-23 10:11:24 +00:00
const tmp4 = onWillDisappear(onDidDisappear.useState(false), 2);
2026-07-20 16:05:17 +00:00
const first = tmp4[0];
2026-07-23 10:11:24 +00:00
const dependencyMap = tmp4[1];
2026-07-20 16:05:17 +00:00
onWillAppear = onWillAppear.onWillAppear;
const onDidAppear = onWillAppear.onDidAppear;
2026-07-23 10:11:24 +00:00
onWillDisappear = onWillAppear.onWillDisappear;
onDidDisappear = onWillAppear.onDidDisappear;
2026-07-20 16:05:17 +00:00
const isFocused = onWillAppear.isFocused;
({ freezeContents, selectedIcon, scrollEdgeEffects } = onWillAppear);
({ icon, standardAppearance, scrollEdgeAppearance, experimental_userInterfaceStyle, style } = onWillAppear);
2026-07-23 10:11:24 +00:00
const tmp7 = onDidAppear(onWillAppear, onWillAppear);
let obj = ref(4481);
2026-07-20 16:05:17 +00:00
let flag = false;
if (obj.freezeEnabled()) {
flag = freezeContents;
if (undefined === freezeContents) {
2026-07-23 10:11:24 +00:00
if (ref(4491).featureFlags.experiment.controlledBottomTabs) {
2026-07-20 16:05:17 +00:00
let tmp11 = tmp10;
if (tmp10) {
tmp11 = !tmp6;
}
flag = tmp11;
} else {
flag = tmp10;
}
}
}
const items = [onWillAppear];
const items1 = [onDidAppear];
2026-07-23 10:11:24 +00:00
const callback = onDidDisappear.useCallback((arg0) => {
ref(4516).bottomTabsDebugLog("TabsScreen [" + ref1.current + "] onWillAppear received");
dependencyMap(true);
2026-07-20 16:05:17 +00:00
if (null != onWillAppear) {
onWillAppear(arg0);
}
}, items);
const items2 = [onWillDisappear];
2026-07-23 10:11:24 +00:00
const callback1 = onDidDisappear.useCallback((arg0) => {
ref(4516).bottomTabsDebugLog("TabsScreen [" + ref1.current + "] onDidAppear received");
2026-07-20 16:05:17 +00:00
if (null != onDidAppear) {
onDidAppear(arg0);
}
}, items1);
const items3 = [onDidDisappear];
2026-07-23 10:11:24 +00:00
const callback2 = onDidDisappear.useCallback((onDidDisappear) => {
ref(4516).bottomTabsDebugLog("TabsScreen [" + ref1.current + "] onWillDisappear received");
2026-07-20 16:05:17 +00:00
if (null != onWillDisappear) {
2026-07-23 10:11:24 +00:00
onWillDisappear(onDidDisappear);
2026-07-20 16:05:17 +00:00
}
}, items2);
2026-07-23 10:11:24 +00:00
const callback3 = onDidDisappear.useCallback((arg0) => {
ref(4516).bottomTabsDebugLog("TabsScreen [" + ref1.current + "] onDidDisappear received");
dependencyMap(false);
2026-07-20 16:05:17 +00:00
if (null != onDidDisappear) {
onDidDisappear(arg0);
}
}, items3);
2026-07-23 10:11:24 +00:00
let obj1 = ref(4516);
2026-07-20 16:05:17 +00:00
const current = ref1.current;
let num2 = -1;
if (null != current) {
num2 = current;
}
obj1.bottomTabsDebugLog("TabsScreen [" + num2 + "] render; tabKey: " + tmp7.tabKey + " shouldFreeze: " + flag + ", isFocused: " + undefined !== isFocused && isFocused + " nativeViewIsVisible: " + first);
obj = { collapsable: false, style: items4, onWillAppear: callback, onDidAppear: callback1, onWillDisappear: callback2, onDidDisappear: callback3, isFocused: tmp6 };
2026-07-23 10:11:24 +00:00
items4 = [style, fillParent.fillParent];
2026-07-20 16:05:17 +00:00
obj = {};
2026-07-23 10:11:24 +00:00
const tmp17 = (function parseIconsToNativeProps(icon) {
2026-07-20 16:05:17 +00:00
let android;
if (null != icon) {
android = icon.android;
}
if (!android) {
let shared;
if (null != icon) {
shared = icon.shared;
}
android = shared;
}
if (android) {
if ("imageSource" === android.type) {
2026-07-23 10:11:24 +00:00
const assetSource = outer1_7.resolveAssetSource(android.imageSource);
2026-07-20 16:05:17 +00:00
if (!assetSource) {
const _console = console;
console.error("[RNScreens] failed to resolve an asset for bottom tab icon");
}
let obj = { imageIconResource: assetSource };
} else if ("drawableResource" === android.type) {
obj = { drawableIconResourceName: android.name };
} else {
const _Error = Error;
const error = new Error("[RNScreens] Incorrect icon format for Android. You must provide `imageSource` or `drawableResource`.");
throw error;
}
} else {
obj = {};
}
return Object.assign({}, obj);
2026-07-23 10:11:24 +00:00
})(icon);
2026-07-20 16:05:17 +00:00
const tmp18 = jsx;
obj.standardAppearance = mapAppearanceToNativeProp(standardAppearance);
obj.scrollEdgeAppearance = mapAppearanceToNativeProp(scrollEdgeAppearance);
obj.ref = ref;
let bottom;
if (null != scrollEdgeEffects) {
bottom = scrollEdgeEffects.bottom;
}
obj.bottomScrollEdgeEffect = bottom;
let left;
if (null != scrollEdgeEffects) {
left = scrollEdgeEffects.left;
}
obj.leftScrollEdgeEffect = left;
let right;
if (null != scrollEdgeEffects) {
right = scrollEdgeEffects.right;
}
obj.rightScrollEdgeEffect = right;
let top;
if (null != scrollEdgeEffects) {
top = scrollEdgeEffects.top;
}
obj.topScrollEdgeEffect = top;
obj.isTitleUndefined = null === tmp7.title || undefined === tmp7.title;
obj.userInterfaceStyle = experimental_userInterfaceStyle;
2026-07-23 10:11:24 +00:00
obj1 = { children: jsx(ref(4489).Freeze, obj2) };
obj2 = { freeze: flag };
2026-07-20 16:05:17 +00:00
({ placeholder: obj6.placeholder, children: obj6.children } = tmp7);
2026-07-23 10:11:24 +00:00
return tmp18(ref1(4523), Object.assign(obj, tmp17, obj, tmp7, obj1));
2026-07-20 16:05:17 +00:00
};