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

175 lines
5.2 KiB
TypeScript
Raw Normal View History

2026-07-27 11:26:19 +00:00
// Module ID: 13562
// Function ID: 104337
2026-07-20 16:05:17 +00:00
// Name: _createForOfIteratorHelperLoose
2026-07-27 11:26:19 +00:00
// Dependencies: [57, 31, 33, 4131, 13563, 2]
2026-07-20 16:05:17 +00:00
// Exports: default, useKeyCommands
2026-07-27 11:26:19 +00:00
// Module 13562 (_createForOfIteratorHelperLoose)
2026-07-23 10:11:24 +00:00
import _slicedToArray from "_slicedToArray";
import importAllResult from "result";
import { jsx } from "jsxProd";
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose";
function _createForOfIteratorHelperLoose(iterable) {
let closure_0 = iterable;
iterable = "undefined" !== typeof Symbol;
if (iterable) {
2026-07-20 16:05:17 +00:00
const _Symbol = Symbol;
2026-07-23 10:11:24 +00:00
iterable = iterable[Symbol.iterator];
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if (!iterable) {
iterable = iterable[Symbol.iterator];
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if (iterable) {
const iter = iterable.call(iterable);
2026-07-20 16:05:17 +00:00
const next = iter.next;
return next.bind(iter);
} else {
const _Array = Array;
2026-07-23 10:11:24 +00:00
let tmp = iterable;
if (!Array.isArray(iterable)) {
2026-07-20 16:05:17 +00:00
let tmp2;
2026-07-23 10:11:24 +00:00
if (iterable) {
if ("string" === typeof iterable) {
tmp2 = _arrayLikeToArray(iterable, undefined);
2026-07-20 16:05:17 +00:00
} else {
const toString = {}.toString;
2026-07-23 10:11:24 +00:00
const substr = toString.call(iterable).slice(8, -1);
2026-07-20 16:05:17 +00:00
let name = substr;
if (tmp3) {
2026-07-23 10:11:24 +00:00
name = iterable.constructor.name;
2026-07-20 16:05:17 +00:00
}
if ("Map" !== name) {
if ("Set" !== name) {
if ("Arguments" === name) {
2026-07-23 10:11:24 +00:00
let arr = _arrayLikeToArray(iterable, undefined);
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
let obj = /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/;
2026-07-20 16:05:17 +00:00
}
}
tmp2 = arr;
}
const _Array2 = Array;
2026-07-23 10:11:24 +00:00
arr = Array.from(iterable);
const callResult = toString.call(iterable);
tmp3 = "Object" === substr && iterable.constructor;
2026-07-20 16:05:17 +00:00
}
}
tmp = tmp2;
if (!tmp2) {
const _TypeError = TypeError;
const typeError = new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
throw typeError;
}
}
if (tmp) {
2026-07-23 10:11:24 +00:00
closure_0 = tmp;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let c1 = 0;
2026-07-20 16:05:17 +00:00
return () => {
2026-07-23 10:11:24 +00:00
if (closure_1 >= length.length) {
2026-07-20 16:05:17 +00:00
let obj = { done: true };
} else {
obj = { done: false };
closure_1 = tmp3 + 1;
2026-07-23 10:11:24 +00:00
obj.value = length[+closure_1];
2026-07-20 16:05:17 +00:00
}
return obj;
};
}
}
function _arrayLikeToArray(arg0, arg1) {
let length;
if (tmp) {
length = arg0.length;
}
const ArrayResult = Array(length);
for (let num = 0; num < length; num = num + 1) {
ArrayResult[num] = arg0[num];
}
return ArrayResult;
}
2026-07-23 10:11:24 +00:00
let closure_5 = _createForOfIteratorHelperLoose.createStyles({ viewDefaults: { flex: 1 } });
let context = importAllResult.createContext({
2026-07-20 16:05:17 +00:00
keyCommands: [],
2026-07-23 10:11:24 +00:00
addKeyCommand(value) {
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) {
let obj = Object.create(null);
obj.style = 0;
const merged = Object.assign(style, obj);
2026-07-23 10:11:24 +00:00
const tmp4 = callback(callback1.useState([]), 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];
callback = callback1.useCallback((arg0) => {
let closure_0 = arg0;
2026-07-20 16:05:17 +00:00
callback((arg0) => {
2026-07-23 10:11:24 +00:00
const items = [...arg0, 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;
callback((arr) => arr.filter((eventName) => eventName.eventName !== outer1_0));
2026-07-20 16:05:17 +00:00
}, []);
2026-07-23 10:11:24 +00:00
let items = [first, callback, callback1];
obj = { value: callback1.useMemo(() => ({ keyCommands: first, addKeyCommand: callback, removeKeyCommand: callback1 }), items) };
2026-07-20 16:05:17 +00:00
obj = {};
2026-07-23 10:11:24 +00:00
const tmp3 = callback();
2026-07-20 16:05:17 +00:00
const merged1 = Object.assign(merged);
const items1 = [tmp3.viewDefaults, style.style];
obj["style"] = items1;
obj["keyCommands"] = first;
obj["onKeyCommand"] = function onKeyCommand(nativeEvent) {
nativeEvent = nativeEvent.nativeEvent;
2026-07-23 10:11:24 +00:00
const found = nativeEvent.find((eventName) => eventName.eventName === nativeEvent.eventName);
2026-07-20 16:05:17 +00:00
if (null != found) {
found.onKeyCommand(nativeEvent);
}
};
2026-07-27 11:26:19 +00:00
obj.children = jsx(first(13563), {});
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(() => {
let done;
2026-07-23 10:11:24 +00:00
let tmp = outer1_7(closure_0);
2026-07-20 16:05:17 +00:00
let iter = tmp();
if (!iter.done) {
do {
2026-07-23 10:11:24 +00:00
let tmp2 = addKeyCommand;
let tmp3 = addKeyCommand(iter.value);
2026-07-20 16:05:17 +00:00
let iter2 = tmp();
iter = iter2;
done = iter2.done;
} while (!done);
}
return () => {
let done;
2026-07-23 10:11:24 +00:00
const tmp = outer2_7(outer1_0);
2026-07-20 16:05:17 +00:00
let iter = tmp();
if (!iter.done) {
do {
2026-07-23 10:11:24 +00:00
let tmp2 = outer1_2;
let tmp3 = outer1_2(iter.value.eventName);
2026-07-20 16:05:17 +00:00
let iter2 = tmp();
iter = iter2;
done = iter2.done;
} while (!done);
}
};
}, items);
};