feat(editor): import docs from docx (#11774)
Support importing .docx files, as mentioned in https://github.com/toeverything/AFFiNE/issues/10154#issuecomment-2655744757 It essentially uses mammoth to convert the docx to html, and then imports the html with the standard steps. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Import Microsoft Word (.docx) files directly via the import dialog (creates new documents). * .docx added as a selectable file type in the file picker and import options. * **Localization** * Added localized labels and tooltips for DOCX import in English, Simplified Chinese, and Traditional Chinese. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: DarkSky <25152247+darkskygit@users.noreply.github.com> Co-authored-by: DarkSky <darksky2048@gmail.com>
This commit is contained in:
@@ -2411,6 +2411,14 @@ export function useAFFiNEI18N(): {
|
||||
* `AFFiNE workspace data`
|
||||
*/
|
||||
["com.affine.import.affine-workspace-data"](): string;
|
||||
/**
|
||||
* `Docx`
|
||||
*/
|
||||
["com.affine.import.docx"](): string;
|
||||
/**
|
||||
* `Import your .docx file.`
|
||||
*/
|
||||
["com.affine.import.docx.tooltip"](): string;
|
||||
/**
|
||||
* `HTML`
|
||||
*/
|
||||
|
||||
@@ -602,6 +602,8 @@
|
||||
"com.affine.import-clipper.dialog.errorLoad": "Failed to load content, please try again.",
|
||||
"com.affine.import_file": "Support Markdown/Notion",
|
||||
"com.affine.import.affine-workspace-data": "AFFiNE workspace data",
|
||||
"com.affine.import.docx": "Docx",
|
||||
"com.affine.import.docx.tooltip": "Import your .docx file.",
|
||||
"com.affine.import.html-files": "HTML",
|
||||
"com.affine.import.html-files.tooltip": "This is an experimental feature that is not perfect and may cause your data to be missing after import.",
|
||||
"com.affine.import.markdown-files": "Markdown files (.md)",
|
||||
|
||||
@@ -592,6 +592,8 @@
|
||||
"com.affine.import-clipper.dialog.errorLoad": "读取内容失败,请重试。",
|
||||
"com.affine.import_file": "支持 Markdown/Notion",
|
||||
"com.affine.import.affine-workspace-data": "AFFiNE 工作区数据",
|
||||
"com.affine.import.docx": "Docx",
|
||||
"com.affine.import.docx.tooltip": "导入您的 Microsoft Office Word 文档。",
|
||||
"com.affine.import.html-files": "HTML",
|
||||
"com.affine.import.html-files.tooltip": "这是一个实验性功能,可能不完全完美,导入后可能会导致数据丢失。",
|
||||
"com.affine.import.markdown-files": "Markdown 文件 (.md)",
|
||||
|
||||
@@ -592,6 +592,8 @@
|
||||
"com.affine.import-clipper.dialog.errorLoad": "加載內容失敗,請重試。",
|
||||
"com.affine.import_file": "支援 Markdown/Notion",
|
||||
"com.affine.import.affine-workspace-data": "AFFiNE 工作區數據",
|
||||
"com.affine.import.docx": "Docx",
|
||||
"com.affine.import.docx.tooltip": "導入您的 Microsoft Office Word 文件。",
|
||||
"com.affine.import.html-files": "HTML",
|
||||
"com.affine.import.html-files.tooltip": "這是一個實驗性功能,可能不完全完美,導入後可能會導致數據丟失。",
|
||||
"com.affine.import.markdown-files": "Markdown 文件 (.md)",
|
||||
|
||||
Reference in New Issue
Block a user