Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion common/config/rush/version-policies.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"definitionName":"lockStepVersion","policyName":"vrenderMain","version":"1.1.12","nextBump":"patch"}]
[{"definitionName":"lockStepVersion","policyName":"vrenderMain","version":"1.1.13","nextBump":"patch"}]
11 changes: 11 additions & 0 deletions docs/assets/changelog/en/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# v1.1.12

2026-10-13


**🔖 other**

- **@visactor/vrender-core**: Fix font variant and style measurements for wrapped, clipped and vertical text.

[more detail about v1.1.12](https://github.com/VisActor/VRender/releases/tag/v1.1.12)

# v1.1.3

2026-07-02
Expand Down
11 changes: 11 additions & 0 deletions docs/assets/changelog/zh/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# v1.1.12

2026-10-13


**🔖 其他**

- **@visactor/vrender-core**: Fix font variant and style measurements for wrapped, clipped and vertical text.

[更多详情请查看 v1.1.12](https://github.com/VisActor/VRender/releases/tag/v1.1.12)

# v1.1.3

2026-07-02
Expand Down
2 changes: 2 additions & 0 deletions docs/assets/guide/en/asd/Basic_Tutorial/Create_Instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ interface IStageParams {
disableDirtyBounds: boolean;
// Whether to support interactiveLayer, default is true
interactiveLayer: boolean;
// Interactive layer mode; omitted uses the environment default. Virtual layers share the main canvas.
interactiveLayerMode?: 'static' | 'virtual';
// Whether to support HTML attributes
enableHtmlAttribute: string | boolean | HTMLElement;
// Whether to support react-dom (pass in ReactDOM)
Expand Down
14 changes: 14 additions & 0 deletions docs/assets/guide/en/asd/Basic_Tutorial/Event.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,17 @@ window['stage'] = stage;
```

【Note】: It is important to note that the event objects thrown by VRender are reusable, so be careful not to save event objects for later use, as the event object will change. This is particularly important to note in asynchronous processes.

## Host-owned input and Stage composition

Set `event: { useNativeEvents: false }` when the host owns DOM listeners. Route only accepted inputs through `stage.eventSystem.handleNativeEvent(nativeEvent, { canvasPoint: { x, y }, inViewport })`. The point uses logical canvas units after removing the host composition transform; do not scale it by DPR. EventSystem then applies the Stage window transform. Federated events already carry viewX/viewY, which Stage.eventPointTransform returns directly. Omitting options uses the default DOM mapping and viewport rules.

Ignoring an input does not cancel a gesture. Call cancelPointer(pointerId), or cancelAllPointers(), when ownership changes. Cancellation clears pointer state before callbacks; reentrant new input is processed synchronously in FIFO order after the terminal transaction. Repeated cancellation is idempotent.

`eventSystem.input.canvas` and `.window` expose on/off only. Both carry accepted Stage input, not unfiltered browser-window events. Dispatch order is scenegraph, window, canvas. Canvas out/leave describes logical viewport transitions, never sibling-mark transitions. An outside release emits one window pointerup and no canvas pointerup; the scenegraph retains pointerupoutside. Events are pooled: consume synchronously and save scalars for delayed work.

Supported input types: pointerdown/move/up/cancel and wheel; mousedown/move/up (rightdown/rightup for the right button); touchstart/move/end/cancel; valid presses generate click/dblclick for mouse/pen, tap/dbltap when touch is supported, and pointertap. Canvas boundaries emit pointerover/enter/out/leave and corresponding mouse aliases. Do not forward native DOM click separately. stopPropagation does not control host authorization; cancel/release invalidate remaining normal dispatch.

DataZoom and Slider subscribe to the accepted window scope and own one active pointer each. Cancellation keeps applied values and ends the gesture. DataZoom flushes the last accepted delayed move on normal up, discards pending moves on cancel, and commits its final value even with realTime=false. The DOM adapter preserves synchronous touch preventDefault; hosts own touch-action and scrolling policy.

Use interactiveLayerMode:'virtual' to reuse the primary canvas. The interactive layer is prepared before the first draw and remains after business layers. Default layer selection and boolean interactiveLayer are preserved; false disables the layer. renderTo(window, rectangle?, options?) keeps its legacy second argument. Only explicit requestRender scheduling enables beforeRender/afterRender hooks in renderTo; default calls do not invoke new hooks. Its try/finally restores Stage state on failure without swallowing errors.
2 changes: 2 additions & 0 deletions docs/assets/guide/zh/asd/Basic_Tutorial/Create_Instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ interface IStageParams {
disableDirtyBounds: boolean;
// 是否支持interactiveLayer,默认为true
interactiveLayer: boolean;
// 交互层模式;缺省沿用环境默认。virtual 复用主层 Canvas。
interactiveLayerMode?: 'static' | 'virtual';
// 是否支持HTML属性
enableHtmlAttribute: string | boolean | HTMLElement;
// 是否支持react-dom(传入ReactDOM)
Expand Down
30 changes: 30 additions & 0 deletions docs/assets/guide/zh/asd/Basic_Tutorial/Event.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,33 @@ window['stage'] = stage;
```

【注意】:需要注意的是,VRender抛出的事件对象是复用的,所以注意不要保存事件对象在后续使用,因为事件对象会变的。这点在异步流程中需要特别注意

## 宿主输入与多 Stage 合成

默认 DOM 输入与宿主输入共用 EventSystem 的归一化、拾取和分发路径。宿主接入时关闭 Stage 的默认 DOM 监听:

```ts
const stage = createStage({
event: { useNativeEvents: false },
interactiveLayerMode: 'virtual',
requestRender: () => scheduleHostFrame()
});
// 先由宿主确定归属;canvasPoint 已去掉宿主合成矩阵,单位为逻辑像素,不乘 DPR。
stage.eventSystem.handleNativeEvent(nativeEvent, {
canvasPoint: { x, y },
inViewport: true
});
// 忽略某一次输入不等于取消。切换所有权、宿主 blur 或开始其他手势时显式取消。
stage.eventSystem.cancelPointer(pointerId);
stage.eventSystem.cancelAllPointers();
```

坐标链为 client → 宿主 canvas 逻辑坐标 → 去掉宿主合成变换 → canvasPoint → Stage window.pointTransform → view。Stage.eventPointTransform 对 Federated 事件直接返回 viewX/viewY,不会重复解释 client 坐标。未传 options 的 handleNativeEvent 沿用 DOM 坐标与视口判断。

获准输入的两个订阅范围位于 `stage.eventSystem.input.canvas/window`,只暴露 on/off。window 是该 Stage 获准处理的输入,不是浏览器全窗口广播;canvas 只接收逻辑视口内输入。图元事件仍走 scenegraph,随后分发 window、canvas 输入源。图元间移动不会产生 canvas out/leave;跨逻辑视口才会。视口外的抬起在 window 发布一次 pointerup,在图元路径派生 pointerupoutside,不向 canvas 发布普通 up。

支持表:pointerdown/move/up/cancel、wheel;mouse 的 mousedown/move/up(右键 down/up 为 rightdown/rightup);touch 的 touchstart/move/end/cancel;有效按下/抬起产生 click/dblclick(mouse/pen)、tap/dbltap(支持 touch 时)、pointertap;canvas 边界产生 pointerover/enter/out/leave 及 mouse 对应别名。宿主不要再次转发浏览器 click。事件对象池化,只允许同步消费;异步处理保存所需标量,不能保存事件对象。stopPropagation 不改变宿主输入授权,cancel/release 会中止当前失效输入的后续正常分发。

取消先清 press/hover/click 状态,再通知消费者;重复取消不重复结束。取消回调里重新送入的输入在当前事务结束后同步按 FIFO 处理。DataZoom/Slider 每个组件只管理一个活动指针;取消保留最后已应用值并结束拖拽。DataZoom 正常 up 应用最后一次已接受的延迟 move,cancel 丢弃尚未应用的 move;realTime=false 仍发送终态。默认 DOM adapter 保持同步触摸 preventDefault;宿主接入自行决定 touch-action 与滚动策略。

virtual 交互 Layer 在第一次绘制准备前创建,保持位于业务 Layer 之后,复用主层 Canvas。默认 Layer 模式不变,interactiveLayer:false 优先禁用交互层。renderTo(window, rectangle?, options?) 保留第二参旧矩形契约,新合成选项在第三参。仅显式设置 requestRender 的宿主调度模式会在 renderTo 调用 beforeRender/afterRender;默认 renderTo 不新增 hook 调用。try/finally 只负责绘制异常时恢复 Stage 状态,不吞掉异常。
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@visactor/vchart": "1.3.0",
"@visactor/vutils": "~1.0.12",
"@visactor/vgrammar": "~0.5.7",
"@visactor/vrender": "workspace:1.1.12",
"@visactor/vrender": "workspace:1.1.13",
"markdown-it": "^13.0.0",
"highlight.js": "^11.8.0",
"axios": "^1.4.0",
Expand Down
6 changes: 6 additions & 0 deletions packages/react-vrender-utils/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"name": "@visactor/react-vrender-utils",
"entries": [
{
"version": "1.1.13",
"tag": "@visactor/react-vrender-utils_v1.1.13",
"date": "Fri, 30 Oct 2026 02:30:40 GMT",
"comments": {}
},
{
"version": "1.1.12",
"tag": "@visactor/react-vrender-utils_v1.1.12",
Expand Down
7 changes: 6 additions & 1 deletion packages/react-vrender-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @visactor/react-vrender-utils

This log was last generated on Tue, 13 Oct 2026 08:17:49 GMT and should not be manually modified.
This log was last generated on Fri, 30 Oct 2026 02:30:40 GMT and should not be manually modified.

## 1.1.13
Fri, 30 Oct 2026 02:30:40 GMT

_Version update only_

## 1.1.12
Tue, 13 Oct 2026 08:17:49 GMT
Expand Down
6 changes: 3 additions & 3 deletions packages/react-vrender-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/react-vrender-utils",
"version": "1.1.12",
"version": "1.1.13",
"description": "",
"sideEffects": false,
"main": "cjs/index.js",
Expand All @@ -27,8 +27,8 @@
"react-dom": "^18.2.0"
},
"dependencies": {
"@visactor/vrender": "workspace:1.1.12",
"@visactor/react-vrender": "workspace:1.1.12",
"@visactor/vrender": "workspace:1.1.13",
"@visactor/react-vrender": "workspace:1.1.13",
"@visactor/vutils": "~1.0.12",
"react-reconciler": "^0.29.0",
"tslib": "^2.3.1"
Expand Down
6 changes: 6 additions & 0 deletions packages/react-vrender/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"name": "@visactor/react-vrender",
"entries": [
{
"version": "1.1.13",
"tag": "@visactor/react-vrender_v1.1.13",
"date": "Fri, 30 Oct 2026 02:30:40 GMT",
"comments": {}
},
{
"version": "1.1.12",
"tag": "@visactor/react-vrender_v1.1.12",
Expand Down
7 changes: 6 additions & 1 deletion packages/react-vrender/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @visactor/react-vrender

This log was last generated on Tue, 13 Oct 2026 08:17:49 GMT and should not be manually modified.
This log was last generated on Fri, 30 Oct 2026 02:30:40 GMT and should not be manually modified.

## 1.1.13
Fri, 30 Oct 2026 02:30:40 GMT

_Version update only_

## 1.1.12
Tue, 13 Oct 2026 08:17:48 GMT
Expand Down
4 changes: 2 additions & 2 deletions packages/react-vrender/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/react-vrender",
"version": "1.1.12",
"version": "1.1.13",
"description": "",
"sideEffects": false,
"main": "cjs/index.js",
Expand All @@ -26,7 +26,7 @@
"react": "^18.2.0"
},
"dependencies": {
"@visactor/vrender": "workspace:1.1.12",
"@visactor/vrender": "workspace:1.1.13",
"@visactor/vutils": "~1.0.12",
"react-reconciler": "^0.29.0",
"tslib": "^2.3.1"
Expand Down
6 changes: 6 additions & 0 deletions packages/vrender-animate/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"name": "@visactor/vrender-animate",
"entries": [
{
"version": "1.1.13",
"tag": "@visactor/vrender-animate_v1.1.13",
"date": "Fri, 30 Oct 2026 02:30:40 GMT",
"comments": {}
},
{
"version": "1.1.12",
"tag": "@visactor/vrender-animate_v1.1.12",
Expand Down
7 changes: 6 additions & 1 deletion packages/vrender-animate/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @visactor/vrender-animate

This log was last generated on Tue, 13 Oct 2026 08:17:49 GMT and should not be manually modified.
This log was last generated on Fri, 30 Oct 2026 02:30:40 GMT and should not be manually modified.

## 1.1.13
Fri, 30 Oct 2026 02:30:40 GMT

_Version update only_

## 1.1.12
Tue, 13 Oct 2026 08:17:49 GMT
Expand Down
4 changes: 2 additions & 2 deletions packages/vrender-animate/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/vrender-animate",
"version": "1.1.12",
"version": "1.1.13",
"description": "",
"sideEffects": false,
"main": "cjs/index.js",
Expand Down Expand Up @@ -37,7 +37,7 @@
},
"dependencies": {
"@visactor/vutils": "~1.0.12",
"@visactor/vrender-core": "workspace:1.1.12"
"@visactor/vrender-core": "workspace:1.1.13"
},
"devDependencies": {
"@internal/bundler": "workspace:*",
Expand Down
6 changes: 6 additions & 0 deletions packages/vrender-components/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"name": "@visactor/vrender-components",
"entries": [
{
"version": "1.1.13",
"tag": "@visactor/vrender-components_v1.1.13",
"date": "Fri, 30 Oct 2026 02:30:40 GMT",
"comments": {}
},
{
"version": "1.1.12",
"tag": "@visactor/vrender-components_v1.1.12",
Expand Down
7 changes: 6 additions & 1 deletion packages/vrender-components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log - @visactor/vrender-components

This log was last generated on Tue, 13 Oct 2026 08:17:49 GMT and should not be manually modified.
This log was last generated on Fri, 30 Oct 2026 02:30:40 GMT and should not be manually modified.

## 1.1.13
Fri, 30 Oct 2026 02:30:40 GMT

_Version update only_

## 1.1.12
Tue, 13 Oct 2026 08:17:49 GMT
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { runHostInputChecks } from '../util/host-input';

describe('host input and native virtual layers', () => {
it('keeps scoped input, cancellation, component drags and first-frame composition consistent', async () => {
const checks = await runHostInputChecks();
expect(checks.length).toBeGreaterThan(40);
checks.forEach(check => expect(check.pass).toBe(true));
});
});
Loading
Loading