@galacean/effects-specification 0.0.1 → 1.0.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 +21 -0
- package/README.md +6 -12
- package/dist/fallback/migration.d.ts +4 -0
- package/dist/fallback.js +29 -4
- package/dist/fallback.js.map +1 -1
- package/dist/fallback.mjs +29 -4
- package/dist/fallback.mjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/dist/src/binary.d.ts +6 -6
- package/dist/src/image.d.ts +5 -5
- package/dist/src/item/base-item.d.ts +2 -2
- package/dist/src/item/filter-item.d.ts +1 -1
- package/dist/src/item/interact-item.d.ts +1 -1
- package/dist/src/item/model/binary.d.ts +5 -5
- package/dist/src/item/model/light.d.ts +1 -1
- package/dist/src/item/model/material.d.ts +1 -1
- package/dist/src/item/model/mesh.d.ts +2 -2
- package/dist/src/item/particle-shape.d.ts +1 -1
- package/dist/src/item/plugin-item.d.ts +1 -1
- package/dist/src/item/spine-item.d.ts +1 -1
- package/dist/src/item.d.ts +1 -1
- package/dist/src/numberExpression.d.ts +44 -44
- package/dist/src/scene.d.ts +3 -2
- package/dist/src/type.d.ts +1 -1
- package/package.json +1 -1
|
@@ -70,11 +70,11 @@ export declare enum ValueType {
|
|
|
70
70
|
*/
|
|
71
71
|
BEZIER_CURVE_PATH = 22
|
|
72
72
|
}
|
|
73
|
-
export
|
|
74
|
-
export
|
|
75
|
-
export
|
|
76
|
-
export
|
|
77
|
-
export
|
|
73
|
+
export type vec2 = [x: number, y: number];
|
|
74
|
+
export type vec3 = [x: number, y: number, z: number];
|
|
75
|
+
export type vec4 = [x: number, y: number, z: number, w: number];
|
|
76
|
+
export type mat2 = [m11: number, m12: number, m21: number, m22: number];
|
|
77
|
+
export type mat3 = [
|
|
78
78
|
m11: number,
|
|
79
79
|
m12: number,
|
|
80
80
|
m13: number,
|
|
@@ -85,7 +85,7 @@ export declare type mat3 = [
|
|
|
85
85
|
m32: number,
|
|
86
86
|
m33: number
|
|
87
87
|
];
|
|
88
|
-
export
|
|
88
|
+
export type mat4 = [
|
|
89
89
|
m11: number,
|
|
90
90
|
m12: number,
|
|
91
91
|
m13: number,
|
|
@@ -105,44 +105,44 @@ export declare type mat4 = [
|
|
|
105
105
|
];
|
|
106
106
|
/*********************************************/
|
|
107
107
|
/*********************************************/
|
|
108
|
-
export
|
|
109
|
-
export
|
|
110
|
-
export
|
|
111
|
-
export
|
|
108
|
+
export type FunctionExpression = LineValue | CurveValue | BezierValue;
|
|
109
|
+
export type FixedNumberExpression = ConstantNumber | LineValue | CurveValue | BezierValue;
|
|
110
|
+
export type NumberExpression = FixedNumberExpression | RandomValue;
|
|
111
|
+
export type FixedVec3Expression = ConstantVec3 | BezierPath | LinearPath | BezierCurvePath;
|
|
112
112
|
/**
|
|
113
113
|
* 常数数值
|
|
114
114
|
* [0,5]
|
|
115
115
|
* [1,[1,2]]
|
|
116
116
|
* [2,[1,2,3]]
|
|
117
117
|
*/
|
|
118
|
-
export
|
|
119
|
-
export
|
|
120
|
-
export
|
|
121
|
-
export
|
|
118
|
+
export type ConstantNumber = [type: ValueType.CONSTANT, value: number];
|
|
119
|
+
export type ConstantVec2 = [type: ValueType.CONSTANT_VEC2, value: vec2];
|
|
120
|
+
export type ConstantVec3 = [type: ValueType.CONSTANT_VEC3, value: vec3];
|
|
121
|
+
export type ConstantVec4 = [type: ValueType.CONSTANT_VEC4, value: vec4];
|
|
122
122
|
/**
|
|
123
123
|
* 随机数数值
|
|
124
124
|
*/
|
|
125
|
-
export
|
|
125
|
+
export type RandomValue = [type: ValueType.RANDOM, value: [min: number, max: number]];
|
|
126
126
|
/**
|
|
127
127
|
* 直线段数值
|
|
128
128
|
*/
|
|
129
|
-
export
|
|
130
|
-
export
|
|
129
|
+
export type LineValue = [type: ValueType.LINE, value: [time: number, value: number][]];
|
|
130
|
+
export type CurveEasingPoint = [time: number, value: number, tanIn: number, tanOut: number];
|
|
131
131
|
/**
|
|
132
132
|
* 曲线段数值
|
|
133
133
|
*/
|
|
134
|
-
export
|
|
134
|
+
export type CurveValue = [type: ValueType.CURVE, value: CurveEasingPoint[]];
|
|
135
135
|
/**
|
|
136
136
|
* 贝塞尔路径数值
|
|
137
137
|
*/
|
|
138
|
-
export
|
|
139
|
-
export
|
|
138
|
+
export type BezierPath = [type: ValueType.BEZIER_PATH, value: BezierPathValue];
|
|
139
|
+
export type BezierPathValue = [
|
|
140
140
|
easing: CurveEasingPoint[],
|
|
141
141
|
points: vec3[],
|
|
142
142
|
controlPoints: vec3[]
|
|
143
143
|
];
|
|
144
|
-
export
|
|
145
|
-
export
|
|
144
|
+
export type LinearPath = [type: ValueType.LINEAR_PATH, value: LinearPathValue];
|
|
145
|
+
export type LinearPathValue = [
|
|
146
146
|
easing: CurveEasingPoint[],
|
|
147
147
|
points: vec3[]
|
|
148
148
|
];
|
|
@@ -161,7 +161,7 @@ export declare enum BezierKeyframeType {
|
|
|
161
161
|
/**
|
|
162
162
|
* 缓动关键帧数据(有三个点:左曲线控制点、曲线点、右曲线控制点,auto:自动关键帧)
|
|
163
163
|
*/
|
|
164
|
-
export
|
|
164
|
+
export type EaseKeyframeValue = [
|
|
165
165
|
type: BezierKeyframeType.EASE,
|
|
166
166
|
value: [x1: number, y1: number, x2: number, y2: number, x3: number, y3: number],
|
|
167
167
|
markType?: BezierKeyframeType
|
|
@@ -169,7 +169,7 @@ export declare type EaseKeyframeValue = [
|
|
|
169
169
|
/**
|
|
170
170
|
* 缓入关键帧数据(有两个点:左曲线控制点、曲线点)
|
|
171
171
|
*/
|
|
172
|
-
export
|
|
172
|
+
export type EaseInKeyframeValue = [
|
|
173
173
|
type: BezierKeyframeType.EASE_IN,
|
|
174
174
|
value: [x1: number, y1: number, x2: number, y2: number],
|
|
175
175
|
markType?: BezierKeyframeType
|
|
@@ -177,7 +177,7 @@ export declare type EaseInKeyframeValue = [
|
|
|
177
177
|
/**
|
|
178
178
|
* 缓出关键帧数据(有两个点:曲线点、右曲线控制点)
|
|
179
179
|
*/
|
|
180
|
-
export
|
|
180
|
+
export type EaseOutKeyframeValue = [
|
|
181
181
|
type: BezierKeyframeType.EASE_OUT,
|
|
182
182
|
value: [x2: number, y2: number, x3: number, y3: number],
|
|
183
183
|
markType?: BezierKeyframeType
|
|
@@ -185,7 +185,7 @@ export declare type EaseOutKeyframeValue = [
|
|
|
185
185
|
/**
|
|
186
186
|
* 线性关键帧数据(有一个点:曲线点)
|
|
187
187
|
*/
|
|
188
|
-
export
|
|
188
|
+
export type LineKeyframeValue = [
|
|
189
189
|
type: BezierKeyframeType.LINE,
|
|
190
190
|
value: [x2: number, y2: number],
|
|
191
191
|
markType?: BezierKeyframeType
|
|
@@ -193,7 +193,7 @@ export declare type LineKeyframeValue = [
|
|
|
193
193
|
/**
|
|
194
194
|
* 缓动定格出关键帧(有两个点:左曲线控制点、曲线点)
|
|
195
195
|
*/
|
|
196
|
-
export
|
|
196
|
+
export type EaseHoldOutKeyframeValue = [
|
|
197
197
|
type: BezierKeyframeType.HOLD,
|
|
198
198
|
value: [x1: number, y1: number, x2: number, y2: number],
|
|
199
199
|
markType: BezierKeyframeType.EASE_IN
|
|
@@ -201,7 +201,7 @@ export declare type EaseHoldOutKeyframeValue = [
|
|
|
201
201
|
/**
|
|
202
202
|
* 缓动定格出关键帧(有两个点:曲线点、右曲线控制点)
|
|
203
203
|
*/
|
|
204
|
-
export
|
|
204
|
+
export type EaseHoldInKeyframeValue = [
|
|
205
205
|
type: BezierKeyframeType.HOLD,
|
|
206
206
|
value: [x1: number, y1: number, x2: number, y2: number],
|
|
207
207
|
markType: BezierKeyframeType.EASE_OUT
|
|
@@ -209,7 +209,7 @@ export declare type EaseHoldInKeyframeValue = [
|
|
|
209
209
|
/**
|
|
210
210
|
* 线性定格出关键帧(有一个点:曲线点)
|
|
211
211
|
*/
|
|
212
|
-
export
|
|
212
|
+
export type LineHoldOutKeyframeValue = [
|
|
213
213
|
type: BezierKeyframeType.HOLD,
|
|
214
214
|
value: [x2: number, y2: number],
|
|
215
215
|
markType: BezierKeyframeType.LINE
|
|
@@ -217,7 +217,7 @@ export declare type LineHoldOutKeyframeValue = [
|
|
|
217
217
|
/**
|
|
218
218
|
* 线性定格进关键帧(有一个点:曲线点)
|
|
219
219
|
*/
|
|
220
|
-
export
|
|
220
|
+
export type LineHoldInKeyframeValue = [
|
|
221
221
|
type: BezierKeyframeType.HOLD,
|
|
222
222
|
value: [x2: number, y2: number],
|
|
223
223
|
markType: BezierKeyframeType.LINE_OUT
|
|
@@ -225,7 +225,7 @@ export declare type LineHoldInKeyframeValue = [
|
|
|
225
225
|
/**
|
|
226
226
|
* 定格进出关键帧(有一个点:曲线点)
|
|
227
227
|
*/
|
|
228
|
-
export
|
|
228
|
+
export type HoldInOutKeyframeValue = [
|
|
229
229
|
type: BezierKeyframeType.HOLD,
|
|
230
230
|
value: [x2: number, y2: number],
|
|
231
231
|
markType: BezierKeyframeType.HOLD
|
|
@@ -233,47 +233,47 @@ export declare type HoldInOutKeyframeValue = [
|
|
|
233
233
|
/**
|
|
234
234
|
* 定格关键帧
|
|
235
235
|
*/
|
|
236
|
-
export
|
|
236
|
+
export type HoldKeyframeValue = EaseHoldOutKeyframeValue | EaseHoldInKeyframeValue | LineHoldOutKeyframeValue | LineHoldInKeyframeValue | HoldInOutKeyframeValue;
|
|
237
237
|
/**
|
|
238
238
|
* 贝塞尔关键帧值
|
|
239
239
|
*/
|
|
240
|
-
export
|
|
240
|
+
export type BezierKeyframeValue = EaseKeyframeValue | EaseInKeyframeValue | EaseOutKeyframeValue | LineKeyframeValue | HoldKeyframeValue;
|
|
241
241
|
/**
|
|
242
242
|
* 贝塞尔关键帧
|
|
243
243
|
*/
|
|
244
|
-
export
|
|
244
|
+
export type BezierValue = [type: ValueType.BEZIER_CURVE, value: BezierKeyframeValue[]];
|
|
245
245
|
/**
|
|
246
246
|
* 贝塞尔曲线路径关键帧值
|
|
247
247
|
*/
|
|
248
|
-
export
|
|
248
|
+
export type BezierCurvePathValue = [easing: BezierKeyframeValue[], points: vec3[], controlePoints: vec3[]];
|
|
249
249
|
/**
|
|
250
250
|
* 贝塞尔曲线路径关键帧
|
|
251
251
|
*/
|
|
252
|
-
export
|
|
252
|
+
export type BezierCurvePath = [type: ValueType.BEZIER_CURVE_PATH, value: BezierCurvePathValue];
|
|
253
253
|
/*********************************************/
|
|
254
254
|
/*********************************************/
|
|
255
|
-
export
|
|
255
|
+
export type ColorExpression = RGBAColor | GradientColor | RGBAColors;
|
|
256
256
|
/**
|
|
257
257
|
* rgba range in [0,255]
|
|
258
258
|
*/
|
|
259
|
-
export
|
|
259
|
+
export type RGBAColorValue = [r: number, g: number, b: number, a: number];
|
|
260
260
|
/**
|
|
261
261
|
* 颜色数值
|
|
262
262
|
*/
|
|
263
|
-
export
|
|
263
|
+
export type RGBAColor = [type: ValueType.RGBA_COLOR, value: RGBAColorValue];
|
|
264
264
|
/**
|
|
265
265
|
* 渐变色数值
|
|
266
266
|
*/
|
|
267
|
-
export
|
|
268
|
-
export
|
|
269
|
-
export
|
|
267
|
+
export type GradientStop = [stop: number, r: number, g: number, b: number, a: number];
|
|
268
|
+
export type GradientColor = [type: ValueType.GRADIENT_COLOR, value: GradientStop[]];
|
|
269
|
+
export type RGBAColors = [type: ValueType.COLORS, value: RGBAColorValue[]];
|
|
270
270
|
/*********************************************/
|
|
271
271
|
/*********************************************/
|
|
272
272
|
/**
|
|
273
273
|
* 蒙版形状控制点数值
|
|
274
274
|
*/
|
|
275
|
-
export
|
|
275
|
+
export type ShapePoints = [type: ValueType.SHAPE_POINTS, value: [x: number, y: number, xIn: number, yIn: number, xOut: number, yOut: number][]];
|
|
276
276
|
/**
|
|
277
277
|
* 蒙版形状采样分割点数值
|
|
278
278
|
*/
|
|
279
|
-
export
|
|
279
|
+
export type ShapeSplits = [type: ValueType.SHAPE_SPLITS, value: number[][]];
|
package/dist/src/scene.d.ts
CHANGED
|
@@ -19,8 +19,9 @@ export interface JSONScene {
|
|
|
19
19
|
* 1.5 增加 Spine 数据
|
|
20
20
|
* 2.0 改造升级
|
|
21
21
|
* 2.1 增加文本元素
|
|
22
|
+
* 2.2 数据类型兼容
|
|
22
23
|
*/
|
|
23
|
-
version: '1.0' | '1.1' | '1.2' | '1.3' | '1.5' | '1.8' | '2.0' | '2.1';
|
|
24
|
+
version: '1.0' | '1.1' | '1.2' | '1.3' | '1.5' | '1.8' | '2.0' | '2.1' | '2.2';
|
|
24
25
|
/**
|
|
25
26
|
* 播放器版本信息
|
|
26
27
|
*/
|
|
@@ -89,4 +90,4 @@ export interface JSONScene {
|
|
|
89
90
|
/**
|
|
90
91
|
* 如果是内置模块,但是需要额外的代码引入,比如滤镜则会加入 requires 数组中
|
|
91
92
|
*/
|
|
92
|
-
export
|
|
93
|
+
export type SceneRequire = 'filter';
|
package/dist/src/type.d.ts
CHANGED