decord/source/actions/ContextMenuActionCreators.tsx

158 lines
4.7 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 5445
// Function ID: 5446
2026-07-29 08:29:29 +00:00
// Name: openContextMenu
2026-08-25 06:04:03 +00:00
// Dependencies: [676, 709, 5446, 500, 5449, 2]
2026-07-20 16:05:17 +00:00
// Exports: closeContextMenu, openContextMenuLazy
2026-08-25 06:04:03 +00:00
// Module 5445 (openContextMenu)
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
import ME from "ME" /* 676 */;
import dispatcherDefault from "dispatcher" /* 709 */;
2026-07-21 22:01:30 +00:00
2026-07-29 08:29:29 +00:00
function openContextMenu(stopPropagation, arg1, enableSpellCheck, arg3) {
2026-07-20 16:05:17 +00:00
stopPropagation.stopPropagation();
if (null == stopPropagation.currentTarget.contains) {
pageY = 0;
2026-07-29 08:29:29 +00:00
pageX = 0;
2026-07-20 16:05:17 +00:00
if ("pageX" in stopPropagation) {
({ pageX, pageY } = stopPropagation);
}
let sum1 = pageY;
let tmp3 = pageX;
if (0 === pageX) {
sum1 = pageY;
2026-07-29 08:29:29 +00:00
tmp3 = pageX;
2026-07-20 16:05:17 +00:00
if (0 === pageY) {
const target = stopPropagation.target;
let selection;
2026-07-29 08:29:29 +00:00
if (target != null) {
2026-07-20 16:05:17 +00:00
const defaultView = target.ownerDocument.defaultView;
2026-07-29 08:29:29 +00:00
if (defaultView != null) {
2026-07-20 16:05:17 +00:00
selection = defaultView.getSelection();
}
}
bottom = pageY;
2026-07-29 08:29:29 +00:00
left = pageX;
2026-07-20 16:05:17 +00:00
if (null != selection) {
bottom = pageY;
2026-07-29 08:29:29 +00:00
left = pageX;
2026-07-20 16:05:17 +00:00
if (selection.rangeCount > 0) {
bottom = pageY;
2026-07-29 08:29:29 +00:00
left = pageX;
2026-07-20 16:05:17 +00:00
if (null != target) {
const rangeAt = selection.getRangeAt(0);
bottom = pageY;
2026-07-29 08:29:29 +00:00
left = pageX;
2026-07-20 16:05:17 +00:00
if (target.contains(rangeAt.commonAncestorContainer)) {
const boundingClientRect = rangeAt.getBoundingClientRect();
bottom = pageY;
2026-07-29 08:29:29 +00:00
left = pageX;
2026-07-20 16:05:17 +00:00
if (0 !== boundingClientRect.height) {
({ left, bottom } = boundingClientRect);
}
}
}
}
}
sum1 = bottom;
tmp3 = left;
if (0 === left) {
sum1 = bottom;
2026-07-29 08:29:29 +00:00
tmp3 = left;
2026-07-20 16:05:17 +00:00
if (0 === bottom) {
let size;
2026-07-29 08:29:29 +00:00
if (target != null) {
2026-07-20 16:05:17 +00:00
size = target.getBoundingClientRect();
}
2026-07-29 08:29:29 +00:00
if (size == null) {
2026-07-20 16:05:17 +00:00
size = {};
}
const left2 = size.left;
let num2 = 0;
if (undefined !== left2) {
num2 = left2;
}
const top = size.top;
let num3 = 0;
if (undefined !== top) {
num3 = top;
}
const width = size.width;
let num4 = 0;
if (undefined !== width) {
num4 = width;
}
const height = size.height;
let num6 = 0;
const sum = num2 + num4 / 2;
if (undefined !== height) {
num6 = height;
}
sum1 = num3 + num6 / 2;
tmp3 = sum;
}
}
}
}
2026-07-29 08:29:29 +00:00
let obj = { render: null, renderLazy: null, target: null, rect: null, config: null };
obj[0] = arg1;
obj[1] = arg3;
2026-07-20 16:05:17 +00:00
let currentTarget2 = stopPropagation.target;
2026-07-29 08:29:29 +00:00
if (currentTarget2 == null) {
2026-07-20 16:05:17 +00:00
currentTarget2 = stopPropagation.currentTarget;
}
2026-07-29 08:29:29 +00:00
obj[2] = currentTarget2;
2026-07-20 16:05:17 +00:00
const _DOMRect = DOMRect;
const dOMRect = new DOMRect(tmp3, sum1, 0, 0);
2026-07-29 08:29:29 +00:00
obj[3] = dOMRect;
2026-08-25 06:04:03 +00:00
let APP = obj(5446).getCurrentlyInteractingAppContext();
2026-07-29 08:29:29 +00:00
if (APP == null) {
2026-07-20 16:05:17 +00:00
APP = AppContext.APP;
}
2026-07-29 08:29:29 +00:00
obj = { context: null };
obj[0] = APP;
2026-07-20 16:05:17 +00:00
const merged = Object.assign(enableSpellCheck);
2026-07-29 08:29:29 +00:00
obj[4] = obj;
2026-07-20 16:05:17 +00:00
let nativeEvent = stopPropagation;
if ("nativeEvent" in stopPropagation) {
nativeEvent = stopPropagation.nativeEvent;
}
2026-07-29 08:29:29 +00:00
enableSpellCheck = undefined;
if (enableSpellCheck != null) {
enableSpellCheck = enableSpellCheck.enableSpellCheck;
}
if (enableSpellCheck) {
let tmp16Result = tmp16(500);
if (tmp16Result.isDesktop()) {
if (nativeEvent.isTrusted) {
2026-08-25 06:04:03 +00:00
tmp16Result = tmp16(5449);
2026-08-24 06:08:38 +00:00
importDefault = tmp16Result.addResultListener(() => {
2026-07-29 08:29:29 +00:00
callback();
2026-08-24 06:08:38 +00:00
obj = callback(closure_1_2[1]);
2026-07-29 08:29:29 +00:00
obj = { type: "CONTEXT_MENU_OPEN", contextMenu: obj };
obj.dispatch(obj);
});
2026-07-20 16:05:17 +00:00
}
}
}
stopPropagation.preventDefault();
2026-08-25 06:04:03 +00:00
const obj3 = obj(5446);
2026-08-24 06:08:38 +00:00
obj1 = { type: "CONTEXT_MENU_OPEN", contextMenu: null };
2026-07-29 08:29:29 +00:00
obj1[1] = obj;
2026-08-24 06:08:38 +00:00
dispatcherDefault.dispatch(obj1);
const obj6 = dispatcherDefault;
2026-07-20 16:05:17 +00:00
} else {
const currentTarget = stopPropagation.currentTarget;
}
}
2026-08-24 06:08:38 +00:00
const AppContext = ME.AppContext;
const result = set.fileFinishedImporting("actions/ContextMenuActionCreators.tsx");
2026-07-20 16:05:17 +00:00
export function closeContextMenu() {
}
export { openContextMenu };
2026-07-29 08:29:29 +00:00
export const openContextMenuLazy = function openContextMenuLazy(stopPropagation, arg1, enableSpellCheck) {
openContextMenu(stopPropagation, undefined, enableSpellCheck, arg1);
2026-07-20 16:05:17 +00:00
};