decord/source/design/components/Tabs/native/TabsGradient.native.tsx

129 lines
5.3 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 11987
// Function ID: 11988
2026-07-29 08:29:29 +00:00
// Name: TabsGradient
2026-08-24 06:08:38 +00:00
// Dependencies: [19, 676, 21, 4119, 4761, 4668, 4749, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 11987 (TabsGradient)
import LinearGradientDefault from "LinearGradient" /* 4761 */;
import closure_2 from "noop" /* 19 */;
import { HorizontalGradient } from "ME" /* 676 */;
import jsxProd from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4668 */;
import importDefaultResult from "module_4119" /* 4119 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
({ jsx: c4, Fragment: c5, jsxs: closure_6 } = jsxProd);
2026-08-24 06:08:38 +00:00
let closure_7 = importDefaultResult.createAnimatedComponent(LinearGradientDefault);
2026-07-23 10:11:24 +00:00
let closure_8 = { mass: 1, damping: 30, stiffness: 250 };
2026-07-29 08:29:29 +00:00
let closure_9 = createCacheKey.createStyles({ gradient: { width: 50, position: "absolute", top: 0, bottom: 0, zIndex: 100 }, left: { left: 0 }, right: { right: 0 } });
2026-07-20 16:05:17 +00:00
let closure_10 = { code: "function TabsGradientNativeTsx1(){const{withSpring,visible,SPRING_CONFIG}=this.__closure;return{opacity:withSpring(visible.get()?1:0,SPRING_CONFIG)};}" };
let closure_11 = { code: "function TabsGradientNativeTsx2(){const{itemDimensions,state}=this.__closure;const items=itemDimensions.get();const itemWidths=items.reduce(function(s,layout){var _layout$width;return s+((_layout$width=layout===null||layout===void 0?void 0:layout.width)!==null&&_layout$width!==void 0?_layout$width:0);},0);const itemsSpacing=items.length*state.itemSpacing;return itemWidths+itemsSpacing;}" };
let closure_12 = { code: "function TabsGradientNativeTsx3(){const{scrollOffset,totalItemWidth,pageWidth}=this.__closure;return scrollOffset.get()>0&&totalItemWidth.get()>pageWidth;}" };
let closure_13 = { code: "function TabsGradientNativeTsx4(){const{scrollOffset,totalItemWidth,pageWidth}=this.__closure;return scrollOffset.get()<totalItemWidth.get()-pageWidth&&totalItemWidth.get()>pageWidth;}" };
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("design/components/Tabs/native/TabsGradient.native.tsx");
2026-07-20 16:05:17 +00:00
export default function TabsGradient(state) {
state = state.state;
2026-07-29 08:29:29 +00:00
let derivedValue2 = state;
2026-07-20 16:05:17 +00:00
const colors = state.colors;
2026-07-29 08:29:29 +00:00
let scrollOffset;
let itemDimensions;
let pageWidth;
let derivedValue;
scrollOffset = state.scrollOffset;
itemDimensions = state.itemDimensions;
pageWidth = state.pageWidth;
let obj = derivedValue2(colors[3]);
2026-07-20 16:05:17 +00:00
const fn = function f() {
const value = itemDimensions.get();
return value.reduce((arg0, width) => {
2026-07-29 08:29:29 +00:00
let num;
if (width != null) {
num = width.width;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (num == null) {
num = 0;
2026-07-20 16:05:17 +00:00
}
return arg0 + num;
2026-07-29 08:29:29 +00:00
}, 0) + value.length * derivedValue2.itemSpacing;
2026-07-20 16:05:17 +00:00
};
fn.__closure = { itemDimensions, state };
fn.__workletHash = 456613763143;
fn.__initData = closure_11;
2026-07-29 08:29:29 +00:00
derivedValue = obj.useDerivedValue(fn);
2026-08-24 06:08:38 +00:00
obj1 = derivedValue2(colors[3]);
2026-07-20 16:05:17 +00:00
const fn2 = function y() {
let tmp = scrollOffset.get() > 0;
if (tmp) {
tmp = derivedValue.get() > pageWidth;
}
return tmp;
};
fn2.__closure = { scrollOffset, totalItemWidth: derivedValue, pageWidth };
fn2.__workletHash = 13237586618288;
fn2.__initData = closure_12;
2026-07-29 08:29:29 +00:00
const derivedValue1 = obj1.useDerivedValue(fn2);
derivedValue2 = derivedValue1;
let obj2 = derivedValue2(colors[3]);
const fn3 = function s() {
let obj = derivedValue2(colors[6]);
let num = 0;
if (derivedValue2.get()) {
num = 1;
}
2026-08-24 06:08:38 +00:00
obj = { opacity: obj.withSpring(num, closure_1_8) };
2026-07-29 08:29:29 +00:00
return obj;
};
obj = { withSpring: derivedValue2(colors[6]).withSpring, visible: derivedValue1, SPRING_CONFIG: closure_8 };
fn3.__closure = obj;
fn3.__workletHash = 14959306962615;
fn3.__initData = closure_10;
const animatedStyle = obj2.useAnimatedStyle(fn3);
2026-07-20 16:05:17 +00:00
class W {
constructor() {
2026-08-24 06:08:38 +00:00
obj = closure_5;
2026-07-20 16:05:17 +00:00
value = scrollOffset.get();
2026-08-24 06:08:38 +00:00
tmp3 = value < closure_5.get() - pageWidth && obj.get() > tmp2;
2026-07-29 08:29:29 +00:00
return tmp3;
2026-07-20 16:05:17 +00:00
}
}
W.__closure = { scrollOffset, totalItemWidth: derivedValue, pageWidth };
W.__workletHash = 13808489302165;
W.__initData = closure_13;
2026-07-29 08:29:29 +00:00
derivedValue2 = derivedValue2(colors[3]).useDerivedValue(W);
const obj5 = derivedValue2(colors[3]);
const fn4 = function s() {
let obj = derivedValue2(colors[6]);
let num = 0;
if (derivedValue2.get()) {
num = 1;
}
2026-08-24 06:08:38 +00:00
obj = { opacity: obj.withSpring(num, closure_1_8) };
2026-07-29 08:29:29 +00:00
return obj;
};
obj = { withSpring: derivedValue2(colors[6]).withSpring, visible: derivedValue2, SPRING_CONFIG: closure_8 };
fn4.__closure = obj;
fn4.__workletHash = 14959306962615;
fn4.__initData = closure_10;
const animatedStyle1 = derivedValue2(colors[3]).useAnimatedStyle(fn4);
const tmp6 = callback2();
2026-07-23 10:11:24 +00:00
let items = [colors];
2026-07-29 08:29:29 +00:00
obj1 = { children: null };
obj2 = { start: itemDimensions.START, end: itemDimensions.END, colors, style: items1, pointerEvents: "none" };
2026-07-23 10:11:24 +00:00
items1 = [, , ];
2026-07-29 08:29:29 +00:00
({ left: arr2[0], gradient: arr2[1] } = tmp6);
items1[2] = animatedStyle;
2026-07-23 10:11:24 +00:00
const memo = scrollOffset.useMemo(() => {
const items = [...colors];
2026-07-20 16:05:17 +00:00
return items.reverse();
}, items);
2026-08-24 06:08:38 +00:00
const items2 = [pageWidth(closure_7, obj2), ];
2026-07-29 08:29:29 +00:00
const items3 = [, , ];
({ right: arr4[0], gradient: arr4[1] } = tmp6);
items3[2] = animatedStyle1;
2026-08-24 06:08:38 +00:00
items2[1] = pageWidth(closure_7, { start: itemDimensions.START, end: itemDimensions.END, colors: memo, style: items3, pointerEvents: "none" });
2026-07-29 08:29:29 +00:00
obj1[0] = items2;
return callback(derivedValue, obj1);
2026-07-20 16:05:17 +00:00
};