efficient-office 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Documents-4L3242LJ.js +1 -0
- package/dist/chunk-7B4B25DB.js +1 -0
- package/dist/{chunk-HNNYUGDU.js → chunk-JI56OCIU.js} +1 -1
- package/dist/{chunk-O35VT6BD.js → chunk-LGY776XE.js} +1 -1
- package/dist/{chunk-EC6D54MM.js → chunk-SDLOT5Z5.js} +1 -1
- package/dist/chunk-VMUUFEWS.js +1 -0
- package/dist/documents/documents.css +43 -1
- package/dist/documents/index.d.ts +154 -2
- package/dist/documents/index.js +1 -1
- package/dist/{docxPdf-S4RXU4L2.js → docxPdf-LO2VPZSJ.js} +1 -1
- package/dist/importDocument-C5L275FU.js +1 -0
- package/package.json +1 -1
- package/dist/Documents-2ZU5D3ZI.js +0 -1
- package/dist/chunk-POH6OTTR.js +0 -1
- package/dist/chunk-YKQ5UKYZ.js +0 -1
- package/dist/importDocument-34WALCTG.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ENGLISH_FILE_WORDS as e,ZH_HANS_FILE_WORDS as t}from"./chunk-B32ASXHM.js";var o={comments:"Comments",comment:"Comment",reply:"Reply",commentPlaceholder:"Comment, or add others with @",commentFailed:"This comment could not be saved.",commentNeedsSelection:"Select the words to comment on first.",editComment:"Edit comment",deleteComment:"Delete comment",assignTo:e=>`Assign to ${e}`,assignedTo:e=>`Assigned to ${e}`,resolve:"Resolve",reopen:"Reopen",resolvedCount:e=>1===e?"1 resolved comment":`${e} resolved comments`,noComments:"No comments yet. Select some words and choose Comment.",noCommentsView:"No comments yet.",suggestions:"Suggestions",suggestionInsert:e=>`Add "${e}"`,suggestionDelete:e=>`Delete "${e}"`,suggestionReplace:(e,t)=>`Replace "${e}" with "${t}"`,accept:"Accept",reject:"Reject",mode:"Mode",modeEditing:"Editing",modeSuggesting:"Suggesting",modeViewing:"Viewing",modeEditingHint:"Edit the document directly",modeSuggestingHint:"Edits become suggestions",modeViewingHint:"Read or print the final document",overwrote:e=>`${e} changed a paragraph you were editing, and their change was kept.`,overwroteSomeone:"Someone else changed a paragraph you were editing, and their change was kept.",putMineBack:"Put mine back",versionHistory:"Version history",nameCurrentVersion:"Name current version",nameVersion:"Name this version",renameVersion:"Rename",versionName:"Version name",currentVersion:"Current version",noVersions:"No earlier versions yet.",versionsFailed:"The history could not be loaded.",restoreVersion:"Restore this version",restoreConfirm:e=>`Make "${e}" the document again? The version it replaces stays in the history.`,restoreFailed:"This version could not be restored.",previewing:e=>`Showing ${e}. Changes since the version before are marked.`,backToDocument:"Back to the document",editors:e=>1===e?"1 other person here":`${e} other people here`,styleHeading4:"Heading 4",styleHeading5:"Heading 5",styleHeading6:"Heading 6",applyStyle:e=>`Apply "${e}"`,updateStyle:e=>`Update "${e}" to match`,styleUpdated:e=>`"${e}" now looks like the selected paragraph.`,paintFormat:"Paint format",paintFormatHint:"Select the text to give this formatting.",checklist:"Checklist",paragraphSpacing:"Line and paragraph spacing",addSpaceBefore:"Add space before paragraph",removeSpaceBefore:"Remove space before paragraph",addSpaceAfter:"Add space after paragraph",removeSpaceAfter:"Remove space after paragraph",customSpacing:"Custom spacing and indents",lineSpacingCustom:"Line spacing (lines)",spacingBefore:"Space before (pt)",spacingAfter:"Space after (pt)",indentLeft:"Left indent (pt)",indentRight:"Right indent (pt)",indentSpecial:"Special indent",indentNone:"None",indentFirstLine:"First line",indentHanging:"Hanging",indentBy:"By (pt)",spacingInvalid:"Enter numbers of 0 or more, and a line spacing between 0 and 10.",ruler:"Ruler",tabStop:"Tab stop",tabStopHint:"Click to add a tab stop. Drag one off the ruler to remove it. Double-click one to change its alignment.",columns:"Columns",columnsCount:e=>1===e?"One column":2===e?"Two columns":`${e} columns`,tableOfContents:"Table of contents",tocRefresh:"Refresh table of contents",tocDelete:"Delete table of contents",footnote:"Footnote",footnotes:"Footnotes",footnotePlaceholder:"Footnote text",footnoteLocked:"This footnote holds more than text, so it is kept as it is. Edit it in Word.",bookmark:"Bookmark",bookmarkPrompt:"Name the bookmark. Letters, numbers and underscores, starting with a letter.",bookmarkInvalid:"A bookmark name starts with a letter and has only letters, numbers and underscores.",bookmarkTaken:"There is already a bookmark with that name.",linkToHeading:"Link to a heading",linkToBookmark:"Link to a bookmark",noHeadings:"No headings yet",noBookmarks:"No bookmarks yet",breakMenu:"Break",sectionBreakNext:"Section break (next page)",sectionBreakContinuous:"Section break (continuous)",removeSectionBreak:"Remove section break",headersFooters:"Headers and footers",headersFootersHint:"Click to edit headers and footers",differentFirst:"Different first page",differentOddEven:"Different odd and even pages",headerDefault:"All pages",headerOdd:"Odd pages",headerFirst:"First page",headerEven:"Even pages",pageCount:"Page count",webFonts:"Web fonts",wordFonts:"Word fonts",pdfPageFailed:e=>`Page ${e} couldn't be drawn for the PDF.`,files:e,fileKind:"Word",backToFiles:"Back to files",filesHeading:"Documents",newFile:"New document",openFile:"Open a file",filesEmptyTitle:"Write your first document",filesEmptyBody:"Every change saves by itself.",deleteFile:"Delete",createFailed:"The document could not be made.",deleteFailed:"The document could not be deleted.",deleteConfirm:e=>`Delete "${e}"? Nobody can open it again.`,documentName:"Document name",documentPanel:"Document",pagePanel:"Page",outline:"Outline",outlineEmpty:"Headings in the document show here.",morePageSetup:"More page setup",export:"Export",renameFailed:"The document could not be renamed.",openFailed:"This document could not be opened.",conflict:"Somebody else saved this document, so your latest changes are not saved. Reload to see theirs.",reload:"Reload",noStoreEdited:"Not saved. Export to keep your changes",noStoreClean:"No autosave here. Export to keep a copy",openFromFiles:"Go back to your files to open another document.",untitled:"Untitled",loading:"Loading",newDocument:"New",open:"Open",rename:"Rename",menuFile:"File",menuInsert:"Insert",menuLayout:"Layout",save:"Save",saveDocx:"Save (.docx)",saveKeepType:"Save",saveAs:"Save as",saveAsWord:"Word document (.docx)",saveAsPdf:"PDF (from the print dialog)",saveAsWeb:"Web page (.html)",saveAsText:"Plain text (.txt)",print:"Print",undo:"Undo",redo:"Redo",find:"Find",replaceWith:"Replace with",replace:"Replace",replaceAll:"Replace all",matchCase:"Match case",previousMatch:"Previous match",nextMatch:"Next match",closeFind:"Close find",noMatches:"No matches",paragraphStyle:"Paragraph style",font:"Font",fontSize:"Font size",bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",superscript:"Superscript",subscript:"Subscript",textColor:"Text color",highlight:"Highlight color",clearFormatting:"Clear formatting",bulletedList:"Bulleted list",numberedList:"Numbered list",decreaseIndent:"Decrease indent",increaseIndent:"Increase indent",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",justify:"Justify",lineSpacing:"Line spacing",styleNormal:"Normal",styleTitle:"Title",styleHeading1:"Heading 1",styleHeading2:"Heading 2",styleHeading3:"Heading 3",styleQuote:"Quote",table:"Table",image:"Image",link:"Link",linkPrompt:"Web address, or leave empty to remove the link.",linkInvalid:"That address can't be used as a link.",pageBreak:"Page break",pageNumber:"Page number",horizontalLine:"Horizontal line",rowAbove:"Insert row above",rowBelow:"Insert row below",columnLeft:"Insert column left",columnRight:"Insert column right",mergeCells:"Merge cells",mergeFailed:"These cells can't be merged: the selection would cut a merged cell.",cellShading:"Cell shading",noColor:"No color",deleteRow:"Delete row",deleteColumn:"Delete column",deleteTable:"Delete table",imageWidth:"Image width",imageOriginalSize:"Original size",imageRemove:"Remove image",pageSetup:"Page setup",paperSize:"Size",paperLetter:"US Letter",paperLegal:"US Legal",custom:"Custom",orientation:"Orientation",portrait:"Portrait",landscape:"Landscape",margins:"Margins",marginsNormal:"Normal, 2.54 cm",marginsNarrow:"Narrow, 1.27 cm",marginsModerate:"Moderate, 1.91 cm sides",marginsWide:"Wide, 5.08 cm sides",header:"Header",footer:"Footer",headerFooterLocked:"This one holds a picture or a table, so it is kept as it is. Edit it in Word.",ok:"OK",cancel:"Cancel",dismiss:"Dismiss",zoomIn:"Zoom in",zoomOut:"Zoom out",wrapLines:"Wrap lines",objectTextBox:"Text box",objectChart:"Chart from Word. Kept as is.",objectDiagram:"Diagram from Word. Kept as is.",objectEquation:"Equation from Word. Kept as is.",objectPicture:"Picture from Word. Kept as is.",objectOther:"Object from Word. Kept as is.",objectField:"Field",discardMessage:"They haven't been saved.",discard:"Discard",keepEditing:"Keep editing",legacyDoc:".doc is the old Word format. Save it as .docx in Word first.",openedOldSave:"Opened as a document. Save it to get a Word file.",saveFailed:"The document could not be saved.",savedAsUtf8:"Saved as UTF-8: the original encoding can't be written from a browser.",dropHint:"Drop a document to open. Images insert into the page.",matchCount:(e,t)=>`${e} of ${t}`,replacedCount:e=>1===e?"1 replacement":`${e} replacements`,tableSize:(e,t)=>`${e} × ${t}`,pageLabel:e=>`Page ${e}`,pageOf:(e,t)=>`Page ${e} of ${t}`,wordCount:e=>1===e?"1 word":`${e.toLocaleString()} words`,lineColumn:(e,t)=>`Ln ${e}, Col ${t}`,lineCount:e=>1===e?"1 line":`${e.toLocaleString()} lines`,noticeComments:e=>1===e?"1 comment":`${e} comments`,noticeTracked:e=>1===e?"1 tracked change":`${e} tracked changes`,noticeObjects:e=>1===e?"1 object such as a text box":`${e} objects such as text boxes`,noticeFootnotes:e=>1===e?"1 footnote":`${e} footnotes`,noticeLead:e=>`Has ${e.length>1?`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`:e[0]}. They stay in the file, but need Word to edit.`,discardTitle:e=>`Discard your changes to ${e}?`,cannotRead:e=>`${e} can't be opened. It may be damaged or password protected.`,unsupported:e=>`Unsupported file type: .${e||"unknown"}`},n={comments:"评论",comment:"评论",reply:"回复",commentPlaceholder:"发表评论,或使用 @ 添加其他人",commentFailed:"无法保存此评论。",commentNeedsSelection:"请先选择要评论的文字。",editComment:"编辑评论",deleteComment:"删除评论",assignTo:e=>`分配给 ${e}`,assignedTo:e=>`已分配给 ${e}`,resolve:"解决",reopen:"重新打开",resolvedCount:e=>`${e} 条已解决的评论`,noComments:"尚无评论。选择文字后点按“评论”。",noCommentsView:"尚无评论。",suggestions:"建议",suggestionInsert:e=>`添加“${e}”`,suggestionDelete:e=>`删除“${e}”`,suggestionReplace:(e,t)=>`将“${e}”替换为“${t}”`,accept:"接受",reject:"拒绝",mode:"模式",modeEditing:"编辑",modeSuggesting:"建议",modeViewing:"查看",modeEditingHint:"直接编辑文档",modeSuggestingHint:"所做修改将成为建议",modeViewingHint:"阅读或打印最终文档",overwrote:e=>`${e} 修改了你正在编辑的段落,已保留其修改。`,overwroteSomeone:"有人修改了你正在编辑的段落,已保留其修改。",putMineBack:"恢复我的修改",versionHistory:"版本历史记录",nameCurrentVersion:"命名当前版本",nameVersion:"命名此版本",renameVersion:"重命名",versionName:"版本名称",currentVersion:"当前版本",noVersions:"尚无早期版本。",versionsFailed:"无法加载历史记录。",restoreVersion:"恢复此版本",restoreConfirm:e=>`将“${e}”恢复为当前文档?被替换的版本会保留在历史记录中。`,restoreFailed:"无法恢复此版本。",previewing:e=>`正在显示 ${e}。已标出与上一版本相比的更改。`,backToDocument:"返回文档",editors:e=>`另有 ${e} 人在此`,styleHeading4:"标题 4",styleHeading5:"标题 5",styleHeading6:"标题 6",applyStyle:e=>`应用“${e}”`,updateStyle:e=>`更新“${e}”以匹配所选内容`,styleUpdated:e=>`“${e}”现在与所选段落一致。`,paintFormat:"格式刷",paintFormatHint:"选择要应用此格式的文字。",checklist:"核对清单",paragraphSpacing:"行距和段落间距",addSpaceBefore:"在段前添加间距",removeSpaceBefore:"删除段前间距",addSpaceAfter:"在段后添加间距",removeSpaceAfter:"删除段后间距",customSpacing:"自定义间距和缩进",lineSpacingCustom:"行距(行)",spacingBefore:"段前(磅)",spacingAfter:"段后(磅)",indentLeft:"左缩进(磅)",indentRight:"右缩进(磅)",indentSpecial:"特殊缩进",indentNone:"无",indentFirstLine:"首行缩进",indentHanging:"悬挂缩进",indentBy:"缩进值(磅)",spacingInvalid:"请输入不小于 0 的数字,行距须在 0 到 10 之间。",ruler:"标尺",tabStop:"制表位",tabStopHint:"单击添加制表位。将制表位拖离标尺即可删除。双击可更改其对齐方式。",columns:"分栏",columnsCount:e=>1===e?"一栏":2===e?"两栏":`${e} 栏`,tableOfContents:"目录",tocRefresh:"更新目录",tocDelete:"删除目录",footnote:"脚注",footnotes:"脚注",footnotePlaceholder:"脚注文字",footnoteLocked:"此脚注包含文字以外的内容,因此保持原样。请在 Word 中编辑。",bookmark:"书签",bookmarkPrompt:"为书签命名。可使用字母、数字和下划线,须以字母开头。",bookmarkInvalid:"书签名称须以字母开头,且只能包含字母、数字和下划线。",bookmarkTaken:"已有同名书签。",linkToHeading:"链接到标题",linkToBookmark:"链接到书签",noHeadings:"尚无标题",noBookmarks:"尚无书签",breakMenu:"分隔符",sectionBreakNext:"分节符(下一页)",sectionBreakContinuous:"分节符(连续)",removeSectionBreak:"删除分节符",headersFooters:"页眉和页脚",headersFootersHint:"单击以编辑页眉和页脚",differentFirst:"首页不同",differentOddEven:"奇偶页不同",headerDefault:"所有页",headerOdd:"奇数页",headerFirst:"首页",headerEven:"偶数页",pageCount:"总页数",webFonts:"网络字体",wordFonts:"Word 字体",pdfPageFailed:e=>`第 ${e} 页无法绘制到 PDF。`,files:t,fileKind:"Word",backToFiles:"返回文件",filesHeading:"文档",newFile:"新建文档",openFile:"打开文件",filesEmptyTitle:"写下您的第一份文档",filesEmptyBody:"每次更改都会自动保存。",deleteFile:"删除",createFailed:"无法创建文档。",deleteFailed:"无法删除文档。",deleteConfirm:e=>`删除“${e}”?之后任何人都无法再打开它。`,documentName:"文档名称",documentPanel:"文档",pagePanel:"页面",outline:"大纲",outlineEmpty:"文档中的标题会显示在这里。",morePageSetup:"更多页面设置",export:"导出",renameFailed:"无法重命名文档。",openFailed:"无法打开此文档。",conflict:"其他人已保存此文档,您最近的更改尚未保存。请重新加载以查看他们的版本。",reload:"重新加载",noStoreEdited:"未保存。请导出以保留更改",noStoreClean:"此处不会自动保存。请导出以保留副本",openFromFiles:"请返回文件列表以打开其他文档。",untitled:"未命名",loading:"正在加载",newDocument:"新建",open:"打开",rename:"重命名",menuFile:"文件",menuInsert:"插入",menuLayout:"布局",save:"保存",saveDocx:"保存 (.docx)",saveKeepType:"保存",saveAs:"另存为",saveAsWord:"Word 文档 (.docx)",saveAsPdf:"PDF(通过打印对话框)",saveAsWeb:"网页 (.html)",saveAsText:"纯文本 (.txt)",print:"打印",undo:"撤销",redo:"重做",find:"查找",replaceWith:"替换为",replace:"替换",replaceAll:"全部替换",matchCase:"区分大小写",previousMatch:"上一个匹配项",nextMatch:"下一个匹配项",closeFind:"关闭查找",noMatches:"无匹配项",paragraphStyle:"段落样式",font:"字体",fontSize:"字号",bold:"加粗",italic:"倾斜",underline:"下划线",strikethrough:"删除线",superscript:"上标",subscript:"下标",textColor:"文字颜色",highlight:"突出显示颜色",clearFormatting:"清除格式",bulletedList:"项目符号列表",numberedList:"编号列表",decreaseIndent:"减少缩进",increaseIndent:"增加缩进",alignLeft:"左对齐",alignCenter:"居中",alignRight:"右对齐",justify:"两端对齐",lineSpacing:"行距",styleNormal:"正文",styleTitle:"标题",styleHeading1:"标题 1",styleHeading2:"标题 2",styleHeading3:"标题 3",styleQuote:"引用",table:"表格",image:"图片",link:"链接",linkPrompt:"输入网址;留空则移除链接。",linkInvalid:"该地址不能用作链接。",pageBreak:"分页符",pageNumber:"页码",horizontalLine:"水平线",rowAbove:"在上方插入行",rowBelow:"在下方插入行",columnLeft:"在左侧插入列",columnRight:"在右侧插入列",mergeCells:"合并单元格",mergeFailed:"无法合并这些单元格:所选范围会切开已合并的单元格。",cellShading:"单元格底纹",noColor:"无颜色",deleteRow:"删除行",deleteColumn:"删除列",deleteTable:"删除表格",imageWidth:"图片宽度",imageOriginalSize:"原始大小",imageRemove:"移除图片",pageSetup:"页面设置",paperSize:"纸张大小",paperLetter:"美国信纸",paperLegal:"美国法律用纸",custom:"自定义",orientation:"方向",portrait:"纵向",landscape:"横向",margins:"页边距",marginsNormal:"常规,2.54 厘米",marginsNarrow:"窄,1.27 厘米",marginsModerate:"中等,左右 1.91 厘米",marginsWide:"宽,左右 5.08 厘米",header:"页眉",footer:"页脚",headerFooterLocked:"此处包含图片或表格,因此保持原样。请在 Word 中编辑。",ok:"确定",cancel:"取消",dismiss:"关闭",zoomIn:"放大",zoomOut:"缩小",wrapLines:"自动换行",objectTextBox:"文本框",objectChart:"来自 Word 的图表,保持原样。",objectDiagram:"来自 Word 的示意图,保持原样。",objectEquation:"来自 Word 的公式,保持原样。",objectPicture:"来自 Word 的图片,保持原样。",objectOther:"来自 Word 的对象,保持原样。",objectField:"域",discardMessage:"这些更改尚未保存。",discard:"放弃",keepEditing:"继续编辑",legacyDoc:".doc 是旧版 Word 格式,请先在 Word 中另存为 .docx。",openedOldSave:"已作为文档打开。保存后即可得到 Word 文件。",saveFailed:"无法保存文档。",savedAsUtf8:"已保存为 UTF-8:浏览器无法写入原始编码。",dropHint:"拖放文档以打开;图片会插入页面。",matchCount:(e,t)=>`第 ${e} 个,共 ${t} 个`,replacedCount:e=>`已替换 ${e} 处`,tableSize:(e,t)=>`${e} × ${t}`,pageLabel:e=>`第 ${e} 页`,pageOf:(e,t)=>`第 ${e} 页,共 ${t} 页`,wordCount:e=>`${e.toLocaleString()} 字`,lineColumn:(e,t)=>`第 ${e} 行,第 ${t} 列`,lineCount:e=>`${e.toLocaleString()} 行`,noticeComments:e=>`${e} 条批注`,noticeTracked:e=>`${e} 处修订`,noticeObjects:e=>`${e} 个文本框等对象`,noticeFootnotes:e=>`${e} 条脚注`,noticeLead:e=>`包含 ${e.join("、")}。它们会保留在文件中,但需要在 Word 中编辑。`,discardTitle:e=>`放弃对 ${e} 的更改?`,cannotRead:e=>`无法打开 ${e}。文件可能已损坏或受密码保护。`,unsupported:e=>`不支持的文件类型:.${e||"未知"}`};export{o as ENGLISH_WORDS,n as ZH_HANS_WORDS};
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
.docs-body { flex: 1; display: flex; min-height: 0; }
|
|
16
16
|
.docs-centre { flex: 1; min-width: 0; display: flex; flex-direction: column; }
|
|
17
17
|
.docs-title { width: 200px; min-width: 80px; flex: 0 1 auto; }
|
|
18
|
-
.docs-history { display: inline-flex; align-items: center; gap: 2px; }
|
|
18
|
+
.docs-history { display: inline-flex; flex: none; align-items: center; gap: 2px; }
|
|
19
19
|
.docs-menu-trigger { padding: 4px 8px; border-radius: 6px; font-size: 13px; color: var(--ink-muted); }
|
|
20
20
|
.docs-menu-trigger:hover { background: var(--line-subtle); color: var(--ink); }
|
|
21
21
|
.docs-export-trigger { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 500; white-space: nowrap; }
|
|
@@ -70,6 +70,48 @@
|
|
|
70
70
|
|
|
71
71
|
.docs-para-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
|
|
72
72
|
.docs-para-error { margin: 8px 0 0; font-size: 12px; color: var(--status-danger-ink, #b42318); }
|
|
73
|
+
|
|
74
|
+
/* Working together (Documents parity items 1-3). */
|
|
75
|
+
.docs-visitors { display: inline-flex; align-items: center; margin-right: 4px; }
|
|
76
|
+
.docs-visitor { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-left: -6px; border: 2px solid var(--surface); border-radius: 50%; color: #fff; font-size: 10px; font-weight: 600; }
|
|
77
|
+
.docs-visitor:first-child { margin-left: 0; }
|
|
78
|
+
.docs-mode-trigger { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 13px; white-space: nowrap; }
|
|
79
|
+
.docs-mode-trigger:hover { background: var(--line-subtle); }
|
|
80
|
+
.docs-toolbar-off { opacity: 0.45; }
|
|
81
|
+
.docs-remote-caret { position: absolute; width: 2px; pointer-events: none; z-index: 3; }
|
|
82
|
+
.docs-remote-caret > span { position: absolute; left: 0; top: -14px; padding: 0 4px; border-radius: 3px; color: #fff; font: 600 10px/14px var(--font-sans, sans-serif); white-space: nowrap; }
|
|
83
|
+
.docs-preview { position: relative; box-sizing: border-box; }
|
|
84
|
+
|
|
85
|
+
.docs-comments, .docs-history-panel { width: clamp(220px, 26%, 300px); display: flex; flex-direction: column; }
|
|
86
|
+
.docs-comments-empty { padding: 12px; }
|
|
87
|
+
.docs-thread { margin: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
|
|
88
|
+
.docs-thread-active { border-color: var(--accent-fill, #1a73e8); box-shadow: 0 0 0 1px var(--accent-fill, #1a73e8); cursor: default; }
|
|
89
|
+
.docs-thread-resolved { opacity: 0.7; }
|
|
90
|
+
.docs-thread-quote { margin: 0; padding-left: 8px; border-left: 3px solid #e0b000; color: var(--ink-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
|
|
91
|
+
.docs-thread-assignee { margin: 0; display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--ink-muted); }
|
|
92
|
+
.docs-thread-actions { display: flex; gap: 6px; flex-wrap: wrap; }
|
|
93
|
+
.docs-comment { display: flex; flex-direction: column; gap: 2px; }
|
|
94
|
+
.docs-comment + .docs-comment { padding-top: 6px; border-top: 1px solid var(--line-subtle, var(--line)); }
|
|
95
|
+
.docs-comment-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
|
|
96
|
+
.docs-avatar { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex: none; border-radius: 50%; background: var(--accent-tint-strong, var(--line)); color: var(--ink); font-size: 9px; font-weight: 600; }
|
|
97
|
+
.docs-comment-author { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
98
|
+
.docs-comment-time { margin-right: auto; font-size: 11px; color: var(--ink-muted); white-space: nowrap; }
|
|
99
|
+
.docs-comment-body { margin: 0; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
100
|
+
.docs-composer { position: relative; display: flex; flex-direction: column; gap: 6px; }
|
|
101
|
+
.docs-composer-actions { display: flex; justify-content: flex-end; gap: 6px; }
|
|
102
|
+
.docs-mentions { position: absolute; z-index: 5; top: 100%; left: 0; right: 0; margin: 2px 0 0; padding: 4px; list-style: none; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-raised, var(--surface)); }
|
|
103
|
+
.docs-mentions li { padding: 4px 6px; border-radius: 4px; font-size: 12px; cursor: pointer; }
|
|
104
|
+
.docs-mentions li:hover { background: var(--line-subtle); }
|
|
105
|
+
.docs-suggestion .docs-comment-body { color: #1a7f5a; }
|
|
106
|
+
.docs-versions { margin: 0; padding: 8px; list-style: none; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
|
|
107
|
+
.docs-versions li { border-radius: 6px; }
|
|
108
|
+
.docs-version-on { background: var(--accent-tint, var(--line-subtle)); }
|
|
109
|
+
.docs-version-on .docs-thread-actions { padding: 0 8px 8px; }
|
|
110
|
+
.docs-version { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 8px; border-radius: 6px; text-align: left; color: var(--ink); }
|
|
111
|
+
.docs-version:hover { background: var(--line-subtle); }
|
|
112
|
+
.docs-version-title { font-size: 12px; font-weight: 600; }
|
|
113
|
+
.docs-version-when, .docs-version-who { font-size: 11px; color: var(--ink-muted); }
|
|
114
|
+
.docs-visitors, .docs-mode-trigger { flex: none; }
|
|
73
115
|
/* The file list Documents and Spreadsheet share (./FileList.tsx), laid out as
|
|
74
116
|
Slides' deck list is. The build appends this to documents.css and
|
|
75
117
|
spreadsheet.css, so a host loads it with the app's own stylesheet. */
|
|
@@ -10,7 +10,7 @@ export { E as ENGLISH_FILE_WORDS, O as OfficeFileChoice, a as OfficeFileRequest,
|
|
|
10
10
|
* The zh-Hans words for the Easel frame (`backToFiles` to `openFromFiles`) are
|
|
11
11
|
* machine-written, and no person has read them yet. Nor have the file list's
|
|
12
12
|
* (`filesHeading` to `deleteConfirm`), nor the parity words of 2026-11-16 (`styleHeading4`
|
|
13
|
-
* to `wordFonts`).
|
|
13
|
+
* to `wordFonts`, `comments` to `editors`).
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
interface DocumentsWords {
|
|
@@ -230,6 +230,51 @@ interface DocumentsWords {
|
|
|
230
230
|
pageCount: string;
|
|
231
231
|
webFonts: string;
|
|
232
232
|
wordFonts: string;
|
|
233
|
+
comments: string;
|
|
234
|
+
comment: string;
|
|
235
|
+
reply: string;
|
|
236
|
+
commentPlaceholder: string;
|
|
237
|
+
commentFailed: string;
|
|
238
|
+
commentNeedsSelection: string;
|
|
239
|
+
editComment: string;
|
|
240
|
+
deleteComment: string;
|
|
241
|
+
assignTo: (name: string) => string;
|
|
242
|
+
assignedTo: (name: string) => string;
|
|
243
|
+
resolve: string;
|
|
244
|
+
reopen: string;
|
|
245
|
+
resolvedCount: (n: number) => string;
|
|
246
|
+
noComments: string;
|
|
247
|
+
noCommentsView: string;
|
|
248
|
+
suggestions: string;
|
|
249
|
+
suggestionInsert: (text: string) => string;
|
|
250
|
+
suggestionDelete: (text: string) => string;
|
|
251
|
+
suggestionReplace: (from: string, to: string) => string;
|
|
252
|
+
accept: string;
|
|
253
|
+
reject: string;
|
|
254
|
+
mode: string;
|
|
255
|
+
modeEditing: string;
|
|
256
|
+
modeSuggesting: string;
|
|
257
|
+
modeViewing: string;
|
|
258
|
+
modeEditingHint: string;
|
|
259
|
+
modeSuggestingHint: string;
|
|
260
|
+
modeViewingHint: string;
|
|
261
|
+
overwrote: (name: string) => string;
|
|
262
|
+
overwroteSomeone: string;
|
|
263
|
+
putMineBack: string;
|
|
264
|
+
versionHistory: string;
|
|
265
|
+
nameCurrentVersion: string;
|
|
266
|
+
nameVersion: string;
|
|
267
|
+
renameVersion: string;
|
|
268
|
+
versionName: string;
|
|
269
|
+
currentVersion: string;
|
|
270
|
+
noVersions: string;
|
|
271
|
+
versionsFailed: string;
|
|
272
|
+
restoreVersion: string;
|
|
273
|
+
restoreConfirm: (name: string) => string;
|
|
274
|
+
restoreFailed: string;
|
|
275
|
+
previewing: (name: string) => string;
|
|
276
|
+
backToDocument: string;
|
|
277
|
+
editors: (n: number) => string;
|
|
233
278
|
/** The file list's shared words: Open, Rename and the rest. */
|
|
234
279
|
files: FileWords;
|
|
235
280
|
/** The kind of file Open takes from the drive, as the drive names it. */
|
|
@@ -264,6 +309,100 @@ interface DocumentsStore {
|
|
|
264
309
|
save: (id: string, bytes: Uint8Array, version: string) => Promise<string>;
|
|
265
310
|
remove: (id: string) => Promise<void>;
|
|
266
311
|
}
|
|
312
|
+
/** Someone signed in, as comments and the live room name them. */
|
|
313
|
+
interface Person {
|
|
314
|
+
id: string;
|
|
315
|
+
name: string;
|
|
316
|
+
}
|
|
317
|
+
/** A comment on a document, anchored to a paragraph (`block_id`, its `w14:paraId`) and
|
|
318
|
+
* the words it was on (`quote`). A reply names its thread's first comment as `parent`.
|
|
319
|
+
* As efficient-backend `DocumentComment` serializes it. */
|
|
320
|
+
interface DocComment {
|
|
321
|
+
id: string;
|
|
322
|
+
parent: string | null;
|
|
323
|
+
block_id: string;
|
|
324
|
+
quote: string;
|
|
325
|
+
body: string;
|
|
326
|
+
author: string;
|
|
327
|
+
author_name: string;
|
|
328
|
+
assignee: string | null;
|
|
329
|
+
assignee_name: string;
|
|
330
|
+
resolved_at: string | null;
|
|
331
|
+
resolved_by_name: string;
|
|
332
|
+
created_at: string;
|
|
333
|
+
}
|
|
334
|
+
interface NewDocComment {
|
|
335
|
+
body: string;
|
|
336
|
+
block_id?: string;
|
|
337
|
+
quote?: string;
|
|
338
|
+
parent?: string;
|
|
339
|
+
mentions?: string[];
|
|
340
|
+
assignee?: string | null;
|
|
341
|
+
}
|
|
342
|
+
interface DocCommentsStore {
|
|
343
|
+
list: (documentId: string) => Promise<DocComment[]>;
|
|
344
|
+
add: (documentId: string, comment: NewDocComment) => Promise<DocComment>;
|
|
345
|
+
update: (documentId: string, commentId: string, change: {
|
|
346
|
+
body?: string;
|
|
347
|
+
resolved?: boolean;
|
|
348
|
+
assignee?: string | null;
|
|
349
|
+
}) => Promise<DocComment>;
|
|
350
|
+
remove: (documentId: string, commentId: string) => Promise<void>;
|
|
351
|
+
}
|
|
352
|
+
/** A version in a document's history, newest first; its file is read on demand. */
|
|
353
|
+
interface DocVersionSummary {
|
|
354
|
+
id: string;
|
|
355
|
+
name: string;
|
|
356
|
+
created_at: string;
|
|
357
|
+
updated_at: string;
|
|
358
|
+
editor_names: string[];
|
|
359
|
+
}
|
|
360
|
+
interface DocVersionsStore {
|
|
361
|
+
list: (documentId: string) => Promise<DocVersionSummary[]>;
|
|
362
|
+
/** Keeps the document as it is now under `name`. */
|
|
363
|
+
snapshot: (documentId: string, name: string) => Promise<DocVersionSummary>;
|
|
364
|
+
/** Names a version, or with '' makes it an ordinary one again. */
|
|
365
|
+
rename: (documentId: string, versionId: string, name: string) => Promise<DocVersionSummary>;
|
|
366
|
+
content: (documentId: string, versionId: string) => Promise<Uint8Array>;
|
|
367
|
+
}
|
|
368
|
+
/** News in an open document's live room (efficient-backend `ws/documents/`). */
|
|
369
|
+
type DocLiveEvent = {
|
|
370
|
+
event: 'hello' | 'presence';
|
|
371
|
+
payload: {
|
|
372
|
+
user: Person;
|
|
373
|
+
key: string;
|
|
374
|
+
block: string | null;
|
|
375
|
+
offset: number | null;
|
|
376
|
+
};
|
|
377
|
+
} | {
|
|
378
|
+
event: 'bye';
|
|
379
|
+
payload: {
|
|
380
|
+
user: Person;
|
|
381
|
+
key: string;
|
|
382
|
+
};
|
|
383
|
+
} | {
|
|
384
|
+
event: 'saved';
|
|
385
|
+
payload: {
|
|
386
|
+
version: string;
|
|
387
|
+
by: string;
|
|
388
|
+
};
|
|
389
|
+
} | {
|
|
390
|
+
event: 'comments';
|
|
391
|
+
payload: {
|
|
392
|
+
by: string;
|
|
393
|
+
};
|
|
394
|
+
};
|
|
395
|
+
interface DocLiveChannel {
|
|
396
|
+
/** This editor's caret: the paragraph it is in, and how far along. */
|
|
397
|
+
send: (message: {
|
|
398
|
+
type: 'hello' | 'presence';
|
|
399
|
+
block: string | null;
|
|
400
|
+
offset: number | null;
|
|
401
|
+
}) => void;
|
|
402
|
+
close: () => void;
|
|
403
|
+
}
|
|
404
|
+
/** What the signed-in person may do to a document: as its drive share says. */
|
|
405
|
+
type DocAccess = 'edit' | 'comment' | 'view';
|
|
267
406
|
interface DocumentsHost {
|
|
268
407
|
/** Absent: nothing saves by itself, and the editor says so. With one, the app
|
|
269
408
|
* opens on the store's list of documents. */
|
|
@@ -276,6 +415,19 @@ interface DocumentsHost {
|
|
|
276
415
|
chooseFile?: ChooseOfficeFile;
|
|
277
416
|
/** The app's words in the host's language. Absent: whatever `DocumentsWordsProvider` says. */
|
|
278
417
|
words?: DocumentsWords;
|
|
418
|
+
/** Absent: documents have no comments of their own (Word's still show). */
|
|
419
|
+
comments?: DocCommentsStore;
|
|
420
|
+
/** Absent: no version history. */
|
|
421
|
+
versions?: DocVersionsStore;
|
|
422
|
+
/** The live room of one open document. Absent: editors meet only when a save is
|
|
423
|
+
* refused, and are merged then. */
|
|
424
|
+
live?: (documentId: string, onEvent: (event: DocLiveEvent) => void) => DocLiveChannel;
|
|
425
|
+
/** Who is signed in: their suggestions carry this name, and their own saves are known. */
|
|
426
|
+
currentUser?: Person;
|
|
427
|
+
/** People an @-mention can name. */
|
|
428
|
+
people?: (query: string) => Promise<Person[]>;
|
|
429
|
+
/** What the signed-in person may do to an open document. Absent: edit. */
|
|
430
|
+
access?: (documentId: string) => Promise<DocAccess>;
|
|
279
431
|
}
|
|
280
432
|
declare function DocumentsProvider({ value, children }: {
|
|
281
433
|
value: DocumentsHost;
|
|
@@ -317,4 +469,4 @@ declare function importDocumentFile(store: DocumentsStore, file: File): Promise<
|
|
|
317
469
|
title: string;
|
|
318
470
|
}>;
|
|
319
471
|
|
|
320
|
-
export { ChooseOfficeFile, DocumentEditor, type DocumentSummary, Documents, DocumentsConflict, type DocumentsHost, DocumentsProvider, type DocumentsStore, type DocumentsWords, DocumentsWordsProvider, ENGLISH_WORDS, FileWords, PdfOptions, type StoredDocument, ZH_HANS_WORDS, documentsApp, docxToPdf, importDocumentFile };
|
|
472
|
+
export { ChooseOfficeFile, type DocAccess, type DocComment, type DocCommentsStore, type DocLiveChannel, type DocLiveEvent, type DocVersionSummary, type DocVersionsStore, DocumentEditor, type DocumentSummary, Documents, DocumentsConflict, type DocumentsHost, DocumentsProvider, type DocumentsStore, type DocumentsWords, DocumentsWordsProvider, ENGLISH_WORDS, FileWords, type NewDocComment, PdfOptions, type Person, type StoredDocument, ZH_HANS_WORDS, documentsApp, docxToPdf, importDocumentFile };
|
package/dist/documents/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DocumentsConflict as t,DocumentsProvider as o,DocumentsWordsProvider as n}from"../chunk-
|
|
1
|
+
import{DocumentsConflict as t,DocumentsProvider as o,DocumentsWordsProvider as n}from"../chunk-JI56OCIU.js";import{ENGLISH_WORDS as m,ZH_HANS_WORDS as r}from"../chunk-VMUUFEWS.js";import{ENGLISH_FILE_WORDS as c,ZH_HANS_FILE_WORDS as e}from"../chunk-B32ASXHM.js";import{hasExtension as i}from"../chunk-XYVQTQ6N.js";import{lazy as s}from"react";var u=s(()=>import("../Documents-4L3242LJ.js")),p=s(()=>import("../Documents-4L3242LJ.js").then(t=>({default:t.OpenDocument}))),a={"/documents":{component:u,label:"Documents",size:"xl",appStyle:!0,multiInstance:!0}};async function f(t,o){const{docxToPdf:n}=await(import("../docxPdf-LO2VPZSJ.js"));return n(t,o)}async function j(t,o){const{importDocumentFile:n}=await(import("../importDocument-C5L275FU.js"));return n(t,o)}export{p as DocumentEditor,u as Documents,t as DocumentsConflict,o as DocumentsProvider,n as DocumentsWordsProvider,c as ENGLISH_FILE_WORDS,m as ENGLISH_WORDS,e as ZH_HANS_FILE_WORDS,r as ZH_HANS_WORDS,a as documentsApp,f as docxToPdf,i as hasExtension,j as importDocumentFile};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{marginText as t,pageBlocks as e,pageStarts as o,pageStyles as n,printStyles as i}from"./chunk-
|
|
1
|
+
import{marginText as t,pageBlocks as e,pageStarts as o,pageStyles as n,printStyles as i}from"./chunk-SDLOT5Z5.js";import{boxesInWindow as r,pageWindows as s}from"./chunk-PWF37Y2N.js";import{ENGLISH_WORDS as a}from"./chunk-VMUUFEWS.js";import{jpegPdf as p}from"./chunk-CEVQKZ66.js";import{drawJpeg as c,embeddedFonts as l,openStage as h,settled as d}from"./chunk-PX4QOBHF.js";import"./chunk-B32ASXHM.js";import{headerKindFor as f,readDocx as u}from"./chunk-7B4B25DB.js";import"./chunk-D3JKD7KW.js";var g="pdf",m=t=>t/20*(4/3);function x(t){const e=t.getBoundingClientRect().top;return Array.from(t.children,t=>{const o=t.getBoundingClientRect();return{top:o.top-e,height:o.height}})}function w(e,o,n,i,r){const s=document.createElement("div");s.style.cssText=`position:absolute;display:flex;justify-content:space-between;font:9pt Calibri,Carlito,Arial,sans-serif;color:#555;white-space:pre;left:${m(o.left)}px;right:${m(o.right)}px;${r}`;for(const o of t(e,n,i))s.append(Object.assign(document.createElement("span"),{textContent:o}));return s}function y(t,e,o,n){const{page:i,headers:s,footers:a,titlePage:p,evenOdd:c}=t.doc,l=f(o,p,c),h=s[l],d=a[l],u=document.createElement("div");u.style.cssText=`position:relative;overflow:hidden;background:#fff;width:${m(i.width)}px;height:${m(i.height)}px`;const g=document.createElement("div");return g.style.cssText=`position:absolute;overflow:hidden;left:${m(i.left)}px;top:${m(i.top)}px;right:${m(i.right)}px;height:${e.height}px`,g.append(function({body:t,boxes:e},o){const n=t.cloneNode(!1),i=r(e,o);if(!i)return n;for(let e=i.first;e<=i.last;e+=1)n.append(t.children[e].cloneNode(!0));const s=parseFloat(getComputedStyle(t.children[i.first]).marginTop)||0;return n.style.position="absolute",n.style.left="0",n.style.top=e[i.first].top-s-o.top+"px",n}(t,e)),u.append(g),h.text&&u.append(w(h.text,i,o,n,`top:${m(i.header)}px`)),d.text&&u.append(w(d.text,i,o,n,`bottom:${m(i.footer)}px`)),u}async function b(t,e,o,n,i){e.append(t);try{await d(t);return{jpeg:await c(t,{width:m(o.width),height:m(o.height),pixelRatio:2,quality:i,fontCss:n}),width:o.width/20,height:o.height/20}}finally{t.remove()}}async function $(t,r={}){const{signal:c,onProgress:f,quality:w}=r;c?.throwIfAborted();const $=await u(new Uint8Array(await t.arrayBuffer())),j=h();try{const t=function(t,e){const o=document.createElement("style");o.textContent=`${n(t,g)}\n${i(g)}`;const r=document.createElement("div");return r.className="docs-page",r.dataset.doc=g,r.style.cssText=`display:flow-root;width:${m(t.page.width-t.page.left-t.page.right)}px`,r.innerHTML=t.html,e.append(o,r),r}($,j.root);await d(t);const r={doc:$,body:t,boxes:x(t)},h=function(t,n){const i=m(t.page.height-t.page.top-t.page.bottom),r=o(e(n,n.getBoundingClientRect().top),i);return s(r,i,n.getBoundingClientRect().height)}($,t),u=await l(t),C=[];for(const[t,e]of h.entries()){c?.throwIfAborted();const o=y(r,e,t+1,h.length);C.push(await b(o,j.root,$.page,u,w).catch(e=>{throw new Error(a.pdfPageFailed(t+1),{cause:e})})),f?.(t+1,h.length)}return p(C)}finally{j.close()}}export{$ as docxToPdf};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{importDocumentFile as o}from"./chunk-LGY776XE.js";import"./chunk-7B4B25DB.js";import"./chunk-D3JKD7KW.js";import"./chunk-XYVQTQ6N.js";export{o as importDocumentFile};
|