release: 发布 v0.6.1 DOCX 视觉一致性修复
新增通用 CSS 到 OOXML 翻译修复,统一字体、字距、精确行距、段落、列表、表格、引用、代码块与行内代码连续性,不引入按主题 ID 分支。 新增 MdTP Mono 并统一 Serif、Sans、Mono 三字体包的 Chromium 与 DOCX 使用链;字体声明、嵌入部件和 Word/WPS 实际采用均进入硬门禁。 重建封面整页及正文语义块视觉差分,14 套主题、纵横两个方向、五组页边距共 140 个真实场景全部通过,阻断失败和诊断失败均为零。 源码服务、Docker Web API 与实际安装 Desktop 的 red-briefing 导出均包含 5 个字体部件;Word/WPS 原生渲染和逐页复核通过。修复 Docker 构建上下文与运行层复用软链接,并完善 v0.6.1 版本、发行说明和发布归集。 验证:npm test(116 个文件、616 项测试)、npm run typecheck、npm run build、git diff --check 全部通过。Desktop 安装器与 ZIP、Docker v0.6.1 镜像已生成;Windows 产物仍为未签名内部发行。
This commit is contained in:
@@ -175,6 +175,12 @@ describe("DOCX 主题令牌归一化", () => {
|
||||
});
|
||||
expect(findSlot(tokens, "strong").style)
|
||||
.not.toHaveProperty("firstLineIndentPt");
|
||||
expect(findSlot(tokens, "inline-code").style.paddingPt).toEqual({
|
||||
top: 3,
|
||||
right: 6,
|
||||
bottom: 3,
|
||||
left: 6
|
||||
});
|
||||
expect(findSlot(tokens, "table").style.widthPercent).toBe(100);
|
||||
expect(tokens.slots).toHaveLength(DOCX_STYLE_SLOT_NAMES.length);
|
||||
});
|
||||
@@ -204,6 +210,43 @@ describe("DOCX 主题令牌归一化", () => {
|
||||
expect(findSlot(tokens, "table").style.widthPercent).toBe(100);
|
||||
});
|
||||
|
||||
it("引用块组合容器盒模型与内部段落文字样式", () => {
|
||||
const tokens = resolveDocxThemeTokens({
|
||||
snapshot: createSnapshot({
|
||||
"block-quote": {
|
||||
fontSize: "24px",
|
||||
paddingLeft: "20px",
|
||||
borderLeft: "4px solid rgb(122, 122, 122)"
|
||||
},
|
||||
"block-quote-text": {
|
||||
fontFamily: '"Merriweather", serif',
|
||||
fontSize: "16px",
|
||||
fontStyle: "italic",
|
||||
lineHeight: "24px",
|
||||
paddingLeft: "0px",
|
||||
borderLeft: "0px none rgb(17, 34, 51)"
|
||||
}
|
||||
}),
|
||||
config: {
|
||||
mode: "auto",
|
||||
basePreset: "general",
|
||||
overrides: {},
|
||||
legacyPreset: false
|
||||
}
|
||||
});
|
||||
|
||||
expect(findSlot(tokens, "block-quote").style).toMatchObject({
|
||||
fontCandidates: ["Merriweather", "serif"],
|
||||
fontSizePt: 12,
|
||||
italic: true,
|
||||
lineSpacing: 1.5,
|
||||
paddingPt: { left: 15 },
|
||||
borders: {
|
||||
left: { widthPt: 3, color: "#7a7a7a", style: "single" }
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it("按父级内容区归一化右置百分比结构容器", () => {
|
||||
const tokens = resolveDocxThemeTokens({
|
||||
snapshot: createSnapshot({
|
||||
@@ -356,7 +399,7 @@ describe("DOCX 主题令牌归一化", () => {
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("以清单覆盖自动值并在未命中时显式降级", () => {
|
||||
it("旧版清单仅补齐自动值,并在未命中时显式降级", () => {
|
||||
const tokens = resolveDocxThemeTokens({
|
||||
snapshot: createSnapshot({ caption: null }),
|
||||
config: {
|
||||
@@ -376,15 +419,15 @@ describe("DOCX 主题令牌归一化", () => {
|
||||
}
|
||||
});
|
||||
expect(findSlot(tokens, "paragraph")).toMatchObject({
|
||||
source: "manifest-override",
|
||||
source: "computed-css",
|
||||
confidence: "exact",
|
||||
style: {
|
||||
fontSizePt: 11,
|
||||
firstLineIndentPt: 22
|
||||
fontSizePt: 12,
|
||||
firstLineIndentPt: 24
|
||||
}
|
||||
});
|
||||
expect(findSlot(tokens, "hyperlink").style).toMatchObject({
|
||||
color: "#aa0000",
|
||||
color: "#112233",
|
||||
underline: false
|
||||
});
|
||||
expect(findSlot(tokens, "caption")).toMatchObject({
|
||||
@@ -401,6 +444,24 @@ describe("DOCX 主题令牌归一化", () => {
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("非旧版自动清单仍可显式覆盖 CSS 计算值", () => {
|
||||
const tokens = resolveDocxThemeTokens({
|
||||
snapshot: createSnapshot(),
|
||||
config: {
|
||||
mode: "auto-with-overrides",
|
||||
basePreset: "formal",
|
||||
legacyPreset: false,
|
||||
overrides: {
|
||||
headings: { color: "#aa0000" }
|
||||
}
|
||||
}
|
||||
});
|
||||
expect(findSlot(tokens, "heading-1")).toMatchObject({
|
||||
source: "manifest-override",
|
||||
style: { color: "#aa0000" }
|
||||
});
|
||||
});
|
||||
|
||||
it("显式模式不读取 CSS,仅使用覆盖与预设降级", () => {
|
||||
const tokens = resolveDocxThemeTokens({
|
||||
snapshot: createSnapshot(),
|
||||
|
||||
Reference in New Issue
Block a user