@a200888213/gbdocx 0.6.1 → 0.6.3
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/LICENSE +21 -21
- package/README.md +215 -215
- package/index.html +31 -30
- package/package.json +49 -48
- package/serve.mjs +27 -23
- package/src/app/file-io.js +122 -122
- package/src/app/main.js +9 -9
- package/src/app/word/catalog.js +52 -52
- package/src/app/word/comments.js +112 -112
- package/src/app/word/doc.js +113 -113
- package/src/app/word/edit.js +72 -72
- package/src/app/word/file.js +191 -191
- package/src/app/word/hf.js +76 -76
- package/src/app/word/layout.js +155 -155
- package/src/app/word/menus.js +201 -201
- package/src/app/word/notes.js +110 -110
- package/src/app/word/shared.js +22 -22
- package/src/app/word/view.js +159 -159
- package/src/app/word-app.js +487 -487
- package/src/app/word-sheets.js +101 -101
- package/src/kernel/docx/catalog.js +41 -41
- package/src/kernel/docx/codec/blocks.js +123 -123
- package/src/kernel/docx/codec/carry.js +129 -129
- package/src/kernel/docx/codec/comments.js +25 -25
- package/src/kernel/docx/codec/docx.js +198 -198
- package/src/kernel/docx/codec/docxStyles.js +177 -177
- package/src/kernel/docx/codec/fonts.js +195 -195
- package/src/kernel/docx/codec/helpers.js +161 -161
- package/src/kernel/docx/codec/hfHtml.js +152 -152
- package/src/kernel/docx/codec/html.js +739 -739
- package/src/kernel/docx/codec/losses.js +420 -420
- package/src/kernel/docx/codec/markdown.js +170 -170
- package/src/kernel/docx/codec/parts.js +249 -249
- package/src/kernel/docx/codec/read.js +603 -603
- package/src/kernel/docx/codec/render.js +1156 -1156
- package/src/kernel/docx/codec/roundtrip.js +236 -236
- package/src/kernel/docx/codec/write.js +833 -833
- package/src/kernel/docx/comments.js +14 -14
- package/src/kernel/docx/menus.js +348 -348
- package/src/kernel/docx/pageGeometry.js +123 -123
- package/src/kernel/docx/pagination.js +481 -481
- package/src/kernel/docx/watermark.js +45 -45
- package/src/kernel/docx/wordShortcuts.js +37 -37
- package/src/kernel/editor/constants.js +8 -8
- package/src/kernel/editor/engine/blocks.js +594 -594
- package/src/kernel/editor/engine/blocksEnter.js +109 -109
- package/src/kernel/editor/engine/blocksInsert.js +254 -254
- package/src/kernel/editor/engine/blocksStructure.js +226 -226
- package/src/kernel/editor/engine/commands.js +181 -181
- package/src/kernel/editor/engine/dom.js +646 -646
- package/src/kernel/editor/engine/editor.js +213 -213
- package/src/kernel/editor/engine/history.js +149 -149
- package/src/kernel/editor/engine/inline.js +656 -656
- package/src/kernel/editor/engine/input.js +554 -554
- package/src/kernel/editor/engine/interaction.js +137 -137
- package/src/kernel/editor/engine/pointer.js +39 -39
- package/src/kernel/editor/engine/revision.js +138 -138
- package/src/kernel/editor/engine/schema.js +417 -417
- package/src/kernel/editor/engine/search.js +113 -113
- package/src/kernel/editor/engine/selection.js +119 -119
- package/src/kernel/editor/engine/state.js +118 -118
- package/src/kernel/editor/engine/tableClip.js +154 -154
- package/src/kernel/editor/engine/tableGrid.js +55 -55
- package/src/kernel/editor/engine/tableInteraction.js +388 -388
- package/src/kernel/editor/engine/tableMenu.js +250 -250
- package/src/kernel/editor/engine/tableOps.js +174 -174
- package/src/kernel/editor/engine/tables.js +732 -732
- package/src/kernel/editor/overlayGeometry.js +20 -20
- package/src/kernel/editor/pasteClean.js +293 -293
- package/src/kernel/editor/utils.js +48 -48
- package/src/kernel/keyboard.js +114 -114
- package/src/kernel/notify.js +54 -54
- package/src/kernel/textStyles.js +84 -84
- package/src/kernel/util/clipboard.js +89 -89
- package/src/kernel/util/imageFile.js +91 -91
- package/src/kernel/util/safeValue.js +25 -25
- package/src/kernel/util/shortcutKey.js +33 -33
- package/src/surface/editor-surface.js +603 -600
- package/src/ui/color-panel.js +69 -69
- package/src/ui/context-menu.js +135 -133
- package/src/ui/dialogs.js +249 -249
- package/src/ui/find-bar.js +151 -151
- package/src/ui/icons.js +245 -137
- package/src/ui/menubar.js +28 -28
- package/src/ui/panels.js +115 -115
- package/src/ui/popup.js +79 -79
- package/src/ui/prompt.js +89 -89
- package/src/ui/ribbon.js +485 -485
- package/src/ui/special-chars.js +39 -39
- package/src/ui/statusbar.js +81 -81
- package/src/ui/toolbar.js +32 -32
- package/styles/app.css +970 -970
- package/styles/editor-content.css +440 -440
- package/styles/tokens.css +154 -154
- package/styles/word-panel.css +410 -410
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
// [文件] web·office·docx·批注 —— 批注键生成、锚点定位与时间显示(正文锚点是 span.doc-comment[data-cmt],锚定/摘除走内核命令)
|
|
2
|
-
import { COMMENT_ATTR, DOC_CLASS } from '../editor/engine/schema.js';
|
|
3
|
-
import { genId } from 'guabiutils';
|
|
4
|
-
|
|
5
|
-
/** 批注键(进程内唯一即可;写进 docx 时会映射成数字 id,读回时键就是数字字符串) */
|
|
6
|
-
export const newCommentKey = () => genId('c');
|
|
7
|
-
|
|
8
|
-
/** 滚动定位到批注锚点 */
|
|
9
|
-
export const scrollToComment = (root, key) => {
|
|
10
|
-
root?.querySelector(`.${DOC_CLASS.COMMENT}[${COMMENT_ATTR}="${key}"]`)?.scrollIntoView({ block: 'center', behavior: 'smooth' });
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
/** 批注时间显示(只到分钟,ISO 串直接切,不引日期库):侧栏列表与锚点预览气泡共用一份口径 */
|
|
14
|
-
export const commentTime = (iso) => (iso ? String(iso).slice(0, 16).replace('T', ' ') : '');
|
|
1
|
+
// [文件] web·office·docx·批注 —— 批注键生成、锚点定位与时间显示(正文锚点是 span.doc-comment[data-cmt],锚定/摘除走内核命令)
|
|
2
|
+
import { COMMENT_ATTR, DOC_CLASS } from '../editor/engine/schema.js';
|
|
3
|
+
import { genId } from 'guabiutils';
|
|
4
|
+
|
|
5
|
+
/** 批注键(进程内唯一即可;写进 docx 时会映射成数字 id,读回时键就是数字字符串) */
|
|
6
|
+
export const newCommentKey = () => genId('c');
|
|
7
|
+
|
|
8
|
+
/** 滚动定位到批注锚点 */
|
|
9
|
+
export const scrollToComment = (root, key) => {
|
|
10
|
+
root?.querySelector(`.${DOC_CLASS.COMMENT}[${COMMENT_ATTR}="${key}"]`)?.scrollIntoView({ block: 'center', behavior: 'smooth' });
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/** 批注时间显示(只到分钟,ISO 串直接切,不引日期库):侧栏列表与锚点预览气泡共用一份口径 */
|
|
14
|
+
export const commentTime = (iso) => (iso ? String(iso).slice(0, 16).replace('T', ' ') : '');
|