@galacean/effects-specification 2.6.0-alpha.2 → 2.6.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.
@@ -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, TextSizeMode } from '../text';
5
5
  import type { ComponentData } from '../components';
6
6
  /**
7
7
  * 文本元素
@@ -38,6 +38,26 @@ export interface TextContentOptions extends BaseTextContentOptions {
38
38
  * @default false
39
39
  */
40
40
  autoWidth?: boolean;
41
+ /**
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
+ * 是否开启自动换行
58
+ * @default false
59
+ */
60
+ wrapEnabled?: boolean;
41
61
  }
42
62
  export interface BaseTextContentOptions {
43
63
  /**
@@ -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
  /**
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
  /**
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.6.0",
4
4
  "description": "Galacean Effects JSON Specification",
5
5
  "module": "./es/index.js",
6
6
  "main": "./es/index.js",
@@ -15,17 +15,6 @@
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
- },
29
18
  "browserslist": [
30
19
  "iOS 9"
31
20
  ],
@@ -48,5 +37,14 @@
48
37
  "publishConfig": {
49
38
  "access": "public",
50
39
  "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/**"
51
49
  }
52
- }
50
+ }