modern-canvas 0.23.13 → 0.24.0
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Background, Chart, Connection, Display, Fill, Foreground, NormalizedFilter, Outline, Shadow, Shape, Table, Text } from 'modern-idoc';
|
|
1
|
+
import type { Background, Chart, CommentThread, Connection, Display, Fill, Foreground, NormalizedFilter, Outline, Shadow, Shape, Table, Text } from 'modern-idoc';
|
|
2
2
|
import type { Path2D, Vector2Like } from 'modern-path2d';
|
|
3
3
|
import type { InputEvent, InputEventKey } from '../../../core';
|
|
4
4
|
import type { Node, Rectangulable, RectangulableEvents, SceneTree, Viewport } from '../../main';
|
|
@@ -10,6 +10,7 @@ import { ColorFilterEffect, MaskEffect } from '../../effects';
|
|
|
10
10
|
import { Node2D } from '../Node2D';
|
|
11
11
|
import { Element2DBackground } from './Element2DBackground';
|
|
12
12
|
import { Element2DChart } from './Element2DChart';
|
|
13
|
+
import { Element2DComments } from './Element2DComments';
|
|
13
14
|
import { Element2DConnection } from './Element2DConnection';
|
|
14
15
|
import { Element2DFill } from './Element2DFill';
|
|
15
16
|
import { Element2DForeground } from './Element2DForeground';
|
|
@@ -41,6 +42,7 @@ export interface Element2DProperties extends Node2DProperties {
|
|
|
41
42
|
connection: Connection;
|
|
42
43
|
table: Table;
|
|
43
44
|
chart: Chart;
|
|
45
|
+
comments: CommentThread[];
|
|
44
46
|
/** 元素级结构化滤镜(Effect.filter),转成 CSS filter 后与 style.filter 合并 */
|
|
45
47
|
filter: NormalizedFilter;
|
|
46
48
|
}
|
|
@@ -87,6 +89,9 @@ export declare class Element2D extends Node2D implements Rectangulable {
|
|
|
87
89
|
protected _chart: Element2DChart;
|
|
88
90
|
get chart(): Element2DChart;
|
|
89
91
|
set chart(value: Element2DProperties['chart'] | undefined);
|
|
92
|
+
protected _comments: Element2DComments;
|
|
93
|
+
get comments(): Element2DComments;
|
|
94
|
+
set comments(value: Element2DProperties['comments'] | undefined);
|
|
90
95
|
/** Last routed connection path; identity-compared to skip re-layout when unchanged. */
|
|
91
96
|
protected _lastRoutePath?: Path2D;
|
|
92
97
|
protected _batchDepth: number;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CommentThread, NormalizedCommentThread, PropertyDeclaration } from 'modern-idoc';
|
|
2
|
+
import type { Element2D } from './Element2D';
|
|
3
|
+
import { CoreObject } from '../../../core';
|
|
4
|
+
/**
|
|
5
|
+
* 元素上的评论线程集合。内部按 `threadId` 作动态键存储(仿 {@link Meta}),
|
|
6
|
+
* 从而能像其它子属性一样被 CRDT 逐线程映射为 Y.Map 项(并发新增不同线程天然合并)。
|
|
7
|
+
* 对外 `toJSON` 输出 idoc 规范的 `CommentThread[]` 数组形态。
|
|
8
|
+
*/
|
|
9
|
+
export declare class Element2DComments extends CoreObject {
|
|
10
|
+
parent: Element2D;
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
constructor(parent: Element2D);
|
|
13
|
+
getPropertyDeclarations(): Record<string, PropertyDeclaration>;
|
|
14
|
+
getPropertyDeclaration(key: string): PropertyDeclaration | undefined;
|
|
15
|
+
/** 接受 CommentThread[](按 thread.id 归键)或已归键的对象。 */
|
|
16
|
+
setProperties(value?: CommentThread[] | Record<string, CommentThread>): this;
|
|
17
|
+
/** 序列化为 idoc 规范的线程数组。 */
|
|
18
|
+
toJSON(): NormalizedCommentThread[];
|
|
19
|
+
isValid(): boolean;
|
|
20
|
+
}
|
|
@@ -2,6 +2,7 @@ export * from './connectionRouter';
|
|
|
2
2
|
export * from './Element2D';
|
|
3
3
|
export * from './Element2DBackground';
|
|
4
4
|
export * from './Element2DChart';
|
|
5
|
+
export * from './Element2DComments';
|
|
5
6
|
export * from './Element2DConnection';
|
|
6
7
|
export * from './Element2DFill';
|
|
7
8
|
export * from './Element2DForeground';
|
|
@@ -32,6 +32,9 @@ export declare class TimelineNode extends Node {
|
|
|
32
32
|
protected _currentTime: number;
|
|
33
33
|
protected _globalStartTime: number;
|
|
34
34
|
protected _globalDuration: number;
|
|
35
|
+
protected _standalone: boolean;
|
|
36
|
+
protected _localCurrentTime: number;
|
|
37
|
+
get standalone(): boolean;
|
|
35
38
|
get parentGlobalStartTime(): number;
|
|
36
39
|
get currentTime(): number;
|
|
37
40
|
get globalStartTime(): number;
|
|
@@ -42,6 +45,16 @@ export declare class TimelineNode extends Node {
|
|
|
42
45
|
constructor(properties?: Partial<TimelineNodeProperties>, nodes?: Node[]);
|
|
43
46
|
protected _updateProperty(key: string, newValue: any, oldValue: any): void;
|
|
44
47
|
protected _updateInsideTimeRange(): void;
|
|
48
|
+
/**
|
|
49
|
+
* 开启/关闭独立播放。开启后本节点的 currentTime 取自 {@link setLocalTime}
|
|
50
|
+
* 设置的本地时钟,完全脱离全局时间轴;关闭后恢复跟随全局时间轴。
|
|
51
|
+
*/
|
|
52
|
+
setStandalone(on: boolean): this;
|
|
53
|
+
/**
|
|
54
|
+
* 独立播放下设置本地时间(毫秒,相对本节点自身 0 起点)并立即刷新。
|
|
55
|
+
* 由外部循环(如交互运行器)逐帧驱动。
|
|
56
|
+
*/
|
|
57
|
+
setLocalTime(ms: number): this;
|
|
45
58
|
protected _updateCurrentTime(force?: boolean): void;
|
|
46
59
|
protected _process(delta: number): void;
|
|
47
60
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "modern-canvas",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.24.0",
|
|
5
5
|
"packageManager": "pnpm@10.19.0",
|
|
6
6
|
"description": "A JavaScript WebGL rendering engine. only the ESM.",
|
|
7
7
|
"author": "wxm",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"colord": "^2.9.3",
|
|
64
64
|
"earcut": "^3.0.2",
|
|
65
65
|
"modern-font": "^0.6.1",
|
|
66
|
-
"modern-idoc": "^0.
|
|
66
|
+
"modern-idoc": "^0.12.0",
|
|
67
67
|
"modern-path2d": "^1.8.5",
|
|
68
68
|
"modern-text": "^2.0.6"
|
|
69
69
|
},
|