decord/source/modules/keyboard/native/KeyCommandsView.tsx

86 lines
2.7 KiB
TypeScript
Raw Normal View History

// Module ID: 14578
// Function ID: 14579
2026-07-29 08:29:29 +00:00
// Name: KeyCommandsView
// Dependencies: [32, 19, 21, 4560, 14579, 2]
2026-07-20 16:05:17 +00:00
// Exports: default, useKeyCommands
// Module 14578 (KeyCommandsView)
2026-08-24 06:08:38 +00:00
import closure_2 from "_slicedToArray" /* 32 */;
import importAllResult from "noop" /* 19 */;
import { jsx } from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4560 */;
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let c3 = importAllResult;
let closure_5 = createCacheKey.createStyles({ viewDefaults: { flex: 1 } });
2026-07-23 10:11:24 +00:00
let context = importAllResult.createContext({
2026-07-20 16:05:17 +00:00
keyCommands: [],
2026-07-29 08:29:29 +00:00
addKeyCommand(item10005) {
2026-07-20 16:05:17 +00:00
},
removeKeyCommand() {
}
});
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/keyboard/native/KeyCommandsView.tsx");
2026-07-20 16:05:17 +00:00
export default function KeyCommandsView(style) {
2026-07-29 08:29:29 +00:00
const merged = Object.assign(style, Object.create(null));
let first;
2026-08-24 06:08:38 +00:00
dependencyMap = undefined;
2026-07-29 08:29:29 +00:00
let callback;
let callback1;
const tmp3 = callback(callback1.useState([]), 2);
first = tmp3[0];
dependencyMap = tmp3[1];
2026-07-23 10:11:24 +00:00
callback = callback1.useCallback((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
2026-07-20 16:05:17 +00:00
callback((arg0) => {
2026-07-29 08:29:29 +00:00
const items = [];
items[HermesBuiltin.arraySpread(arg0, 0)] = closure_0;
2026-07-20 16:05:17 +00:00
return items;
});
}, []);
2026-07-23 10:11:24 +00:00
callback1 = callback1.useCallback((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
2026-07-29 08:29:29 +00:00
callback((arr) => arr.filter((eventName) => eventName.eventName !== closure_0));
2026-07-20 16:05:17 +00:00
}, []);
2026-07-23 10:11:24 +00:00
let items = [first, callback, callback1];
2026-07-29 08:29:29 +00:00
let obj = { value: callback1.useMemo(() => ({ keyCommands: first, addKeyCommand: callback, removeKeyCommand: callback1 }), items), children: null };
2026-07-20 16:05:17 +00:00
obj = {};
2026-07-29 08:29:29 +00:00
const tmp2 = callback();
2026-07-20 16:05:17 +00:00
const merged1 = Object.assign(merged);
2026-07-29 08:29:29 +00:00
const items1 = [tmp2.viewDefaults, style.style];
obj.style = items1;
obj.keyCommands = first;
obj.onKeyCommand = function onKeyCommand(nativeEvent) {
2026-07-20 16:05:17 +00:00
nativeEvent = nativeEvent.nativeEvent;
2026-07-23 10:11:24 +00:00
const found = nativeEvent.find((eventName) => eventName.eventName === nativeEvent.eventName);
2026-07-29 08:29:29 +00:00
if (found != null) {
2026-07-20 16:05:17 +00:00
found.onKeyCommand(nativeEvent);
}
};
obj[1] = jsx(first(14579), {});
2026-07-23 10:11:24 +00:00
return <redux.Provider />;
2026-07-20 16:05:17 +00:00
};
export const useKeyCommands = function useKeyCommands(memo) {
2026-08-24 06:08:38 +00:00
closure_0 = memo;
2026-07-20 16:05:17 +00:00
const context = importAllResult.useContext(closure_6);
const addKeyCommand = context.addKeyCommand;
const removeKeyCommand = context.removeKeyCommand;
const items = [addKeyCommand, removeKeyCommand, memo];
const effect = importAllResult.useEffect(() => {
2026-07-29 08:29:29 +00:00
for (const item10005 of closure_0) {
let tmp = addKeyCommand;
let tmp2 = addKeyCommand(item10005);
continue;
2026-07-20 16:05:17 +00:00
}
return () => {
2026-07-29 08:29:29 +00:00
for (const item10005 of closure_0) {
let tmp = callback;
let tmp2 = callback(item10005.eventName);
continue;
2026-07-20 16:05:17 +00:00
}
};
}, items);
};