import type { PageDSL6, PageDSL7 } from '../../../types/index.js';
import { adjustModalCanvases } from './adjustModalCanvases.js';
import { migrateToDimensions } from './migrateToDimensions.js';
import { migrateToSections } from './migrateToSections.js';

export const migrate6to7 = (dsl: PageDSL6): PageDSL7 => {
  const dslWithModalAdjustments = adjustModalCanvases(dsl);
  const dslWithSections = migrateToSections(dslWithModalAdjustments);
  const dslWithDimensions = migrateToDimensions(dslWithSections);
  dslWithDimensions.version = 7;
  return dslWithDimensions;
};
