import { TablePropertiesEventHandler } from './table-properties';
/**
 * Save Event handler for the table properties.
 */
export class TablePropertiesSaveEventHandler extends TablePropertiesEventHandler {
  /**
   * Commit the table properties changes
   *
   * @param {RTETableExtensionContext} extensionContext - The table extension context.
   * @param {unknown} _tableBlock - The table block.
   * @param {unknown} _data - The table properties data.
   * @param {RTENode} focusNode - The focus node.
   */
  handle(extensionContext, _tableBlock, _data, focusNode) {
    if (extensionContext && extensionContext.host) {
      extensionContext.flushValue(extensionContext.host.value);
      this.updateCursorPosition(extensionContext, focusNode);
    }
  }
}
