@antv/g 5.0.23-alpha.9 → 5.1.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.
- package/dist/index.umd.min.js +4 -3
- package/es/AbstractRenderer.d.ts +11 -0
- package/es/AbstractRenderer.js +17 -2
- package/es/Canvas.d.ts +1 -1
- package/es/Canvas.js +2 -0
- package/es/css/CSS.d.ts +2 -1
- package/es/css/CSS.js +6 -2
- package/es/css/CSSProperty.d.ts +3 -2
- package/es/css/StyleValueRegistry.d.ts +4 -2
- package/es/css/StyleValueRegistry.js +100 -95
- package/es/css/cssom/CSSNumericValue.js +1 -1
- package/es/css/index.d.ts +2 -1
- package/es/css/index.js +2 -1
- package/es/css/interfaces.d.ts +6 -0
- package/es/css/interfaces.js +2 -0
- package/es/css/layout/FragmentResult.d.ts +32 -0
- package/es/css/layout/FragmentResult.js +32 -0
- package/es/css/layout/LayoutChildren.d.ts +23 -0
- package/es/css/layout/LayoutChildren.js +55 -0
- package/es/css/layout/LayoutContext.d.ts +35 -0
- package/es/css/layout/LayoutContext.js +35 -0
- package/es/css/layout/LayoutDefinition.d.ts +20 -0
- package/es/css/layout/LayoutDefinition.js +9 -0
- package/es/css/layout/LayoutEdges.d.ts +24 -0
- package/es/css/layout/LayoutEdges.js +41 -0
- package/es/css/layout/LayoutEngine.d.ts +41 -0
- package/es/css/layout/LayoutEngine.js +332 -0
- package/es/css/layout/LayoutFragment.d.ts +26 -0
- package/es/css/layout/LayoutFragment.js +28 -0
- package/es/css/layout/LayoutObject.d.ts +46 -0
- package/es/css/layout/LayoutObject.js +172 -0
- package/es/css/layout/LayoutRegistry.d.ts +16 -0
- package/es/css/layout/LayoutRegistry.js +78 -0
- package/es/css/layout/LayoutWorkTask.d.ts +14 -0
- package/es/css/layout/LayoutWorkTask.js +1 -0
- package/es/css/layout/index.d.ts +11 -0
- package/es/css/layout/index.js +11 -0
- package/es/css/layout/types.d.ts +104 -0
- package/es/css/layout/types.js +66 -0
- package/es/css/parser/color.d.ts +1 -1
- package/es/css/parser/color.js +2 -2
- package/es/css/parser/dimension.js +5 -1
- package/es/css/parser/path.d.ts +2 -2
- package/es/css/parser/path.js +9 -2
- package/es/css/parser/points.d.ts +8 -1
- package/es/css/parser/points.js +33 -3
- package/es/css/parser/transform.js +1 -1
- package/es/css/properties/CSSPropertyClipPath.js +7 -1
- package/es/css/properties/CSSPropertyColor.d.ts +1 -1
- package/es/css/properties/CSSPropertyLengthOrPercentage.d.ts +1 -1
- package/es/css/properties/CSSPropertyLocalPosition.d.ts +0 -9
- package/es/css/properties/CSSPropertyLocalPosition.js +64 -20
- package/es/css/properties/CSSPropertyPath.d.ts +2 -2
- package/es/css/properties/CSSPropertyPath.js +7 -5
- package/es/css/properties/CSSPropertyPoints.js +3 -4
- package/es/css/properties/CSSPropertyTransform.d.ts +1 -1
- package/es/css/properties/CSSPropertyTransform.js +76 -104
- package/es/display-objects/Circle.d.ts +4 -0
- package/es/display-objects/Circle.js +2 -0
- package/es/display-objects/DisplayObject.d.ts +2 -9
- package/es/display-objects/DisplayObject.js +8 -27
- package/es/display-objects/Ellipse.d.ts +4 -0
- package/es/display-objects/Ellipse.js +2 -0
- package/es/display-objects/Group.d.ts +4 -0
- package/es/display-objects/Group.js +2 -0
- package/es/display-objects/HTML.d.ts +4 -4
- package/es/display-objects/HTML.js +5 -3
- package/es/display-objects/Image.d.ts +4 -0
- package/es/display-objects/Image.js +2 -0
- package/es/display-objects/Line.js +2 -0
- package/es/display-objects/Path.d.ts +2 -2
- package/es/display-objects/Polygon.js +1 -1
- package/es/display-objects/Polyline.js +1 -1
- package/es/display-objects/Rect.d.ts +6 -2
- package/es/display-objects/Rect.js +2 -0
- package/es/display-objects/Text.d.ts +4 -0
- package/es/display-objects/Text.js +2 -0
- package/es/dom/Document.js +2 -2
- package/es/dom/Element.js +1 -0
- package/es/global-module.js +91 -8
- package/es/index.d.ts +3 -0
- package/es/index.js +3 -0
- package/es/plugins/CullingPlugin.d.ts +1 -0
- package/es/plugins/CullingPlugin.js +8 -3
- package/es/plugins/DirtyCheckPlugin.d.ts +1 -0
- package/es/plugins/DirtyCheckPlugin.js +7 -2
- package/es/plugins/EventPlugin.d.ts +1 -0
- package/es/plugins/EventPlugin.js +14 -9
- package/es/plugins/PrepareRendererPlugin.d.ts +1 -0
- package/es/plugins/PrepareRendererPlugin.js +10 -5
- package/es/services/EventService.js +14 -10
- package/es/services/OffscreenCanvasCreator.d.ts +1 -1
- package/es/services/OffscreenCanvasCreator.js +1 -1
- package/es/services/RenderingService.d.ts +18 -18
- package/es/services/RenderingService.js +26 -23
- package/es/services/SceneGraphService.d.ts +2 -0
- package/es/services/SceneGraphService.js +12 -1
- package/es/services/aabb/CircleUpdater.d.ts +0 -2
- package/es/services/aabb/CircleUpdater.js +2 -6
- package/es/services/aabb/EllipseUpdater.d.ts +0 -2
- package/es/services/aabb/EllipseUpdater.js +2 -6
- package/es/services/aabb/LineUpdater.d.ts +0 -2
- package/es/services/aabb/LineUpdater.js +1 -3
- package/es/services/aabb/PathUpdater.d.ts +0 -2
- package/es/services/aabb/PathUpdater.js +1 -5
- package/es/services/aabb/PolylineUpdater.d.ts +0 -2
- package/es/services/aabb/PolylineUpdater.js +1 -3
- package/es/services/aabb/RectUpdater.d.ts +0 -2
- package/es/services/aabb/RectUpdater.js +1 -5
- package/es/services/aabb/TextUpdater.d.ts +7 -0
- package/es/services/aabb/TextUpdater.js +0 -4
- package/es/services/aabb/interfaces.d.ts +0 -3
- package/es/types.d.ts +12 -23
- package/es/types.js +1 -0
- package/es/utils/deferred.d.ts +43 -0
- package/es/utils/deferred.js +117 -0
- package/es/utils/dom.d.ts +2 -0
- package/es/utils/dom.js +8 -0
- package/es/utils/index.d.ts +2 -1
- package/es/utils/index.js +2 -1
- package/es/utils/interpolation.js +3 -9
- package/es/utils/math.js +4 -3
- package/es/utils/path.d.ts +2 -2
- package/es/utils/path.js +61 -24
- package/lib/AbstractRenderer.d.ts +11 -0
- package/lib/AbstractRenderer.js +17 -2
- package/lib/Canvas.d.ts +1 -1
- package/lib/Canvas.js +2 -0
- package/lib/css/CSS.d.ts +2 -1
- package/lib/css/CSS.js +9 -3
- package/lib/css/CSSProperty.d.ts +3 -2
- package/lib/css/StyleValueRegistry.d.ts +4 -2
- package/lib/css/StyleValueRegistry.js +104 -96
- package/lib/css/cssom/CSSNumericValue.js +17 -17
- package/lib/css/index.d.ts +2 -1
- package/lib/css/index.js +25 -12
- package/lib/css/interfaces.d.ts +6 -0
- package/lib/css/interfaces.js +12 -0
- package/lib/css/layout/FragmentResult.d.ts +32 -0
- package/lib/css/layout/FragmentResult.js +51 -0
- package/lib/css/layout/LayoutChildren.d.ts +23 -0
- package/lib/css/layout/LayoutChildren.js +72 -0
- package/lib/css/layout/LayoutContext.d.ts +35 -0
- package/lib/css/layout/LayoutContext.js +49 -0
- package/lib/css/layout/LayoutDefinition.d.ts +20 -0
- package/lib/css/layout/LayoutDefinition.js +16 -0
- package/lib/css/layout/LayoutEdges.d.ts +24 -0
- package/lib/css/layout/LayoutEdges.js +56 -0
- package/lib/css/layout/LayoutEngine.d.ts +41 -0
- package/lib/css/layout/LayoutEngine.js +345 -0
- package/lib/css/layout/LayoutFragment.d.ts +26 -0
- package/lib/css/layout/LayoutFragment.js +44 -0
- package/lib/css/layout/LayoutObject.d.ts +46 -0
- package/lib/css/layout/LayoutObject.js +182 -0
- package/lib/css/layout/LayoutRegistry.d.ts +16 -0
- package/lib/css/layout/LayoutRegistry.js +87 -0
- package/lib/css/layout/LayoutWorkTask.d.ts +14 -0
- package/lib/css/layout/LayoutWorkTask.js +5 -0
- package/lib/css/layout/index.d.ts +11 -0
- package/lib/css/layout/index.js +148 -0
- package/lib/css/layout/types.d.ts +104 -0
- package/lib/css/layout/types.js +74 -0
- package/lib/css/parser/color.d.ts +1 -1
- package/lib/css/parser/color.js +1 -1
- package/lib/css/parser/dimension.js +4 -0
- package/lib/css/parser/path.d.ts +2 -2
- package/lib/css/parser/path.js +9 -2
- package/lib/css/parser/points.d.ts +8 -1
- package/lib/css/parser/points.js +33 -3
- package/lib/css/parser/transform.js +1 -1
- package/lib/css/properties/CSSPropertyClipPath.js +8 -1
- package/lib/css/properties/CSSPropertyColor.d.ts +1 -1
- package/lib/css/properties/CSSPropertyLengthOrPercentage.d.ts +1 -1
- package/lib/css/properties/CSSPropertyLocalPosition.d.ts +0 -9
- package/lib/css/properties/CSSPropertyLocalPosition.js +65 -20
- package/lib/css/properties/CSSPropertyPath.d.ts +2 -2
- package/lib/css/properties/CSSPropertyPath.js +7 -5
- package/lib/css/properties/CSSPropertyPoints.js +3 -4
- package/lib/css/properties/CSSPropertyTransform.d.ts +1 -1
- package/lib/css/properties/CSSPropertyTransform.js +75 -103
- package/lib/display-objects/Circle.d.ts +4 -0
- package/lib/display-objects/Circle.js +2 -0
- package/lib/display-objects/DisplayObject.d.ts +2 -9
- package/lib/display-objects/DisplayObject.js +9 -29
- package/lib/display-objects/Ellipse.d.ts +4 -0
- package/lib/display-objects/Ellipse.js +2 -0
- package/lib/display-objects/Group.d.ts +4 -0
- package/lib/display-objects/Group.js +2 -0
- package/lib/display-objects/HTML.d.ts +4 -4
- package/lib/display-objects/HTML.js +5 -3
- package/lib/display-objects/Image.d.ts +4 -0
- package/lib/display-objects/Image.js +2 -0
- package/lib/display-objects/Line.js +2 -0
- package/lib/display-objects/Path.d.ts +2 -2
- package/lib/display-objects/Polygon.js +1 -1
- package/lib/display-objects/Polyline.js +1 -1
- package/lib/display-objects/Rect.d.ts +6 -2
- package/lib/display-objects/Rect.js +2 -0
- package/lib/display-objects/Text.d.ts +4 -0
- package/lib/display-objects/Text.js +2 -0
- package/lib/dom/Document.js +2 -2
- package/lib/dom/Element.js +1 -0
- package/lib/global-module.js +91 -6
- package/lib/index.d.ts +3 -0
- package/lib/index.js +7 -2
- package/lib/plugins/CullingPlugin.d.ts +1 -0
- package/lib/plugins/CullingPlugin.js +7 -3
- package/lib/plugins/DirtyCheckPlugin.d.ts +1 -0
- package/lib/plugins/DirtyCheckPlugin.js +6 -2
- package/lib/plugins/EventPlugin.d.ts +1 -0
- package/lib/plugins/EventPlugin.js +13 -9
- package/lib/plugins/PrepareRendererPlugin.d.ts +1 -0
- package/lib/plugins/PrepareRendererPlugin.js +9 -5
- package/lib/services/EventService.js +14 -10
- package/lib/services/OffscreenCanvasCreator.d.ts +1 -1
- package/lib/services/OffscreenCanvasCreator.js +1 -1
- package/lib/services/RenderingService.d.ts +18 -18
- package/lib/services/RenderingService.js +26 -23
- package/lib/services/SceneGraphService.d.ts +2 -0
- package/lib/services/SceneGraphService.js +15 -1
- package/lib/services/aabb/CircleUpdater.d.ts +0 -2
- package/lib/services/aabb/CircleUpdater.js +2 -6
- package/lib/services/aabb/EllipseUpdater.d.ts +0 -2
- package/lib/services/aabb/EllipseUpdater.js +2 -6
- package/lib/services/aabb/LineUpdater.d.ts +0 -2
- package/lib/services/aabb/LineUpdater.js +1 -3
- package/lib/services/aabb/PathUpdater.d.ts +0 -2
- package/lib/services/aabb/PathUpdater.js +1 -5
- package/lib/services/aabb/PolylineUpdater.d.ts +0 -2
- package/lib/services/aabb/PolylineUpdater.js +1 -3
- package/lib/services/aabb/RectUpdater.d.ts +0 -2
- package/lib/services/aabb/RectUpdater.js +1 -5
- package/lib/services/aabb/TextUpdater.d.ts +7 -0
- package/lib/services/aabb/TextUpdater.js +0 -4
- package/lib/services/aabb/interfaces.d.ts +0 -3
- package/lib/types.d.ts +12 -23
- package/lib/types.js +1 -0
- package/lib/utils/deferred.d.ts +43 -0
- package/lib/utils/deferred.js +131 -0
- package/lib/utils/dom.d.ts +2 -0
- package/lib/utils/dom.js +17 -0
- package/lib/utils/index.d.ts +2 -1
- package/lib/utils/index.js +17 -4
- package/lib/utils/interpolation.js +4 -10
- package/lib/utils/math.js +4 -3
- package/lib/utils/path.d.ts +2 -2
- package/lib/utils/path.js +55 -24
- package/package.json +4 -3
- package/es/css/LayoutRegistry.d.ts +0 -11
- package/es/css/LayoutRegistry.js +0 -22
- package/es/utils/hooks.d.ts +0 -280
- package/es/utils/hooks.js +0 -753
- package/lib/css/LayoutRegistry.d.ts +0 -11
- package/lib/css/LayoutRegistry.js +0 -30
- package/lib/utils/hooks.d.ts +0 -280
- package/lib/utils/hooks.js +0 -759
|
@@ -3,13 +3,17 @@ import { DisplayObject } from './DisplayObject';
|
|
|
3
3
|
import type { DisplayObjectConfig } from '../dom';
|
|
4
4
|
import type { CSSUnitValue } from '../css';
|
|
5
5
|
export interface RectStyleProps extends BaseStyleProps {
|
|
6
|
+
x?: number | string;
|
|
7
|
+
y?: number | string;
|
|
6
8
|
width: number | string;
|
|
7
9
|
height: number | string;
|
|
8
10
|
radius?: number | string;
|
|
9
11
|
}
|
|
10
12
|
export interface ParsedRectStyleProps extends ParsedBaseStyleProps {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
x: CSSUnitValue;
|
|
14
|
+
y: CSSUnitValue;
|
|
15
|
+
width: CSSUnitValue;
|
|
16
|
+
height: CSSUnitValue;
|
|
13
17
|
radius?: CSSUnitValue;
|
|
14
18
|
}
|
|
15
19
|
export declare class Rect extends DisplayObject<RectStyleProps, ParsedRectStyleProps> {
|
|
@@ -4,6 +4,8 @@ import type { BaseStyleProps, ParsedBaseStyleProps } from '../types';
|
|
|
4
4
|
import { DisplayObject } from './DisplayObject';
|
|
5
5
|
import type { CSSUnitValue, CSSGlobalKeywords, CSSKeywordValue } from '../css';
|
|
6
6
|
export interface TextStyleProps extends BaseStyleProps {
|
|
7
|
+
x?: number | string;
|
|
8
|
+
y?: number | string;
|
|
7
9
|
text: string;
|
|
8
10
|
/** 设置文本内容的当前对齐方式 */
|
|
9
11
|
textAlign?: CSSGlobalKeywords | 'start' | 'center' | 'end' | 'left' | 'right';
|
|
@@ -31,6 +33,8 @@ export interface TextStyleProps extends BaseStyleProps {
|
|
|
31
33
|
dy?: number | string;
|
|
32
34
|
}
|
|
33
35
|
export interface ParsedTextStyleProps extends ParsedBaseStyleProps {
|
|
36
|
+
x: CSSUnitValue;
|
|
37
|
+
y: CSSUnitValue;
|
|
34
38
|
text: string;
|
|
35
39
|
/** 设置文本内容的当前对齐方式 */
|
|
36
40
|
textAlign?: CSSKeywordValue;
|
package/lib/dom/Document.js
CHANGED
|
@@ -159,7 +159,7 @@ function (_super) {
|
|
|
159
159
|
}), clientX = _c.x, clientY = _c.y;
|
|
160
160
|
return [4
|
|
161
161
|
/*yield*/
|
|
162
|
-
, this.defaultView.getRenderingService().hooks.pick.
|
|
162
|
+
, this.defaultView.getRenderingService().hooks.pick.promise({
|
|
163
163
|
topmost: true,
|
|
164
164
|
position: {
|
|
165
165
|
x: x,
|
|
@@ -213,7 +213,7 @@ function (_super) {
|
|
|
213
213
|
}), clientX = _c.x, clientY = _c.y;
|
|
214
214
|
return [4
|
|
215
215
|
/*yield*/
|
|
216
|
-
, this.defaultView.getRenderingService().hooks.pick.
|
|
216
|
+
, this.defaultView.getRenderingService().hooks.pick.promise({
|
|
217
217
|
topmost: false,
|
|
218
218
|
position: {
|
|
219
219
|
x: x,
|
package/lib/dom/Element.js
CHANGED
package/lib/global-module.js
CHANGED
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.containerModule = void 0;
|
|
7
7
|
|
|
8
|
+
var _tslib = require("tslib");
|
|
9
|
+
|
|
8
10
|
var _manaSyringe = require("mana-syringe");
|
|
9
11
|
|
|
10
12
|
var _eventemitter = require("eventemitter3");
|
|
@@ -15,6 +17,8 @@ var _services = require("./services");
|
|
|
15
17
|
|
|
16
18
|
var _css = require("./css");
|
|
17
19
|
|
|
20
|
+
var _layout = require("./css/layout");
|
|
21
|
+
|
|
18
22
|
var containerModule = (0, _manaSyringe.Module)(function (register) {
|
|
19
23
|
(0, _manaSyringe.decorate)((0, _manaSyringe.injectable)(), _eventemitter.EventEmitter); // bind DisplayObject pool
|
|
20
24
|
|
|
@@ -30,10 +34,7 @@ var containerModule = (0, _manaSyringe.Module)(function (register) {
|
|
|
30
34
|
}
|
|
31
35
|
}); // bind scenegraph service
|
|
32
36
|
|
|
33
|
-
register(
|
|
34
|
-
token: _services.SceneGraphService,
|
|
35
|
-
useClass: _services.DefaultSceneGraphService
|
|
36
|
-
}); // bind text service
|
|
37
|
+
register(_services.DefaultSceneGraphService); // bind text service
|
|
37
38
|
|
|
38
39
|
register(_services.OffscreenCanvasCreator);
|
|
39
40
|
register(_services.TextService); // bind aabb updater
|
|
@@ -62,7 +63,7 @@ var containerModule = (0, _manaSyringe.Module)(function (register) {
|
|
|
62
63
|
}); // bind CSS property handlers
|
|
63
64
|
|
|
64
65
|
register(_css.LayoutRegistry);
|
|
65
|
-
register(_css.
|
|
66
|
+
register(_css.DefaultStyleValueRegistry);
|
|
66
67
|
register(_css.CSSPropertyLengthOrPercentage);
|
|
67
68
|
register(_css.CSSPropertyLocalPosition);
|
|
68
69
|
register(_css.CSSPropertyOpacity);
|
|
@@ -80,6 +81,90 @@ var containerModule = (0, _manaSyringe.Module)(function (register) {
|
|
|
80
81
|
register(_css.CSSPropertyPoints);
|
|
81
82
|
register(_css.CSSPropertyClipPath);
|
|
82
83
|
register(_css.CSSPropertyText);
|
|
83
|
-
register(_css.CSSPropertyTextTransform);
|
|
84
|
+
register(_css.CSSPropertyTextTransform); // bind layout engine
|
|
85
|
+
|
|
86
|
+
register(_layout.LayoutEngine);
|
|
87
|
+
register(_layout.LayoutEdges);
|
|
88
|
+
register({
|
|
89
|
+
token: _layout.LayoutEdgesFactory,
|
|
90
|
+
useFactory: function useFactory(context) {
|
|
91
|
+
return function (options) {
|
|
92
|
+
var container = context.container.createChild();
|
|
93
|
+
container.register({
|
|
94
|
+
token: _layout.LayoutEdgesOptions,
|
|
95
|
+
useValue: options
|
|
96
|
+
});
|
|
97
|
+
return container.get(_layout.LayoutEdges);
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
register({
|
|
102
|
+
token: _layout.LayoutContextFactory,
|
|
103
|
+
useFactory: function useFactory(context) {
|
|
104
|
+
return function (options) {
|
|
105
|
+
var container = context.container.createChild();
|
|
106
|
+
container.register(_layout.LayoutContext);
|
|
107
|
+
container.register(_layout.LayoutChildren);
|
|
108
|
+
container.register({
|
|
109
|
+
token: _layout.LayoutChildrenFactory,
|
|
110
|
+
useFactory: function useFactory(childContext) {
|
|
111
|
+
return function (childOptions) {
|
|
112
|
+
var childContainer = childContext.container.createChild();
|
|
113
|
+
childContainer.register({
|
|
114
|
+
token: _layout.LayoutChildrenOptions,
|
|
115
|
+
useValue: childOptions
|
|
116
|
+
});
|
|
117
|
+
return childContainer.get(_layout.LayoutChildren);
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
container.register(_layout.FragmentResult);
|
|
122
|
+
container.register({
|
|
123
|
+
token: _layout.FragmentResultFactory,
|
|
124
|
+
useFactory: function useFactory(childContext) {
|
|
125
|
+
return function (childOptions, node) {
|
|
126
|
+
var childContainer = childContext.container.createChild();
|
|
127
|
+
childContainer.register({
|
|
128
|
+
token: _layout.FragmentResultOptions,
|
|
129
|
+
useValue: childOptions
|
|
130
|
+
});
|
|
131
|
+
childContainer.register({
|
|
132
|
+
token: _layout.ContextNode,
|
|
133
|
+
useValue: node
|
|
134
|
+
});
|
|
135
|
+
return childContainer.get(_layout.FragmentResult);
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
container.register(_layout.LayoutFragment);
|
|
140
|
+
container.register({
|
|
141
|
+
token: _layout.LayoutFragmentFactory,
|
|
142
|
+
useFactory: function useFactory(childContext) {
|
|
143
|
+
return function (childOptions) {
|
|
144
|
+
var childContainer = childContext.container.createChild();
|
|
145
|
+
childContainer.register({
|
|
146
|
+
token: _layout.LayoutFragmentOptions,
|
|
147
|
+
useValue: childOptions
|
|
148
|
+
});
|
|
149
|
+
return childContainer.get(_layout.LayoutFragment);
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
var layoutChildrenFactory = container.get(_layout.LayoutChildrenFactory);
|
|
154
|
+
var layoutFragmentFactory = container.get(_layout.LayoutFragmentFactory);
|
|
155
|
+
var fragmentResultFactory = container.get(_layout.FragmentResultFactory);
|
|
156
|
+
container.register({
|
|
157
|
+
token: _layout.LayoutContextOptions,
|
|
158
|
+
useValue: (0, _tslib.__assign)((0, _tslib.__assign)({}, options), {
|
|
159
|
+
layoutChildrenFactory: layoutChildrenFactory,
|
|
160
|
+
layoutFragmentFactory: layoutFragmentFactory,
|
|
161
|
+
fragmentResultFactory: fragmentResultFactory
|
|
162
|
+
})
|
|
163
|
+
});
|
|
164
|
+
var layoutContext = container.get(_layout.LayoutContext);
|
|
165
|
+
return layoutContext;
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
});
|
|
84
169
|
});
|
|
85
170
|
exports.containerModule = containerModule;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import 'reflect-metadata';
|
|
2
2
|
import * as ManaSyringe from 'mana-syringe';
|
|
3
|
+
import { LayoutEngine } from './css/layout';
|
|
3
4
|
export { ManaSyringe };
|
|
5
|
+
declare const layoutEngine: LayoutEngine;
|
|
6
|
+
export { layoutEngine };
|
|
4
7
|
export * from './types';
|
|
5
8
|
export * from './css';
|
|
6
9
|
export * from './dom';
|
package/lib/index.js
CHANGED
|
@@ -6,9 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
var _exportNames = {
|
|
9
|
+
layoutEngine: true,
|
|
9
10
|
ManaSyringe: true
|
|
10
11
|
};
|
|
11
|
-
exports.ManaSyringe = void 0;
|
|
12
|
+
exports.layoutEngine = exports.ManaSyringe = void 0;
|
|
12
13
|
|
|
13
14
|
require("reflect-metadata");
|
|
14
15
|
|
|
@@ -18,6 +19,8 @@ exports.ManaSyringe = ManaSyringe;
|
|
|
18
19
|
|
|
19
20
|
var _globalModule = require("./global-module");
|
|
20
21
|
|
|
22
|
+
var _layout = require("./css/layout");
|
|
23
|
+
|
|
21
24
|
var _types = require("./types");
|
|
22
25
|
|
|
23
26
|
Object.keys(_types).forEach(function (key) {
|
|
@@ -190,4 +193,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
190
193
|
|
|
191
194
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
192
195
|
|
|
193
|
-
ManaSyringe.GlobalContainer.load(_globalModule.containerModule);
|
|
196
|
+
ManaSyringe.GlobalContainer.load(_globalModule.containerModule);
|
|
197
|
+
var layoutEngine = ManaSyringe.GlobalContainer.get(_layout.LayoutEngine);
|
|
198
|
+
exports.layoutEngine = layoutEngine;
|
|
@@ -11,6 +11,7 @@ export interface CullingStrategyContribution {
|
|
|
11
11
|
* 2. other custom culling strategies, eg. frustum culling
|
|
12
12
|
*/
|
|
13
13
|
export declare class CullingPlugin implements RenderingPlugin {
|
|
14
|
+
static tag: string;
|
|
14
15
|
private strategyProvider;
|
|
15
16
|
apply(renderingService: RenderingService): void;
|
|
16
17
|
}
|
|
@@ -26,9 +26,11 @@ var CullingPlugin =
|
|
|
26
26
|
function () {
|
|
27
27
|
function CullingPlugin() {}
|
|
28
28
|
|
|
29
|
+
CullingPlugin_1 = CullingPlugin;
|
|
30
|
+
|
|
29
31
|
CullingPlugin.prototype.apply = function (renderingService) {
|
|
30
32
|
var strategies = this.strategyProvider.getContributions();
|
|
31
|
-
renderingService.hooks.cull.tap(function (object) {
|
|
33
|
+
renderingService.hooks.cull.tap(CullingPlugin_1.tag, function (object) {
|
|
32
34
|
if (object) {
|
|
33
35
|
var cullable = object.cullable;
|
|
34
36
|
|
|
@@ -50,13 +52,15 @@ function () {
|
|
|
50
52
|
|
|
51
53
|
return object;
|
|
52
54
|
});
|
|
53
|
-
renderingService.hooks.afterRender.tap(function (object) {
|
|
55
|
+
renderingService.hooks.afterRender.tap(CullingPlugin_1.tag, function (object) {
|
|
54
56
|
object.cullable.visibilityPlaneMask = -1;
|
|
55
57
|
});
|
|
56
58
|
};
|
|
57
59
|
|
|
60
|
+
var CullingPlugin_1;
|
|
61
|
+
CullingPlugin.tag = 'Culling';
|
|
58
62
|
(0, _tslib.__decorate)([(0, _manaSyringe.contrib)(CullingStrategyContribution), (0, _tslib.__metadata)("design:type", Object)], CullingPlugin.prototype, "strategyProvider", void 0);
|
|
59
|
-
CullingPlugin = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)({
|
|
63
|
+
CullingPlugin = CullingPlugin_1 = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)({
|
|
60
64
|
contrib: _RenderingService.RenderingPluginContribution
|
|
61
65
|
})], CullingPlugin);
|
|
62
66
|
return CullingPlugin;
|
|
@@ -3,6 +3,7 @@ import type { RenderingService, RenderingPlugin } from '../services/RenderingSer
|
|
|
3
3
|
* Filter dirty renderables and calculate the "dirty rectangle" which will be clear when frame began
|
|
4
4
|
*/
|
|
5
5
|
export declare class DirtyCheckPlugin implements RenderingPlugin {
|
|
6
|
+
static tag: string;
|
|
6
7
|
private canvasConfig;
|
|
7
8
|
private renderingContext;
|
|
8
9
|
apply(renderingService: RenderingService): void;
|
|
@@ -23,10 +23,12 @@ var DirtyCheckPlugin =
|
|
|
23
23
|
function () {
|
|
24
24
|
function DirtyCheckPlugin() {}
|
|
25
25
|
|
|
26
|
+
DirtyCheckPlugin_1 = DirtyCheckPlugin;
|
|
27
|
+
|
|
26
28
|
DirtyCheckPlugin.prototype.apply = function (renderingService) {
|
|
27
29
|
var _this = this;
|
|
28
30
|
|
|
29
|
-
renderingService.hooks.dirtycheck.tap(function (object) {
|
|
31
|
+
renderingService.hooks.dirtycheck.tap(DirtyCheckPlugin_1.tag, function (object) {
|
|
30
32
|
if (object) {
|
|
31
33
|
var enableDirtyCheck = _this.canvasConfig.renderer.getConfig().enableDirtyCheck;
|
|
32
34
|
|
|
@@ -48,9 +50,11 @@ function () {
|
|
|
48
50
|
});
|
|
49
51
|
};
|
|
50
52
|
|
|
53
|
+
var DirtyCheckPlugin_1;
|
|
54
|
+
DirtyCheckPlugin.tag = 'DirtyCheck';
|
|
51
55
|
(0, _tslib.__decorate)([(0, _manaSyringe.inject)(_types.CanvasConfig), (0, _tslib.__metadata)("design:type", Object)], DirtyCheckPlugin.prototype, "canvasConfig", void 0);
|
|
52
56
|
(0, _tslib.__decorate)([(0, _manaSyringe.inject)(_RenderingContext.RenderingContext), (0, _tslib.__metadata)("design:type", Object)], DirtyCheckPlugin.prototype, "renderingContext", void 0);
|
|
53
|
-
DirtyCheckPlugin = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)({
|
|
57
|
+
DirtyCheckPlugin = DirtyCheckPlugin_1 = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)({
|
|
54
58
|
contrib: _RenderingService.RenderingPluginContribution
|
|
55
59
|
})], DirtyCheckPlugin);
|
|
56
60
|
return DirtyCheckPlugin;
|
|
@@ -7,6 +7,7 @@ import { RenderingService } from '../services';
|
|
|
7
7
|
* also provide some extra events such as `drag`
|
|
8
8
|
*/
|
|
9
9
|
export declare class EventPlugin implements RenderingPlugin {
|
|
10
|
+
static tag: string;
|
|
10
11
|
private canvasConfig;
|
|
11
12
|
private contextService;
|
|
12
13
|
private renderingService;
|
|
@@ -55,6 +55,8 @@ function () {
|
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
EventPlugin_1 = EventPlugin;
|
|
59
|
+
|
|
58
60
|
EventPlugin.prototype.apply = function (renderingService) {
|
|
59
61
|
var _this = this;
|
|
60
62
|
|
|
@@ -67,7 +69,7 @@ function () {
|
|
|
67
69
|
case 0:
|
|
68
70
|
return [4
|
|
69
71
|
/*yield*/
|
|
70
|
-
, this.renderingService.hooks.pick.
|
|
72
|
+
, this.renderingService.hooks.pick.promise({
|
|
71
73
|
position: position,
|
|
72
74
|
picked: [],
|
|
73
75
|
topmost: true // we only concern the topmost element
|
|
@@ -83,12 +85,12 @@ function () {
|
|
|
83
85
|
});
|
|
84
86
|
});
|
|
85
87
|
});
|
|
86
|
-
renderingService.hooks.pointerWheel.tap(function (nativeEvent) {
|
|
88
|
+
renderingService.hooks.pointerWheel.tap(EventPlugin_1.tag, function (nativeEvent) {
|
|
87
89
|
var wheelEvent = _this.normalizeWheelEvent(nativeEvent);
|
|
88
90
|
|
|
89
91
|
_this.eventService.mapEvent(wheelEvent);
|
|
90
92
|
});
|
|
91
|
-
renderingService.hooks.pointerDown.tap(function (nativeEvent) {
|
|
93
|
+
renderingService.hooks.pointerDown.tap(EventPlugin_1.tag, function (nativeEvent) {
|
|
92
94
|
if (canvas.supportTouchEvent && nativeEvent.pointerType === 'touch') {
|
|
93
95
|
return;
|
|
94
96
|
}
|
|
@@ -109,7 +111,7 @@ function () {
|
|
|
109
111
|
|
|
110
112
|
_this.setCursor(_this.eventService.cursor);
|
|
111
113
|
});
|
|
112
|
-
renderingService.hooks.pointerUp.tap(function (nativeEvent) {
|
|
114
|
+
renderingService.hooks.pointerUp.tap(EventPlugin_1.tag, function (nativeEvent) {
|
|
113
115
|
if (canvas.supportTouchEvent && nativeEvent.pointerType === 'touch') return; // account for element in SVG
|
|
114
116
|
|
|
115
117
|
var $element = _this.contextService.getDomElement();
|
|
@@ -128,10 +130,10 @@ function () {
|
|
|
128
130
|
|
|
129
131
|
_this.setCursor(_this.eventService.cursor);
|
|
130
132
|
});
|
|
131
|
-
renderingService.hooks.pointerMove.tap(this.onPointerMove);
|
|
132
|
-
renderingService.hooks.pointerOver.tap(this.onPointerMove);
|
|
133
|
-
renderingService.hooks.pointerOut.tap(this.onPointerMove);
|
|
134
|
-
renderingService.hooks.pointerCancel.tap(function (nativeEvent) {
|
|
133
|
+
renderingService.hooks.pointerMove.tap(EventPlugin_1.tag, this.onPointerMove);
|
|
134
|
+
renderingService.hooks.pointerOver.tap(EventPlugin_1.tag, this.onPointerMove);
|
|
135
|
+
renderingService.hooks.pointerOut.tap(EventPlugin_1.tag, this.onPointerMove);
|
|
136
|
+
renderingService.hooks.pointerCancel.tap(EventPlugin_1.tag, function (nativeEvent) {
|
|
135
137
|
if (canvas.supportTouchEvent && nativeEvent.pointerType === 'touch') {
|
|
136
138
|
return;
|
|
137
139
|
}
|
|
@@ -364,12 +366,14 @@ function () {
|
|
|
364
366
|
}
|
|
365
367
|
};
|
|
366
368
|
|
|
369
|
+
var EventPlugin_1;
|
|
370
|
+
EventPlugin.tag = 'Event';
|
|
367
371
|
(0, _tslib.__decorate)([(0, _manaSyringe.inject)(_types.CanvasConfig), (0, _tslib.__metadata)("design:type", Object)], EventPlugin.prototype, "canvasConfig", void 0);
|
|
368
372
|
(0, _tslib.__decorate)([(0, _manaSyringe.inject)(_services.ContextService), (0, _tslib.__metadata)("design:type", Object)], EventPlugin.prototype, "contextService", void 0);
|
|
369
373
|
(0, _tslib.__decorate)([(0, _manaSyringe.inject)(_services.RenderingService), (0, _tslib.__metadata)("design:type", _services.RenderingService)], EventPlugin.prototype, "renderingService", void 0);
|
|
370
374
|
(0, _tslib.__decorate)([(0, _manaSyringe.inject)(_services.RenderingContext), (0, _tslib.__metadata)("design:type", Object)], EventPlugin.prototype, "renderingContext", void 0);
|
|
371
375
|
(0, _tslib.__decorate)([(0, _manaSyringe.inject)(_services.EventService), (0, _tslib.__metadata)("design:type", _services.EventService)], EventPlugin.prototype, "eventService", void 0);
|
|
372
|
-
EventPlugin = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)({
|
|
376
|
+
EventPlugin = EventPlugin_1 = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)({
|
|
373
377
|
contrib: _services.RenderingPluginContribution
|
|
374
378
|
})], EventPlugin);
|
|
375
379
|
return EventPlugin;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { RenderingService, RenderingPlugin } from '../services';
|
|
2
2
|
export declare class PrepareRendererPlugin implements RenderingPlugin {
|
|
3
|
+
static tag: string;
|
|
3
4
|
private renderingContext;
|
|
4
5
|
private styleValueRegistry;
|
|
5
6
|
apply(renderingService: RenderingService): void;
|
|
@@ -9,7 +9,7 @@ var _tslib = require("tslib");
|
|
|
9
9
|
|
|
10
10
|
var _manaSyringe = require("mana-syringe");
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _interfaces = require("../css/interfaces");
|
|
13
13
|
|
|
14
14
|
var _dom = require("../dom");
|
|
15
15
|
|
|
@@ -20,6 +20,8 @@ var PrepareRendererPlugin =
|
|
|
20
20
|
function () {
|
|
21
21
|
function PrepareRendererPlugin() {}
|
|
22
22
|
|
|
23
|
+
PrepareRendererPlugin_1 = PrepareRendererPlugin;
|
|
24
|
+
|
|
23
25
|
PrepareRendererPlugin.prototype.apply = function (renderingService) {
|
|
24
26
|
var _this = this;
|
|
25
27
|
|
|
@@ -48,7 +50,7 @@ function () {
|
|
|
48
50
|
renderingService.dirtify();
|
|
49
51
|
};
|
|
50
52
|
|
|
51
|
-
renderingService.hooks.init.tapPromise(function () {
|
|
53
|
+
renderingService.hooks.init.tapPromise(PrepareRendererPlugin_1.tag, function () {
|
|
52
54
|
return (0, _tslib.__awaiter)(_this, void 0, void 0, function () {
|
|
53
55
|
return (0, _tslib.__generator)(this, function (_a) {
|
|
54
56
|
this.renderingContext.root.addEventListener(_dom.ElementEvent.MOUNTED, handleMounted);
|
|
@@ -61,7 +63,7 @@ function () {
|
|
|
61
63
|
});
|
|
62
64
|
});
|
|
63
65
|
});
|
|
64
|
-
renderingService.hooks.destroy.tap(function () {
|
|
66
|
+
renderingService.hooks.destroy.tap(PrepareRendererPlugin_1.tag, function () {
|
|
65
67
|
_this.renderingContext.root.removeEventListener(_dom.ElementEvent.MOUNTED, handleMounted);
|
|
66
68
|
|
|
67
69
|
_this.renderingContext.root.removeEventListener(_dom.ElementEvent.UNMOUNTED, handleUnmounted);
|
|
@@ -72,9 +74,11 @@ function () {
|
|
|
72
74
|
});
|
|
73
75
|
};
|
|
74
76
|
|
|
77
|
+
var PrepareRendererPlugin_1;
|
|
78
|
+
PrepareRendererPlugin.tag = 'Prepare';
|
|
75
79
|
(0, _tslib.__decorate)([(0, _manaSyringe.inject)(_services.RenderingContext), (0, _tslib.__metadata)("design:type", Object)], PrepareRendererPlugin.prototype, "renderingContext", void 0);
|
|
76
|
-
(0, _tslib.__decorate)([(0, _manaSyringe.inject)(
|
|
77
|
-
PrepareRendererPlugin = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)({
|
|
80
|
+
(0, _tslib.__decorate)([(0, _manaSyringe.inject)(_interfaces.StyleValueRegistry), (0, _tslib.__metadata)("design:type", Object)], PrepareRendererPlugin.prototype, "styleValueRegistry", void 0);
|
|
81
|
+
PrepareRendererPlugin = PrepareRendererPlugin_1 = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)({
|
|
78
82
|
contrib: _services.RenderingPluginContribution
|
|
79
83
|
})], PrepareRendererPlugin);
|
|
80
84
|
return PrepareRendererPlugin;
|
|
@@ -212,8 +212,7 @@ function (_super) {
|
|
|
212
212
|
e = _a.sent();
|
|
213
213
|
this.dispatchEvent(e, 'pointerdown');
|
|
214
214
|
|
|
215
|
-
if (e.pointerType === 'touch') {
|
|
216
|
-
this.dispatchEvent(e, 'touchstart');
|
|
215
|
+
if (e.pointerType === 'touch') {// this.dispatchEvent(e, 'touchstart');
|
|
217
216
|
} else if (e.pointerType === 'mouse' || e.pointerType === 'pen') {
|
|
218
217
|
isRightButton = e.button === 2;
|
|
219
218
|
this.dispatchEvent(e, isRightButton ? 'rightdown' : 'mousedown');
|
|
@@ -251,8 +250,7 @@ function (_super) {
|
|
|
251
250
|
e = _a.sent();
|
|
252
251
|
this.dispatchEvent(e, 'pointerup');
|
|
253
252
|
|
|
254
|
-
if (e.pointerType === 'touch') {
|
|
255
|
-
this.dispatchEvent(e, 'touchend');
|
|
253
|
+
if (e.pointerType === 'touch') {// this.dispatchEvent(e, 'touchend');
|
|
256
254
|
} else if (e.pointerType === 'mouse' || e.pointerType === 'pen') {
|
|
257
255
|
isRightButton = e.button === 2;
|
|
258
256
|
this.dispatchEvent(e, isRightButton ? 'rightup' : 'mouseup');
|
|
@@ -378,7 +376,11 @@ function (_super) {
|
|
|
378
376
|
while (leaveEvent.target && !e.composedPath().includes(leaveEvent.target)) {
|
|
379
377
|
leaveEvent.currentTarget = leaveEvent.target;
|
|
380
378
|
this.notifyTarget(leaveEvent);
|
|
381
|
-
|
|
379
|
+
|
|
380
|
+
if (isMouse) {
|
|
381
|
+
// console.error(leaveEvent.target);
|
|
382
|
+
this.notifyTarget(leaveEvent, 'mouseleave');
|
|
383
|
+
}
|
|
382
384
|
|
|
383
385
|
if (_Node.Node.isNode(leaveEvent.target)) {
|
|
384
386
|
leaveEvent.target = leaveEvent.target.parentNode;
|
|
@@ -429,8 +431,7 @@ function (_super) {
|
|
|
429
431
|
} // Then pointermove
|
|
430
432
|
|
|
431
433
|
|
|
432
|
-
this.dispatchEvent(e, 'pointermove');
|
|
433
|
-
if (e.pointerType === 'touch') this.dispatchEvent(e, 'touchmove');
|
|
434
|
+
this.dispatchEvent(e, 'pointermove'); // if (e.pointerType === 'touch') this.dispatchEvent(e, 'touchmove');
|
|
434
435
|
|
|
435
436
|
if (isMouse) {
|
|
436
437
|
this.dispatchEvent(e, 'mousemove');
|
|
@@ -484,7 +485,11 @@ function (_super) {
|
|
|
484
485
|
while (leaveEvent.target && leaveEvent.target !== (_Node.Node.isNode(this.rootTarget) && this.rootTarget.parentNode)) {
|
|
485
486
|
leaveEvent.currentTarget = leaveEvent.target;
|
|
486
487
|
this.notifyTarget(leaveEvent);
|
|
487
|
-
|
|
488
|
+
|
|
489
|
+
if (isMouse) {
|
|
490
|
+
// console.error(leaveEvent.target, 'out');
|
|
491
|
+
this.notifyTarget(leaveEvent, 'mouseleave');
|
|
492
|
+
}
|
|
488
493
|
|
|
489
494
|
if (_Node.Node.isNode(leaveEvent.target)) {
|
|
490
495
|
leaveEvent.target = leaveEvent.target.parentNode;
|
|
@@ -586,8 +591,7 @@ function (_super) {
|
|
|
586
591
|
e.currentTarget = currentTarget;
|
|
587
592
|
this.notifyTarget(e, 'pointerupoutside');
|
|
588
593
|
|
|
589
|
-
if (e.pointerType === 'touch') {
|
|
590
|
-
this.notifyTarget(e, 'touchendoutside');
|
|
594
|
+
if (e.pointerType === 'touch') {// this.notifyTarget(e, 'touchendoutside');
|
|
591
595
|
} else if (e.pointerType === 'mouse' || e.pointerType === 'pen') {
|
|
592
596
|
this.notifyTarget(e, e.button === 2 ? 'rightupoutside' : 'mouseupoutside');
|
|
593
597
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* used in following scenes:
|
|
4
4
|
* - g `ctx.measureText`
|
|
5
5
|
* - g-plugin-canvas-picker `ctx.isPointInPath`
|
|
6
|
-
* - g-plugin-
|
|
6
|
+
* - g-plugin-device-renderer `ctx.createLinearGradient` and generate texture
|
|
7
7
|
*/
|
|
8
8
|
export declare class OffscreenCanvasCreator {
|
|
9
9
|
private canvas;
|
|
@@ -13,7 +13,7 @@ var _manaSyringe = require("mana-syringe");
|
|
|
13
13
|
* used in following scenes:
|
|
14
14
|
* - g `ctx.measureText`
|
|
15
15
|
* - g-plugin-canvas-picker `ctx.isPointInPath`
|
|
16
|
-
* - g-plugin-
|
|
16
|
+
* - g-plugin-device-renderer `ctx.createLinearGradient` and generate texture
|
|
17
17
|
*/
|
|
18
18
|
var OffscreenCanvasCreator =
|
|
19
19
|
/** @class */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Syringe } from 'mana-syringe';
|
|
2
|
-
import { SyncHook, SyncWaterfallHook, AsyncParallelHook, AsyncSeriesWaterfallHook } from '
|
|
2
|
+
import { SyncHook, SyncWaterfallHook, AsyncParallelHook, AsyncSeriesWaterfallHook } from 'tapable';
|
|
3
3
|
import type { DisplayObject } from '../display-objects';
|
|
4
4
|
import type { CanvasConfig, EventPosition, InteractivePointerEvent } from '../types';
|
|
5
5
|
export interface RenderingPlugin {
|
|
@@ -38,47 +38,47 @@ export declare class RenderingService {
|
|
|
38
38
|
/**
|
|
39
39
|
* called before any frame rendered
|
|
40
40
|
*/
|
|
41
|
-
init: AsyncParallelHook<[],
|
|
41
|
+
init: AsyncParallelHook<[], import("tapable").UnsetAdditionalOptions>;
|
|
42
42
|
/**
|
|
43
43
|
* only dirty object which has sth changed will be rendered
|
|
44
44
|
*/
|
|
45
|
-
dirtycheck: SyncWaterfallHook<[DisplayObject<any, any>],
|
|
45
|
+
dirtycheck: SyncWaterfallHook<[DisplayObject<any, any>], import("tapable").UnsetAdditionalOptions>;
|
|
46
46
|
/**
|
|
47
47
|
* do culling
|
|
48
48
|
*/
|
|
49
|
-
cull: SyncWaterfallHook<[DisplayObject<any, any>],
|
|
49
|
+
cull: SyncWaterfallHook<[DisplayObject<any, any>], import("tapable").UnsetAdditionalOptions>;
|
|
50
50
|
/**
|
|
51
51
|
* called at beginning of each frame, won't get called if nothing to re-render
|
|
52
52
|
*/
|
|
53
|
-
beginFrame: SyncHook<[], void>;
|
|
53
|
+
beginFrame: SyncHook<[], void, import("tapable").UnsetAdditionalOptions>;
|
|
54
54
|
/**
|
|
55
55
|
* called before every dirty object get rendered
|
|
56
56
|
*/
|
|
57
|
-
beforeRender: SyncHook<[DisplayObject<any, any>], void>;
|
|
57
|
+
beforeRender: SyncHook<[DisplayObject<any, any>], void, import("tapable").UnsetAdditionalOptions>;
|
|
58
58
|
/**
|
|
59
59
|
* called when every dirty object rendering even it's culled
|
|
60
60
|
*/
|
|
61
|
-
render: SyncHook<[DisplayObject<any, any>], void>;
|
|
61
|
+
render: SyncHook<[DisplayObject<any, any>], void, import("tapable").UnsetAdditionalOptions>;
|
|
62
62
|
/**
|
|
63
63
|
* called after every dirty object get rendered
|
|
64
64
|
*/
|
|
65
|
-
afterRender: SyncHook<[DisplayObject<any, any>], void>;
|
|
66
|
-
endFrame: SyncHook<[], void>;
|
|
67
|
-
destroy: SyncHook<[], void>;
|
|
65
|
+
afterRender: SyncHook<[DisplayObject<any, any>], void, import("tapable").UnsetAdditionalOptions>;
|
|
66
|
+
endFrame: SyncHook<[], void, import("tapable").UnsetAdditionalOptions>;
|
|
67
|
+
destroy: SyncHook<[], void, import("tapable").UnsetAdditionalOptions>;
|
|
68
68
|
/**
|
|
69
|
-
* use async but faster method such as GPU-based picking in `g-plugin-
|
|
69
|
+
* use async but faster method such as GPU-based picking in `g-plugin-device-renderer`
|
|
70
70
|
*/
|
|
71
71
|
pick: AsyncSeriesWaterfallHook<[PickingResult], PickingResult>;
|
|
72
72
|
/**
|
|
73
73
|
* used in event system
|
|
74
74
|
*/
|
|
75
|
-
pointerDown: SyncHook<[InteractivePointerEvent], void>;
|
|
76
|
-
pointerUp: SyncHook<[InteractivePointerEvent], void>;
|
|
77
|
-
pointerMove: SyncHook<[InteractivePointerEvent], void>;
|
|
78
|
-
pointerOut: SyncHook<[InteractivePointerEvent], void>;
|
|
79
|
-
pointerOver: SyncHook<[InteractivePointerEvent], void>;
|
|
80
|
-
|
|
81
|
-
|
|
75
|
+
pointerDown: SyncHook<[InteractivePointerEvent], void, import("tapable").UnsetAdditionalOptions>;
|
|
76
|
+
pointerUp: SyncHook<[InteractivePointerEvent], void, import("tapable").UnsetAdditionalOptions>;
|
|
77
|
+
pointerMove: SyncHook<[InteractivePointerEvent], void, import("tapable").UnsetAdditionalOptions>;
|
|
78
|
+
pointerOut: SyncHook<[InteractivePointerEvent], void, import("tapable").UnsetAdditionalOptions>;
|
|
79
|
+
pointerOver: SyncHook<[InteractivePointerEvent], void, import("tapable").UnsetAdditionalOptions>;
|
|
80
|
+
pointerWheel: SyncHook<[InteractivePointerEvent], void, import("tapable").UnsetAdditionalOptions>;
|
|
81
|
+
pointerCancel: SyncHook<[InteractivePointerEvent], void, import("tapable").UnsetAdditionalOptions>;
|
|
82
82
|
};
|
|
83
83
|
init(): Promise<void>;
|
|
84
84
|
getStats(): {
|