@galacean/effects-specification 2.6.0-alpha.2 → 2.7.0-alpha.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/es/assets.d.ts CHANGED
@@ -80,10 +80,7 @@ export interface TemplateImage extends Image {
80
80
  */
81
81
  export interface CompressedImage extends Image {
82
82
  /**
83
- * 压缩贴图地址
83
+ * KTX2 地址
84
84
  */
85
- compressed: {
86
- astc?: string;
87
- pvrtc?: string;
88
- };
85
+ ktx2?: string;
89
86
  }
package/es/index.d.ts CHANGED
@@ -41,4 +41,4 @@ export * from './material-data';
41
41
  export * from './geometry-data';
42
42
  export * from './shader-data';
43
43
  export * from './effects-package-data';
44
- export declare const LATEST_VERSION = JSONSceneVersion['3_5'];
44
+ export declare const LATEST_VERSION = JSONSceneVersion['3_6'];
@@ -2,6 +2,7 @@ import type { BaseItem, EndBehavior, MaskOptions } from './base-item';
2
2
  import type { ItemType } from '../type';
3
3
  import type { BaseTextContentOptions, TextComponentData, TextContent } from './text-item';
4
4
  import type { vec2 } from '../number-expression';
5
+ import type { TextSizeMode } from '../text';
5
6
  /**
6
7
  * 富文本元素
7
8
  */
@@ -24,6 +25,25 @@ export interface RichTextContentOptions extends BaseTextContentOptions {
24
25
  * 富文本元素大小
25
26
  */
26
27
  size?: vec2;
28
+ /**
29
+ * 文本框宽度,用来排版和控制文本溢出行为
30
+ */
31
+ maxTextWidth?: number;
32
+ /**
33
+ * 文本框高度,用来排版和控制文本溢出行为
34
+ * @default undefined
35
+ */
36
+ maxTextHeight?: number;
37
+ /**
38
+ * 是否开启自动换行
39
+ * @default false
40
+ */
41
+ wrapEnabled?: boolean;
42
+ /**
43
+ * 尺寸模式
44
+ * @default TextSizeMode.autoWidth
45
+ */
46
+ sizeMode?: TextSizeMode;
27
47
  }
28
48
  /**
29
49
  * 富文本元素渲染属性
@@ -25,6 +25,7 @@ export interface SpriteContentOptions {
25
25
  }
26
26
  /**
27
27
  * 图层元素渲染属性
28
+ * @deprecated Please use SpriteComponentData instead
28
29
  */
29
30
  export interface SpriteContent {
30
31
  /**
@@ -78,4 +79,8 @@ export interface SpriteContent {
78
79
  * 图层组件属性
79
80
  */
80
81
  export interface SpriteComponentData extends ComponentData, SpriteContent {
82
+ /**
83
+ * 图层帧动画是否循环播放
84
+ */
85
+ loop?: boolean;
81
86
  }
@@ -1,7 +1,7 @@
1
1
  import type { BaseItem, EndBehavior, MaskOptions } from './base-item';
2
2
  import type { SizeOverLifetime, RotationOverLifetime, PositionOverLifetime, ColorOverLifetime, ItemType, TextureSheetAnimation, RendererOptions, InteractBehavior } from '../type';
3
3
  import type { RGBAColorValue } from '../number-expression';
4
- import type { FontStyle, TextAlignment, TextBaseline, TextOverflow, TextWeight } from '../text';
4
+ import type { FontStyle, TextAlignment, TextBaseline, TextOverflow, TextWeight, TextVerticalAlign } from '../text';
5
5
  import type { ComponentData } from '../components';
6
6
  /**
7
7
  * 文本元素
@@ -23,11 +23,6 @@ export interface TextContentOptions extends BaseTextContentOptions {
23
23
  * @default 31
24
24
  */
25
25
  textWidth?: number;
26
- /**
27
- * 文本行高
28
- * @default 31
29
- */
30
- lineHeight?: number;
31
26
  /**
32
27
  * 文本高度
33
28
  * @default 31
@@ -38,6 +33,11 @@ export interface TextContentOptions extends BaseTextContentOptions {
38
33
  * @default false
39
34
  */
40
35
  autoWidth?: boolean;
36
+ /**
37
+ * 自适应宽高开关(和文本固定高度冲突)
38
+ * @default false
39
+ */
40
+ autoHeight?: boolean;
41
41
  }
42
42
  export interface BaseTextContentOptions {
43
43
  /**
@@ -50,6 +50,11 @@ export interface BaseTextContentOptions {
50
50
  * @default 0.571
51
51
  */
52
52
  lineGap?: number;
53
+ /**
54
+ * 文本行高
55
+ * @default 31
56
+ */
57
+ lineHeight?: number;
53
58
  /**
54
59
  * 文本内容
55
60
  */
@@ -74,6 +79,11 @@ export interface BaseTextContentOptions {
74
79
  * @default TextBaseline.middle
75
80
  */
76
81
  textBaseline?: TextBaseline;
82
+ /**
83
+ * 垂直对齐方式
84
+ * @default TextVerticalAlign.middle
85
+ */
86
+ textVerticalAlign?: TextVerticalAlign;
77
87
  /**
78
88
  * 左右对齐方式
79
89
  * @default TextAlignment.left
package/es/scene.d.ts CHANGED
@@ -34,7 +34,8 @@ export declare enum JSONSceneVersion {
34
34
  '3_3' = "3.3",// 指向型蒙版、图片/文字蒙版
35
35
  '3_4' = "3.4",// 动画状态机
36
36
  '3_5' = "3.5",// 网格形状变化动画、矢量图形填充/描边渐变色
37
- 'LATEST' = "3.5"
37
+ '3_6' = "3.6",// KTX2 纹理支持、文本增强
38
+ 'LATEST' = "3.6"
38
39
  }
39
40
  /**
40
41
  * runtime 2.0 之前的场景信息
package/es/scene.js CHANGED
@@ -20,5 +20,6 @@ export var JSONSceneVersion;
20
20
  JSONSceneVersion["3_3"] = "3.3";
21
21
  JSONSceneVersion["3_4"] = "3.4";
22
22
  JSONSceneVersion["3_5"] = "3.5";
23
- JSONSceneVersion["LATEST"] = "3.5";
23
+ JSONSceneVersion["3_6"] = "3.6";
24
+ JSONSceneVersion["LATEST"] = "3.6";
24
25
  })(JSONSceneVersion || (JSONSceneVersion = {}));
@@ -1,4 +1,4 @@
1
- import type { RenderMode, SideMode, BlendingMode } from '../type';
1
+ import type { SideMode, BlendingMode } from '../type';
2
2
  import type { ComponentData, DataPath } from '../components/component-data';
3
3
  import type { MaskOptions } from '../item/base-item';
4
4
  import type { ShapePrimitiveType } from './shape-primitive-type';
@@ -35,7 +35,6 @@ export interface ShapeComponentData extends ComponentData {
35
35
  renderer?: ShapeRendererOptions;
36
36
  }
37
37
  export interface ShapeRendererOptions {
38
- renderMode?: RenderMode;
39
38
  side?: SideMode;
40
39
  occlusion?: boolean;
41
40
  transparentOcclusion?: boolean;
@@ -77,8 +76,14 @@ export interface TexturePaintData {
77
76
  texture: DataPath;
78
77
  scaleMode: TexturePaintScaleMode;
79
78
  scalingFactor?: number;
79
+ textureTransform?: TextureTransformData;
80
80
  opacity?: number;
81
81
  }
82
+ export interface TextureTransformData {
83
+ offset?: Vector2Data;
84
+ rotation?: number;
85
+ scale?: Vector2Data;
86
+ }
82
87
  export declare enum TexturePaintScaleMode {
83
88
  Fill = 0,
84
89
  Fit = 1,
package/es/text.d.ts CHANGED
@@ -52,17 +52,35 @@ export interface FontBase {
52
52
  }
53
53
  export declare enum TextOverflow {
54
54
  /**
55
- * display 模式下,会显示所有文本,文本大小会根据边界框调整。
55
+ * visible 模式下,文本内容超出边界框时,会继续显示内容,不进行裁剪或缩放。
56
56
  */
57
- display = 0,
57
+ visible = 0,
58
+ /**
59
+ * display 模式下,会显示所有文本,文本字号大小会根据边界框调整。
60
+ */
61
+ display = 1,
58
62
  /**
59
63
  * clip 模式下,当文本内容超出边界框时,多余的会被截断。
60
64
  */
61
- clip = 1,
65
+ clip = 2,
62
66
  /**
63
67
  * ellipsis 模式下,会使用(...)来代替超出边界框的内容。
64
68
  */
65
- ellipsis = 2
69
+ ellipsis = 3
70
+ }
71
+ export declare enum TextSizeMode {
72
+ /**
73
+ * 自适应宽度
74
+ */
75
+ autoWidth = 0,
76
+ /**
77
+ * 自适应高度
78
+ */
79
+ autoHeight = 1,
80
+ /**
81
+ * 固定宽高
82
+ */
83
+ fixed = 2
66
84
  }
67
85
  export declare enum TextBaseline {
68
86
  /**
@@ -95,6 +113,20 @@ export declare enum TextAlignment {
95
113
  */
96
114
  right = 2
97
115
  }
116
+ export declare enum TextVerticalAlign {
117
+ /**
118
+ * 文本顶对齐。
119
+ */
120
+ top = 0,
121
+ /**
122
+ * 文本垂直居中对齐。
123
+ */
124
+ middle = 1,
125
+ /**
126
+ * 文本底对齐。
127
+ */
128
+ bottom = 2
129
+ }
98
130
  /**
99
131
  * 文本字重
100
132
  */
package/es/text.js CHANGED
@@ -1,18 +1,37 @@
1
1
  export var TextOverflow;
2
2
  (function (TextOverflow) {
3
3
  /**
4
- * display 模式下,会显示所有文本,文本大小会根据边界框调整。
4
+ * visible 模式下,文本内容超出边界框时,会继续显示内容,不进行裁剪或缩放。
5
5
  */
6
- TextOverflow[TextOverflow["display"] = 0] = "display";
6
+ TextOverflow[TextOverflow["visible"] = 0] = "visible";
7
+ /**
8
+ * display 模式下,会显示所有文本,文本字号大小会根据边界框调整。
9
+ */
10
+ TextOverflow[TextOverflow["display"] = 1] = "display";
7
11
  /**
8
12
  * clip 模式下,当文本内容超出边界框时,多余的会被截断。
9
13
  */
10
- TextOverflow[TextOverflow["clip"] = 1] = "clip";
14
+ TextOverflow[TextOverflow["clip"] = 2] = "clip";
11
15
  /**
12
16
  * ellipsis 模式下,会使用(...)来代替超出边界框的内容。
13
17
  */
14
- TextOverflow[TextOverflow["ellipsis"] = 2] = "ellipsis";
18
+ TextOverflow[TextOverflow["ellipsis"] = 3] = "ellipsis";
15
19
  })(TextOverflow || (TextOverflow = {}));
20
+ export var TextSizeMode;
21
+ (function (TextSizeMode) {
22
+ /**
23
+ * 自适应宽度
24
+ */
25
+ TextSizeMode[TextSizeMode["autoWidth"] = 0] = "autoWidth";
26
+ /**
27
+ * 自适应高度
28
+ */
29
+ TextSizeMode[TextSizeMode["autoHeight"] = 1] = "autoHeight";
30
+ /**
31
+ * 固定宽高
32
+ */
33
+ TextSizeMode[TextSizeMode["fixed"] = 2] = "fixed";
34
+ })(TextSizeMode || (TextSizeMode = {}));
16
35
  export var TextBaseline;
17
36
  (function (TextBaseline) {
18
37
  /**
@@ -46,6 +65,21 @@ export var TextAlignment;
46
65
  */
47
66
  TextAlignment[TextAlignment["right"] = 2] = "right";
48
67
  })(TextAlignment || (TextAlignment = {}));
68
+ export var TextVerticalAlign;
69
+ (function (TextVerticalAlign) {
70
+ /**
71
+ * 文本顶对齐。
72
+ */
73
+ TextVerticalAlign[TextVerticalAlign["top"] = 0] = "top";
74
+ /**
75
+ * 文本垂直居中对齐。
76
+ */
77
+ TextVerticalAlign[TextVerticalAlign["middle"] = 1] = "middle";
78
+ /**
79
+ * 文本底对齐。
80
+ */
81
+ TextVerticalAlign[TextVerticalAlign["bottom"] = 2] = "bottom";
82
+ })(TextVerticalAlign || (TextVerticalAlign = {}));
49
83
  /**
50
84
  * 文本字重
51
85
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/effects-specification",
3
- "version": "2.6.0-alpha.2",
3
+ "version": "2.7.0-alpha.0",
4
4
  "description": "Galacean Effects JSON Specification",
5
5
  "module": "./es/index.js",
6
6
  "main": "./es/index.js",