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

86 lines
2.7 KiB
TypeScript
Raw Normal View History

2026-07-30 10:14:41 +00:00
// Module ID: 13622
// Function ID: 13623
2026-07-29 08:29:29 +00:00
// Name: KeyCommandsView
2026-07-30 10:14:41 +00:00
// Dependencies: [32, 19, 21, 4189, 13623, 2]
2026-07-20 16:05:17 +00:00
// Exports: default, useKeyCommands
2026-07-30 10:14:41 +00:00
// Module 13622 (KeyCommandsView)
2026-07-23 10:11:24 +00:00
import _slicedToArray from "_slicedToArray";
2026-07-29 08:29:29 +00:00
import importAllResult from "noop";
2026-07-23 10:11:24 +00:00
import { jsx } from "jsxProd";
2026-07-29 08:29:29 +00:00
import createCacheKey from "createCacheKey";
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-07-23 10:11:24 +00:00
const result = require("jsxProd").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;
let dependencyMap;
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) => {
let 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) => {
let 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);
}
};
2026-07-30 10:14:41 +00:00
obj[1] = jsx(first(13623), {});
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-07-23 10:11:24 +00:00
let 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);
};