@galacean/effects-specification 2.7.2 → 2.8.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.
@@ -78,6 +78,7 @@ interface CompositionBase {
78
78
  }
79
79
  /**
80
80
  * 合成信息
81
+ * @deprecated
81
82
  */
82
83
  export interface Composition extends CompositionBase {
83
84
  /**
@@ -93,6 +94,10 @@ export interface CompositionData extends CompositionBase {
93
94
  * @description 组件数据
94
95
  */
95
96
  components: DataPath[];
97
+ /**
98
+ * 合成的子节点列表
99
+ */
100
+ children?: DataPath[];
96
101
  }
97
102
  /**
98
103
  * 合成组件数据
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_6'];
44
+ export declare const LATEST_VERSION = JSONSceneVersion['3_7'];
@@ -1,7 +1,6 @@
1
1
  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
- import type { vec2 } from '../number-expression';
5
4
  import type { TextSizeMode } from '../text';
6
5
  /**
7
6
  * 富文本元素
@@ -21,10 +20,6 @@ export interface RichTextItem extends BaseItem {
21
20
  * 富文本元素参数
22
21
  */
23
22
  export interface RichTextContentOptions extends BaseTextContentOptions {
24
- /**
25
- * 富文本元素大小
26
- */
27
- size?: vec2;
28
23
  /**
29
24
  * 文本框宽度,用来排版和控制文本溢出行为
30
25
  */
@@ -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, TextVerticalAlign } from '../text';
4
+ import type { FontStyle, TextAlignment, TextBaseline, TextOverflow, TextWeight, TextVerticalAlign, TextSizeMode } from '../text';
5
5
  import type { ComponentData } from '../components';
6
6
  /**
7
7
  * 文本元素
@@ -29,15 +29,10 @@ export interface TextContentOptions extends BaseTextContentOptions {
29
29
  */
30
30
  textHeight?: number;
31
31
  /**
32
- * 自适应宽高开关(和文本固定宽度冲突)
33
- * @default false
32
+ * 文本自动调整尺寸模式
33
+ * @default TextSizeMode.fixed
34
34
  */
35
- autoWidth?: boolean;
36
- /**
37
- * 自适应宽高开关(和文本固定高度冲突)
38
- * @default false
39
- */
40
- autoHeight?: boolean;
35
+ autoResize?: TextSizeMode;
41
36
  }
42
37
  export interface BaseTextContentOptions {
43
38
  /**
package/es/scene.d.ts CHANGED
@@ -35,7 +35,8 @@ export declare enum JSONSceneVersion {
35
35
  '3_4' = "3.4",// 动画状态机
36
36
  '3_5' = "3.5",// 网格形状变化动画、矢量图形填充/描边渐变色
37
37
  '3_6' = "3.6",// 支持 KTX2 纹理、H265 视频格式、文本增强
38
- 'LATEST' = "3.6"
38
+ '3_7' = "3.7",// 文本 autoSize、元素子节点
39
+ 'LATEST' = "3.7"
39
40
  }
40
41
  /**
41
42
  * runtime 2.0 之前的场景信息
package/es/scene.js CHANGED
@@ -21,5 +21,6 @@ export var JSONSceneVersion;
21
21
  JSONSceneVersion["3_4"] = "3.4";
22
22
  JSONSceneVersion["3_5"] = "3.5";
23
23
  JSONSceneVersion["3_6"] = "3.6";
24
- JSONSceneVersion["LATEST"] = "3.6";
24
+ JSONSceneVersion["3_7"] = "3.7";
25
+ JSONSceneVersion["LATEST"] = "3.7";
25
26
  })(JSONSceneVersion || (JSONSceneVersion = {}));
@@ -23,6 +23,15 @@ export interface VFXItemData extends EffectsObjectData {
23
23
  * plugin 模块实现者自由实现命名
24
24
  */
25
25
  type: ItemType;
26
+ /**
27
+ * 元素结束行为
28
+ * @default destroy
29
+ */
30
+ endBehavior: EndBehavior;
31
+ /**
32
+ * 元素的组件数据
33
+ */
34
+ components: DataPath[];
26
35
  /**
27
36
  * 父节点 ID
28
37
  * 如果父节点无法找到,播放将直接报错
@@ -35,40 +44,39 @@ export interface VFXItemData extends EffectsObjectData {
35
44
  */
36
45
  visible?: boolean;
37
46
  /**
38
- * 元素结束行为
39
- * @default destroy
47
+ * 元素渲染等级
40
48
  */
41
- endBehavior: EndBehavior;
49
+ renderLevel?: RenderLevel;
50
+ /**
51
+ * 元素的基础位置
52
+ */
53
+ transform?: TransformData;
54
+ /**
55
+ * 元素的子节点列表
56
+ */
57
+ children?: DataPath[];
42
58
  /**
43
59
  * 元素播放延时(单位秒)
44
60
  * @default 0
61
+ * @deprecated
45
62
  */
46
63
  delay?: number;
47
64
  /**
48
65
  * 元素渲染信息属性
66
+ * @deprecated
49
67
  */
50
68
  content: BaseContent;
51
- /**
52
- * 元素渲染等级
53
- */
54
- renderLevel?: RenderLevel;
55
69
  /**
56
70
  * 元素的插件模块名,如果不指定,则和 type 相同
57
71
  * 从数组的 plugins 中获取 name
58
72
  * 例如:pn:1, plugins:["model@1.0",'spine@1.0']
59
73
  * pn 实际为 spine
74
+ * @deprecated
60
75
  */
61
76
  pn?: number;
62
77
  /**
63
78
  * 元素的插件模块名, 优先级高于 pn
79
+ * @deprecated
64
80
  */
65
81
  pluginName?: string;
66
- /**
67
- * 元素的基础位置
68
- */
69
- transform?: TransformData;
70
- /**
71
- * 元素的组件数据
72
- */
73
- components: DataPath[];
74
82
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/effects-specification",
3
- "version": "2.7.2",
3
+ "version": "2.8.0-alpha.0",
4
4
  "description": "Galacean Effects JSON Specification",
5
5
  "module": "./es/index.js",
6
6
  "main": "./es/index.js",
@@ -15,6 +15,17 @@
15
15
  "types": "./es/index.d.ts"
16
16
  }
17
17
  },
18
+ "scripts": {
19
+ "prebuild": "pnpm clean",
20
+ "build": "pnpm build:lib",
21
+ "build:lib": "tsc -b tsconfig.build.json",
22
+ "lint": "eslint src --ext .ts,.mjs",
23
+ "lint:fix": "eslint src --fix --quiet --ext .ts,.mjs",
24
+ "check:ts": "tsc -b tsconfig.check.json",
25
+ "clean": "rimraf es/**",
26
+ "prepare": "husky install",
27
+ "prepublishOnly": "npm run build"
28
+ },
18
29
  "browserslist": [
19
30
  "iOS 9"
20
31
  ],
@@ -37,14 +48,5 @@
37
48
  "publishConfig": {
38
49
  "access": "public",
39
50
  "registry": "https://registry.npmjs.org"
40
- },
41
- "scripts": {
42
- "prebuild": "pnpm clean",
43
- "build": "pnpm build:lib",
44
- "build:lib": "tsc -b tsconfig.build.json",
45
- "lint": "eslint src --ext .ts,.mjs",
46
- "lint:fix": "eslint src --fix --quiet --ext .ts,.mjs",
47
- "check:ts": "tsc -b tsconfig.check.json",
48
- "clean": "rimraf es/**"
49
51
  }
50
- }
52
+ }