@coding01/docsjs 0.1.3 → 0.1.5

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
@@ -3,6 +3,10 @@
3
3
  Render-first Word fidelity component for the web.
4
4
  Import Word/WPS/Google Docs content from paste or `.docx` while preserving structure and layout as much as possible.
5
5
 
6
+ [![npm version](https://img.shields.io/npm/v/@coding01/docsjs)](https://www.npmjs.com/package/@coding01/docsjs)
7
+ [![npm downloads](https://img.shields.io/npm/dm/@coding01/docsjs)](https://www.npmjs.com/package/@coding01/docsjs)
8
+ [![CI](https://github.com/fanly/docsjs/actions/workflows/ci.yml/badge.svg)](https://github.com/fanly/docsjs/actions/workflows/ci.yml)
9
+
6
10
  [中文文档](./README.zh-CN.md)
7
11
 
8
12
  ## What You Get
@@ -101,17 +105,24 @@ el.addEventListener("docsjs-change", (e) => {
101
105
  - ✅ Basic run styles (bold/italic/underline/strike/color/highlight/super/sub)
102
106
  - ✅ List reconstruction (`numId` + `ilvl` + `lvlText`)
103
107
  - ✅ Basic table structure (`table/tr/td`)
108
+ - ✅ Table merge + nested table read-only fidelity (`vMerge/gridSpan`)
109
+ - ✅ Table width mapping (`tblGrid/gridCol`, `tcW`)
104
110
  - ✅ Embedded image relationship mapping (`rId -> media`)
105
111
  - ✅ Page geometry mapping (page height, margins, content width)
106
112
  - ✅ Runtime render fixes (`mso-*` compatibility, pagination spacer, empty paragraph normalization)
107
113
  - ✅ Events and public methods
108
114
  - ✅ React and Vue runnable demos
109
115
  - ✅ npm publish workflow with OIDC trusted publishing
110
- - Floating anchors (`wp:anchor`) full layout fidelity
111
- - Merged cells / nested tables full fidelity
112
- - Footnotes / endnotes / comments / track changes
113
- - OMML / charts / SmartArt
114
- - Automated fidelity benchmark scorecard
116
+ - Footnotes / endnotes / comments / track changes read-only semantics
117
+ - Comment range markers (`commentRangeStart/commentRangeEnd`)
118
+ - Revision metadata markers (`id/author/date`)
119
+ - Floating anchors (`wp:anchor`) v1 fidelity (position ref / overlap / layer / wrap distance markers)
120
+ - Word table v1 fidelity (border model / cell spacing / table-layout mapping)
121
+ - ✅ OMML / charts / SmartArt semantic fallback rendering (v1)
122
+ - ✅ Automated fidelity benchmark v1 (golden corpus + CI trend artifacts)
123
+ - ⏳ Floating anchor text-wrap collision fidelity (pixel-level)
124
+ - ⏳ Word table auto layout parity with desktop Word
125
+ - ⏳ OMML high-fidelity renderer (MathML/KaTeX pipeline)
115
126
 
116
127
  ## What's New in v0.1.3
117
128
 
@@ -121,15 +132,21 @@ el.addEventListener("docsjs-change", (e) => {
121
132
  - footnotes and endnotes (read-only rendering)
122
133
  - comments (read-only rendering)
123
134
  - revisions insert/delete markers (read-only rendering)
135
+ - comment range markers and revision metadata attributes
124
136
  - page break semantic markers (`w:br type=page`, `lastRenderedPageBreak`)
137
+ - table width mapping (`tblGrid/gridCol`, `tcW`)
138
+ - table border model / cell spacing / table-layout mapping
139
+ - OMML formula fallback rendering and chart/SmartArt semantic fallback
125
140
  - Added floating image MVP:
126
141
  - anchor position mapping (`wp:anchor`)
127
142
  - wrap mode markers (`square`, `tight`, `topAndBottom`, `none`)
143
+ - anchor layout metadata (`relativeFrom`, `behindDoc`, `allowOverlap`, `layoutInCell`, `relativeHeight`, `dist*`)
128
144
  - Added fidelity tooling:
129
145
  - semantic stats collector
130
146
  - fidelity score calculator
131
147
  - baseline regression framework (config-driven)
132
148
  - visual regression workflow scaffold (Playwright + diff artifacts)
149
+ - golden corpus benchmark + trend report workflow (`fidelity-benchmark.yml`)
133
150
  - Added engineering quality gates:
134
151
  - ESLint + strict verify pipeline (`lint`, `typecheck`, `test`, `build`, `sizecheck`)
135
152
  - CI workflow for mandatory quality checks
@@ -146,6 +163,7 @@ npm install
146
163
  npm run typecheck
147
164
  npm run test
148
165
  npm run build
166
+ npm run benchmark:fidelity
149
167
  ```
150
168
 
151
169
  ## Demos
@@ -184,6 +202,15 @@ Workflow: `.github/workflows/publish.yml`
184
202
  - Trigger: push tag `v*.*.*`
185
203
  - Steps: `npm ci` -> `npm run typecheck` -> `npm run build` -> `npm publish --provenance`
186
204
 
205
+ ### GitHub Packages (repo sidebar "Packages")
206
+
207
+ Workflow: `.github/workflows/publish-github-packages.yml`
208
+
209
+ - Trigger: push tag `v*.*.*` or manual run
210
+ - Target registry: `https://npm.pkg.github.com`
211
+ - Package name in GitHub Packages: `@fanly/docsjs`
212
+ - Note: GitHub sidebar "Packages" only shows packages published to GitHub Packages, not npmjs
213
+
187
214
  ## Roadmap
188
215
 
189
216
  See [ROADMAP.md](./ROADMAP.md) for prioritized execution plan (P0/P1/P2) and acceptance criteria.
package/README.zh-CN.md CHANGED
@@ -3,6 +3,10 @@
3
3
  面向 Web 的 Render-first Word 高保真导入组件。
4
4
  目标是在粘贴或上传 `.docx` 时,尽可能无损保留 Word/WPS/Google Docs 的结构和版式。
5
5
 
6
+ [![npm version](https://img.shields.io/npm/v/@coding01/docsjs)](https://www.npmjs.com/package/@coding01/docsjs)
7
+ [![npm downloads](https://img.shields.io/npm/dm/@coding01/docsjs)](https://www.npmjs.com/package/@coding01/docsjs)
8
+ [![CI](https://github.com/fanly/docsjs/actions/workflows/ci.yml/badge.svg)](https://github.com/fanly/docsjs/actions/workflows/ci.yml)
9
+
6
10
  [English README](./README.md)
7
11
 
8
12
  ## 核心能力
@@ -96,17 +100,24 @@ document.body.appendChild(el);
96
100
  - ✅ Run 基础样式(粗斜体、下划线、删除线、颜色、高亮、上下标)
97
101
  - ✅ 列表基础恢复(`numId` + `ilvl` + `lvlText`)
98
102
  - ✅ 表格基础结构(`table/tr/td`)
103
+ - ✅ 表格合并与嵌套表格只读保真(`vMerge/gridSpan`)
104
+ - ✅ 表格宽度映射(`tblGrid/gridCol`、`tcW`)
99
105
  - ✅ 图片关系映射(`rId -> media`)
100
106
  - ✅ 页面几何映射(页高、页边距、版心宽)
101
107
  - ✅ 运行时渲染修正(`mso-*` 兼容、分页 spacer、空段落修正)
102
108
  - ✅ 事件与公共 API
103
109
  - ✅ React/Vue 可运行示例
104
110
  - ✅ npm OIDC 自动发布流水线
105
- - 浮动锚点对象(`wp:anchor`)完整还原
106
- - 合并单元格/嵌套表格完整还原
107
- - 批注/脚注/修订等高级语义
108
- - OMML/图表/SmartArt
109
- - 自动化保真评分体系
111
+ - 批注/脚注/修订只读语义支持
112
+ - 批注区间标记(`commentRangeStart/commentRangeEnd`)
113
+ - 修订元数据标记(`id/author/date`)
114
+ - 浮动锚点对象 v1 保真(定位参照/层级/避让距离/重叠策略标记)
115
+ - Word 表格 v1 保真(边框模型/单元格间距/布局类型映射)
116
+ - ✅ OMML/图表/SmartArt 语义降级渲染(v1)
117
+ - ✅ 自动化保真评分 v1(golden corpus + CI 趋势产物)
118
+ - ⏳ 浮动对象文字绕排碰撞的像素级还原
119
+ - ⏳ Word 表格自动布局与桌面 Word 深度一致
120
+ - ⏳ OMML 高保真渲染(MathML/KaTeX 渲染链)
110
121
 
111
122
  ## v0.1.3 更新内容
112
123
 
@@ -116,15 +127,21 @@ document.body.appendChild(el);
116
127
  - 脚注与尾注(只读渲染)
117
128
  - 批注(只读渲染)
118
129
  - 修订新增/删除标记(只读渲染)
130
+ - 批注区间标记与修订元数据属性
119
131
  - 分页语义标记(`w:br type=page`、`lastRenderedPageBreak`)
132
+ - 表格宽度映射(`tblGrid/gridCol`、`tcW`)
133
+ - 表格边框模型/单元格间距/布局类型映射
134
+ - OMML 公式降级渲染、图表/SmartArt 语义降级渲染
120
135
  - 浮动图片 MVP:
121
136
  - 锚点定位(`wp:anchor`)
122
137
  - 绕排模式标记(`square`、`tight`、`topAndBottom`、`none`)
138
+ - 锚点布局元数据(`relativeFrom`、`behindDoc`、`allowOverlap`、`layoutInCell`、`relativeHeight`、`dist*`)
123
139
  - 保真工具链增强:
124
140
  - 语义统计器
125
141
  - 保真评分器
126
142
  - 配置驱动的基准回归测试框架
127
143
  - 视觉回归工作流骨架(Playwright + diff artifacts)
144
+ - golden corpus 基准评分 + 趋势报告工作流(`fidelity-benchmark.yml`)
128
145
  - 工程质量门增强:
129
146
  - ESLint + 严格 `verify`(`lint/typecheck/test/build/sizecheck`)
130
147
  - CI 必过质量门
@@ -141,6 +158,7 @@ npm install
141
158
  npm run typecheck
142
159
  npm run test
143
160
  npm run build
161
+ npm run benchmark:fidelity
144
162
  ```
145
163
 
146
164
  ## 演示
@@ -165,6 +183,13 @@ npm run dev
165
183
 
166
184
  执行优先级与验收标准见 [ROADMAP.md](./ROADMAP.md)。
167
185
 
186
+ ## 发布与关联
187
+
188
+ - npmjs 发布工作流:`.github/workflows/publish.yml`
189
+ - GitHub Packages 发布工作流:`.github/workflows/publish-github-packages.yml`
190
+ - GitHub 侧栏 `Packages` 只显示发布到 GitHub Packages 的包,不显示 npmjs 包
191
+ - 当前 GitHub Packages 包名:`@fanly/docsjs`
192
+
168
193
  ## 安全说明
169
194
 
170
195
  - 默认策略是保真优先,不主动清洗 Word 内联样式。