@vvfx/sdk 0.1.19-alpha.9 → 0.2.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/LICENSE +22 -0
- package/dist/index.js +96633 -14
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +96736 -0
- package/dist/index.mjs.map +1 -0
- package/dist/src/config.d.ts +855 -0
- package/dist/src/exporter/config.d.ts +18 -0
- package/dist/src/exporter/const.d.ts +71 -0
- package/dist/src/exporter/export-media.d.ts +68 -0
- package/dist/src/exporter/exporter.d.ts +22 -0
- package/dist/src/exporter/index.d.ts +2 -0
- package/dist/src/exporter/types.d.ts +194 -0
- package/dist/src/exporter/utils.d.ts +22 -0
- package/dist/src/exporter/wav-audio.d.ts +27 -0
- package/dist/src/gesture-handler/gizmo/adsorption-gizmo.d.ts +68 -0
- package/dist/src/gesture-handler/gizmo/control-gizmo.d.ts +67 -0
- package/dist/src/gesture-handler/gizmo/gizmo.d.ts +59 -0
- package/dist/src/gesture-handler/gizmo/icon-gizmo.d.ts +44 -0
- package/dist/src/gesture-handler/gizmo/index.d.ts +6 -0
- package/dist/src/gesture-handler/gizmo/item-create-gizmo.d.ts +43 -0
- package/dist/src/gesture-handler/gizmo/loading-gizmo.d.ts +48 -0
- package/dist/src/gesture-handler/gizmo/mask-gizmo.d.ts +113 -0
- package/dist/src/gesture-handler/gizmo/picture-cut-gizmo.d.ts +94 -0
- package/dist/src/gesture-handler/gizmo/picture-expand-gizmo.d.ts +57 -0
- package/dist/src/gesture-handler/gizmo/preference-gizmo.d.ts +32 -0
- package/dist/src/gesture-handler/gizmo/selector-gizmo.d.ts +101 -0
- package/dist/src/gesture-handler/gizmo/sprite-text-edit-gizmo.d.ts +36 -0
- package/dist/src/gesture-handler/gizmo/text-gizmo.d.ts +128 -0
- package/dist/src/gesture-handler/gizmo/transform-gizmo.d.ts +233 -0
- package/dist/src/gesture-handler/gizmo/type.d.ts +402 -0
- package/dist/src/gesture-handler/index.d.ts +3 -0
- package/dist/src/gesture-handler/src/gesture-handler.d.ts +143 -0
- package/dist/src/gesture-handler/src/icons.d.ts +7 -0
- package/dist/src/gesture-handler/utils.d.ts +2 -0
- package/dist/src/html-overlay/auto-height-runtime.d.ts +13 -0
- package/dist/src/html-overlay/document-runtime.d.ts +4 -0
- package/dist/src/html-overlay/document-transform.d.ts +7 -0
- package/dist/src/html-overlay/dom-order.d.ts +1 -0
- package/dist/src/html-overlay/host-message-runtime.d.ts +3 -0
- package/dist/src/html-overlay/html-viewport-style.d.ts +1 -0
- package/dist/src/html-overlay/index.d.ts +1 -0
- package/dist/src/html-overlay/manager.d.ts +77 -0
- package/dist/src/html-overlay/mime-utils.d.ts +2 -0
- package/dist/src/html-overlay/overlay-transform.d.ts +13 -0
- package/dist/src/html-overlay/path-utils.d.ts +8 -0
- package/dist/src/html-overlay/shell-runtime.d.ts +6 -0
- package/dist/src/index.d.ts +14 -0
- package/dist/src/math/box2.d.ts +166 -0
- package/dist/src/math/circle.d.ts +82 -0
- package/dist/src/math/euler.d.ts +20 -0
- package/dist/src/math/index.d.ts +13 -0
- package/dist/src/math/line2.d.ts +93 -0
- package/dist/src/math/line3.d.ts +17 -0
- package/dist/src/math/matrix4.d.ts +28 -0
- package/dist/src/math/plane.d.ts +14 -0
- package/dist/src/math/quaternion.d.ts +3 -0
- package/dist/src/math/ray-caster.d.ts +10 -0
- package/dist/src/math/ray.d.ts +18 -0
- package/dist/src/math/type.d.ts +32 -0
- package/dist/src/math/utils.d.ts +19 -0
- package/dist/src/math/vector2.d.ts +30 -0
- package/dist/src/math/vector3.d.ts +29 -0
- package/dist/src/screen-shot/index.d.ts +1 -0
- package/dist/src/screen-shot/screen-shot.d.ts +35 -0
- package/dist/src/sdk-item/base-item.d.ts +126 -0
- package/dist/src/sdk-item/card-item.d.ts +67 -0
- package/dist/src/sdk-item/effects-item.d.ts +70 -0
- package/dist/src/sdk-item/frame-item.d.ts +112 -0
- package/dist/src/sdk-item/generator-item.d.ts +86 -0
- package/dist/src/sdk-item/group-item.d.ts +57 -0
- package/dist/src/sdk-item/index.d.ts +36 -0
- package/dist/src/sdk-item/sprite-item.d.ts +67 -0
- package/dist/src/sdk-item/text-item.d.ts +107 -0
- package/dist/src/sdk-item/types.d.ts +153 -0
- package/dist/src/sdk-item/video-item.d.ts +87 -0
- package/dist/src/sdk.d.ts +589 -0
- package/dist/src/service/UndoRedo.d.ts +48 -0
- package/dist/src/shared/index.d.ts +1 -0
- package/dist/src/shared/player.d.ts +9 -0
- package/dist/src/size-adapte/index.d.ts +1 -0
- package/dist/src/size-adapte/size-adapt.d.ts +28 -0
- package/dist/src/types.d.ts +1298 -0
- package/dist/src/utils/background-manager.d.ts +72 -0
- package/dist/src/utils/common-utils.d.ts +28 -0
- package/dist/src/utils/index.d.ts +8 -0
- package/dist/src/utils/interaction-utils.d.ts +60 -0
- package/dist/src/utils/json-data-utils.d.ts +165 -0
- package/dist/src/utils/layout-utils.d.ts +219 -0
- package/dist/src/utils/page-data-utils.d.ts +372 -0
- package/dist/src/utils/player-data-utils.d.ts +11 -0
- package/dist/src/utils/types.d.ts +114 -0
- package/dist/src/wireframe/common/box.d.ts +1 -0
- package/dist/src/wireframe/common/dashed-line.d.ts +1 -0
- package/dist/src/wireframe/common/line.d.ts +1 -0
- package/dist/src/wireframe/common/pixi-ext.d.ts +11 -0
- package/dist/src/wireframe/common/pixi.d.ts +18 -0
- package/dist/src/wireframe/index.d.ts +4 -0
- package/package.json +42 -22
- package/dist/index.cjs +0 -14
- package/dist/index.d.cts +0 -3555
- package/dist/index.d.ts +0 -3555
- package/dist/index.global.js +0 -333
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { Graphics, Text, Sprite } from '../../wireframe';
|
|
2
|
+
import { spec } from '../../shared';
|
|
3
|
+
import type { PageDataUtils } from '../../utils/page-data-utils';
|
|
4
|
+
import { Box2, Line2, Vector2, Vector3, Circle } from '../../math';
|
|
5
|
+
import { Gizmo } from './gizmo';
|
|
6
|
+
import type { GestureCursorResult, GizmoType, ScaleParam, TransformType } from './type';
|
|
7
|
+
import type { AdsorptionGizmo } from './adsorption-gizmo';
|
|
8
|
+
import { SelectorGizmo } from './selector-gizmo';
|
|
9
|
+
import { SDKItemType } from '../../sdk-item/types';
|
|
10
|
+
import { SDKItem } from '../../sdk-item';
|
|
11
|
+
export declare class TransformGizmo extends Gizmo {
|
|
12
|
+
readonly type: GizmoType;
|
|
13
|
+
/**
|
|
14
|
+
* 变换框绘制结果
|
|
15
|
+
*/
|
|
16
|
+
wireframe: TransfromWireframe;
|
|
17
|
+
/**
|
|
18
|
+
* 鼠标状态绘制结果
|
|
19
|
+
*/
|
|
20
|
+
cursorResult: GestureCursorResult;
|
|
21
|
+
/**
|
|
22
|
+
* 视图起始交互坐标[用于绘制指针]
|
|
23
|
+
*/
|
|
24
|
+
cursorPoint: Vector2;
|
|
25
|
+
/**
|
|
26
|
+
* 页面绘制 [通过页面绘制计算交互变换值,确保交互状态下移除页面也可以继续执行交互]
|
|
27
|
+
*/
|
|
28
|
+
lastPoint: Vector2;
|
|
29
|
+
/**
|
|
30
|
+
* @description 交互起点,用于判断是否可以触发选中交互
|
|
31
|
+
*/
|
|
32
|
+
startPoint: Vector2;
|
|
33
|
+
/**
|
|
34
|
+
* 单次旋转交互中z轴旋转角度[辅助计算鼠标位置]
|
|
35
|
+
*/
|
|
36
|
+
rotationAngle: number;
|
|
37
|
+
/**
|
|
38
|
+
* 是否处于激活状态
|
|
39
|
+
*/
|
|
40
|
+
active: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* 吸附对齐功能开关
|
|
43
|
+
*/
|
|
44
|
+
enableAdsorption: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* @description 缩放方向
|
|
47
|
+
*/
|
|
48
|
+
scaleParam?: ScaleParam;
|
|
49
|
+
/**
|
|
50
|
+
* 交互类型
|
|
51
|
+
*/
|
|
52
|
+
activeType: TransformType;
|
|
53
|
+
/**
|
|
54
|
+
* 上一帧鼠标射线碰撞位置
|
|
55
|
+
*/
|
|
56
|
+
lastWorldPosition: Vector3;
|
|
57
|
+
/**
|
|
58
|
+
* 是否忽视所有交互
|
|
59
|
+
*/
|
|
60
|
+
private _ignoreInteraction;
|
|
61
|
+
/**
|
|
62
|
+
* @description 初次点击鼠标位置 - 用于触发双击时,子元素选中
|
|
63
|
+
*/
|
|
64
|
+
firstClickPoint: Vector2;
|
|
65
|
+
/**
|
|
66
|
+
* @description 画板包围盒信息
|
|
67
|
+
*/
|
|
68
|
+
frameBoxes: Map<string, Box2>;
|
|
69
|
+
/**
|
|
70
|
+
* @description
|
|
71
|
+
*/
|
|
72
|
+
toAddedFrameId: string | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* @description 自动布局插入指示器
|
|
75
|
+
*/
|
|
76
|
+
private autoLayoutIndicator;
|
|
77
|
+
/**
|
|
78
|
+
* @description 是否在自动布局拖拽中
|
|
79
|
+
*/
|
|
80
|
+
private isAutoLayoutDragging;
|
|
81
|
+
/**
|
|
82
|
+
* @description 被拖拽元素的原始行列位置(用于自动布局时调整其他元素)
|
|
83
|
+
*/
|
|
84
|
+
private autoLayoutDragOriginalPosition;
|
|
85
|
+
/**
|
|
86
|
+
* @description 待应用的布局位置(用于延迟执行行列修改)
|
|
87
|
+
*/
|
|
88
|
+
private pendingLayoutPosition;
|
|
89
|
+
/**
|
|
90
|
+
* @description 自动布局指示器 Graphics
|
|
91
|
+
*/
|
|
92
|
+
private autoLayoutGraphics;
|
|
93
|
+
/**
|
|
94
|
+
* @description 需要处理子元素分离的组信息
|
|
95
|
+
* key: groupId, value: 需要分离的子元素信息
|
|
96
|
+
*/
|
|
97
|
+
groupsNeedProcess: Map<string, {
|
|
98
|
+
groupId: string;
|
|
99
|
+
frameId: string;
|
|
100
|
+
childrenOutOfFrame: string[];
|
|
101
|
+
}>;
|
|
102
|
+
private _pageDataUtils;
|
|
103
|
+
private adsorptionGizmo;
|
|
104
|
+
private selectorGizmo;
|
|
105
|
+
/**
|
|
106
|
+
* @description 选中控制器待触发
|
|
107
|
+
*/
|
|
108
|
+
onSelectorGizmoTrigger: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* @description Graphics to render transform gizmo result.
|
|
111
|
+
*/
|
|
112
|
+
private graphics;
|
|
113
|
+
/**
|
|
114
|
+
* @description 是否为锁定比例缩放
|
|
115
|
+
*/
|
|
116
|
+
_isLockScale: boolean;
|
|
117
|
+
isShiftDown: boolean;
|
|
118
|
+
private nameText;
|
|
119
|
+
private sizeText;
|
|
120
|
+
private imageSprite;
|
|
121
|
+
private groupSprite;
|
|
122
|
+
private textSprite;
|
|
123
|
+
private videoSprite;
|
|
124
|
+
private frameSprite;
|
|
125
|
+
/**
|
|
126
|
+
* @description 卡片类型图标缓存(cardType → Sprite)
|
|
127
|
+
*/
|
|
128
|
+
private cardSprites;
|
|
129
|
+
private effectsSprite;
|
|
130
|
+
get interactive(): boolean;
|
|
131
|
+
set interactive(bool: boolean);
|
|
132
|
+
get isLockScale(): boolean;
|
|
133
|
+
set isLockScale(state: boolean);
|
|
134
|
+
get infoType(): spec.ItemType.base | SDKItemType;
|
|
135
|
+
constructor(utils: PageDataUtils, adsorptionGizmo: AdsorptionGizmo, selectorGizmo: SelectorGizmo);
|
|
136
|
+
/**
|
|
137
|
+
* @description 根据卡片类型获取对应的图标 Sprite,带缓存
|
|
138
|
+
* @param cardType 卡片类型标识
|
|
139
|
+
* @returns 对应的 Sprite 实例
|
|
140
|
+
*/
|
|
141
|
+
private getCardSprite;
|
|
142
|
+
get ignoreInteraction(): boolean;
|
|
143
|
+
set ignoreInteraction(state: boolean);
|
|
144
|
+
actionKey(keyCode: KeyboardEvent): void;
|
|
145
|
+
endActionKey(keyCode: KeyboardEvent): void;
|
|
146
|
+
getRenderObjects(): (Graphics | Text | Sprite)[];
|
|
147
|
+
/**
|
|
148
|
+
* @description 绘制自动布局指示线
|
|
149
|
+
*/
|
|
150
|
+
private renderAutoLayoutIndicator;
|
|
151
|
+
cancelPreparation(): void;
|
|
152
|
+
/**
|
|
153
|
+
* 行动准备事件 - 获取鼠标交互状态
|
|
154
|
+
* @param event 鼠标事件
|
|
155
|
+
*/
|
|
156
|
+
preparationAction(event: MouseEvent): GizmoType | undefined;
|
|
157
|
+
/**
|
|
158
|
+
* 行动前置事件 - 交互预备事件
|
|
159
|
+
* @param event 鼠标事件
|
|
160
|
+
*/
|
|
161
|
+
preAction(event: MouseEvent, isDoubleClick?: boolean): GizmoType | undefined;
|
|
162
|
+
/**
|
|
163
|
+
* 行动事件 - 变换交互
|
|
164
|
+
* @param event 鼠标事件
|
|
165
|
+
*/
|
|
166
|
+
action(event: MouseEvent): void;
|
|
167
|
+
/**
|
|
168
|
+
* 行动结束时间 - 交互结束
|
|
169
|
+
* @param event 鼠标事件
|
|
170
|
+
*/
|
|
171
|
+
endAction(event: MouseEvent): undefined;
|
|
172
|
+
/**
|
|
173
|
+
* 交互中断事件 - 清空交互状态以及鼠标状态, 重新进行交互Gizmo选中
|
|
174
|
+
* @returns undefined
|
|
175
|
+
*/
|
|
176
|
+
interruption(): GizmoType | undefined;
|
|
177
|
+
/**
|
|
178
|
+
* 刷新指针结果
|
|
179
|
+
* @param activeType 交互类型
|
|
180
|
+
* @param point 指针位置
|
|
181
|
+
* @param dir 指针方向
|
|
182
|
+
*/
|
|
183
|
+
refreshCursorResult(activeType: TransformType, angle?: number): void;
|
|
184
|
+
/**
|
|
185
|
+
* 根据选中元素刷新交互框
|
|
186
|
+
*/
|
|
187
|
+
refreshResults(): void;
|
|
188
|
+
initInteractionPlane(viewportPoint: Vector2): void;
|
|
189
|
+
refreshRenderObject(): void;
|
|
190
|
+
refreshTransformType(point: Vector2): void;
|
|
191
|
+
refreshWireframeBySelectedItems(): void;
|
|
192
|
+
setAdsorptionEnabled(state: boolean): void;
|
|
193
|
+
/**
|
|
194
|
+
* @description 处理需要断开父子关系的组
|
|
195
|
+
* 在拖拽结束时调用,将画板外的子元素从组中移除,并移出画板
|
|
196
|
+
*/
|
|
197
|
+
private processGroupsNeedProcess;
|
|
198
|
+
refreshFrameBoxes(): void;
|
|
199
|
+
refreshItemFrameRelationShip(item: SDKItem, mouse: Vector2): string | undefined;
|
|
200
|
+
/**
|
|
201
|
+
* @description 更新自动布局指示器
|
|
202
|
+
* 基于鼠标位置实时更新被拖拽元素的 layoutInfos(row 和 column)
|
|
203
|
+
* 注意:移动过程中只更新被拖拽元素的布局信息,其他元素保持不动
|
|
204
|
+
* 等到交互结束时再执行整体排布
|
|
205
|
+
*/
|
|
206
|
+
private updateAutoLayoutIndicator;
|
|
207
|
+
/**
|
|
208
|
+
* @description 执行自动布局重排序
|
|
209
|
+
* 基于更新后的 layoutInfos 重新排布所有元素
|
|
210
|
+
* @param draggedItem 被拖拽的元素
|
|
211
|
+
*/
|
|
212
|
+
private executeAutoLayoutReorder;
|
|
213
|
+
refreshFrameChildren(): void;
|
|
214
|
+
}
|
|
215
|
+
type TransfromWireframe = {
|
|
216
|
+
edges: Line2[];
|
|
217
|
+
scaleCorners: Circle[];
|
|
218
|
+
rotationCorners: Circle[];
|
|
219
|
+
interactive: boolean;
|
|
220
|
+
cornerEnable: boolean;
|
|
221
|
+
directionEnable: boolean;
|
|
222
|
+
box: Box2;
|
|
223
|
+
rotationEnabled: boolean;
|
|
224
|
+
scaleEnabled: boolean;
|
|
225
|
+
anchor: Vector2;
|
|
226
|
+
totalBox: Box2;
|
|
227
|
+
childrenBoxes: Box2[];
|
|
228
|
+
activeType: TransformType;
|
|
229
|
+
interactiveDirection: Vector2;
|
|
230
|
+
scaleCorner?: Vector2;
|
|
231
|
+
scaleEdgeCorners?: Vector2[];
|
|
232
|
+
};
|
|
233
|
+
export {};
|
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
import type { Region, spec } from '../../shared';
|
|
2
|
+
import type { Box2, Ray, Vector2, Vector3 } from '../../math';
|
|
3
|
+
export type TextResult = TextValidResult | TextEmptyResult;
|
|
4
|
+
/**
|
|
5
|
+
* @description 文本编辑器有效结果
|
|
6
|
+
*/
|
|
7
|
+
export type TextValidResult = {
|
|
8
|
+
type: 'valid';
|
|
9
|
+
/**
|
|
10
|
+
* @description 包围盒
|
|
11
|
+
*/
|
|
12
|
+
box: Box2;
|
|
13
|
+
/**
|
|
14
|
+
* @description 宽度缩放交互点
|
|
15
|
+
*/
|
|
16
|
+
widthScaleCorners: [Vector2, Vector2];
|
|
17
|
+
/**
|
|
18
|
+
* @description 旋转交互点
|
|
19
|
+
*/
|
|
20
|
+
rotationCorner: Vector2;
|
|
21
|
+
/**
|
|
22
|
+
* @description 旋转交互
|
|
23
|
+
*/
|
|
24
|
+
rotation: number;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* @description 文本编辑器无效结果
|
|
28
|
+
*/
|
|
29
|
+
export type TextEmptyResult = {
|
|
30
|
+
type: 'empty';
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* @description 文本编辑器交互参数
|
|
34
|
+
*/
|
|
35
|
+
export type TextInteractionParam = {
|
|
36
|
+
/**
|
|
37
|
+
* @description 是否可以交互
|
|
38
|
+
*/
|
|
39
|
+
active: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* @description 交互类型
|
|
42
|
+
*/
|
|
43
|
+
type: 'none' | 'translation' | 'scale' | 'rotation' | 'edit' | 'width-scale';
|
|
44
|
+
/**
|
|
45
|
+
* @description 上一帧鼠标位置
|
|
46
|
+
*/
|
|
47
|
+
lastPoint: Vector2;
|
|
48
|
+
/**
|
|
49
|
+
* @description 交互起点鼠标位置
|
|
50
|
+
*/
|
|
51
|
+
startPoint: Vector2;
|
|
52
|
+
/**
|
|
53
|
+
* @description 上一帧交互世界坐标位置
|
|
54
|
+
*/
|
|
55
|
+
lastWorldPosition: Vector3;
|
|
56
|
+
/**
|
|
57
|
+
* @description 交互锚点
|
|
58
|
+
*/
|
|
59
|
+
anchor: Vector2;
|
|
60
|
+
/**
|
|
61
|
+
* @description textarea 初始状态
|
|
62
|
+
*/
|
|
63
|
+
textareaType?: 'select' | 'focus';
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* @description 图片蒙版工具结果
|
|
67
|
+
*/
|
|
68
|
+
export type MaskResult = {
|
|
69
|
+
/**
|
|
70
|
+
* @description 状态
|
|
71
|
+
*/
|
|
72
|
+
status: 'init' | 'done';
|
|
73
|
+
/**
|
|
74
|
+
* @description 包围盒
|
|
75
|
+
*/
|
|
76
|
+
box?: Box2;
|
|
77
|
+
/**
|
|
78
|
+
* @description 鼠标位置
|
|
79
|
+
*/
|
|
80
|
+
point?: Vector2;
|
|
81
|
+
/**
|
|
82
|
+
* @description 蒙版线条列表
|
|
83
|
+
*/
|
|
84
|
+
lines: {
|
|
85
|
+
brushSize: number;
|
|
86
|
+
points: Vector2[];
|
|
87
|
+
type?: 'paint' | 'erase';
|
|
88
|
+
}[];
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* @description 图片裁切工具结果
|
|
92
|
+
*/
|
|
93
|
+
export type PictureCutResult = PictureCutValidResult | PictureCutEmptyResult;
|
|
94
|
+
export type PictureCutValidResult = {
|
|
95
|
+
/**
|
|
96
|
+
* @description 类型 - 有效值
|
|
97
|
+
*/
|
|
98
|
+
type: 'valid';
|
|
99
|
+
/**
|
|
100
|
+
* @description 原始包围盒
|
|
101
|
+
*/
|
|
102
|
+
itemBox: Box2;
|
|
103
|
+
/**
|
|
104
|
+
* @description 当前包围盒
|
|
105
|
+
*/
|
|
106
|
+
normalizeCutBox: Box2;
|
|
107
|
+
};
|
|
108
|
+
export type PictureCutEmptyResult = {
|
|
109
|
+
type: 'invalid';
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* @description 图片裁切交互参数
|
|
113
|
+
*/
|
|
114
|
+
export type PictureCutInteractionParam = PictureCutNoneParam | PictureCutScaleParam | PictureCutDirectionScaleParam | PictureCutMoveParam;
|
|
115
|
+
export type PictureCutNoneParam = {
|
|
116
|
+
type: 'none';
|
|
117
|
+
};
|
|
118
|
+
export type PictureCutScaleParam = {
|
|
119
|
+
type: 'scale';
|
|
120
|
+
box: Box2;
|
|
121
|
+
anchor: Vector2;
|
|
122
|
+
startMouse: Vector2;
|
|
123
|
+
startCorner: Vector2;
|
|
124
|
+
lockedAspect?: number;
|
|
125
|
+
};
|
|
126
|
+
export type PictureCutDirectionScaleParam = {
|
|
127
|
+
type: 'direction-scale';
|
|
128
|
+
box: Box2;
|
|
129
|
+
index: number;
|
|
130
|
+
startMouse: Vector2;
|
|
131
|
+
lockedAspect?: number;
|
|
132
|
+
};
|
|
133
|
+
export type PictureCutMoveParam = {
|
|
134
|
+
type: 'move';
|
|
135
|
+
box: Box2;
|
|
136
|
+
startMouse: Vector2;
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* @description 裁剪工具交互类型
|
|
140
|
+
*/
|
|
141
|
+
export type PictureCutInteractionType = 'none' | 'scale' | 'direction-scale' | 'move';
|
|
142
|
+
/**
|
|
143
|
+
* @description 图片扩边交互参数
|
|
144
|
+
*/
|
|
145
|
+
export type PictureExpandInteractionParam = PictureExpandNoneParam | PictureExpandScaleParam | PictureExpandDirectionScaleParam | PictureExpandMoveParam;
|
|
146
|
+
export type PictureExpandNoneParam = {
|
|
147
|
+
type: 'none';
|
|
148
|
+
};
|
|
149
|
+
export type PictureExpandScaleParam = {
|
|
150
|
+
type: 'scale';
|
|
151
|
+
box: Box2;
|
|
152
|
+
index: number;
|
|
153
|
+
startMouse: Vector2;
|
|
154
|
+
lockedAspect?: number;
|
|
155
|
+
};
|
|
156
|
+
export type PictureExpandDirectionScaleParam = {
|
|
157
|
+
type: 'direction-scale';
|
|
158
|
+
box: Box2;
|
|
159
|
+
index: number;
|
|
160
|
+
startMouse: Vector2;
|
|
161
|
+
lockedAspect?: number;
|
|
162
|
+
};
|
|
163
|
+
export type PictureExpandMoveParam = {
|
|
164
|
+
type: 'move';
|
|
165
|
+
box: Box2;
|
|
166
|
+
startMouse: Vector2;
|
|
167
|
+
};
|
|
168
|
+
export type PictureExpandInteractionType = 'none' | 'scale' | 'direction-scale' | 'move';
|
|
169
|
+
/**
|
|
170
|
+
* @description 图片扩边工具结果
|
|
171
|
+
*/
|
|
172
|
+
export type PictureExpandResult = PictureExpandValidResult | PictureExpandEmptyResult;
|
|
173
|
+
export type PictureExpandValidResult = {
|
|
174
|
+
/**
|
|
175
|
+
* @description 类型 - 有效值
|
|
176
|
+
*/
|
|
177
|
+
type: 'valid';
|
|
178
|
+
/**
|
|
179
|
+
* @description 原始包围盒
|
|
180
|
+
*/
|
|
181
|
+
itemBox: Box2;
|
|
182
|
+
/**
|
|
183
|
+
* @description 当前包围盒
|
|
184
|
+
*/
|
|
185
|
+
normalizeExpandBox: Box2;
|
|
186
|
+
};
|
|
187
|
+
export type PictureExpandEmptyResult = {
|
|
188
|
+
type: 'invalid';
|
|
189
|
+
};
|
|
190
|
+
export type SelectorResult = {
|
|
191
|
+
type: 'null' | 'region' | 'pre-select';
|
|
192
|
+
box: Box2;
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* @description 碰撞结果
|
|
196
|
+
*/
|
|
197
|
+
export type HitTestResult = {
|
|
198
|
+
/**
|
|
199
|
+
* @description 碰撞射线
|
|
200
|
+
*/
|
|
201
|
+
ray: Ray;
|
|
202
|
+
/**
|
|
203
|
+
* @description 碰撞结果集合
|
|
204
|
+
*/
|
|
205
|
+
regions: Region[];
|
|
206
|
+
};
|
|
207
|
+
/**
|
|
208
|
+
* 位移吸附结果
|
|
209
|
+
*/
|
|
210
|
+
export type TranslationAdsorptionResult = {
|
|
211
|
+
/**
|
|
212
|
+
* x方向吸附距离
|
|
213
|
+
*/
|
|
214
|
+
x?: number;
|
|
215
|
+
/**
|
|
216
|
+
* y方向吸附距离
|
|
217
|
+
*/
|
|
218
|
+
y?: number;
|
|
219
|
+
/**
|
|
220
|
+
* x方向点吸附信息
|
|
221
|
+
*/
|
|
222
|
+
xPoints?: TranslationPointAdsorptionTarget[];
|
|
223
|
+
/**
|
|
224
|
+
* x方向点吸附信息
|
|
225
|
+
*/
|
|
226
|
+
yPoints?: TranslationPointAdsorptionTarget[];
|
|
227
|
+
};
|
|
228
|
+
/**
|
|
229
|
+
* 平移点吸附信息
|
|
230
|
+
*/
|
|
231
|
+
export type TranslationPointAdsorptionTarget = {
|
|
232
|
+
/**
|
|
233
|
+
* 包围盒点
|
|
234
|
+
*/
|
|
235
|
+
point: Vector2;
|
|
236
|
+
/**
|
|
237
|
+
* 吸附点
|
|
238
|
+
*/
|
|
239
|
+
targets: Vector2[];
|
|
240
|
+
};
|
|
241
|
+
/**
|
|
242
|
+
* @description 缩放参数
|
|
243
|
+
*/
|
|
244
|
+
export type ScaleParam = {
|
|
245
|
+
/**
|
|
246
|
+
* @description 缩放中心
|
|
247
|
+
*/
|
|
248
|
+
center: Vector3;
|
|
249
|
+
/**
|
|
250
|
+
* @description 缩放角点
|
|
251
|
+
*/
|
|
252
|
+
corner: Vector3;
|
|
253
|
+
/**
|
|
254
|
+
* @description 角点偏移值
|
|
255
|
+
*/
|
|
256
|
+
shift: Vector3;
|
|
257
|
+
/**
|
|
258
|
+
* @description 上一帧的缩放比例
|
|
259
|
+
*/
|
|
260
|
+
lastScalar: Vector3;
|
|
261
|
+
/**
|
|
262
|
+
* @description 缩放初始化包围盒
|
|
263
|
+
*/
|
|
264
|
+
farthestCorner: Vector2;
|
|
265
|
+
};
|
|
266
|
+
export type GestureCursorResult = {
|
|
267
|
+
/**
|
|
268
|
+
* 辅助面板交互指针类型
|
|
269
|
+
*/
|
|
270
|
+
type: GestureCursorType;
|
|
271
|
+
/**
|
|
272
|
+
* 辅助面板交互指针角度
|
|
273
|
+
*/
|
|
274
|
+
angle: number;
|
|
275
|
+
/**
|
|
276
|
+
* 半径
|
|
277
|
+
*/
|
|
278
|
+
radius?: number;
|
|
279
|
+
};
|
|
280
|
+
export type SpriteTextEditInteractionParam = {
|
|
281
|
+
selected: number;
|
|
282
|
+
preSelected: number;
|
|
283
|
+
};
|
|
284
|
+
export type SpriteTextEditResult = SpriteTextInfo[];
|
|
285
|
+
/**
|
|
286
|
+
* @description 图层文字信息
|
|
287
|
+
*/
|
|
288
|
+
export type SpriteTextInfo = {
|
|
289
|
+
/**
|
|
290
|
+
* @description 元素ID
|
|
291
|
+
*/
|
|
292
|
+
id: string;
|
|
293
|
+
/**
|
|
294
|
+
* @description 文本框索引
|
|
295
|
+
*/
|
|
296
|
+
index: number;
|
|
297
|
+
/**
|
|
298
|
+
* @description 文本包围盒
|
|
299
|
+
*/
|
|
300
|
+
box: Box2;
|
|
301
|
+
/**
|
|
302
|
+
* @description 文本内容
|
|
303
|
+
*/
|
|
304
|
+
text: string;
|
|
305
|
+
/**
|
|
306
|
+
* @description 是否被修改过
|
|
307
|
+
*/
|
|
308
|
+
hasChanged: boolean;
|
|
309
|
+
/**
|
|
310
|
+
* @description 是否处于编辑态
|
|
311
|
+
*/
|
|
312
|
+
isEditing: boolean;
|
|
313
|
+
};
|
|
314
|
+
/**
|
|
315
|
+
* @description 精准改字功能初始化信息
|
|
316
|
+
*/
|
|
317
|
+
export type SpriteTextInitParam = {
|
|
318
|
+
/**
|
|
319
|
+
* @description 元素ID
|
|
320
|
+
*/
|
|
321
|
+
id: string;
|
|
322
|
+
/**
|
|
323
|
+
* @description 改字信息
|
|
324
|
+
*/
|
|
325
|
+
info: SpriteTextInitInfo[];
|
|
326
|
+
};
|
|
327
|
+
export type SpriteTextInitInfo = {
|
|
328
|
+
/**
|
|
329
|
+
* @description 是否被修改过
|
|
330
|
+
*/
|
|
331
|
+
hasChanged: boolean;
|
|
332
|
+
/**
|
|
333
|
+
* @description 文字内容
|
|
334
|
+
*/
|
|
335
|
+
text: string;
|
|
336
|
+
/**
|
|
337
|
+
* @description 包围盒信息
|
|
338
|
+
*/
|
|
339
|
+
box: [spec.vec2, spec.vec2, spec.vec2, spec.vec2];
|
|
340
|
+
};
|
|
341
|
+
/**
|
|
342
|
+
* @description 辅助渲染Icon类型
|
|
343
|
+
*/
|
|
344
|
+
export declare enum IconType {
|
|
345
|
+
/**
|
|
346
|
+
* @description 视频播放Icon
|
|
347
|
+
*/
|
|
348
|
+
VIDEO_PLAY = "video-play",
|
|
349
|
+
/**
|
|
350
|
+
* @description 视频生成器Icon
|
|
351
|
+
*/
|
|
352
|
+
VIDEO_GENERATOR = "video-generator",
|
|
353
|
+
/**
|
|
354
|
+
* @description 图片生成器Icon
|
|
355
|
+
*/
|
|
356
|
+
IMAGE_GENERATOR = "image-generator"
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* @description 元素辅助Icon结果
|
|
360
|
+
*/
|
|
361
|
+
export type IconResult = {
|
|
362
|
+
/**
|
|
363
|
+
* @description 选中元素Id
|
|
364
|
+
*/
|
|
365
|
+
id: string;
|
|
366
|
+
/**
|
|
367
|
+
* @description Icon类型
|
|
368
|
+
*/
|
|
369
|
+
type: IconType;
|
|
370
|
+
/**
|
|
371
|
+
* @description 包围盒信息
|
|
372
|
+
*/
|
|
373
|
+
box: Box2;
|
|
374
|
+
};
|
|
375
|
+
export type IconInteractionParam = {
|
|
376
|
+
type: IconInteractionType;
|
|
377
|
+
hoverVideoId?: string;
|
|
378
|
+
};
|
|
379
|
+
export type IconInteractionType = 'preSelected' | 'none';
|
|
380
|
+
export type ItemCreateType = 'none' | 'text' | 'video-generator' | 'sprite-generator' | 'frame';
|
|
381
|
+
/**
|
|
382
|
+
* @description 自动布局插入位置
|
|
383
|
+
*/
|
|
384
|
+
export type InsertPosition = {
|
|
385
|
+
/**
|
|
386
|
+
* @description 插入位置索引
|
|
387
|
+
*/
|
|
388
|
+
index: number;
|
|
389
|
+
/**
|
|
390
|
+
* @description 插入方向(在目标元素前还是后)
|
|
391
|
+
*/
|
|
392
|
+
direction: 'before' | 'after';
|
|
393
|
+
/**
|
|
394
|
+
* @description 目标相邻元素ID
|
|
395
|
+
*/
|
|
396
|
+
siblingId?: string;
|
|
397
|
+
};
|
|
398
|
+
export type GizmoType = 'null' | 'selector' | 'transform' | 'control' | 'adsorption' | 'preference' | 'picture-cut' | 'text' | 'mask' | 'loading' | 'picture-expand' | 'sprite-text-edit' | 'icon' | 'item-create';
|
|
399
|
+
export type GestureCursorType = 'normal' | 'rotation' | 'scale' | 'text-rotation' | 'circle' | 'hand' | 'active-hand' | 'pointer' | 'text-create' | 'frame-create';
|
|
400
|
+
export type TransformType = 'null' | 'translation' | 'rotation' | 'scale';
|
|
401
|
+
export type GestureHandlerInteractType = 'select' | 'hand';
|
|
402
|
+
export type ControlGizmoInteractionType = 'mouse' | 'wheel';
|