workflow底层UI库整合至项目,优化构建逻辑

This commit is contained in:
2026-02-24 11:20:18 +08:00
parent 094b185c49
commit 12accb2575
91 changed files with 6820 additions and 115 deletions

View File

@@ -0,0 +1,16 @@
/**
* 判断当前焦点是否位于可编辑元素中(如 input、textarea 或 contenteditable 区域)。
* 适用于快捷键、全局事件监听等需要避免干扰用户输入的场景。
*/
export const isInEditableElement = () => {
const el = document.activeElement;
if (!el || !(el instanceof HTMLElement)) {
return false;
}
return (
el instanceof HTMLInputElement ||
el instanceof HTMLTextAreaElement ||
el.isContentEditable
);
};