@a200888213/gbdocx 0.5.2 → 0.6.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.
Files changed (80) hide show
  1. package/README.md +215 -207
  2. package/index.html +3 -2
  3. package/package.json +48 -48
  4. package/serve.mjs +3 -2
  5. package/src/app/file-io.js +122 -122
  6. package/src/app/main.js +9 -9
  7. package/src/app/word/catalog.js +52 -52
  8. package/src/app/word/comments.js +112 -112
  9. package/src/app/word/doc.js +113 -113
  10. package/src/app/word/edit.js +72 -72
  11. package/src/app/word/file.js +30 -1
  12. package/src/app/word/hf.js +76 -76
  13. package/src/app/word/layout.js +155 -155
  14. package/src/app/word/notes.js +110 -110
  15. package/src/app/word/shared.js +22 -22
  16. package/src/app/word/view.js +6 -2
  17. package/src/app/word-app.js +486 -469
  18. package/src/app/word-sheets.js +101 -101
  19. package/src/kernel/docx/codec/blocks.js +123 -123
  20. package/src/kernel/docx/codec/carry.js +129 -129
  21. package/src/kernel/docx/codec/comments.js +25 -25
  22. package/src/kernel/docx/codec/docx.js +198 -198
  23. package/src/kernel/docx/codec/docxStyles.js +177 -177
  24. package/src/kernel/docx/codec/fonts.js +195 -195
  25. package/src/kernel/docx/codec/helpers.js +161 -161
  26. package/src/kernel/docx/codec/hfHtml.js +152 -152
  27. package/src/kernel/docx/codec/html.js +739 -739
  28. package/src/kernel/docx/codec/losses.js +420 -420
  29. package/src/kernel/docx/codec/markdown.js +170 -170
  30. package/src/kernel/docx/codec/parts.js +249 -249
  31. package/src/kernel/docx/codec/read.js +603 -603
  32. package/src/kernel/docx/codec/render.js +1156 -1156
  33. package/src/kernel/docx/codec/roundtrip.js +236 -236
  34. package/src/kernel/docx/codec/write.js +833 -833
  35. package/src/kernel/docx/comments.js +14 -14
  36. package/src/kernel/docx/pageGeometry.js +123 -123
  37. package/src/kernel/docx/pagination.js +481 -481
  38. package/src/kernel/docx/watermark.js +45 -45
  39. package/src/kernel/editor/constants.js +8 -8
  40. package/src/kernel/editor/engine/blocks.js +594 -594
  41. package/src/kernel/editor/engine/blocksEnter.js +109 -109
  42. package/src/kernel/editor/engine/blocksInsert.js +254 -254
  43. package/src/kernel/editor/engine/blocksStructure.js +226 -226
  44. package/src/kernel/editor/engine/commands.js +181 -181
  45. package/src/kernel/editor/engine/dom.js +646 -646
  46. package/src/kernel/editor/engine/history.js +149 -149
  47. package/src/kernel/editor/engine/inline.js +656 -656
  48. package/src/kernel/editor/engine/input.js +554 -554
  49. package/src/kernel/editor/engine/interaction.js +137 -137
  50. package/src/kernel/editor/engine/pointer.js +39 -39
  51. package/src/kernel/editor/engine/revision.js +138 -138
  52. package/src/kernel/editor/engine/schema.js +417 -417
  53. package/src/kernel/editor/engine/selection.js +119 -119
  54. package/src/kernel/editor/engine/state.js +118 -118
  55. package/src/kernel/editor/engine/tableClip.js +154 -154
  56. package/src/kernel/editor/engine/tableGrid.js +55 -55
  57. package/src/kernel/editor/engine/tableInteraction.js +388 -388
  58. package/src/kernel/editor/engine/tableMenu.js +250 -250
  59. package/src/kernel/editor/engine/tableOps.js +174 -174
  60. package/src/kernel/editor/engine/tables.js +732 -732
  61. package/src/kernel/editor/overlayGeometry.js +20 -20
  62. package/src/kernel/editor/utils.js +48 -48
  63. package/src/kernel/keyboard.js +114 -114
  64. package/src/kernel/textStyles.js +84 -84
  65. package/src/kernel/util/imageFile.js +91 -91
  66. package/src/kernel/util/shortcutKey.js +33 -33
  67. package/src/surface/editor-surface.js +600 -600
  68. package/src/ui/color-panel.js +69 -69
  69. package/src/ui/context-menu.js +133 -133
  70. package/src/ui/find-bar.js +151 -151
  71. package/src/ui/icons.js +137 -135
  72. package/src/ui/menubar.js +28 -28
  73. package/src/ui/panels.js +115 -115
  74. package/src/ui/prompt.js +89 -89
  75. package/src/ui/ribbon.js +485 -485
  76. package/src/ui/special-chars.js +39 -39
  77. package/src/ui/statusbar.js +81 -81
  78. package/src/ui/toolbar.js +32 -32
  79. package/styles/editor-content.css +440 -440
  80. package/styles/tokens.css +154 -154
@@ -1,151 +1,151 @@
1
- // [文件] gbdocx·FindBar —— 查找与替换浮条(两行:查找行常显、替换行默认收起;走内核 search 的 CSS Highlight 高亮,正文零改写)
2
- export class FindBar {
3
- /** @param {() => object|null} getEditor 内核实例读取器 */
4
- constructor(getEditor) {
5
- this.getEditor = getEditor;
6
- this.replaceOpen = false;
7
- this.readOnly = false;
8
- this.el = document.createElement('div');
9
- this.el.className = 'gbd-findbar';
10
- this.el.innerHTML = `
11
- <div class="gbd-findbar__row">
12
- <input class="gbd-findbar__input" type="text" placeholder="查找…" />
13
- <span class="gbd-findbar__count">0/0</span>
14
- <button type="button" class="gbd-iconbtn" data-act="prev" title="上一个">↑</button>
15
- <button type="button" class="gbd-iconbtn" data-act="next" title="下一个">↓</button>
16
- <label class="gbd-findbar__case"><input type="checkbox" data-act="case" />区分大小写</label>
17
- <button type="button" class="gbd-iconbtn" data-act="toggleReplace" title="展开替换"></button>
18
- <button type="button" class="gbd-iconbtn" data-act="close" title="关闭">✕</button>
19
- </div>
20
- <div class="gbd-findbar__row" data-k="replace" hidden>
21
- <input class="gbd-findbar__replace" type="text" placeholder="替换为…" />
22
- <button type="button" class="gbd-btn" data-act="replace">替换</button>
23
- <button type="button" class="gbd-btn" data-act="replaceAll">全部替换</button>
24
- </div>`;
25
- this.el.hidden = true;
26
- this.input = this.el.querySelector('.gbd-findbar__input');
27
- this.replaceInput = this.el.querySelector('.gbd-findbar__replace');
28
- this.replaceRow = this.el.querySelector('[data-k="replace"]');
29
- this.countEl = this.el.querySelector('.gbd-findbar__count');
30
- this.caseEl = this.el.querySelector('[data-act="case"]');
31
- this.toggleReplaceEl = this.el.querySelector('[data-act="toggleReplace"]');
32
- this.bind();
33
- this.syncReplace();
34
- }
35
-
36
- bind() {
37
- const on = (act, fn) => this.el.querySelector(`[data-act="${act}"]`).addEventListener('click', (e) => {
38
- e.preventDefault();
39
- fn();
40
- });
41
- this.input.addEventListener('input', () => this.refresh());
42
- this.caseEl.addEventListener('change', () => this.refresh());
43
- this.input.addEventListener('keydown', (e) => {
44
- if (e.key === 'Enter') {
45
- e.preventDefault();
46
- e.shiftKey ? this.prev() : this.next();
47
- } else if (e.key === 'Escape') {
48
- e.preventDefault();
49
- this.close();
50
- }
51
- });
52
- this.replaceInput.addEventListener('keydown', (e) => {
53
- if (e.key === 'Enter') {
54
- e.preventDefault();
55
- this.replaceCurrent();
56
- } else if (e.key === 'Escape') {
57
- e.preventDefault();
58
- this.close();
59
- }
60
- });
61
- on('prev', () => this.prev());
62
- on('next', () => this.next());
63
- on('replace', () => this.replaceCurrent());
64
- on('replaceAll', () => this.replaceAll());
65
- on('close', () => this.close());
66
- on('toggleReplace', () => this.setReplaceOpen(!this.replaceOpen));
67
- }
68
-
69
- get search() {
70
- return this.getEditor()?.search || null;
71
- }
72
-
73
- /** 替换行展开/收起(展开时聚焦替换输入) */
74
- setReplaceOpen(on) {
75
- this.replaceOpen = !!on;
76
- this.syncReplace();
77
- if (this.replaceOpen) requestAnimationFrame(() => this.replaceInput.focus());
78
- }
79
-
80
- syncReplace() {
81
- this.replaceRow.hidden = !this.replaceOpen;
82
- this.toggleReplaceEl.textContent = this.replaceOpen ? '▴' : '▾';
83
- this.toggleReplaceEl.title = this.replaceOpen ? '收起替换' : '展开替换';
84
- }
85
-
86
- refresh() {
87
- const s = this.search;
88
- if (!s) return;
89
- s.setKeyword(this.input.value, { caseSensitive: this.caseEl.checked });
90
- this.renderCount();
91
- }
92
-
93
- renderCount() {
94
- const s = this.search;
95
- if (!s) return;
96
- const snap = s.snapshot();
97
- this.countEl.textContent = `${snap.total ? snap.activeIndex + 1 : 0}/${snap.total}`;
98
- }
99
-
100
- next() {
101
- this.search?.next();
102
- this.renderCount();
103
- }
104
-
105
- prev() {
106
- this.search?.prev();
107
- this.renderCount();
108
- }
109
-
110
- replaceCurrent() {
111
- if (this.readOnly) return;
112
- const ed = this.getEditor();
113
- if (!ed) return;
114
- ed.run(() => ed.search.replaceCurrent(this.replaceInput.value));
115
- this.renderCount();
116
- }
117
-
118
- replaceAll() {
119
- if (this.readOnly) return;
120
- const ed = this.getEditor();
121
- if (!ed) return;
122
- ed.run(() => ed.search.replaceAll(this.replaceInput.value));
123
- this.renderCount();
124
- }
125
-
126
- /** 只读档只留查找,替换行的入口与执行一并锁掉 */
127
- setReadOnly(on) {
128
- this.readOnly = !!on;
129
- this.toggleReplaceEl.disabled = this.readOnly;
130
- if (this.readOnly) this.setReplaceOpen(false);
131
- }
132
-
133
- /** 打开:replace=true(Ctrl+H / 菜单「查找和替换」)时展开替换行,否则只显示查找行 */
134
- open(replace = false) {
135
- this.el.hidden = false;
136
- this.setReplaceOpen(replace && !this.readOnly);
137
- requestAnimationFrame(() => {
138
- this.input.focus();
139
- this.input.select();
140
- });
141
- this.refresh();
142
- }
143
-
144
- close() {
145
- if (this.el.hidden) return;
146
- this.el.hidden = true;
147
- this.replaceOpen = false;
148
- this.syncReplace();
149
- this.search?.clear();
150
- }
151
- }
1
+ // [文件] gbdocx·FindBar —— 查找与替换浮条(两行:查找行常显、替换行默认收起;走内核 search 的 CSS Highlight 高亮,正文零改写)
2
+ export class FindBar {
3
+ /** @param {() => object|null} getEditor 内核实例读取器 */
4
+ constructor(getEditor) {
5
+ this.getEditor = getEditor;
6
+ this.replaceOpen = false;
7
+ this.readOnly = false;
8
+ this.el = document.createElement('div');
9
+ this.el.className = 'gbd-findbar';
10
+ this.el.innerHTML = `
11
+ <div class="gbd-findbar__row">
12
+ <input class="gbd-findbar__input" type="text" placeholder="查找…" />
13
+ <span class="gbd-findbar__count">0/0</span>
14
+ <button type="button" class="gbd-iconbtn" data-act="prev" title="上一个">↑</button>
15
+ <button type="button" class="gbd-iconbtn" data-act="next" title="下一个">↓</button>
16
+ <label class="gbd-findbar__case"><input type="checkbox" data-act="case" />区分大小写</label>
17
+ <button type="button" class="gbd-iconbtn" data-act="toggleReplace" title="展开替换"></button>
18
+ <button type="button" class="gbd-iconbtn" data-act="close" title="关闭">✕</button>
19
+ </div>
20
+ <div class="gbd-findbar__row" data-k="replace" hidden>
21
+ <input class="gbd-findbar__replace" type="text" placeholder="替换为…" />
22
+ <button type="button" class="gbd-btn" data-act="replace">替换</button>
23
+ <button type="button" class="gbd-btn" data-act="replaceAll">全部替换</button>
24
+ </div>`;
25
+ this.el.hidden = true;
26
+ this.input = this.el.querySelector('.gbd-findbar__input');
27
+ this.replaceInput = this.el.querySelector('.gbd-findbar__replace');
28
+ this.replaceRow = this.el.querySelector('[data-k="replace"]');
29
+ this.countEl = this.el.querySelector('.gbd-findbar__count');
30
+ this.caseEl = this.el.querySelector('[data-act="case"]');
31
+ this.toggleReplaceEl = this.el.querySelector('[data-act="toggleReplace"]');
32
+ this.bind();
33
+ this.syncReplace();
34
+ }
35
+
36
+ bind() {
37
+ const on = (act, fn) => this.el.querySelector(`[data-act="${act}"]`).addEventListener('click', (e) => {
38
+ e.preventDefault();
39
+ fn();
40
+ });
41
+ this.input.addEventListener('input', () => this.refresh());
42
+ this.caseEl.addEventListener('change', () => this.refresh());
43
+ this.input.addEventListener('keydown', (e) => {
44
+ if (e.key === 'Enter') {
45
+ e.preventDefault();
46
+ e.shiftKey ? this.prev() : this.next();
47
+ } else if (e.key === 'Escape') {
48
+ e.preventDefault();
49
+ this.close();
50
+ }
51
+ });
52
+ this.replaceInput.addEventListener('keydown', (e) => {
53
+ if (e.key === 'Enter') {
54
+ e.preventDefault();
55
+ this.replaceCurrent();
56
+ } else if (e.key === 'Escape') {
57
+ e.preventDefault();
58
+ this.close();
59
+ }
60
+ });
61
+ on('prev', () => this.prev());
62
+ on('next', () => this.next());
63
+ on('replace', () => this.replaceCurrent());
64
+ on('replaceAll', () => this.replaceAll());
65
+ on('close', () => this.close());
66
+ on('toggleReplace', () => this.setReplaceOpen(!this.replaceOpen));
67
+ }
68
+
69
+ get search() {
70
+ return this.getEditor()?.search || null;
71
+ }
72
+
73
+ /** 替换行展开/收起(展开时聚焦替换输入) */
74
+ setReplaceOpen(on) {
75
+ this.replaceOpen = !!on;
76
+ this.syncReplace();
77
+ if (this.replaceOpen) requestAnimationFrame(() => this.replaceInput.focus());
78
+ }
79
+
80
+ syncReplace() {
81
+ this.replaceRow.hidden = !this.replaceOpen;
82
+ this.toggleReplaceEl.textContent = this.replaceOpen ? '▴' : '▾';
83
+ this.toggleReplaceEl.title = this.replaceOpen ? '收起替换' : '展开替换';
84
+ }
85
+
86
+ refresh() {
87
+ const s = this.search;
88
+ if (!s) return;
89
+ s.setKeyword(this.input.value, { caseSensitive: this.caseEl.checked });
90
+ this.renderCount();
91
+ }
92
+
93
+ renderCount() {
94
+ const s = this.search;
95
+ if (!s) return;
96
+ const snap = s.snapshot();
97
+ this.countEl.textContent = `${snap.total ? snap.activeIndex + 1 : 0}/${snap.total}`;
98
+ }
99
+
100
+ next() {
101
+ this.search?.next();
102
+ this.renderCount();
103
+ }
104
+
105
+ prev() {
106
+ this.search?.prev();
107
+ this.renderCount();
108
+ }
109
+
110
+ replaceCurrent() {
111
+ if (this.readOnly) return;
112
+ const ed = this.getEditor();
113
+ if (!ed) return;
114
+ ed.run(() => ed.search.replaceCurrent(this.replaceInput.value));
115
+ this.renderCount();
116
+ }
117
+
118
+ replaceAll() {
119
+ if (this.readOnly) return;
120
+ const ed = this.getEditor();
121
+ if (!ed) return;
122
+ ed.run(() => ed.search.replaceAll(this.replaceInput.value));
123
+ this.renderCount();
124
+ }
125
+
126
+ /** 只读档只留查找,替换行的入口与执行一并锁掉 */
127
+ setReadOnly(on) {
128
+ this.readOnly = !!on;
129
+ this.toggleReplaceEl.disabled = this.readOnly;
130
+ if (this.readOnly) this.setReplaceOpen(false);
131
+ }
132
+
133
+ /** 打开:replace=true(Ctrl+H / 菜单「查找和替换」)时展开替换行,否则只显示查找行 */
134
+ open(replace = false) {
135
+ this.el.hidden = false;
136
+ this.setReplaceOpen(replace && !this.readOnly);
137
+ requestAnimationFrame(() => {
138
+ this.input.focus();
139
+ this.input.select();
140
+ });
141
+ this.refresh();
142
+ }
143
+
144
+ close() {
145
+ if (this.el.hidden) return;
146
+ this.el.hidden = true;
147
+ this.replaceOpen = false;
148
+ this.syncReplace();
149
+ this.search?.clear();
150
+ }
151
+ }
package/src/ui/icons.js CHANGED
@@ -1,135 +1,137 @@
1
- // [文件] gbdocx·UI 图标集 —— 工具栏/菜单用的内联 SVG(stroke 风格,currentColor 上色)
2
- const S = (body, size = 16) =>
3
- `<svg viewBox="0 0 24 24" width="${size}" height="${size}" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round">${body}</svg>`;
4
-
5
- export const ICONS = {
6
- bold: S('<path d="M7 5h6a3.5 3.5 0 0 1 0 7H7zM7 12h7a3.5 3.5 0 0 1 0 7H7z"/>'),
7
- italic: S('<path d="M15 5h-5M14 19H9M14 5l-4 14"/>'),
8
- underline: S('<path d="M7 5v7a5 5 0 0 0 10 0V5M5 20h14"/>'),
9
- strike: S('<path d="M5 12h14M8 8a3 3 0 0 1 3-3h3a3 3 0 0 1 0 6M16 16a3 3 0 0 1-3 3h-3a3 3 0 0 1-2-1"/>'),
10
- superscript: S('<path d="M4 19l4.5-11L13 19M5.5 15h5.5"/><path d="M16 8h3l-3 4h3"/>'),
11
- subscript: S('<path d="M4 15l4.5-11L13 15M5.5 11h5.5"/><path d="M16 15h3l-3 4h3"/>'),
12
- colorIcon: S('<path d="M6 18h12M8 14l4-9 4 9M7 14h10"/><path d="M4 21h16"/>'),
13
- bgIcon: S('<path d="M4 20h16M6 14l4-9 4 9M7 14h10"/>'),
14
- alignLeft: S('<path d="M4 6h16M4 12h10M4 18h14"/>'),
15
- alignCenter: S('<path d="M4 6h16M7 12h10M5 18h14"/>'),
16
- alignRight: S('<path d="M4 6h16M10 12h10M6 18h14"/>'),
17
- alignJustify: S('<path d="M4 6h16M4 12h16M4 18h16"/>'),
18
- bullet: S('<path d="M9 6h11M9 12h11M9 18h11M5 6h.01M5 12h.01M5 18h.01"/>'),
19
- ordered: S('<path d="M10 6h10M10 12h10M10 18h10M4 5h1v3M4 11h2l-2 3h2M4 17h1.5a1 1 0 0 1 0 2H4h1.5a1 1 0 0 1 0 2H4"/>'),
20
- indentAdd: S('<path d="M4 6h16M10 12h10M4 18h16M6 9l3 3-3 3"/>'),
21
- indentReduce: S('<path d="M4 6h16M10 12h10M4 18h16M9 9l-3 3 3 3"/>'),
22
- quote: S('<path d="M7 7H4v6h5V8M17 7h-3v6h5V8"/>'),
23
- code: S('<path d="M9 8l-4 4 4 4M15 8l4 4-4 4"/>'),
24
- table: S('<rect x="3" y="4" width="18" height="16" rx="1.5"/><path d="M3 10h18M3 15h18M9 4v16M15 4v16"/>'),
25
- image: S('<rect x="3" y="4" width="18" height="16" rx="1.5"/><path d="M4 16l4-4 4 4 3-3 5 5"/><circle cx="9" cy="9" r="1.4"/>'),
26
- linkIcon: S('<path d="M10 13a4 4 0 0 0 5.7 0l2.3-2.3a4 4 0 0 0-5.7-5.7L11 6"/><path d="M14 11a4 4 0 0 0-5.7 0L6 13.3a4 4 0 0 0 5.7 5.7L13 18"/>'),
27
- divider: S('<path d="M3 12h18"/>'),
28
- pageBreak: S('<path d="M4 4h16v6H4zM4 14h6v6H4zM14 14h6v6h-6z"/>'),
29
- undo: S('<path d="M9 7L4 12l5 5M4 12h11a5 5 0 0 1 0 10"/>'),
30
- redo: S('<path d="M15 7l5 5-5 5M20 12H9a5 5 0 0 0 0 10"/>'),
31
- clear: S('<path d="M6 6l12 12M18 6L6 18"/>'),
32
- chevronDown: S('<path d="M6 9l6 6 6-6"/>'),
33
- // 选项卡面板专用(紧凑图标按钮,与上面同款 stroke 风格)
34
- find: S('<circle cx="10.5" cy="10.5" r="6.5"/><path d="M15.5 15.5L21 21"/>'),
35
- pageSetup: S('<path d="M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2M4 7h16v12a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1z"/><path d="M8 12h8M8 16h5"/>'),
36
- columns: S('<rect x="3" y="4" width="18" height="16" rx="1"/><path d="M12 4v16"/>'),
37
- headerFooter: S('<rect x="3" y="4" width="18" height="16" rx="1"/><path d="M3 9h18M3 15h18"/>'),
38
- footnote: S('<path d="M5 5h14M5 12h9M5 19h6M17 11v8M15 19h4"/>'),
39
- comment: S('<path d="M20 15a3 3 0 0 1-3 3H8l-4 3V6a3 3 0 0 1 3-3h10a3 3 0 0 1 3 3z"/>'),
40
- toc: S('<path d="M4 6h3M4 12h3M4 18h3M11 6h9M11 12h9M11 18h9"/>'),
41
- watermark: S('<path d="M4 5h16v14H4z"/><path d="M9 15l2.5-6 2.5 6M9.8 13h3.4"/>'),
42
- pageNumber: S('<rect x="6" y="3" width="12" height="18" rx="1.5"/><path d="M9 18h6"/>'),
43
- suggest: S('<path d="M4 20h4L19 9a2 2 0 0 0-3-3L5 17z"/><path d="M14 7l3 3"/>'),
44
- accept: S('<path d="M5 13l4 4L19 7"/>'),
45
- reject: S('<path d="M6 6l12 12M18 6L6 18"/>'),
46
- print: S('<path d="M6 9V4h12v5M6 18H4a1 1 0 0 1-1-1v-5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v5a1 1 0 0 1-1 1h-2"/><path d="M6 15h12v5H6z"/>'),
47
- export: S('<path d="M12 3v12M8 11l4 4 4-4M4 17v3a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-3"/>'),
48
- zoomIn: S('<circle cx="10.5" cy="10.5" r="6.5"/><path d="M15.5 15.5L21 21M10.5 7v7M7 10.5h7"/>'),
49
- zoomOut: S('<circle cx="10.5" cy="10.5" r="6.5"/><path d="M15.5 15.5L21 21M7 10.5h7"/>'),
50
- specialChars: S('<path d="M12 4v16M5 8h14M5 8c0 6 14 6 14 0"/>'),
51
- bookmark: S('<path d="M6 4h12v17l-6-4-6 4z"/>'),
52
- panel: S('<rect x="3" y="4" width="18" height="16" rx="1"/><path d="M15 4v16"/>'),
53
- eye: S('<path d="M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12z"/><circle cx="12" cy="12" r="2.8"/>'),
54
- fullscreen: S('<path d="M4 4h6v2H6v4H4zM14 4h6v6h-2V6h-4zM4 14h2v4h4v2H4zM18 14h2v6h-6v-2h4z"/>'),
55
- fullscreenExit: S('<path d="M9 4h2v6H5V8h4zM13 4h2v4h4v2h-6zM5 14h6v6H9v-4H5zM13 16h6v-2h-4v-4h-2z"/>'),
56
- margin: S('<rect x="3" y="3" width="18" height="18" rx="1"/><rect x="8" y="8" width="8" height="8" rx="0.5"/>'),
57
- zoomReset: S('<circle cx="10.5" cy="10.5" r="6.5"/><path d="M15.5 15.5L21 21M7.5 10.5h6"/>'),
58
- selectAll: S('<rect x="3" y="3" width="12" height="12" rx="1"/><path d="M9 21h10a2 2 0 0 0 2-2V9"/>'),
59
-
60
- // ---- WPS 风格功能区专用图标 ----
61
- // 剪贴板
62
- paste: S('<rect x="5" y="4" width="14" height="17" rx="1.5"/><path d="M9 4V3h6v1M8 9h8M8 13h8M8 17h5"/>'),
63
- cut: S('<circle cx="6" cy="17" r="2.5"/><circle cx="18" cy="17" r="2.5"/><path d="M8 15L19 4M16 4L5 15"/>'),
64
- copy: S('<rect x="8" y="8" width="12" height="12" rx="1.5"/><path d="M16 8V5a1.5 1.5 0 0 0-1.5-1.5H5A1.5 1.5 0 0 0 3.5 5v9.5A1.5 1.5 0 0 0 5 16h3"/>'),
65
- formatPainter: S('<path d="M14 4l6 6-8 8-6-6zM6 12l-2 6 6-2M9 9l6 6"/>'),
66
- // 字体
67
- growFont: S('<path d="M3 18l4.5-11L12 18M4.5 14h6M18 7v8M14 11h8"/>'),
68
- shrinkFont: S('<path d="M3 18l4.5-11L12 18M4.5 14h6M14 11h8"/>'),
69
- eraser: S('<path d="M4 15l8-8a2 2 0 0 1 3 0l4 4a2 2 0 0 1 0 3l-7 7H8zM12 19h9"/>'),
70
- highlight: S('<path d="M4 20h16M14 4l6 6-8 8-6-6zM9 15l6 6"/>'),
71
- pinyin: S('<path d="M4 6h16M12 6v13M7 12l3 3M17 12l-3 3M8 19h8"/>'),
72
- circleChar: S('<circle cx="12" cy="12" r="9"/><path d="M9 15l3-7 3 7M10 13h4"/>'),
73
- // 段落
74
- multiLevel: S('<path d="M9 6h11M9 12h11M9 18h11M4 5h1v3M4 11h2l-2 3h2M4 17h2v3H4z"/>'),
75
- outdent: S('<path d="M11 6h9M11 12h9M11 18h9M3 12h6M6 9l-3 3 3 3"/>'),
76
- distribute: S('<path d="M4 6h16M7 12h10M4 18h16M4 3v18M20 3v18"/>'),
77
- lineSpacing: S('<path d="M4 7h10M4 12h10M4 17h10M18 5v14M15 8l3-3 3 3M15 16l3 3 3-3"/>'),
78
- shading: S('<path d="M4 4h16v16H4zM4 9h16M4 14h16M9 4v16M15 4v16"/>'),
79
- borders: S('<rect x="3" y="3" width="18" height="18" rx="1"/><path d="M3 12h18M12 3v18"/>'),
80
- newStyle: S('<path d="M5 19h14M8 15l7-9 3 3-7 9H8zM13 8l3 3"/>'),
81
- // 插入
82
- coverPage: S('<rect x="5" y="3" width="14" height="18" rx="1"/><path d="M5 8h14M8 12h8M8 15h8"/>'),
83
- blankPage: S('<rect x="5" y="3" width="14" height="18" rx="1"/><path d="M9 9h6v6H9z"/>'),
84
- chart: S('<path d="M4 20h16M6 20V10M11 20V5M16 20v-7M21 20v-4"/>'),
85
- screenshot: S('<path d="M4 8V5a1 1 0 0 1 1-1h3M16 4h3a1 1 0 0 1 1 1v3M20 16v3a1 1 0 0 1-1 1h-3M8 20H5a1 1 0 0 1-1-1v-3M4 12h16"/>'),
86
- shape: S('<circle cx="8" cy="8" r="4"/><rect x="12" y="12" width="8" height="8" rx="1"/>'),
87
- iconGallery: S('<path d="M12 3l2.2 5.6L20 9l-5 4 1.5 6L12 16l-4.5 3L9 13 4 9l5.8-.4z"/>'),
88
- mindMap: S('<rect x="2" y="9" width="6" height="5" rx="1"/><rect x="16" y="3" width="6" height="5" rx="1"/><rect x="16" y="15" width="6" height="5" rx="1"/><path d="M8 11h4V6h4M12 11v7h4"/>'),
89
- flowChart: S('<rect x="2" y="4" width="7" height="5" rx="1"/><rect x="15" y="15" width="7" height="5" rx="1"/><path d="M9 6h4v12h2M5 9v6h10"/>'),
90
- textBox: S('<rect x="3" y="5" width="18" height="14" rx="1"/><path d="M7 9h10M12 9v9M9 18h6"/>'),
91
- wordArt: S('<path d="M4 18l4-11 4 11M5 14h6M14 18V7h6M14 12h5"/>'),
92
- equation: S('<path d="M8 4c-2 0-3 1-3 3 0 3 6 4 6 8a3 3 0 0 1-6 0M6 11h8M17 7l4 8M21 7l-4 8"/>'),
93
- insertText: S('<path d="M4 6h10M9 3v6M4 18h16M14 14h6M17 11v6"/>'),
94
- object: S('<path d="M12 3l9 5v8l-9 5-9-5V8zM3 8l9 5 9-5M12 13v8"/>'),
95
- date: S('<rect x="3" y="5" width="18" height="16" rx="2"/><path d="M3 10h18M8 3v4M16 3v4M8 14h3M8 17h6"/>'),
96
- attachment: S('<path d="M20 11l-8 8a5 5 0 0 1-7-7l9-9a3.5 3.5 0 0 1 5 5l-9 9a2 2 0 0 1-3-3l8-8"/>'),
97
- fileLink: S('<path d="M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8M14 3l6 6h-6zM13 15a3 3 0 0 1 5-2M18 13a3 3 0 0 1 1 4l-2 2a3 3 0 0 1-4 0"/>'),
98
- crossReference: S('<path d="M6 4h8l4 4v12H6zM14 4v4h4M9 13h6M9 17h4M4 8v12a2 2 0 0 0 2 2"/>'),
99
- // 页面布局
100
- theme: S('<circle cx="12" cy="12" r="9"/><path d="M12 3a9 9 0 0 0 0 18M8 8h.01M12 6h.01M16 9h.01"/>'),
101
- colors: S('<circle cx="7" cy="8" r="3"/><circle cx="16" cy="7" r="3"/><circle cx="11" cy="16" r="3"/><path d="M7 11v2a2 2 0 0 0 2 2M16 10v3a3 3 0 0 1-3 3"/>'),
102
- effects: S('<path d="M5 3l1.5 4L10 9l-3.5 2L5 15l-1.5-4L0 9l3.5-2zM17 12l1 3 3 1-3 1-1 3-1-3-3-1 3-1z"/>'),
103
- fontCollection: S('<path d="M3 18l4-10 4 10M4 14h6M14 18l3-8 3 8M15 15h4"/>'),
104
- orientation: S('<rect x="6" y="3" width="12" height="18" rx="1"/><path d="M6 8h12M9 12h6M9 15h6"/>'),
105
- paperSize: S('<rect x="4" y="3" width="16" height="18" rx="1"/><path d="M4 17h16M16 17V3"/>'),
106
- textDirection: S('<path d="M12 3v18M9 6l3-3 3 3M9 18l3 3 3-3M6 9h4M6 12h3"/>'),
107
- separator: S('<path d="M3 12h5M16 12h5M9 6v12M12 6v12M15 6v12"/>'),
108
- lineNumbers: S('<path d="M8 4h13M8 10h13M8 16h13M3 4h.01M3 10h.01M3 16h.01"/>'),
109
- background: S('<rect x="3" y="4" width="18" height="16" rx="2"/><path d="M3 14l4-4 4 4 3-3 4 4 3-3"/>'),
110
- pageBorder: S('<rect x="4" y="3" width="16" height="18" rx="1"/><rect x="7" y="6" width="10" height="12" rx="0.5"/>'),
111
- paperSettings: S('<rect x="4" y="3" width="16" height="18" rx="1"/><path d="M4 9h16M4 15h16M10 3v18M15 3v18"/>'),
112
- wrap: S('<path d="M4 6h16M4 18h16M8 10h8a3 3 0 0 1 0 6H9M8 13l-2 3 2 3"/>'),
113
- alignObjects: S('<path d="M4 3v18M9 7h11M9 14h8M6 4h.01M6 20h.01"/>'),
114
- groupObjects: S('<rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/><path d="M10 10l4 4M14 6h4v4M10 18H6v-4"/>'),
115
- rotate: S('<path d="M20 12a8 8 0 1 1-2.3-5.6M20 4v5h-5"/>'),
116
- bringForward: S('<rect x="8" y="8" width="12" height="12" rx="1"/><path d="M4 16V4h12M12 14h4M14 12v4"/>'),
117
- sendBackward: S('<rect x="4" y="4" width="12" height="12" rx="1"/><path d="M20 8v12H8M10 10h4M12 8v4"/>'),
118
- // 引用
119
- updateToc: S('<path d="M4 6h10M4 12h7M4 18h10M18 8a4 4 0 1 1-1 5M17 5v3h3"/>'),
120
- tocLevel: S('<path d="M4 6h16M6 12h14M8 18h12M4 12h.01M4 18h.01"/>'),
121
- prevFootnote: S('<path d="M15 18l-6-6 6-6M8 12h8M4 4h.01M4 20h.01"/>'),
122
- nextFootnote: S('<path d="M9 6l6 6-6 6M8 12h8M20 4h.01M20 20h.01"/>'),
123
- insertEndnote: S('<path d="M12 4v12M8 12l4 4 4-4M5 20h14"/>'),
124
- prevEndnote: S('<path d="M15 18l-6-6 6-6M8 12h8M4 20h16"/>'),
125
- nextEndnote: S('<path d="M9 6l6 6-6 6M8 12h8M4 20h16"/>'),
126
- footnoteSep: S('<path d="M4 6h16M4 18h16M4 12h4M16 12h4M9 12h6"/>'),
127
- caption: S('<path d="M4 5h16v11H4zM8 9h8M8 13h5M4 20h10"/>'),
128
- markCitation: S('<path d="M8 6c-2 0-3 1-3 3s1 3 3 3c-1 2-2 3-4 4M16 6c-2 0-3 1-3 3s1 3 3 3c-1 2-2 3-4 4"/>'),
129
- insertIndex: S('<path d="M4 5h16M4 11h16M4 17h10M17 15v6M14 18h6"/>'),
130
- updateIndex: S('<path d="M4 5h16M4 11h16M4 17h10M18 14a3 3 0 1 1-1 4M17 12v2h2"/>'),
131
- mail: S('<rect x="3" y="5" width="18" height="14" rx="2"/><path d="M3 7l9 6 9-6"/>'),
132
- };
133
-
134
- /** 取图标 SVG 串(未登记返回空串) */
135
- export const icon = (name) => ICONS[name] || '';
1
+ // [文件] gbdocx·UI 图标集 —— 工具栏/菜单用的内联 SVG(stroke 风格,currentColor 上色)
2
+ const S = (body, size = 16) =>
3
+ `<svg viewBox="0 0 24 24" width="${size}" height="${size}" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round">${body}</svg>`;
4
+
5
+ export const ICONS = {
6
+ bold: S('<path d="M7 5h6a3.5 3.5 0 0 1 0 7H7zM7 12h7a3.5 3.5 0 0 1 0 7H7z"/>'),
7
+ italic: S('<path d="M15 5h-5M14 19H9M14 5l-4 14"/>'),
8
+ underline: S('<path d="M7 5v7a5 5 0 0 0 10 0V5M5 20h14"/>'),
9
+ strike: S('<path d="M5 12h14M8 8a3 3 0 0 1 3-3h3a3 3 0 0 1 0 6M16 16a3 3 0 0 1-3 3h-3a3 3 0 0 1-2-1"/>'),
10
+ superscript: S('<path d="M4 19l4.5-11L13 19M5.5 15h5.5"/><path d="M16 8h3l-3 4h3"/>'),
11
+ subscript: S('<path d="M4 15l4.5-11L13 15M5.5 11h5.5"/><path d="M16 15h3l-3 4h3"/>'),
12
+ colorIcon: S('<path d="M6 18h12M8 14l4-9 4 9M7 14h10"/><path d="M4 21h16"/>'),
13
+ bgIcon: S('<path d="M4 20h16M6 14l4-9 4 9M7 14h10"/>'),
14
+ alignLeft: S('<path d="M4 6h16M4 12h10M4 18h14"/>'),
15
+ alignCenter: S('<path d="M4 6h16M7 12h10M5 18h14"/>'),
16
+ alignRight: S('<path d="M4 6h16M10 12h10M6 18h14"/>'),
17
+ alignJustify: S('<path d="M4 6h16M4 12h16M4 18h16"/>'),
18
+ bullet: S('<path d="M9 6h11M9 12h11M9 18h11M5 6h.01M5 12h.01M5 18h.01"/>'),
19
+ ordered: S('<path d="M10 6h10M10 12h10M10 18h10M4 5h1v3M4 11h2l-2 3h2M4 17h1.5a1 1 0 0 1 0 2H4h1.5a1 1 0 0 1 0 2H4"/>'),
20
+ indentAdd: S('<path d="M4 6h16M10 12h10M4 18h16M6 9l3 3-3 3"/>'),
21
+ indentReduce: S('<path d="M4 6h16M10 12h10M4 18h16M9 9l-3 3 3 3"/>'),
22
+ quote: S('<path d="M7 7H4v6h5V8M17 7h-3v6h5V8"/>'),
23
+ code: S('<path d="M9 8l-4 4 4 4M15 8l4 4-4 4"/>'),
24
+ table: S('<rect x="3" y="4" width="18" height="16" rx="1.5"/><path d="M3 10h18M3 15h18M9 4v16M15 4v16"/>'),
25
+ image: S('<rect x="3" y="4" width="18" height="16" rx="1.5"/><path d="M4 16l4-4 4 4 3-3 5 5"/><circle cx="9" cy="9" r="1.4"/>'),
26
+ linkIcon: S('<path d="M10 13a4 4 0 0 0 5.7 0l2.3-2.3a4 4 0 0 0-5.7-5.7L11 6"/><path d="M14 11a4 4 0 0 0-5.7 0L6 13.3a4 4 0 0 0 5.7 5.7L13 18"/>'),
27
+ divider: S('<path d="M3 12h18"/>'),
28
+ pageBreak: S('<path d="M4 4h16v6H4zM4 14h6v6H4zM14 14h6v6h-6z"/>'),
29
+ undo: S('<path d="M9 7L4 12l5 5M4 12h11a5 5 0 0 1 0 10"/>'),
30
+ redo: S('<path d="M15 7l5 5-5 5M20 12H9a5 5 0 0 0 0 10"/>'),
31
+ clear: S('<path d="M6 6l12 12M18 6L6 18"/>'),
32
+ chevronDown: S('<path d="M6 9l6 6 6-6"/>'),
33
+ // 选项卡面板专用(紧凑图标按钮,与上面同款 stroke 风格)
34
+ find: S('<circle cx="10.5" cy="10.5" r="6.5"/><path d="M15.5 15.5L21 21"/>'),
35
+ pageSetup: S('<path d="M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2M4 7h16v12a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1z"/><path d="M8 12h8M8 16h5"/>'),
36
+ columns: S('<rect x="3" y="4" width="18" height="16" rx="1"/><path d="M12 4v16"/>'),
37
+ headerFooter: S('<rect x="3" y="4" width="18" height="16" rx="1"/><path d="M3 9h18M3 15h18"/>'),
38
+ footnote: S('<path d="M5 5h14M5 12h9M5 19h6M17 11v8M15 19h4"/>'),
39
+ comment: S('<path d="M20 15a3 3 0 0 1-3 3H8l-4 3V6a3 3 0 0 1 3-3h10a3 3 0 0 1 3 3z"/>'),
40
+ toc: S('<path d="M4 6h3M4 12h3M4 18h3M11 6h9M11 12h9M11 18h9"/>'),
41
+ watermark: S('<path d="M4 5h16v14H4z"/><path d="M9 15l2.5-6 2.5 6M9.8 13h3.4"/>'),
42
+ pageNumber: S('<rect x="6" y="3" width="12" height="18" rx="1.5"/><path d="M9 18h6"/>'),
43
+ suggest: S('<path d="M4 20h4L19 9a2 2 0 0 0-3-3L5 17z"/><path d="M14 7l3 3"/>'),
44
+ accept: S('<path d="M5 13l4 4L19 7"/>'),
45
+ reject: S('<path d="M6 6l12 12M18 6L6 18"/>'),
46
+ print: S('<path d="M6 9V4h12v5M6 18H4a1 1 0 0 1-1-1v-5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v5a1 1 0 0 1-1 1h-2"/><path d="M6 15h12v5H6z"/>'),
47
+ export: S('<path d="M12 3v12M8 11l4 4 4-4M4 17v3a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-3"/>'),
48
+ zoomIn: S('<circle cx="10.5" cy="10.5" r="6.5"/><path d="M15.5 15.5L21 21M10.5 7v7M7 10.5h7"/>'),
49
+ zoomOut: S('<circle cx="10.5" cy="10.5" r="6.5"/><path d="M15.5 15.5L21 21M7 10.5h7"/>'),
50
+ specialChars: S('<path d="M12 4v16M5 8h14M5 8c0 6 14 6 14 0"/>'),
51
+ bookmark: S('<path d="M6 4h12v17l-6-4-6 4z"/>'),
52
+ panel: S('<rect x="3" y="4" width="18" height="16" rx="1"/><path d="M15 4v16"/>'),
53
+ eye: S('<path d="M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12z"/><circle cx="12" cy="12" r="2.8"/>'),
54
+ fullscreen: S('<path d="M4 4h6v2H6v4H4zM14 4h6v6h-2V6h-4zM4 14h2v4h4v2H4zM18 14h2v6h-6v-2h4z"/>'),
55
+ fullscreenExit: S('<path d="M9 4h2v6H5V8h4zM13 4h2v4h4v2h-6zM5 14h6v6H9v-4H5zM13 16h6v-2h-4v-4h-2z"/>'),
56
+ margin: S('<rect x="3" y="3" width="18" height="18" rx="1"/><rect x="8" y="8" width="8" height="8" rx="0.5"/>'),
57
+ zoomReset: S('<circle cx="10.5" cy="10.5" r="6.5"/><path d="M15.5 15.5L21 21M7.5 10.5h6"/>'),
58
+ selectAll: S('<rect x="3" y="3" width="12" height="12" rx="1"/><path d="M9 21h10a2 2 0 0 0 2-2V9"/>'),
59
+
60
+ // ---- WPS 风格功能区专用图标 ----
61
+ // 剪贴板
62
+ paste: S('<rect x="5" y="4" width="14" height="17" rx="1.5"/><path d="M9 4V3h6v1M8 9h8M8 13h8M8 17h5"/>'),
63
+ cut: S('<circle cx="6" cy="17" r="2.5"/><circle cx="18" cy="17" r="2.5"/><path d="M8 15L19 4M16 4L5 15"/>'),
64
+ copy: S('<rect x="8" y="8" width="12" height="12" rx="1.5"/><path d="M16 8V5a1.5 1.5 0 0 0-1.5-1.5H5A1.5 1.5 0 0 0 3.5 5v9.5A1.5 1.5 0 0 0 5 16h3"/>'),
65
+ formatPainter: S('<path d="M14 4l6 6-8 8-6-6zM6 12l-2 6 6-2M9 9l6 6"/>'),
66
+ // 字体
67
+ growFont: S('<path d="M3 18l4.5-11L12 18M4.5 14h6M18 7v8M14 11h8"/>'),
68
+ shrinkFont: S('<path d="M3 18l4.5-11L12 18M4.5 14h6M14 11h8"/>'),
69
+ eraser: S('<path d="M4 15l8-8a2 2 0 0 1 3 0l4 4a2 2 0 0 1 0 3l-7 7H8zM12 19h9"/>'),
70
+ highlight: S('<path d="M4 20h16M14 4l6 6-8 8-6-6zM9 15l6 6"/>'),
71
+ pinyin: S('<path d="M4 6h16M12 6v13M7 12l3 3M17 12l-3 3M8 19h8"/>'),
72
+ circleChar: S('<circle cx="12" cy="12" r="9"/><path d="M9 15l3-7 3 7M10 13h4"/>'),
73
+ // 段落
74
+ multiLevel: S('<path d="M9 6h11M9 12h11M9 18h11M4 5h1v3M4 11h2l-2 3h2M4 17h2v3H4z"/>'),
75
+ outdent: S('<path d="M11 6h9M11 12h9M11 18h9M3 12h6M6 9l-3 3 3 3"/>'),
76
+ distribute: S('<path d="M4 6h16M7 12h10M4 18h16M4 3v18M20 3v18"/>'),
77
+ lineSpacing: S('<path d="M4 7h10M4 12h10M4 17h10M18 5v14M15 8l3-3 3 3M15 16l3 3 3-3"/>'),
78
+ shading: S('<path d="M4 4h16v16H4zM4 9h16M4 14h16M9 4v16M15 4v16"/>'),
79
+ borders: S('<rect x="3" y="3" width="18" height="18" rx="1"/><path d="M3 12h18M12 3v18"/>'),
80
+ newStyle: S('<path d="M5 19h14M8 15l7-9 3 3-7 9H8zM13 8l3 3"/>'),
81
+ // 插入
82
+ coverPage: S('<rect x="5" y="3" width="14" height="18" rx="1"/><path d="M5 8h14M8 12h8M8 15h8"/>'),
83
+ blankPage: S('<rect x="5" y="3" width="14" height="18" rx="1"/><path d="M9 9h6v6H9z"/>'),
84
+ chart: S('<path d="M4 20h16M6 20V10M11 20V5M16 20v-7M21 20v-4"/>'),
85
+ screenshot: S('<path d="M4 8V5a1 1 0 0 1 1-1h3M16 4h3a1 1 0 0 1 1 1v3M20 16v3a1 1 0 0 1-1 1h-3M8 20H5a1 1 0 0 1-1-1v-3M4 12h16"/>'),
86
+ shape: S('<circle cx="8" cy="8" r="4"/><rect x="12" y="12" width="8" height="8" rx="1"/>'),
87
+ iconGallery: S('<path d="M12 3l2.2 5.6L20 9l-5 4 1.5 6L12 16l-4.5 3L9 13 4 9l5.8-.4z"/>'),
88
+ mindMap: S('<rect x="2" y="9" width="6" height="5" rx="1"/><rect x="16" y="3" width="6" height="5" rx="1"/><rect x="16" y="15" width="6" height="5" rx="1"/><path d="M8 11h4V6h4M12 11v7h4"/>'),
89
+ flowChart: S('<rect x="2" y="4" width="7" height="5" rx="1"/><rect x="15" y="15" width="7" height="5" rx="1"/><path d="M9 6h4v12h2M5 9v6h10"/>'),
90
+ textBox: S('<rect x="3" y="5" width="18" height="14" rx="1"/><path d="M7 9h10M12 9v9M9 18h6"/>'),
91
+ wordArt: S('<path d="M4 18l4-11 4 11M5 14h6M14 18V7h6M14 12h5"/>'),
92
+ equation: S('<path d="M8 4c-2 0-3 1-3 3 0 3 6 4 6 8a3 3 0 0 1-6 0M6 11h8M17 7l4 8M21 7l-4 8"/>'),
93
+ insertText: S('<path d="M4 6h10M9 3v6M4 18h16M14 14h6M17 11v6"/>'),
94
+ object: S('<path d="M12 3l9 5v8l-9 5-9-5V8zM3 8l9 5 9-5M12 13v8"/>'),
95
+ date: S('<rect x="3" y="5" width="18" height="16" rx="2"/><path d="M3 10h18M8 3v4M16 3v4M8 14h3M8 17h6"/>'),
96
+ attachment: S('<path d="M20 11l-8 8a5 5 0 0 1-7-7l9-9a3.5 3.5 0 0 1 5 5l-9 9a2 2 0 0 1-3-3l8-8"/>'),
97
+ fileLink: S('<path d="M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8M14 3l6 6h-6zM13 15a3 3 0 0 1 5-2M18 13a3 3 0 0 1 1 4l-2 2a3 3 0 0 1-4 0"/>'),
98
+ crossReference: S('<path d="M6 4h8l4 4v12H6zM14 4v4h4M9 13h6M9 17h4M4 8v12a2 2 0 0 0 2 2"/>'),
99
+ // 页面布局
100
+ theme: S('<circle cx="12" cy="12" r="9"/><path d="M12 3a9 9 0 0 0 0 18M8 8h.01M12 6h.01M16 9h.01"/>'),
101
+ colors: S('<circle cx="7" cy="8" r="3"/><circle cx="16" cy="7" r="3"/><circle cx="11" cy="16" r="3"/><path d="M7 11v2a2 2 0 0 0 2 2M16 10v3a3 3 0 0 1-3 3"/>'),
102
+ effects: S('<path d="M5 3l1.5 4L10 9l-3.5 2L5 15l-1.5-4L0 9l3.5-2zM17 12l1 3 3 1-3 1-1 3-1-3-3-1 3-1z"/>'),
103
+ fontCollection: S('<path d="M3 18l4-10 4 10M4 14h6M14 18l3-8 3 8M15 15h4"/>'),
104
+ orientation: S('<rect x="6" y="3" width="12" height="18" rx="1"/><path d="M6 8h12M9 12h6M9 15h6"/>'),
105
+ paperSize: S('<rect x="4" y="3" width="16" height="18" rx="1"/><path d="M4 17h16M16 17V3"/>'),
106
+ textDirection: S('<path d="M12 3v18M9 6l3-3 3 3M9 18l3 3 3-3M6 9h4M6 12h3"/>'),
107
+ separator: S('<path d="M3 12h5M16 12h5M9 6v12M12 6v12M15 6v12"/>'),
108
+ lineNumbers: S('<path d="M8 4h13M8 10h13M8 16h13M3 4h.01M3 10h.01M3 16h.01"/>'),
109
+ background: S('<rect x="3" y="4" width="18" height="16" rx="2"/><path d="M3 14l4-4 4 4 3-3 4 4 3-3"/>'),
110
+ pageBorder: S('<rect x="4" y="3" width="16" height="18" rx="1"/><rect x="7" y="6" width="10" height="12" rx="0.5"/>'),
111
+ paperSettings: S('<rect x="4" y="3" width="16" height="18" rx="1"/><path d="M4 9h16M4 15h16M10 3v18M15 3v18"/>'),
112
+ wrap: S('<path d="M4 6h16M4 18h16M8 10h8a3 3 0 0 1 0 6H9M8 13l-2 3 2 3"/>'),
113
+ alignObjects: S('<path d="M4 3v18M9 7h11M9 14h8M6 4h.01M6 20h.01"/>'),
114
+ groupObjects: S('<rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/><path d="M10 10l4 4M14 6h4v4M10 18H6v-4"/>'),
115
+ rotate: S('<path d="M20 12a8 8 0 1 1-2.3-5.6M20 4v5h-5"/>'),
116
+ bringForward: S('<rect x="8" y="8" width="12" height="12" rx="1"/><path d="M4 16V4h12M12 14h4M14 12v4"/>'),
117
+ sendBackward: S('<rect x="4" y="4" width="12" height="12" rx="1"/><path d="M20 8v12H8M10 10h4M12 8v4"/>'),
118
+ // 引用
119
+ updateToc: S('<path d="M4 6h10M4 12h7M4 18h10M18 8a4 4 0 1 1-1 5M17 5v3h3"/>'),
120
+ tocLevel: S('<path d="M4 6h16M6 12h14M8 18h12M4 12h.01M4 18h.01"/>'),
121
+ prevFootnote: S('<path d="M15 18l-6-6 6-6M8 12h8M4 4h.01M4 20h.01"/>'),
122
+ nextFootnote: S('<path d="M9 6l6 6-6 6M8 12h8M20 4h.01M20 20h.01"/>'),
123
+ insertEndnote: S('<path d="M12 4v12M8 12l4 4 4-4M5 20h14"/>'),
124
+ prevEndnote: S('<path d="M15 18l-6-6 6-6M8 12h8M4 20h16"/>'),
125
+ nextEndnote: S('<path d="M9 6l6 6-6 6M8 12h8M4 20h16"/>'),
126
+ footnoteSep: S('<path d="M4 6h16M4 18h16M4 12h4M16 12h4M9 12h6"/>'),
127
+ caption: S('<path d="M4 5h16v11H4zM8 9h8M8 13h5M4 20h10"/>'),
128
+ markCitation: S('<path d="M8 6c-2 0-3 1-3 3s1 3 3 3c-1 2-2 3-4 4M16 6c-2 0-3 1-3 3s1 3 3 3c-1 2-2 3-4 4"/>'),
129
+ insertIndex: S('<path d="M4 5h16M4 11h16M4 17h10M17 15v6M14 18h6"/>'),
130
+ updateIndex: S('<path d="M4 5h16M4 11h16M4 17h10M18 14a3 3 0 1 1-1 4M17 12v2h2"/>'),
131
+ mail: S('<rect x="3" y="5" width="18" height="14" rx="2"/><path d="M3 7l9 6 9-6"/>'),
132
+ download: S('<path d="M12 3v12M8 11l4 4 4-4M4 17v3a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-3"/>'),
133
+ rename: S('<path d="M4 20h4L19 9a2 2 0 0 0-3-3L5 17v3z"/><path d="M14.5 6.5l3 3"/>'),
134
+ };
135
+
136
+ /** 取图标 SVG 串(未登记返回空串) */
137
+ export const icon = (name) => ICONS[name] || '';