import { MergeTranslationsVisitor } from "@makeswift/controls";
import { RichTextV2Definition } from "../rich-text-v2";
import { mergeTranslatedNodes } from "../rich-text-v2/translations/merge-translations";
class ReactMergeTranslationsVisitor extends MergeTranslationsVisitor {
  visitRichTextV2(def, data, translatedData) {
    if (data == null || translatedData == null)
      return data;
    const { descendants, ...rest } = RichTextV2Definition.normalizeData(data);
    return {
      ...rest,
      descendants: mergeTranslatedNodes(
        descendants,
        translatedData,
        def.config.plugins
      )
    };
  }
}
export {
  ReactMergeTranslationsVisitor
};
//# sourceMappingURL=merge-translations-visitor.js.map