2025-12-02 21:05:59 +01:00

133 lines
5.0 KiB
Diff

Index: EFB.js
===================================================================
--- EFB.js
+++ EFB.js
@@ -29548,18 +29548,17 @@
"{shift} Z X C V B N M /",
"{space} {close}"
]
};
- var Keyboard = (0, import_react4.forwardRef)(({ value, inputRef, onInput, onClose }, ref) => {
+ var Keyboard = (0, import_react4.forwardRef)(({ value, blurRef, onInput, onClose }, ref) => {
const [shift, setShift] = (0, import_react4.useState)(false);
const layout = shift ? defaultLayout.shift : defaultLayout.default;
const handleKeyPress = (key) => {
- var _a;
if (key === "{close}") {
onClose();
return;
}
- (_a = inputRef.current) == null ? void 0 : _a.focus();
+ blurRef.current = true;
if (key === "{shift}") {
setShift(!shift);
return;
}
@@ -29603,12 +29602,8 @@
"button",
{
className: `flex justify-center rounded-md p-4 ${key === "{close}" ? "bg-zinc-700 px-12 focus:bg-zinc-600" : "flex-1 bg-zinc-600"}`,
onMouseDown: () => handleKeyPress(key),
- onMouseUp: () => {
- var _a;
- return (_a = inputRef.current) == null ? void 0 : _a.focus();
- },
children: keyIdent
},
`key-${rowIndex}-${keyIndex}`
);
@@ -29628,9 +29623,9 @@
function Input(props) {
const [guid] = (0, import_react5.useState)(v4_default());
const ref = (0, import_react5.useRef)(null);
const keyboardRef = (0, import_react5.useRef)(null);
- const blurTimeoutRef = (0, import_react5.useRef)();
+ const blurRef = (0, import_react5.useRef)(false);
const [isFocused, setFocused] = (0, import_react5.useState)(false);
const [showKeyboard, setShowKeyboard] = (0, import_react5.useState)(false);
(0, import_react5.useEffect)(() => {
if (simulator() === 0 /* MSFS */) {
@@ -29660,25 +29655,23 @@
placeholder: props.placeholder,
disabled: props.disabled,
onFocus: () => {
var _a;
- clearTimeout(blurTimeoutRef.current);
if (!isFocused) {
setFocused(true);
setShowKeyboard(true);
(_a = ref.current) == null ? void 0 : _a.select();
}
},
- onBlur: (e) => {
+ onBlur: () => {
var _a;
- if ((_a = keyboardRef.current) == null ? void 0 : _a.contains(e.relatedTarget)) {
- return;
- }
- blurTimeoutRef.current = setTimeout(() => {
- if (props.onBlur) props.onBlur(e.target.value);
- if (isFocused) setFocused(false);
+ if (blurRef.current && isFocused) (_a = ref.current) == null ? void 0 : _a.focus();
+ else {
setShowKeyboard(false);
- }, 100);
+ setFocused(false);
+ (_a = ref.current) == null ? void 0 : _a.blur();
+ }
+ blurRef.current = false;
},
onChange: (e) => {
if (props.onChange) props.onChange(e.target.value);
},
@@ -29690,9 +29683,9 @@
Keyboard_default,
{
ref: keyboardRef,
value: String(props.value),
- inputRef: ref,
+ blurRef: blurRef,
onInput: (value) => props.onChange && props.onChange(value),
onClose: () => {
var _a;
setShowKeyboard(false);
@@ -30209,9 +30202,9 @@
{
className: "middle none center rounded-lg bg-green-700 px-6 py-3 font-sans text-xs font-bold uppercase text-white shadow-md shadow-green-500/20 transition-all hover:shadow-lg hover:shadow-green-500/40 focus:opacity-[0.85] focus:shadow-none active:opacity-[0.85] active:shadow-none disabled:pointer-events-none disabled:opacity-50 disabled:shadow-none",
"data-ripple-light": "true",
onClick: () => getOutput(),
- children: "Set Payload"
+ children: "Manage Payload"
}
) }) })
] }) }) });
}
@@ -40562,8 +40555,27 @@
] })
] }) }) });
}
+ // Exports for add. script
+ window.reactExports = __toESM(require_react());
+ window.reactDomExports = __toESM(require_react_dom());
+ window.jsxRuntimeExports = __toESM(require_jsx_runtime());
+ window.useSelector = useSelector;
+ window.v4 = v4_default;
+ window.ArrowBigUp = ArrowBigUp;
+ window.Delete = Delete;
+ window.Space = Space;
+ window.X = X;
+ // Include
+ var script = document.createElement('script');
+ script.onload = function () {
+ console.log("LM App injected");
+ routes["/payload"].page = window.KH_LM
+ };
+ script.src = "/Pages/VCockpit/Instruments/aircraft_efb/KH_TFDi_MD11_efb/App.js";
+ document.head.appendChild(script); //or something of the likes
+
// src/components/Router.tsx
init_common();
var import_jsx_runtime15 = __toESM(require_jsx_runtime());
var routes = {