@univerjs/engine-render 0.10.1 → 0.10.2
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/lib/cjs/index.js +1 -1
- package/lib/es/index.js +1806 -1724
- package/lib/index.js +1806 -1724
- package/lib/types/base-object.d.ts +1 -0
- package/lib/types/scene.d.ts +11 -3
- package/lib/types/scene.input-manager.d.ts +7 -0
- package/lib/types/shape/scroll-bar.d.ts +17 -27
- package/lib/types/shape/shape.d.ts +2 -1
- package/lib/umd/index.js +1 -1
- package/package.json +4 -4
|
@@ -139,6 +139,7 @@ export declare abstract class BaseObject extends Disposable {
|
|
|
139
139
|
skew(skewX?: number, skewY?: number): this;
|
|
140
140
|
flip(flipX?: boolean, flipY?: boolean): this;
|
|
141
141
|
/**
|
|
142
|
+
* Similar to setProps, but only props in BASE_OBJECT_ARRAY_Set
|
|
142
143
|
* this[pKey] = option[pKey]
|
|
143
144
|
* @param option
|
|
144
145
|
*/
|
package/lib/types/scene.d.ts
CHANGED
|
@@ -152,12 +152,18 @@ export declare class Scene extends Disposable {
|
|
|
152
152
|
getParent(): Engine | SceneViewer;
|
|
153
153
|
getEngine(): Nullable<Engine>;
|
|
154
154
|
getLayers(): Layer[];
|
|
155
|
+
/**
|
|
156
|
+
* Get layer by zIndex.
|
|
157
|
+
* This method would create a new Layer if Layer is not exist.
|
|
158
|
+
* @param zIndex
|
|
159
|
+
*/
|
|
155
160
|
getLayer(zIndex?: number): Layer;
|
|
156
161
|
findLayerByZIndex(zIndex?: number): Nullable<Layer>;
|
|
157
162
|
getLayerMaxZIndex(): number;
|
|
158
163
|
addLayer(...argument: Layer[]): void;
|
|
159
164
|
/**
|
|
160
|
-
* Add objects to Layer( Layer is
|
|
165
|
+
* Add objects to Layer( Layer is specified by zIndex)
|
|
166
|
+
* This method would create a new Layer if Layer is not exist.
|
|
161
167
|
* If object is a group, insert all its children and group itself to _objects[].
|
|
162
168
|
* @param objects
|
|
163
169
|
* @param zIndex
|
|
@@ -166,7 +172,8 @@ export declare class Scene extends Disposable {
|
|
|
166
172
|
addObjects(objects: BaseObject[], zIndex?: number): Scene;
|
|
167
173
|
/**
|
|
168
174
|
* Add object to Layer (Layer is specified by zIndex).
|
|
169
|
-
*
|
|
175
|
+
* This method would create a new Layer if Layer is not exist.
|
|
176
|
+
* And if object is a group, insert all its children and group itself to _objects[].
|
|
170
177
|
* @param o
|
|
171
178
|
* @param zIndex layer index
|
|
172
179
|
* @returns {Scene} scene
|
|
@@ -312,8 +319,9 @@ export declare class Scene extends Disposable {
|
|
|
312
319
|
*/
|
|
313
320
|
private _transformHandler;
|
|
314
321
|
/**
|
|
322
|
+
* Disable scene.event
|
|
315
323
|
* If scene.event is disabled, scene.pick(cursor Pos) return null.
|
|
316
|
-
*
|
|
324
|
+
* After disableObjectsEvent, only the scene itself can respond to pointer events; objects beneath the scene will not.
|
|
317
325
|
* see sceneInputManager@_onPointerMove
|
|
318
326
|
*/
|
|
319
327
|
disableObjectsEvent(): void;
|
|
@@ -66,6 +66,13 @@ export declare class InputManager extends Disposable {
|
|
|
66
66
|
* @param currentObject
|
|
67
67
|
* @returns
|
|
68
68
|
*/
|
|
69
|
+
/**
|
|
70
|
+
* If return true, the event will be dispatched to Scene
|
|
71
|
+
* Even Scene is not a object, but scene could handle event.
|
|
72
|
+
* currentObject is null, return true
|
|
73
|
+
* @param currentObject
|
|
74
|
+
* @returns boolean
|
|
75
|
+
*/
|
|
69
76
|
private _shouldDispatchEventToScene;
|
|
70
77
|
private _isObjectInSceneViewer;
|
|
71
78
|
/**
|
|
@@ -33,34 +33,16 @@ export interface IScrollBarProps {
|
|
|
33
33
|
minThumbSizeV?: number;
|
|
34
34
|
}
|
|
35
35
|
export declare class ScrollBar extends Disposable {
|
|
36
|
-
_enableHorizontal
|
|
37
|
-
_enableVertical
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
horizonScrollTrack: Nullable<Rect>;
|
|
42
|
-
horizonThumbRect: Nullable<Rect>;
|
|
43
|
-
verticalThumbSize: number;
|
|
44
|
-
verticalTrackHeight: number;
|
|
45
|
-
verticalMinusMiniThumb: number;
|
|
46
|
-
verticalScrollTrack: Nullable<Rect>;
|
|
47
|
-
verticalThumbRect: Nullable<Rect>;
|
|
48
|
-
placeholderBarRect: Nullable<Rect>;
|
|
36
|
+
private _enableHorizontal;
|
|
37
|
+
private _enableVertical;
|
|
38
|
+
private _horizontalMetrics;
|
|
39
|
+
private _verticalMetrics;
|
|
40
|
+
private _scrollElements;
|
|
49
41
|
protected _viewport: Viewport;
|
|
50
42
|
private _mainScene;
|
|
51
|
-
private
|
|
52
|
-
private
|
|
53
|
-
private
|
|
54
|
-
private _isVerticalMove;
|
|
55
|
-
private _horizonPointerMoveSub;
|
|
56
|
-
private _horizonPointerUpSub;
|
|
57
|
-
private _verticalPointerMoveSub;
|
|
58
|
-
private _verticalPointerUpSub;
|
|
59
|
-
private _thumbDefaultBackgroundColor;
|
|
60
|
-
private _thumbHoverBackgroundColor;
|
|
61
|
-
private _thumbActiveBackgroundColor;
|
|
62
|
-
private _trackBackgroundColor;
|
|
63
|
-
private _trackBorderColor;
|
|
43
|
+
private _pointerState;
|
|
44
|
+
private _subscriptions;
|
|
45
|
+
private _colors;
|
|
64
46
|
/**
|
|
65
47
|
* The thickness of a scrolling track
|
|
66
48
|
* ThumbSize = trackSize - thumbMargin * 2
|
|
@@ -85,6 +67,8 @@ export declare class ScrollBar extends Disposable {
|
|
|
85
67
|
private _eventSub;
|
|
86
68
|
constructor(view: Viewport, props?: IScrollBarProps);
|
|
87
69
|
setProps(props?: IScrollBarProps): void;
|
|
70
|
+
get verticalScrollTrack(): Nullable<Rect<import('./rect').IRectProps>>;
|
|
71
|
+
get horizonScrollTrack(): Nullable<Rect<import('./rect').IRectProps>>;
|
|
88
72
|
get enableHorizontal(): boolean;
|
|
89
73
|
set enableHorizontal(val: boolean);
|
|
90
74
|
get enableVertical(): boolean;
|
|
@@ -95,6 +79,10 @@ export declare class ScrollBar extends Disposable {
|
|
|
95
79
|
get ratioScrollY(): number;
|
|
96
80
|
get miniThumbRatioX(): number;
|
|
97
81
|
get miniThumbRatioY(): number;
|
|
82
|
+
get horizontalTrackWidth(): number;
|
|
83
|
+
get horizontalThumbSize(): number;
|
|
84
|
+
get verticalTrackHeight(): number;
|
|
85
|
+
get verticalThumbSize(): number;
|
|
98
86
|
hasHorizonThumb(): boolean;
|
|
99
87
|
hasVerticalThumb(): boolean;
|
|
100
88
|
get scrollHorizonThumbThickness(): number;
|
|
@@ -125,11 +113,13 @@ export declare class ScrollBar extends Disposable {
|
|
|
125
113
|
makeViewDirty(state: boolean): void;
|
|
126
114
|
pick(coord: Vector2): Rect<import('./rect').IRectProps> | null;
|
|
127
115
|
private _initialScrollRect;
|
|
116
|
+
private _setHorizonEvented;
|
|
117
|
+
private _setVerticalEvented;
|
|
128
118
|
private _initialVerticalEvent;
|
|
119
|
+
private _initialHorizontalEvent;
|
|
129
120
|
private _horizonHoverFunc;
|
|
130
121
|
private _horizonHoverLeaveFunc;
|
|
131
122
|
private _verticalHoverFunc;
|
|
132
123
|
private _verticalHoverLeaveFunc;
|
|
133
124
|
private _hoverFunc;
|
|
134
|
-
private _initialHorizontalEvent;
|
|
135
125
|
}
|
|
@@ -106,7 +106,8 @@ export declare abstract class Shape<T extends IShapeProps> extends BaseObject {
|
|
|
106
106
|
private static _setStrokeStyles;
|
|
107
107
|
render(mainCtx: UniverRenderingContext, bounds?: IViewportInfo): this;
|
|
108
108
|
/**
|
|
109
|
-
* if
|
|
109
|
+
* if props not in BASE_OBJECT_ARRAY_Set then this[_key] = props[key]
|
|
110
|
+
* if props in BASE_OBJECT_ARRAY_Set, You should use transformByState
|
|
110
111
|
* @param props
|
|
111
112
|
*/
|
|
112
113
|
setProps(props?: T): Shape<T>;
|