decord/source/4552_context.js

34 lines
1.1 KiB
JavaScript
Raw Normal View History

2026-07-29 08:29:29 +00:00
// Module ID: 4552
// Function ID: 4553
2026-07-20 16:05:17 +00:00
// Name: context
2026-07-29 08:29:29 +00:00
// Dependencies: [19]
2026-07-20 16:05:17 +00:00
// Exports: useEdgeInsetApplication
2026-07-29 08:29:29 +00:00
// Module 4552 (context)
import importAllResult from "noop";
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let c0 = importAllResult;
2026-07-23 10:11:24 +00:00
let context = importAllResult.createContext({ leftDisabled: false, rightDisabled: false, bottomDisabled: false });
2026-07-20 16:05:17 +00:00
export const EdgeInsetApplicationContext = context;
2026-07-29 08:29:29 +00:00
export const useEdgeInsetApplication = function useEdgeInsetApplication(flag, flag2, flag3) {
2026-07-20 16:05:17 +00:00
let bottomDisabled;
let leftDisabled;
let rightDisabled;
2026-07-29 08:29:29 +00:00
let obj = leftDisabled;
const context = leftDisabled.useContext(rightDisabled);
2026-07-20 16:05:17 +00:00
({ leftDisabled, rightDisabled, bottomDisabled } = context);
if (!leftDisabled) {
2026-07-29 08:29:29 +00:00
leftDisabled = flag;
2026-07-20 16:05:17 +00:00
}
if (!rightDisabled) {
2026-07-29 08:29:29 +00:00
rightDisabled = flag2;
2026-07-20 16:05:17 +00:00
}
if (!bottomDisabled) {
2026-07-29 08:29:29 +00:00
bottomDisabled = flag3;
2026-07-20 16:05:17 +00:00
}
const items = [leftDisabled, rightDisabled, bottomDisabled];
2026-07-29 08:29:29 +00:00
obj = { consumeLeftInset: !leftDisabled, consumeRightInset: !rightDisabled, consumeBottomInset: !bottomDisabled, nextContextValue: obj.useMemo(() => ({ leftDisabled, rightDisabled, bottomDisabled }), items) };
2026-07-20 16:05:17 +00:00
return obj;
};