modern-canvas 0.14.16 → 0.14.17
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/dist/index.js +3812 -3808
- package/dist/scene/2d/element/Element2D.d.ts +9 -12
- package/dist/scene/2d/element/Element2DShape.d.ts +1 -0
- package/dist/scene/2d/{FlexLayout.d.ts → element/Flexbox.d.ts} +10 -16
- package/dist/scene/2d/element/index.d.ts +1 -0
- package/dist/scene/2d/index.d.ts +0 -1
- package/dist/scene/main/Node.d.ts +5 -5
- package/package.json +6 -6
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import type { Background, Fill, Foreground, Outline, Shadow, Shape, Text } from 'modern-idoc';
|
|
1
|
+
import type { Background, Display, Fill, Foreground, Outline, Shadow, Shape, Text } from 'modern-idoc';
|
|
2
2
|
import type { InputEvent, InputEventKey, Vector2Like } from '../../../core';
|
|
3
3
|
import type { Node, Rectangulable, RectangulableEvents, SceneTree } from '../../main';
|
|
4
4
|
import type { Node2DEvents, Node2DProperties } from '../Node2D';
|
|
5
5
|
import type { Element2DStyleProperties } from './Element2DStyle';
|
|
6
6
|
import { Aabb2D, Obb2D, Vector2 } from '../../../core';
|
|
7
7
|
import { ColorFilterEffect } from '../../effects';
|
|
8
|
-
import { directionMap, FlexLayout } from '../FlexLayout';
|
|
9
8
|
import { Node2D } from '../Node2D';
|
|
10
9
|
import { Element2DBackground } from './Element2DBackground';
|
|
11
10
|
import { Element2DFill } from './Element2DFill';
|
|
@@ -15,6 +14,7 @@ import { Element2DShadow } from './Element2DShadow';
|
|
|
15
14
|
import { Element2DShape } from './Element2DShape';
|
|
16
15
|
import { Element2DStyle } from './Element2DStyle';
|
|
17
16
|
import { Element2DText } from './Element2DText';
|
|
17
|
+
import { Flexbox } from './Flexbox';
|
|
18
18
|
export interface BaseElement2DEvents extends Node2DEvents, RectangulableEvents {
|
|
19
19
|
updateStyleProperty: [key: string, value: any, oldValue: any];
|
|
20
20
|
}
|
|
@@ -33,12 +33,12 @@ export interface Element2DProperties extends Node2DProperties {
|
|
|
33
33
|
foreground: Foreground;
|
|
34
34
|
text: Text;
|
|
35
35
|
shadow: Shadow;
|
|
36
|
-
layoutMode: LayoutMode;
|
|
37
36
|
}
|
|
38
|
-
export type LayoutMode = 'inherit' | 'absolute' | 'flex';
|
|
39
37
|
export declare class Element2D extends Node2D implements Rectangulable {
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
protected _parentGlobalDisplay?: Display;
|
|
39
|
+
protected _globalDisplay?: Display;
|
|
40
|
+
get globalDisplay(): Display | undefined;
|
|
41
|
+
readonly flexbox: Flexbox;
|
|
42
42
|
readonly size: Vector2;
|
|
43
43
|
protected _allowPointerEvents: boolean;
|
|
44
44
|
protected _overflowHidden: boolean;
|
|
@@ -69,20 +69,17 @@ export declare class Element2D extends Node2D implements Rectangulable {
|
|
|
69
69
|
protected _styleFilter?: ColorFilterEffect;
|
|
70
70
|
constructor(properties?: Partial<Element2DProperties>, nodes?: Node[]);
|
|
71
71
|
protected _treeEnter(tree: SceneTree): void;
|
|
72
|
-
protected _parented(parent: Node): void;
|
|
73
|
-
protected _unparented(oldParent: Node): void;
|
|
74
72
|
setProperties(properties?: Record<string, any>): this;
|
|
75
73
|
onUpdateStyleProperty(key: string, value: any, oldValue: any): void;
|
|
76
74
|
protected _updateStyleProperty(key: string, value: any, oldValue: any): void;
|
|
75
|
+
updateGlobalDisplay(): void;
|
|
76
|
+
requestLayout(): void;
|
|
77
77
|
protected _process(delta: number): void;
|
|
78
|
-
getGlobalLayoutMode(): Omit<LayoutMode, 'inherit'>;
|
|
79
|
-
updateLayout(): void;
|
|
80
|
-
calculateLayout(width?: number | 'auto', height?: number | 'auto', direction?: typeof directionMap[keyof typeof directionMap]): void;
|
|
81
78
|
protected _getStyleFilter(): ColorFilterEffect;
|
|
82
79
|
protected _updateMaskImage(maskImage?: string): void;
|
|
83
80
|
updateGlobalTransform(): void;
|
|
84
|
-
getRect(): Aabb2D;
|
|
85
81
|
protected _getPointArray(): Vector2Like[];
|
|
82
|
+
getRect(): Aabb2D;
|
|
86
83
|
getAabb(): Aabb2D;
|
|
87
84
|
getGlobalAabb(): Aabb2D;
|
|
88
85
|
getObb(): Obb2D;
|
|
@@ -13,6 +13,7 @@ export declare class Element2DShape extends CoreObject {
|
|
|
13
13
|
constructor(parent: Element2D);
|
|
14
14
|
setProperties(properties?: Shape): this;
|
|
15
15
|
protected _updateProperty(key: string, value: any, oldValue: any): void;
|
|
16
|
+
isValid(): boolean;
|
|
16
17
|
protected _updatePath2DSet(): void;
|
|
17
18
|
draw(rect?: boolean): void;
|
|
18
19
|
protected _drawRect(): void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Node as YogaNode } from 'yoga-layout/load';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Node } from '../../main';
|
|
3
|
+
import { Element2D } from './Element2D';
|
|
3
4
|
export declare const edgeMap: {
|
|
4
5
|
left: number;
|
|
5
6
|
top: number;
|
|
@@ -70,21 +71,14 @@ export declare const boxSizingMap: {
|
|
|
70
71
|
'border-box': number;
|
|
71
72
|
'content-box': number;
|
|
72
73
|
};
|
|
73
|
-
export
|
|
74
|
-
|
|
75
|
-
right: number;
|
|
76
|
-
top: number;
|
|
77
|
-
bottom: number;
|
|
78
|
-
width: number;
|
|
79
|
-
height: number;
|
|
80
|
-
}
|
|
81
|
-
export declare class FlexLayout {
|
|
82
|
-
protected _element: Element2D;
|
|
74
|
+
export declare class Flexbox {
|
|
75
|
+
protected _el: Element2D;
|
|
83
76
|
static _yoga?: any;
|
|
84
77
|
static load(): Promise<void>;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
updateStyleProperty(key: string, value: any
|
|
78
|
+
readonly node: YogaNode | undefined;
|
|
79
|
+
constructor(_el: Element2D);
|
|
80
|
+
protected _addChild(child: Node, newIndex: number): void;
|
|
81
|
+
protected _removeChild(child: Node, _oldIndex: number): void;
|
|
82
|
+
updateStyleProperty(key: string, value: any): void;
|
|
83
|
+
update(): void;
|
|
90
84
|
}
|
package/dist/scene/2d/index.d.ts
CHANGED
|
@@ -104,11 +104,11 @@ export declare class Node extends CoreObject {
|
|
|
104
104
|
canProcess(): boolean;
|
|
105
105
|
canInput(): boolean;
|
|
106
106
|
canRender(): boolean;
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
107
|
+
private _onTreeEnter;
|
|
108
|
+
private _onTreeExit;
|
|
109
|
+
private _onParented;
|
|
110
|
+
private _onUnparented;
|
|
111
|
+
private _onReady;
|
|
112
112
|
protected _onProcess(delta?: number): void;
|
|
113
113
|
requestRender(): void;
|
|
114
114
|
protected _updateProperty(key: string, newValue: any, oldValue: any): void;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "modern-canvas",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.14.
|
|
4
|
+
"version": "0.14.17",
|
|
5
5
|
"packageManager": "pnpm@10.19.0",
|
|
6
6
|
"description": "A JavaScript WebGL rendering engine. only the ESM.",
|
|
7
7
|
"author": "wxm",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"colord": "^2.9.3",
|
|
65
65
|
"earcut": "^3.0.2",
|
|
66
66
|
"modern-font": "^0.4.4",
|
|
67
|
-
"modern-idoc": "^0.10.
|
|
67
|
+
"modern-idoc": "^0.10.7",
|
|
68
68
|
"modern-path2d": "^1.4.15",
|
|
69
69
|
"modern-text": "^1.10.5"
|
|
70
70
|
},
|
|
@@ -85,19 +85,19 @@
|
|
|
85
85
|
}
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
|
-
"@antfu/eslint-config": "^6.
|
|
88
|
+
"@antfu/eslint-config": "^6.7.1",
|
|
89
89
|
"@types/earcut": "^3.0.0",
|
|
90
|
-
"@types/node": "^
|
|
90
|
+
"@types/node": "^25.0.2",
|
|
91
91
|
"bumpp": "^10.3.2",
|
|
92
92
|
"conventional-changelog-cli": "^5.0.0",
|
|
93
|
-
"eslint": "^9.39.
|
|
93
|
+
"eslint": "^9.39.2",
|
|
94
94
|
"lint-staged": "^16.2.7",
|
|
95
95
|
"lottie-web": "^5.13.0",
|
|
96
96
|
"modern-gif": "^2.0.4",
|
|
97
97
|
"simple-git-hooks": "^2.13.1",
|
|
98
98
|
"typescript": "^5.9.3",
|
|
99
99
|
"unbuild": "^3.6.1",
|
|
100
|
-
"vite": "^7.
|
|
100
|
+
"vite": "^7.3.0",
|
|
101
101
|
"vitest": "^4.0.15",
|
|
102
102
|
"yoga-layout": "^3.2.1"
|
|
103
103
|
},
|