/** * Export dialogs (`e` in the sessions pane, what pi's `/export` does): the * format menu and the output-path prompt. * * ┌─ Export as ─────────────────────────── FilmRecall ─┐ * │ › HTML whole tree, opens in a browser │ * │ JSONL active branch, can be imported again │ * └──────────────────────────────────────────────────────┘ * ┌─ Export to ─────────────────── Enter the export path ─┐ * │ E:\work\pi-session-2026-09-23T….html │ * └──────────────────────────────────────────────────────┘ * * Only wording for a ./select-dialog.ts and an ./input-dialog.ts preset, like * ./restore-dialog.ts. The path is pre-filled with pi's default (the actions * layer resolves it); a directory gets the default file name inside it, and an * existing file is confirmed (./confirm-dialog.ts) before it is overwritten. * * 导出只是两个通用弹窗的预设:先选格式(SelectDialog),再输入输出路径(InputDialog, * 预填 pi 的默认路径,Esc 退回格式菜单)。目标文件已存在时再弹确认框。 */ import { t } from "../../i18n/index.ts"; import type { ExportFormat, KeyHint } from "../../types.ts"; /** Title of the format menu (localised). */ export function exportFormatTitle(): string { return t("dialog.exportFormatTitle"); } /** Format order, top to bottom (HTML first, like /export without an extension). */ export const EXPORT_FORMAT_ORDER: readonly ExportFormat[] = ["html", "jsonl"]; /** Menu entries, top to bottom, localised. */ export function exportFormats(): ReadonlyArray<{ format: ExportFormat; label: string }> { return [ { format: "html", label: t("dialog.exportHtml") }, { format: "jsonl", label: t("dialog.exportJsonl") }, ]; } /** Footer hints while the format menu is open. */ export function exportFormatHints(): KeyHint[] { return [ ["j/k", t("hint.move")], ["Enter", t("hint.select")], ["Esc", t("hint.cancel")], ]; } /** Title of the output-path prompt (localised). */ export function exportPathTitle(): string { return t("dialog.exportPathTitle"); } /** Right-hand title-bar note of the output-path prompt (the field asks for a path). */ export function exportPathSubject(): string { return t("dialog.exportPathSubject"); } /** Footer hints while the output-path prompt is open. */ export function exportPathHints(): KeyHint[] { return [ ["Enter", t("hint.export")], ["Esc", t("hint.back")], [t("hint.folderKey"), t("hint.defaultInside")], ]; }