@a200888213/gbdocx 0.4.0 → 0.5.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/README.md CHANGED
@@ -82,7 +82,7 @@ app.setReadOnly(false); // 回到可编辑
82
82
  app.setMenuBarVisible(true); // 再显示菜单栏
83
83
  ```
84
84
 
85
- 只读档下:内核切到 `editMode='readonly'`(正文 `contenteditable` 关闭、`run()` 拒绝写命令),工具栏与文件头 `inert`,编辑/插入/表格/格式菜单禁用,状态栏的模式/页边距/分栏开关与查找栏的替换行一并锁定;选区、滚动、复制、查找、缩放、导出与打印仍可用。`hideMenuBar` 只隐藏 `.gbd-menubar-host` 那一行,下面的文件头与正文不受影响。
85
+ 只读档下:内核切到 `editMode='readonly'`(正文 `contenteditable` 关闭、`run()` 拒绝写命令),工具栏与文件头 `inert`,编辑/插入/表格/格式菜单禁用,状态栏的模式/页边距/分栏开关与查找栏的替换行一并锁定;选区、滚动、复制、查找、缩放、导出与打印仍可用。`hideMenuBar` 只隐藏 `.gbd-menubar-host` 那一行,文件头与正文不受影响。
86
86
 
87
87
  ## 只读写文件(codec)
88
88
 
package/index.html CHANGED
@@ -7,8 +7,12 @@
7
7
  <link rel="stylesheet" href="/styles/tokens.css" />
8
8
  <link rel="stylesheet" href="/styles/editor-content.css" />
9
9
  <link rel="stylesheet" href="/styles/word-panel.css" />
10
- <link rel="stylesheet" href="/styles/app.css" />
10
+ <link rel="stylesheet" href="/styles/app.css" />
11
11
  <link rel="stylesheet" href="/vendor/gbofficeui/office-chrome.css" />
12
+ <style>
13
+ /* 独立运行时撑满视口;嵌入宿主由宿主容器给高度,不依赖这条 */
14
+ html, body { height: 100%; margin: 0; }
15
+ </style>
12
16
  <script type="importmap">
13
17
  {
14
18
  "imports": {
package/package.json CHANGED
@@ -1,48 +1,48 @@
1
- {
2
- "name": "@a200888213/gbdocx",
3
- "version": "0.4.0",
4
- "description": "挂逼文档:独立 .docx 编辑器(内核移植自 guabi office/docx 编解码 + 自研 contenteditable 编辑器内核,UI 用原生 HTML 重写),只依赖 gbooxml。",
5
- "type": "module",
6
- "license": "MIT",
7
- "main": "./src/app/word-app.js",
8
- "exports": {
9
- ".": "./src/app/word-app.js",
10
- "./app": "./src/app/word-app.js",
11
- "./styles/*": "./styles/*",
12
- "./*": "./src/*.js",
13
- "./package.json": "./package.json"
14
- },
15
- "files": [
16
- "src",
17
- "styles",
18
- "index.html",
19
- "serve.mjs",
20
- "LICENSE"
21
- ],
22
- "keywords": [
23
- "docx",
24
- "document",
25
- "word",
26
- "ooxml",
27
- "editor",
28
- "contenteditable"
29
- ],
30
- "engines": {
31
- "node": ">=18"
32
- },
33
- "scripts": {
34
- "start": "node serve.mjs",
35
- "test": "node --test test/roundtrip.test.js test/ui.test.js test/mode.test.js"
36
- },
37
- "dependencies": {
38
- "gbooxml": "^0.1.1",
39
- "gbofficeui": "^0.1.0",
40
- "guabiutils": "^0.3.0"
41
- },
42
- "devDependencies": {
43
- "jsdom": "^30.1.3"
44
- },
45
- "publishConfig": {
46
- "access": "public"
47
- }
48
- }
1
+ {
2
+ "name": "@a200888213/gbdocx",
3
+ "version": "0.5.0",
4
+ "description": "挂逼文档:独立 .docx 编辑器(内核移植自 guabi office/docx 编解码 + 自研 contenteditable 编辑器内核,UI 用原生 HTML 重写),只依赖 gbooxml。",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "main": "./src/app/word-app.js",
8
+ "exports": {
9
+ ".": "./src/app/word-app.js",
10
+ "./app": "./src/app/word-app.js",
11
+ "./styles/*": "./styles/*",
12
+ "./*": "./src/*.js",
13
+ "./package.json": "./package.json"
14
+ },
15
+ "files": [
16
+ "src",
17
+ "styles",
18
+ "index.html",
19
+ "serve.mjs",
20
+ "LICENSE"
21
+ ],
22
+ "keywords": [
23
+ "docx",
24
+ "document",
25
+ "word",
26
+ "ooxml",
27
+ "editor",
28
+ "contenteditable"
29
+ ],
30
+ "engines": {
31
+ "node": ">=18"
32
+ },
33
+ "scripts": {
34
+ "start": "node serve.mjs",
35
+ "test": "node --test test/roundtrip.test.js test/ui.test.js test/mode.test.js"
36
+ },
37
+ "dependencies": {
38
+ "gbooxml": "^0.1.1",
39
+ "gbofficeui": "^0.2.0",
40
+ "guabiutils": "^0.3.0"
41
+ },
42
+ "devDependencies": {
43
+ "jsdom": "^30.1.3"
44
+ },
45
+ "publishConfig": {
46
+ "access": "public"
47
+ }
48
+ }
@@ -51,6 +51,19 @@ function menuCtx() {
51
51
  get align() { return app.editorState?.textAlign; },
52
52
  get lineHeight() { return app.editorState?.lineHeight; },
53
53
  get firstLineIndent() { return app.editorState?.firstLineIndent; },
54
+ get bold() { return app.editorState?.bold; },
55
+ get italic() { return app.editorState?.italic; },
56
+ get underline() { return app.editorState?.underline; },
57
+ get strike() { return app.editorState?.strike; },
58
+ get superscript() { return app.editorState?.superscript; },
59
+ get subscript() { return app.editorState?.subscript; },
60
+ get fontSize() { return app.editorState?.fontSize; },
61
+ get fontFamily() { return app.editorState?.fontFamily; },
62
+ get color() { return app.editorState?.color; },
63
+ get backgroundColor() { return app.editorState?.backgroundColor; },
64
+ get bulletList() { return app.editorState?.bulletList; },
65
+ get orderedList() { return app.editorState?.orderedList; },
66
+ get taskList() { return app.editorState?.taskList; },
54
67
  get inTable() { return app.editorState?.inTable; },
55
68
  get hasSelection() { return app.editorState?.hasSelection; },
56
69
  get columns() { return app.state.page.columns || 1; },
@@ -132,6 +145,19 @@ function menuCtx() {
132
145
  align: (v) => this.run('setBlockAlign', v),
133
146
  setLineHeight: (v) => this.run('setBlockLineHeight', v),
134
147
  firstLine: () => this.run('toggleFirstLineIndent'),
148
+ bold: () => this.run('toggleBold'),
149
+ italic: () => this.run('toggleItalic'),
150
+ underline: () => this.run('toggleUnderline'),
151
+ strike: () => this.run('toggleStrike'),
152
+ superscript: () => this.run('toggleSuperscript'),
153
+ subscript: () => this.run('toggleSubscript'),
154
+ setFontFamily: (v) => this.run('setFontFamily', v),
155
+ setFontSize: (v) => this.run('setFontSize', v),
156
+ setColor: (v) => this.run('setColor', v),
157
+ unsetColor: () => this.run('unsetColor'),
158
+ setHighlight: (v) => this.run('setBackgroundColor', v),
159
+ unsetHighlight: () => this.run('unsetBackgroundColor'),
160
+ indent: (command) => this.run(command),
135
161
  setHfMode: (mode) => { this.state.hfMode = mode; this.onDocUpdate(); },
136
162
  list: (command) => this.run(command),
137
163
  clearFormat: () => this.run('clearFormat'),
@@ -53,6 +53,7 @@ function applyView() {
53
53
  if (!hasComments && this.commentsPanel.el.isConnected) this.commentsPanel.el.remove();
54
54
  if (hasCatalog) this.refreshCatalog();
55
55
  this.renderPanels();
56
+ this.ribbon?.refresh();
56
57
  }
57
58
 
58
59
  function renderPanels() {
@@ -114,20 +114,18 @@ export class WordApp {
114
114
  root.className = 'word-app word-skin';
115
115
  if (this.embed) root.classList.add('gbd-is-embed');
116
116
  root.innerHTML = `
117
- <div class="gbd-menubar-host"></div>
118
- <div class="word-head">
119
- <span class="word-head__title"></span>
120
- <span class="word-head__path"></span>
117
+ <div class="gbo-head word-head">
118
+ <span class="gbo-head__title"></span>
119
+ <span class="gbo-head__sub"></span>
121
120
  <span class="word-head__dirty" hidden>●</span>
122
- <span class="word-head__spacer"></span>
123
- <span class="word-head__actions">
124
- <label class="word-head__auto"><input type="checkbox" class="word-head__autosave" />自动保存</label>
125
- <button type="button" class="gbd-btn" data-act="open">打开</button>
126
- <button type="button" class="gbd-btn" data-act="save">保存</button>
127
- <button type="button" class="gbd-btn" data-act="export">导出副本</button>
121
+ <span class="gbo-head__spacer"></span>
122
+ <span class="gbo-head__actions">
123
+ <label class="gbo-head__auto"><input type="checkbox" class="gbo-head__autosave" />自动保存</label>
124
+ <button type="button" class="gbo-head__btn gbo-head__btn--primary" data-act="save">保存</button>
128
125
  </span>
129
- <button type="button" class="gbd-btn word-head__preview" data-act="preview" title="预览模式" aria-pressed="false">${icon('eye')}<span>预览</span></button>
126
+ <button type="button" class="gbo-head__btn gbo-head__preview" data-act="preview" title="预览模式" aria-pressed="false">${icon('eye')}<span>预览</span></button>
130
127
  </div>
128
+ <div class="gbd-menubar-host"></div>
131
129
  <div class="gbd-toolbar-host"></div>
132
130
  <div class="word-main">
133
131
  <div class="word-editor"><div class="word-editor-mount"></div></div>
@@ -140,14 +138,14 @@ export class WordApp {
140
138
  this.menubarHost = root.querySelector('.gbd-menubar-host');
141
139
  this.headEl = root.querySelector('.word-head');
142
140
  this.toolbarHost = root.querySelector('.gbd-toolbar-host');
143
- this.headActionsEl = root.querySelector('.word-head__actions');
141
+ this.headActionsEl = root.querySelector('.gbo-head__actions');
144
142
  // 预览按钮不随只读被 inert:它要能在预览档里继续点「退出预览」
145
143
  this.guard = createReadOnlyGuard(root, { editZones: () => [this.headActionsEl, this.toolbarHost] });
146
144
  this.editorWrap = root.querySelector('.word-editor');
147
- this.titleEl = root.querySelector('.word-head__title');
148
- this.pathEl = root.querySelector('.word-head__path');
145
+ this.titleEl = root.querySelector('.gbo-head__title');
146
+ this.pathEl = root.querySelector('.gbo-head__sub');
149
147
  this.dirtyEl = root.querySelector('.word-head__dirty');
150
- this.autosaveEl = root.querySelector('.word-head__autosave');
148
+ this.autosaveEl = root.querySelector('.gbo-head__autosave');
151
149
  this.previewBtn = root.querySelector('[data-act="preview"]');
152
150
 
153
151
  this.catalogPanel = new CatalogPanel((key) => this.locateCatalog(key));
@@ -247,9 +245,7 @@ export class WordApp {
247
245
  return hostAction ? hostAction() : fallback.call(this);
248
246
  });
249
247
  };
250
- bind('open', 'open', this.openFile);
251
248
  bind('save', 'save', this.save);
252
- bind('export', 'exportCopy', this.exportDocx);
253
249
  this.previewBtn.addEventListener('click', () => this.setPreview(!this.preview));
254
250
  this.autosaveEl.addEventListener('change', () => {
255
251
  const on = this.autosaveEl.checked;
@@ -9,6 +9,7 @@
9
9
  */
10
10
  import { LINE_HEIGHTS } from '../editor/constants.js';
11
11
  import { tableMenuItems as buildTableMenuItems } from '../editor/engine/tableMenu.js';
12
+ import { FONT_FAMILIES, FONT_SIZES } from '../textStyles.js';
12
13
  import { HF_MODES, PAGE_NUMBER_ALIGNS, PARA_STYLES } from './constants.js';
13
14
 
14
15
  /** 行距预设(空串 = 跟随正文默认行高;档位复用内核) */
@@ -25,6 +26,32 @@ const ALIGN_ITEMS = [
25
26
  { label: '两端对齐', v: 'justify' },
26
27
  ];
27
28
 
29
+ /** 右键菜单色板:常用 12 色,够用又不把子菜单撑出屏幕 */
30
+ const TEXT_PALETTE = [
31
+ { label: '黑色', value: '#000000' },
32
+ { label: '深灰', value: '#666666' },
33
+ { label: '浅灰', value: '#999999' },
34
+ { label: '白色', value: '#ffffff' },
35
+ { label: '红色', value: '#ff0000' },
36
+ { label: '橙色', value: '#ff9900' },
37
+ { label: '黄色', value: '#ffd966' },
38
+ { label: '绿色', value: '#38761d' },
39
+ { label: '青色', value: '#00b0f0' },
40
+ { label: '蓝色', value: '#2a6bff' },
41
+ { label: '紫色', value: '#9900ff' },
42
+ { label: '粉色', value: '#c27ba0' },
43
+ ];
44
+
45
+ /** 突出显示色板:浅底色,避免正文看不清 */
46
+ const HIGHLIGHT_PALETTE = [
47
+ { label: '黄色', value: '#fff3b0' },
48
+ { label: '绿色', value: '#d3f2b3' },
49
+ { label: '青色', value: '#b3e9e9' },
50
+ { label: '蓝色', value: '#d0e4f7' },
51
+ { label: '粉色', value: '#fddede' },
52
+ { label: '灰色', value: '#e7e9eb' },
53
+ ];
54
+
28
55
  /** 页眉页脚重复模式 */
29
56
  const HF_ITEMS = HF_MODES.map((m) => ({ label: m.label, v: m.value }));
30
57
 
@@ -36,20 +63,130 @@ export const VIEW_TOGGLES = [
36
63
 
37
64
  /**
38
65
  * 正文右键菜单(编辑面非表格区的右键;条目与菜单栏「编辑 / 格式 / 插入」同源,禁各写一份)
66
+ * [设计] 字体 / 段落 / 项目符号和编号 / 更换背景用二级菜单承载,打开即见当前状态勾选;
67
+ * 只挂真实可执行的命令,没有实现的能力(AI 排版、划词翻译、格式刷)不摆假入口。
39
68
  * @param {Object} ctx 页面注入的 menuCtx(state/edit/format/insert 与菜单栏同一份)
40
69
  */
41
70
  export const textMenuItems = (ctx) => {
42
71
  const has = () => Boolean(ctx.state.hasSelection);
72
+ const state = () => ctx.state;
43
73
  return [
44
- { label: '剪切', shortcut: 'Ctrl+X', disabled: !has(), onClick: ctx.edit.cut },
45
- { label: '复制', shortcut: 'Ctrl+C', disabled: !has(), onClick: ctx.edit.copy },
46
- { label: '粘贴', shortcut: 'Ctrl+V', onClick: ctx.edit.paste },
74
+ { label: '剪切', icon: 'cut', shortcut: 'Ctrl+X', disabled: !has(), onClick: ctx.edit.cut },
75
+ { label: '复制', icon: 'copy', shortcut: 'Ctrl+C', disabled: !has(), onClick: ctx.edit.copy },
76
+ { label: '粘贴', icon: 'paste', shortcut: 'Ctrl+V', onClick: ctx.edit.paste },
47
77
  { divided: true },
48
- { label: '全选', shortcut: 'Ctrl+A', onClick: ctx.edit.selectAll },
49
- { label: '清除格式', disabled: !has(), onClick: ctx.format.clearFormat },
78
+ {
79
+ label: '字体',
80
+ icon: 'fontCollection',
81
+ children: [
82
+ {
83
+ label: '字体',
84
+ children: FONT_FAMILIES.map((f) => ({
85
+ label: f.label,
86
+ checked: state().fontFamily === f.value,
87
+ onClick: () => ctx.format.setFontFamily(f.value),
88
+ })),
89
+ },
90
+ {
91
+ label: '字号',
92
+ children: FONT_SIZES.map((v) => ({
93
+ label: String(v),
94
+ checked: state().fontSize === `${v}px`,
95
+ onClick: () => ctx.format.setFontSize(`${v}px`),
96
+ })),
97
+ },
98
+ { divided: true },
99
+ { label: '加粗', checked: state().bold, onClick: ctx.format.bold },
100
+ { label: '斜体', checked: state().italic, onClick: ctx.format.italic },
101
+ { label: '下划线', checked: state().underline, onClick: ctx.format.underline },
102
+ { label: '删除线', checked: state().strike, onClick: ctx.format.strike },
103
+ { label: '上标', checked: state().superscript, onClick: ctx.format.superscript },
104
+ { label: '下标', checked: state().subscript, onClick: ctx.format.subscript },
105
+ { divided: true },
106
+ {
107
+ label: '字体颜色',
108
+ icon: 'colorIcon',
109
+ children: [
110
+ { label: '自动', onClick: ctx.format.unsetColor },
111
+ ...TEXT_PALETTE.map((c) => ({
112
+ label: c.label,
113
+ colorDot: c.value,
114
+ checked: state().color === c.value,
115
+ onClick: () => ctx.format.setColor(c.value),
116
+ })),
117
+ ],
118
+ },
119
+ ],
120
+ },
121
+ {
122
+ label: '段落',
123
+ icon: 'lineSpacing',
124
+ children: [
125
+ {
126
+ label: '对齐方式',
127
+ children: ALIGN_ITEMS.map((a) => ({
128
+ label: a.label,
129
+ checked: state().align === a.v,
130
+ onClick: () => ctx.format.align(a.v),
131
+ })),
132
+ },
133
+ {
134
+ label: '行距',
135
+ children: LINE_SPACING_ITEMS.map((s) => ({
136
+ label: s.label,
137
+ checked: state().lineHeight === s.v,
138
+ onClick: () => ctx.format.setLineHeight(s.v),
139
+ })),
140
+ },
141
+ {
142
+ label: '段落样式',
143
+ children: PARA_STYLES.map((s) => ({
144
+ label: s.label,
145
+ checked: state().blockType === s.value,
146
+ onClick: () => ctx.format.paragraphStyle(s.value),
147
+ })),
148
+ },
149
+ { divided: true },
150
+ { label: '首行缩进 2 字符', checked: state().firstLineIndent, onClick: ctx.format.firstLine },
151
+ { label: '增加缩进', onClick: () => ctx.format.indent('increaseBlockIndent') },
152
+ { label: '减少缩进', onClick: () => ctx.format.indent('decreaseBlockIndent') },
153
+ ],
154
+ },
155
+ {
156
+ label: '项目符号和编号',
157
+ icon: 'multiLevel',
158
+ children: [
159
+ { label: '无序列表', checked: state().bulletList, onClick: () => ctx.format.list('toggleBulletList') },
160
+ { label: '有序列表', checked: state().orderedList, onClick: () => ctx.format.list('toggleOrderedList') },
161
+ { label: '待办列表', checked: state().taskList, onClick: () => ctx.format.list('toggleTaskList') },
162
+ ],
163
+ },
164
+ { divided: true },
165
+ {
166
+ label: '更换背景',
167
+ icon: 'background',
168
+ children: [
169
+ {
170
+ label: '突出显示',
171
+ icon: 'highlight',
172
+ children: [
173
+ { label: '无', onClick: ctx.format.unsetHighlight },
174
+ ...HIGHLIGHT_PALETTE.map((c) => ({
175
+ label: c.label,
176
+ colorDot: c.value,
177
+ checked: state().backgroundColor === c.value,
178
+ onClick: () => ctx.format.setHighlight(c.value),
179
+ })),
180
+ ],
181
+ },
182
+ { label: '页面水印...', onClick: ctx.insert.watermark },
183
+ ],
184
+ },
185
+ { label: '超链接...', icon: 'linkIcon', shortcut: 'Ctrl+K', disabled: !has(), onClick: ctx.insert.link },
186
+ { label: '插入批注...', icon: 'comment', disabled: !has(), onClick: ctx.insert.comment },
50
187
  { divided: true },
51
- { label: '批注...', disabled: !has(), onClick: ctx.insert.comment },
52
- { label: '链接...', disabled: !has(), onClick: ctx.insert.link },
188
+ { label: '全选', icon: 'selectAll', shortcut: 'Ctrl+A', onClick: ctx.edit.selectAll },
189
+ { label: '清除格式', icon: 'eraser', disabled: !has(), onClick: ctx.format.clearFormat },
53
190
  ];
54
191
  };
55
192
 
@@ -1,5 +1,6 @@
1
- // [文件] gbdocx·ContextMenu —— 右键/下拉菜单渲染(条目口径:label/disabled/checked/icon/colorDot/shortcut/divided/children/input/onClick)
1
+ // [文件] gbdocx·ContextMenu —— 右键/下拉菜单渲染(条目口径:label/icon/disabled/checked/colorDot/shortcut/divided/children/input/onClick)
2
2
  import { openPopup } from './popup.js';
3
+ import { icon } from './icons.js';
3
4
 
4
5
  const CHECK = '<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12l5 5L20 7"/></svg>';
5
6
  const SUB = '<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 6l6 6-6 6"/></svg>';
@@ -58,6 +59,8 @@ function buildList(items) {
58
59
  if (item.checked) lead.innerHTML = CHECK;
59
60
  else if (item.colorDot) {
60
61
  lead.innerHTML = `<i class="gbd-menu__dot" style="background:${item.colorDot}"></i>`;
62
+ } else if (item.icon) {
63
+ lead.innerHTML = icon(item.icon);
61
64
  }
62
65
  row.appendChild(lead);
63
66
 
package/src/ui/icons.js CHANGED
@@ -71,7 +71,6 @@ export const ICONS = {
71
71
  // 段落
72
72
  multiLevel: S('<path d="M9 6h11M9 12h11M9 18h11M4 5h1v3M4 11h2l-2 3h2M4 17h2v3H4z"/>'),
73
73
  outdent: S('<path d="M11 6h9M11 12h9M11 18h9M3 12h6M6 9l-3 3 3 3"/>'),
74
- showMarks: S('<path d="M8 4v13a3 3 0 1 1-3-3M4 14h4M12 6h9M12 12h7M12 18h9"/>'),
75
74
  distribute: S('<path d="M4 6h16M7 12h10M4 18h16M4 3v18M20 3v18"/>'),
76
75
  lineSpacing: S('<path d="M4 7h10M4 12h10M4 17h10M18 5v14M15 8l3-3 3 3M15 16l3 3 3-3"/>'),
77
76
  shading: S('<path d="M4 4h16v16H4zM4 9h16M4 14h16M9 4v16M15 4v16"/>'),
package/styles/app.css CHANGED
@@ -67,6 +67,7 @@
67
67
  pointer-events: none;
68
68
  }
69
69
 
70
+
70
71
  .word-scope .rich-edit-surface .re-table-layer {
71
72
  --gbd-re-handle-thickness: 12px;
72
73
  position: absolute;
@@ -251,7 +252,7 @@
251
252
  min-height: 0;
252
253
  }
253
254
 
254
- .word-scope .word-head__dirty {
255
+ .word-scope .word-head .word-head__dirty {
255
256
  color: var(--gbd-dt-warning);
256
257
  }
257
258
 
@@ -521,14 +522,16 @@
521
522
  }
522
523
 
523
524
  .word-scope .gbd-menu__list {
524
- min-width: 160px;
525
- padding: 4px;
525
+ min-width: 190px;
526
+ padding: 5px;
526
527
  }
527
528
  .word-scope .gbd-menu__item {
528
529
  display: flex;
529
530
  align-items: center;
530
- gap: 6px;
531
- padding: 5px 8px;
531
+ gap: 8px;
532
+ box-sizing: border-box;
533
+ min-height: 30px;
534
+ padding: 0 8px;
532
535
  border-radius: 4px;
533
536
  font-size: 13px;
534
537
  white-space: nowrap;
@@ -548,9 +551,19 @@
548
551
  color: var(--gbd-dt-danger);
549
552
  }
550
553
  .word-scope .gbd-menu__lead {
551
- width: 14px;
554
+ width: 18px;
552
555
  display: inline-flex;
556
+ align-items: center;
553
557
  justify-content: center;
558
+ flex: none;
559
+ color: var(--gbd-dt-text-secondary);
560
+ }
561
+ .word-scope .gbd-menu__lead svg {
562
+ width: 15px;
563
+ height: 15px;
564
+ }
565
+ .word-scope .gbd-menu__item.gbd-is-disabled .gbd-menu__lead {
566
+ opacity: 0.55;
554
567
  }
555
568
  .word-scope .gbd-menu__dot {
556
569
  width: 12px;
@@ -562,15 +575,18 @@
562
575
  flex: 1;
563
576
  }
564
577
  .word-scope .gbd-menu__shortcut {
578
+ margin-left: 16px;
565
579
  color: var(--gbd-dt-text-tertiary);
566
580
  font-size: 11px;
567
581
  }
568
582
  .word-scope .gbd-menu__arrow {
583
+ display: inline-flex;
584
+ margin-left: 8px;
569
585
  color: var(--gbd-dt-text-tertiary);
570
586
  }
571
587
  .word-scope .gbd-menu__sep {
572
588
  height: 1px;
573
- margin: 4px 0;
589
+ margin: 4px 2px;
574
590
  background: var(--gbd-dt-border);
575
591
  }
576
592
  .word-scope .gbd-menu__input {
@@ -896,21 +912,21 @@
896
912
  word-break: break-word;
897
913
  }
898
914
 
899
- /* ==================== 预览模式 ==================== */
900
- /* 只留文件头(标题/路径 + 退出预览)与正文;菜单、功能区、状态栏、侧栏等编辑界面全部收起 */
901
- .word-scope .word-app.gb-is-preview .word-head__actions,
902
- .word-scope .word-app.gb-is-preview .gbd-toolbar-host,
903
- .word-scope .word-app.gb-is-preview .gbd-statusbar-host,
904
- .word-scope .word-app.gb-is-preview .gbd-panel,
905
- .word-scope .word-app.gb-is-preview .gbd-findbar,
906
- .word-scope .word-app.gb-is-preview .word-chars-pop {
907
- display: none;
908
- }
909
- /* 预览档本体也是只读档,但退出按钮不能被只读档的 55% 透明度压暗 */
910
- .word-scope .word-app.gb-is-preview .word-head {
911
- opacity: 1;
912
- }
913
-
915
+ /* ==================== 预览模式 ==================== */
916
+ /* 只留文件头(标题/路径 + 退出预览)与正文;菜单、功能区、状态栏、侧栏等编辑界面全部收起 */
917
+ .word-scope .word-app.gb-is-preview .gbo-head__actions,
918
+ .word-scope .word-app.gb-is-preview .gbd-toolbar-host,
919
+ .word-scope .word-app.gb-is-preview .gbd-statusbar-host,
920
+ .word-scope .word-app.gb-is-preview .gbd-panel,
921
+ .word-scope .word-app.gb-is-preview .gbd-findbar,
922
+ .word-scope .word-app.gb-is-preview .word-chars-pop {
923
+ display: none;
924
+ }
925
+ /* 预览档本体也是只读档,但退出按钮不能被只读档的 55% 透明度压暗 */
926
+ .word-scope .word-app.gb-is-preview .word-head {
927
+ opacity: 1;
928
+ }
929
+
914
930
  /* ==================== 只读档 ==================== */
915
931
  /* 编辑控件已被 inert,压低视觉权重但不改底色;禁用态背景属状态反馈,不受静态背景约束 */
916
932
  .word-scope .word-app.gb-is-readonly:not(.gb-is-preview) .word-head,