@galacean/effects-specification 2.2.0-alpha.2 → 2.2.0-alpha.4

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/es/assets.d.ts CHANGED
@@ -68,12 +68,6 @@ export interface Image extends AssetBase {
68
68
  * @default false
69
69
  */
70
70
  mipmap?: boolean;
71
- /**
72
- * 图片 Y 轴的方向,如果 Y 轴向上(与 OpenGL 相同)则为 1
73
- * 如果 Y 轴向下(与 OpenGL 相反)则为 -1,图片再绘制数据模板的时候需要翻转绘制
74
- * @default 1
75
- */
76
- oriY?: 1 | -1;
77
71
  }
78
72
  /**
79
73
  * 模板贴图属性
package/es/index.d.ts CHANGED
@@ -40,4 +40,4 @@ export * from './material-data';
40
40
  export * from './geometry-data';
41
41
  export * from './shader-data';
42
42
  export * from './effects-package-data';
43
- export declare const LATEST_VERSION = JSONSceneVersion['3_1'];
43
+ export declare const LATEST_VERSION = JSONSceneVersion['3_2'];
@@ -1,12 +1,13 @@
1
1
  import type { BaseItem, EndBehavior } from './base-item';
2
2
  import type { ItemType } from '../type';
3
3
  import type { BaseTextContentOptions, TextComponentData, TextContent } from './text-item';
4
+ import type { vec2 } from '../number-expression';
4
5
  /**
5
6
  * 富文本元素
6
7
  */
7
8
  export interface RichTextItem extends BaseItem {
8
9
  /**
9
- * 元素类型(指定为 text
10
+ * 元素类型(指定为 richtext
10
11
  */
11
12
  type: ItemType.richtext;
12
13
  /**
@@ -16,13 +17,22 @@ export interface RichTextItem extends BaseItem {
16
17
  endBehavior: EndBehavior;
17
18
  }
18
19
  /**
19
- * 文本元素渲染属性
20
+ * 富文本元素参数
21
+ */
22
+ export interface RichTextContentOptions extends BaseTextContentOptions {
23
+ /**
24
+ * 富文本元素大小
25
+ */
26
+ size?: vec2;
27
+ }
28
+ /**
29
+ * 富文本元素渲染属性
20
30
  */
21
31
  export interface RichTextContent extends Omit<TextContent, 'options'> {
22
32
  /**
23
- * 文本元素基础属性
33
+ * 富文本元素基础属性
24
34
  */
25
- options: BaseTextContentOptions;
35
+ options: RichTextContentOptions;
26
36
  }
27
37
  /**
28
38
  * 富文本元素渲染属性
@@ -31,5 +41,5 @@ export interface RichTextComponentData extends Omit<TextComponentData, 'options'
31
41
  /**
32
42
  * 富文本元素基础属性
33
43
  */
34
- options: BaseTextContentOptions;
44
+ options: RichTextContentOptions;
35
45
  }
@@ -18,11 +18,6 @@ export interface TextItem extends BaseItem {
18
18
  endBehavior: EndBehavior;
19
19
  }
20
20
  export interface TextContentOptions extends BaseTextContentOptions {
21
- /**
22
- * 文本间隔
23
- * @default 0
24
- */
25
- letterSpace?: number;
26
21
  /**
27
22
  * 文本固定宽度(和自适应宽高冲突)
28
23
  * @default 31
@@ -43,14 +38,13 @@ export interface TextContentOptions extends BaseTextContentOptions {
43
38
  * @default false
44
39
  */
45
40
  autoWidth?: boolean;
46
- /**
47
- * 当文字超过最大宽度时,文字的表现行为
48
- * 仅当设置文字最大宽度后生效
49
- * @default TextOverflow.display
50
- */
51
- textOverflow?: TextOverflow;
52
41
  }
53
42
  export interface BaseTextContentOptions {
43
+ /**
44
+ * 文本间隔
45
+ * @default 0
46
+ */
47
+ letterSpace?: number;
54
48
  /**
55
49
  * 文本内容
56
50
  */
@@ -93,7 +87,7 @@ export interface BaseTextContentOptions {
93
87
  /**
94
88
  * 当文字超过最大宽度时,文字的表现行为
95
89
  * 仅当设置文字最大宽度后生效
96
- * @default TextOverflow.display
90
+ * @default TextOverflow.clip
97
91
  */
98
92
  textOverflow?: TextOverflow;
99
93
  /**
@@ -41,6 +41,11 @@ export interface VideoContentOptions {
41
41
  * @default 1
42
42
  */
43
43
  volume?: number;
44
+ /**
45
+ * 是否为透明视频
46
+ * @default false
47
+ */
48
+ transparent?: boolean;
44
49
  }
45
50
  /**
46
51
  * 视频组件属性
package/es/scene.d.ts CHANGED
@@ -30,7 +30,8 @@ export declare enum JSONSceneVersion {
30
30
  '2_4' = "2.4",// 支持贝塞尔曲线
31
31
  '3_0' = "3.0",// EC 改造、移除滤镜元素
32
32
  '3_1' = "3.1",// 音视频
33
- 'LATEST' = "3.1"
33
+ '3_2' = "3.2",// 矢量动画、透明视频、增加富文本属性
34
+ 'LATEST' = "3.2"
34
35
  }
35
36
  /**
36
37
  * runtime 2.0 之前的场景信息
package/es/scene.js CHANGED
@@ -16,5 +16,6 @@ export var JSONSceneVersion;
16
16
  JSONSceneVersion["2_4"] = "2.4";
17
17
  JSONSceneVersion["3_0"] = "3.0";
18
18
  JSONSceneVersion["3_1"] = "3.1";
19
- JSONSceneVersion["LATEST"] = "3.1";
19
+ JSONSceneVersion["3_2"] = "3.2";
20
+ JSONSceneVersion["LATEST"] = "3.2";
20
21
  })(JSONSceneVersion || (JSONSceneVersion = {}));
@@ -1,7 +1,6 @@
1
1
  import type { TransformData } from '../item/base-item';
2
2
  import type { Vector2Data } from '../math';
3
3
  import type { ShapeComponentData } from './shape-component-data';
4
- import type { ShapeFillParam } from './shape-fill-param';
5
4
  import type { ShapePrimitiveType } from './shape-primitive-type';
6
5
  /**
7
6
  * 自定义形状点
@@ -32,10 +31,6 @@ export interface CustomShape {
32
31
  * 是否为闭合图形 - 用于Stroke
33
32
  */
34
33
  close: boolean;
35
- /**
36
- * 填充属性
37
- */
38
- fill?: ShapeFillParam;
39
34
  /**
40
35
  * 空间变换
41
36
  */
@@ -1,6 +1,5 @@
1
1
  import type { TransformData } from '../item/base-item';
2
2
  import type { ShapeComponentData } from './shape-component-data';
3
- import type { ShapeFillParam } from './shape-fill-param';
4
3
  import type { ShapePrimitiveType } from './shape-primitive-type';
5
4
  /**
6
5
  * 椭圆组件参数
@@ -17,10 +16,6 @@ export interface EllipseData extends ShapeComponentData {
17
16
  * y 轴半径
18
17
  */
19
18
  yRadius: number;
20
- /**
21
- * 填充属性
22
- */
23
- fill?: ShapeFillParam;
24
19
  /**
25
20
  * 空间变换
26
21
  */
@@ -1,6 +1,5 @@
1
1
  import type { TransformData } from '../item/base-item';
2
2
  import type { ShapeComponentData } from './shape-component-data';
3
- import type { ShapeFillParam } from './shape-fill-param';
4
3
  /**
5
4
  * 多边形参数
6
5
  */
@@ -17,10 +16,6 @@ export interface PolygonData extends ShapeComponentData {
17
16
  * 角点圆度
18
17
  */
19
18
  roundness: number;
20
- /**
21
- * 填充属性
22
- */
23
- fill?: ShapeFillParam;
24
19
  /**
25
20
  * 空间变换
26
21
  */
@@ -1,6 +1,5 @@
1
1
  import type { TransformData } from '../item/base-item';
2
2
  import type { ShapeComponentData } from './shape-component-data';
3
- import type { ShapeFillParam } from './shape-fill-param';
4
3
  /**
5
4
  * 矩形参数
6
5
  */
@@ -17,10 +16,6 @@ export interface RectangleData extends ShapeComponentData {
17
16
  * 角点元素
18
17
  */
19
18
  roundness: number;
20
- /**
21
- * 填充属性
22
- */
23
- fill?: ShapeFillParam;
24
19
  /**
25
20
  * 空间变换
26
21
  */
@@ -1,4 +1,5 @@
1
1
  import type { ComponentData } from '../components/component-data';
2
+ import type { ShapeFillParam } from './shape-fill-param';
2
3
  import type { ShapePrimitiveType } from './shape-primitive-type';
3
4
  import type { ShapeStrokeParam } from './shape-stroke-param';
4
5
  /**
@@ -13,4 +14,8 @@ export interface ShapeComponentData extends ComponentData {
13
14
  * 描边属性
14
15
  */
15
16
  stroke?: ShapeStrokeParam;
17
+ /**
18
+ * 填充属性
19
+ */
20
+ fill?: ShapeFillParam;
16
21
  }
@@ -1,7 +1,19 @@
1
1
  import type { ColorData } from '../math/color-data';
2
- export declare enum ShapeConnectType {
2
+ export declare enum LineCap {
3
+ /** 默认值。向线条的每个末端添加平直的边缘 */
4
+ Butt = 0,
5
+ /** 向线条的每个末端添加圆形线帽 */
6
+ Round = 1,
7
+ /** 向线条的每个末端添加正方形线帽 */
8
+ Square = 2
3
9
  }
4
- export declare enum ShapePointType {
10
+ export declare enum LineJoin {
11
+ /** 创建圆角 */
12
+ Round = 0,
13
+ /** 创建斜角 */
14
+ Bevel = 1,
15
+ /** 创建尖角 */
16
+ Miter = 2
5
17
  }
6
18
  /**
7
19
  * 矢量描边参数
@@ -16,11 +28,11 @@ export interface ShapeStrokeParam {
16
28
  */
17
29
  color: ColorData;
18
30
  /**
19
- * 连接类型
31
+ * 线段端点的样式
20
32
  */
21
- connectType: ShapeConnectType;
33
+ cap: LineCap;
22
34
  /**
23
- * 点类型
35
+ * 线段连接处的样式
24
36
  */
25
- pointType: ShapePointType;
37
+ join: LineJoin;
26
38
  }
@@ -1,8 +1,18 @@
1
- // 本期无该功能 待补充
2
- export var ShapeConnectType;
3
- (function (ShapeConnectType) {
4
- })(ShapeConnectType || (ShapeConnectType = {}));
5
- // @待补充
6
- export var ShapePointType;
7
- (function (ShapePointType) {
8
- })(ShapePointType || (ShapePointType = {}));
1
+ export var LineCap;
2
+ (function (LineCap) {
3
+ /** 默认值。向线条的每个末端添加平直的边缘 */
4
+ LineCap[LineCap["Butt"] = 0] = "Butt";
5
+ /** 向线条的每个末端添加圆形线帽 */
6
+ LineCap[LineCap["Round"] = 1] = "Round";
7
+ /** 向线条的每个末端添加正方形线帽 */
8
+ LineCap[LineCap["Square"] = 2] = "Square";
9
+ })(LineCap || (LineCap = {}));
10
+ export var LineJoin;
11
+ (function (LineJoin) {
12
+ /** 创建圆角 */
13
+ LineJoin[LineJoin["Round"] = 0] = "Round";
14
+ /** 创建斜角 */
15
+ LineJoin[LineJoin["Bevel"] = 1] = "Bevel";
16
+ /** 创建尖角 */
17
+ LineJoin[LineJoin["Miter"] = 2] = "Miter";
18
+ })(LineJoin || (LineJoin = {}));
@@ -1,6 +1,5 @@
1
1
  import type { TransformData } from '../item/base-item';
2
2
  import type { ShapeComponentData } from './shape-component-data';
3
- import type { ShapeFillParam } from './shape-fill-param';
4
3
  /**
5
4
  * 星形参数
6
5
  */
@@ -25,10 +24,6 @@ export interface StarData extends ShapeComponentData {
25
24
  * 外径点圆度
26
25
  */
27
26
  outerRoundness: number;
28
- /**
29
- * 填充属性
30
- */
31
- fill?: ShapeFillParam;
32
27
  /**
33
28
  * 空间变换
34
29
  */
package/es/text.d.ts CHANGED
@@ -52,7 +52,7 @@ export interface FontBase {
52
52
  }
53
53
  export declare enum TextOverflow {
54
54
  /**
55
- * display 模式下,会显示所有文本,存在文本超过边界框的情况。
55
+ * display 模式下,会显示所有文本,文本大小会根据边界框调整。
56
56
  */
57
57
  display = 0,
58
58
  /**
package/es/text.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export var TextOverflow;
2
2
  (function (TextOverflow) {
3
3
  /**
4
- * display 模式下,会显示所有文本,存在文本超过边界框的情况。
4
+ * display 模式下,会显示所有文本,文本大小会根据边界框调整。
5
5
  */
6
6
  TextOverflow[TextOverflow["display"] = 0] = "display";
7
7
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/effects-specification",
3
- "version": "2.2.0-alpha.2",
3
+ "version": "2.2.0-alpha.4",
4
4
  "description": "Galacean Effects JSON Specification",
5
5
  "module": "./es/index.js",
6
6
  "main": "./es/index.js",