import { getTableElement } from '@admin/utils/editor/get-table-element' import { TABLE_WRAPPER_CLASS } from '@admin/utils/editor/table-wrapper-class' export function getTableWrapperElement(dom: Node | null): HTMLElement | null { if (!(dom instanceof HTMLElement)) return null if (dom.classList.contains(TABLE_WRAPPER_CLASS)) return dom const table = getTableElement(dom) const wrapper = table?.closest(`.${TABLE_WRAPPER_CLASS}`) return wrapper instanceof HTMLElement ? wrapper : null }