Skip to content

Commit d9987e9

Browse files
authored
Merge pull request #2054 from VisActor/release/1.0.42
[Auto release] release 1.0.42
2 parents 0e8a747 + 2b8e7c9 commit d9987e9

37 files changed

Lines changed: 563 additions & 78 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
- [x] SmartInvertAttrs.interactInvertType 已包含 'background'
2+
- [x] 相交且 'background' 时设置 label.stroke=false
3+
- [x] 相交且 'background' 时设置 label.background=baseMark.fill(有填充时)
4+
- [x] 其他类型(none/stroked/inside)行为无回归
5+
- [x] 注释更新为“四种处理方式”并包含 background 描述
6+
- [x] 示例验证通过(IText 与 IRichText 场景)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# 标签相交背景模式 Spec
2+
3+
## Why
4+
当前标签与 mark 相交时仅支持 none/stroked/inside 三种处理方式,无法满足关闭描边并以底层 mark 的填充色作为文字背景的视觉需求,导致相交场景下对比度与观感不可控。
5+
6+
## What Changes
7+
- 在 SmartInvertAttrs.interactInvertType 中新增 'background' 选项
8+
- 在相交场景下(label 与 mark 相交且不完全在内部),当 interactInvertType 为 'background':
9+
- 将标签描边 stroke 设置为 false(禁用描边)
10+
- 将标签背景 background 设置为关联 mark 的填充色
11+
- 更新 SmartInvert 相关注释文档,将“三种处理方式”修改为“四种”,并补充 background 描述
12+
- 默认行为不变(未配置时保持现状),无破坏性变更
13+
14+
## Impact
15+
- Affected specs: 标签智能反色/相交处理能力
16+
- Affected code:
17+
- packages/vrender-components/src/label/type.ts(类型与注释)
18+
- packages/vrender-components/src/label/base.ts(_smartInvert 相交分支逻辑)
19+
20+
## ADDED Requirements
21+
### Requirement: 新增 interactInvertType 'background'
22+
系统应在标签与 mark 相交且配置 interactInvertType 为 'background' 时:
23+
- 将标签的 stroke 设为 false,关闭描边;
24+
- 将标签的 background 颜色设置为关联 mark 的填充色(优先取 mark.attribute.fill;若缺省则不改动 background)。
25+
- 保持标签 fill 不做变更。
26+
27+
#### Scenario: Success case
28+
- WHEN 标签与 mark 相交,且 smartInvert.interactInvertType === 'background'
29+
- THEN label.stroke === false,且 label.background === baseMark.fill(存在时)
30+
31+
## MODIFIED Requirements
32+
### Requirement: 更新交互反色类型文档
33+
将注释由“支持三种处理方式:none/stroked/inside”更新为“四种处理方式:none/stroked/inside/background”,其中:
34+
- background:关闭描边,并以 mark 的填充色作为文本背景参与渲染。
35+
36+
## REMOVED Requirements
37+
38+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Tasks
2+
- [x] 更新类型定义与注释:为 SmartInvertAttrs.interactInvertType 添加 'background',并改注释为“四种处理方式”
3+
- [x] 修改 _smartInvert 相交分支:实现 'background' 行为(stroke=false;background=baseMark.fill;保持 fill 不变;跳过描边缺省早退)
4+
- [x] 添加验证用例:构造 label 与 mark 相交示例,确认背景色与填充色一致且描边关闭(覆盖 IText 与 IRichText)
5+
- [x] 自检与清理:校验边界(mark 无 fill、stroke 初始为数组/布尔的情况)、类型约束与代码风格
6+
7+
# Task Dependencies
8+
- [修改 _smartInvert 相交分支] 依赖于 [更新类型定义与注释]
9+
- [添加验证用例] 依赖于 [修改 _smartInvert 相交分支]

common/config/rush/pnpm-lock.yaml

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[{"definitionName":"lockStepVersion","policyName":"vrenderMain","version":"1.0.41","nextBump":"patch"}]
1+
[{"definitionName":"lockStepVersion","policyName":"vrenderMain","version":"1.0.42","nextBump":"patch"}]

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@visactor/vchart": "1.3.0",
1414
"@visactor/vutils": "~1.0.12",
1515
"@visactor/vgrammar": "~0.5.7",
16-
"@visactor/vrender": "workspace:1.0.41",
16+
"@visactor/vrender": "workspace:1.0.42",
1717
"markdown-it": "^13.0.0",
1818
"highlight.js": "^11.8.0",
1919
"axios": "^1.4.0",

packages/react-vrender-utils/CHANGELOG.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
{
22
"name": "@visactor/react-vrender-utils",
33
"entries": [
4+
{
5+
"version": "1.0.42",
6+
"tag": "@visactor/react-vrender-utils_v1.0.42",
7+
"date": "Mon, 23 Mar 2026 08:08:45 GMT",
8+
"comments": {}
9+
},
410
{
511
"version": "1.0.41",
612
"tag": "@visactor/react-vrender-utils_v1.0.41",

packages/react-vrender-utils/CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Change Log - @visactor/react-vrender-utils
22

3-
This log was last generated on Tue, 03 Mar 2026 11:54:26 GMT and should not be manually modified.
3+
This log was last generated on Mon, 23 Mar 2026 08:08:45 GMT and should not be manually modified.
4+
5+
## 1.0.42
6+
Mon, 23 Mar 2026 08:08:45 GMT
7+
8+
_Version update only_
49

510
## 1.0.41
611
Tue, 03 Mar 2026 11:54:26 GMT

packages/react-vrender-utils/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@visactor/react-vrender-utils",
3-
"version": "1.0.41",
3+
"version": "1.0.42",
44
"description": "",
55
"sideEffects": false,
66
"main": "cjs/index.js",
@@ -24,8 +24,8 @@
2424
"react-dom": "^18.2.0"
2525
},
2626
"dependencies": {
27-
"@visactor/vrender": "workspace:1.0.41",
28-
"@visactor/react-vrender": "workspace:1.0.41",
27+
"@visactor/vrender": "workspace:1.0.42",
28+
"@visactor/react-vrender": "workspace:1.0.42",
2929
"@visactor/vutils": "~1.0.12",
3030
"react-reconciler": "^0.29.0",
3131
"tslib": "^2.3.1"

packages/react-vrender/CHANGELOG.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
{
22
"name": "@visactor/react-vrender",
33
"entries": [
4+
{
5+
"version": "1.0.42",
6+
"tag": "@visactor/react-vrender_v1.0.42",
7+
"date": "Mon, 23 Mar 2026 08:08:45 GMT",
8+
"comments": {}
9+
},
410
{
511
"version": "1.0.41",
612
"tag": "@visactor/react-vrender_v1.0.41",

0 commit comments

Comments
 (0)