refactor: move to modern monaco (#32966)

This commit is contained in:
Stephen Zhou
2026-03-11 17:44:12 +08:00
committed by GitHub
parent b2df0010ce
commit 5ff7d2c895
112 changed files with 334 additions and 54292 deletions

View File

@ -146,6 +146,16 @@ describe('isEventTargetInputArea', () => {
expect(isEventTargetInputArea(el)).toBe(true)
})
it('should return true for monaco editor descendants', () => {
const wrapper = document.createElement('div')
wrapper.className = 'monaco-editor'
const child = document.createElement('div')
wrapper.appendChild(child)
document.body.appendChild(wrapper)
expect(isEventTargetInputArea(child)).toBe(true)
wrapper.remove()
})
it('should return undefined for non-input elements', () => {
const el = document.createElement('div')
expect(isEventTargetInputArea(el)).toBeUndefined()

View File

@ -32,6 +32,9 @@ export const isEventTargetInputArea = (target: HTMLElement) => {
if (target.contentEditable === 'true')
return true
if (target.closest?.('.monaco-editor, .monaco-diff-editor'))
return true
}
/**