@galacean/effects-specification 2.6.0 → 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 +2 -5
- package/es/index.d.ts +1 -1
- package/es/item/rich-text-item.d.ts +20 -0
- package/es/item/text-item.d.ts +13 -23
- package/es/scene.d.ts +2 -1
- package/es/scene.js +2 -1
- package/es/text.d.ts +14 -0
- package/es/text.js +15 -0
- package/package.json +13 -11
package/es/assets.d.ts
CHANGED
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['
|
|
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
|
* 富文本元素渲染属性
|
package/es/item/text-item.d.ts
CHANGED
|
@@ -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,
|
|
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
|
|
@@ -39,25 +34,10 @@ export interface TextContentOptions extends BaseTextContentOptions {
|
|
|
39
34
|
*/
|
|
40
35
|
autoWidth?: boolean;
|
|
41
36
|
/**
|
|
42
|
-
*
|
|
43
|
-
* @default TextSizeMode.autoWidth
|
|
44
|
-
*/
|
|
45
|
-
sizeMode?: TextSizeMode;
|
|
46
|
-
/**
|
|
47
|
-
* 文本框宽度,用来排版和控制文本溢出行为
|
|
48
|
-
* @default undefined
|
|
49
|
-
*/
|
|
50
|
-
maxTextWidth?: number;
|
|
51
|
-
/**
|
|
52
|
-
* 文本框高度,用来排版和控制文本溢出行为
|
|
53
|
-
* @default undefined
|
|
54
|
-
*/
|
|
55
|
-
maxTextHeight?: number;
|
|
56
|
-
/**
|
|
57
|
-
* 是否开启自动换行
|
|
37
|
+
* 自适应宽高开关(和文本固定高度冲突)
|
|
58
38
|
* @default false
|
|
59
39
|
*/
|
|
60
|
-
|
|
40
|
+
autoHeight?: boolean;
|
|
61
41
|
}
|
|
62
42
|
export interface BaseTextContentOptions {
|
|
63
43
|
/**
|
|
@@ -70,6 +50,11 @@ export interface BaseTextContentOptions {
|
|
|
70
50
|
* @default 0.571
|
|
71
51
|
*/
|
|
72
52
|
lineGap?: number;
|
|
53
|
+
/**
|
|
54
|
+
* 文本行高
|
|
55
|
+
* @default 31
|
|
56
|
+
*/
|
|
57
|
+
lineHeight?: number;
|
|
73
58
|
/**
|
|
74
59
|
* 文本内容
|
|
75
60
|
*/
|
|
@@ -94,6 +79,11 @@ export interface BaseTextContentOptions {
|
|
|
94
79
|
* @default TextBaseline.middle
|
|
95
80
|
*/
|
|
96
81
|
textBaseline?: TextBaseline;
|
|
82
|
+
/**
|
|
83
|
+
* 垂直对齐方式
|
|
84
|
+
* @default TextVerticalAlign.middle
|
|
85
|
+
*/
|
|
86
|
+
textVerticalAlign?: TextVerticalAlign;
|
|
97
87
|
/**
|
|
98
88
|
* 左右对齐方式
|
|
99
89
|
* @default TextAlignment.left
|
package/es/scene.d.ts
CHANGED
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["
|
|
23
|
+
JSONSceneVersion["3_6"] = "3.6";
|
|
24
|
+
JSONSceneVersion["LATEST"] = "3.6";
|
|
24
25
|
})(JSONSceneVersion || (JSONSceneVersion = {}));
|
package/es/text.d.ts
CHANGED
|
@@ -113,6 +113,20 @@ export declare enum TextAlignment {
|
|
|
113
113
|
*/
|
|
114
114
|
right = 2
|
|
115
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
|
+
}
|
|
116
130
|
/**
|
|
117
131
|
* 文本字重
|
|
118
132
|
*/
|
package/es/text.js
CHANGED
|
@@ -65,6 +65,21 @@ export var TextAlignment;
|
|
|
65
65
|
*/
|
|
66
66
|
TextAlignment[TextAlignment["right"] = 2] = "right";
|
|
67
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 = {}));
|
|
68
83
|
/**
|
|
69
84
|
* 文本字重
|
|
70
85
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/effects-specification",
|
|
3
|
-
"version": "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",
|
|
@@ -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
|
+
}
|