import { CellPropertiesEventHandler } from './cell-properties';
/**
 * Save Event handler for the cell properties.
 */
export class CellPropertiesSaveEventHandler extends CellPropertiesEventHandler {
  /**
   * Commit the cell properties changes
   *
   * @param {RTETableExtensionContext} extensionContext - The table extension context.
   * @param {Record<string, RTETablePropertiesType>} _data - The origin of the properties.
   * @param {RTENode} focusNode - The focus node.
   */
  handle(extensionContext, _data, focusNode) {
    if (extensionContext && extensionContext.host) {
      extensionContext.flushValue(extensionContext.host.value);
      this.updateCursorPosition(extensionContext, focusNode);
    }
  }
}
