import React from "react"; import "./CodeEditorMenu.css"; import type { SourceFormat } from "../types/editor"; interface CodeEditorMenuProps { /** Current source content; passed to the formatter when the user clicks "Format PreTeXt". */ content: string; /** Determines which toolbar actions are available (e.g. formatting is PreTeXt-only). */ sourceFormat: SourceFormat; /** Called with the formatted content after a successful format operation. */ onContentChange: (newContent: string) => void; /** Called when the user clicks "Import LaTeX" to open the import dialog. */ onOpenLatexImport: () => void; /** Called when the user clicks "Edit Macros" to open the docinfo editor. */ onOpenDocinfoEditor: () => void; /** Triggers an undo in the Monaco editor. Passed through from the parent. */ onUndo: () => void; /** Triggers a redo in the Monaco editor. Passed through from the parent. */ onRedo: () => void; /** Whether the undo button should be enabled. */ canUndo: boolean; /** Whether the redo button should be enabled. */ canRedo: boolean; /** * If provided, a "Convert to PreTeXt" button is shown. * Called when the user clicks to promote the derived PreTeXt to the canonical source. */ onConvertToPretext?: () => void; /** * Controls whether the "Convert to PreTeXt" button is enabled. * Should be `false` when conversion has failed. */ canConvertToPretext?: boolean; /** If provided, an "Assets" button is shown (PreTeXt mode only). */ onOpenAssets?: () => void; /** Called when the user clicks "Display Full Source" to open the assembled-source modal. */ onShowFullSource: () => void; } declare const CodeEditorMenu: React.FC; export default CodeEditorMenu;