@ap666/office-word 0.1.6 → 0.1.7

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/README.md CHANGED
@@ -38,6 +38,7 @@ The package imports its own styles from the entry, so no extra CSS import is req
38
38
  - `editable?: boolean`
39
39
  - `mode?: 'edit' | 'preview'`
40
40
  - `outlinePlacement?: 'left' | 'right'`
41
+ - `messages?: Partial<Record<string, string>> | null`
41
42
  - `enabledExportItems?: ('pdf' | 'html' | 'image' | 'print')[] | null`
42
43
  - `enabledInsertMenuItems?: ('image' | 'video' | 'table' | 'local-file' | 'columns' | 'highlight-block' | 'date' | 'code-block' | 'formula' | 'blockquote' | 'emoji' | 'link' | 'divider' | 'countdown' | 'markdown-import')[] | null`
43
44
  - `enabledToolbarActions?: ('blockquote')[] | null`
@@ -55,6 +56,65 @@ When these whitelist props are omitted, all built-in options stay enabled. Once
55
56
  />
56
57
  ```
57
58
 
59
+ The editor UI stays in Chinese by default. Use `messages` to override only the keys you need.
60
+
61
+ ```vue
62
+ <RichTextEditor
63
+ v-model="content"
64
+ :messages="{
65
+ 'insert.localFile': 'Attachment',
66
+ 'export.label': 'Download',
67
+ }"
68
+ />
69
+ ```
70
+
71
+ Available `messages` keys:
72
+
73
+ - `insert.label`: 插入
74
+ - `insert.section.general`: 通用
75
+ - `insert.section.apps`: 小应用
76
+ - `insert.section.external`: 外部内容
77
+ - `insert.image`: 图片
78
+ - `insert.video`: 视频
79
+ - `insert.table`: 表格
80
+ - `insert.localFile`: 本地文件
81
+ - `insert.columns`: 分栏
82
+ - `insert.highlightBlock`: 高亮块
83
+ - `insert.date`: 日期
84
+ - `insert.codeBlock`: 代码块
85
+ - `insert.formula`: 公式
86
+ - `insert.blockquote`: 引用
87
+ - `insert.emoji`: 表情符号
88
+ - `insert.link`: 超链接
89
+ - `insert.divider`: 分隔线
90
+ - `insert.countdown`: 倒计时
91
+ - `insert.markdownImport`: Markdown导入
92
+ - `export.label`: 导出
93
+ - `export.pdf`: 导出PDF
94
+ - `export.pdf.loading`: 导出PDF中...
95
+ - `export.html`: 导出HTML
96
+ - `export.html.loading`: 导出HTML中...
97
+ - `export.image`: 导出图片
98
+ - `export.image.loading`: 导出图片中...
99
+ - `print.label`: 打印
100
+ - `print.loading`: 打印中...
101
+ - `quote.apply`: 应用引用
102
+ - `quote.cancel`: 取消引用
103
+ - `quote.borderColor`: 边框颜色
104
+ - `quote.backgroundColor`: 背景颜色
105
+ - `outline.label`: 大纲
106
+ - `outline.collapse`: 收起大纲
107
+ - `outline.empty.description`: 对文档内容应用“标题”样式,即可自动生成大纲。
108
+ - `outline.empty.tip`: 点击左下角“大纲”按钮可以随时展开或收起。
109
+ - `status.wordCountUnit`: 个字
110
+ - `status.presentation.enter`: 演示
111
+ - `status.presentation.exit`: 退出演示
112
+ - `status.fullscreen.enter`: 全屏
113
+ - `status.fullscreen.exit`: 退出全屏
114
+ - `countdown.selectTime`: 请选择时间
115
+ - `countdown.settingsTitle`: 倒计时设置
116
+ - `formula.insertTitle`: 插入 LaTeX 公式
117
+
58
118
  ## Preview Mode
59
119
 
60
120
  Use `mode="preview"` to switch the component into a read-only preview shell. In preview mode, the toolbar is hidden, editing is disabled, and the outline can be placed on either side.
@@ -1,6 +1,9 @@
1
1
  type __VLS_Props = {
2
2
  open: boolean;
3
3
  placement: 'left' | 'right';
4
+ collapseTitle: string;
5
+ emptyDescription: string;
6
+ emptyTip: string;
4
7
  items: Array<{
5
8
  pos: number;
6
9
  level: number;
@@ -27,6 +27,7 @@ declare const _default: import('vue').DefineComponent<RichTextEditorProps, {
27
27
  editable: boolean;
28
28
  modelValue: JSONContent | null;
29
29
  outlinePlacement: "left" | "right";
30
+ messages: import('..').RichTextEditorMessages | null;
30
31
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
31
32
  rootRef: HTMLDivElement;
32
33
  insertMenuRef: HTMLDivElement;
package/dist/index.d.ts CHANGED
@@ -4,5 +4,5 @@ import { default as RichTextEditor } from './components/RichTextEditor.vue';
4
4
  import { default as ScrollArea } from './components/ScrollArea.vue';
5
5
  export { OfficeColorIcon, OfficeIcon, RichTextEditor, ScrollArea };
6
6
  export { colorIconNames, monoIconNames } from './icons';
7
- export type { OfficeColorIconProps, OfficeIconProps, RichTextEditorCollaborationAwareness, RichTextEditorCollaborationDocument, RichTextEditorCollaborationOptions, RichTextEditorCollaborationProvider, RichTextEditorCollaborationUser, RichTextEditorFilePayload, RichTextEditorExportItemKey, RichTextEditorImageExportOptions, RichTextEditorImagePayload, RichTextEditorInstance, RichTextEditorInsertMenuItemKey, RichTextEditorLocalFilePayload, RichTextEditorProps, RichTextEditorToolbarActionKey, RichTextEditorVideoPayload, } from './types';
7
+ export type { OfficeColorIconProps, OfficeIconProps, RichTextEditorCollaborationAwareness, RichTextEditorCollaborationDocument, RichTextEditorCollaborationOptions, RichTextEditorCollaborationProvider, RichTextEditorCollaborationUser, RichTextEditorFilePayload, RichTextEditorExportItemKey, RichTextEditorImageExportOptions, RichTextEditorImagePayload, RichTextEditorInstance, RichTextEditorInsertMenuItemKey, RichTextEditorLocalFilePayload, RichTextEditorMessages, RichTextEditorProps, RichTextEditorToolbarActionKey, RichTextEditorVideoPayload, } from './types';
8
8
  export default RichTextEditor;