@galacean/engine-spine 0.0.0-experimental-2024071103 → 0.0.0-experimental-2024071601
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/dist/browser.js +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +1 -1
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/package.json +47 -9
- package/types/SpineAnimation.d.ts +4 -17
- package/types/loader/LoaderUtils.d.ts +3 -2
- package/types/loader/SpineLoader.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.0.0-experimental-
|
|
2
|
+
"version": "0.0.0-experimental-2024071601",
|
|
3
3
|
"description": "galacean spine runtime",
|
|
4
4
|
"name": "@galacean/engine-spine",
|
|
5
5
|
"main": "dist/main.js",
|
|
@@ -16,9 +16,10 @@
|
|
|
16
16
|
"@babel/plugin-proposal-class-properties": "^7.12.1",
|
|
17
17
|
"@babel/plugin-proposal-decorators": "^7.12.1",
|
|
18
18
|
"@babel/plugin-proposal-optional-chaining": "^7.12.1",
|
|
19
|
+
"@babel/plugin-transform-class-properties": "^7.24.7",
|
|
19
20
|
"@babel/plugin-transform-object-assign": "^7.12.1",
|
|
20
|
-
"@babel/preset-env": "^7.
|
|
21
|
-
"@babel/preset-typescript": "^7.
|
|
21
|
+
"@babel/preset-env": "^7.24.8",
|
|
22
|
+
"@babel/preset-typescript": "^7.24.7",
|
|
22
23
|
"@galacean/engine": "1.3.0-alpha.0",
|
|
23
24
|
"@galacean/engine-toolkit": "beta",
|
|
24
25
|
"@rollup/plugin-babel": "^5.2.1",
|
|
@@ -29,12 +30,24 @@
|
|
|
29
30
|
"@rollup/plugin-terser": "^0.4.3",
|
|
30
31
|
"@swc/core": "^1.3.32",
|
|
31
32
|
"@swc/helpers": "^0.5",
|
|
33
|
+
"@types/chai": "^4.3.16",
|
|
34
|
+
"@types/jest": "^29.5.12",
|
|
35
|
+
"@types/node": "^20.14.10",
|
|
32
36
|
"@vitejs/plugin-basic-ssl": "^1.1.0",
|
|
33
|
-
"
|
|
37
|
+
"babel-core": "^6.26.3",
|
|
38
|
+
"babel-jest": "^29.7.0",
|
|
39
|
+
"canvas": "^2.11.2",
|
|
40
|
+
"chai": "^4.3.6",
|
|
41
|
+
"chai-spies": "^1.0.0",
|
|
42
|
+
"cross-env": "^5.2.1",
|
|
43
|
+
"cypress": "^13.13.0",
|
|
34
44
|
"dat.gui": "^0.7.9",
|
|
35
|
-
"
|
|
45
|
+
"electron": "^12.0.0",
|
|
46
|
+
"jest": "^29.7.0",
|
|
47
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
36
48
|
"react": "^16.14.0",
|
|
37
49
|
"react-dom": "^16.14.0",
|
|
50
|
+
"regenerator-runtime": "^0.14.1",
|
|
38
51
|
"rollup": "^2.32.0",
|
|
39
52
|
"rollup-plugin-glslify": "^1.2.0",
|
|
40
53
|
"rollup-plugin-modify": "^3.0.0",
|
|
@@ -42,7 +55,11 @@
|
|
|
42
55
|
"rollup-plugin-swc3": "^0.8.0",
|
|
43
56
|
"rollup-plugin-terser": "^7.0.2",
|
|
44
57
|
"rollup-plugin-version-injector": "^1.3.3",
|
|
45
|
-
"
|
|
58
|
+
"sinon": "^18.0.0",
|
|
59
|
+
"ts-jest": "^29.2.2",
|
|
60
|
+
"ts-node": "^10.9.2",
|
|
61
|
+
"tsconfig-paths": "^4.2.0",
|
|
62
|
+
"typescript": "^5.5.3",
|
|
46
63
|
"vite": "^4.3.9"
|
|
47
64
|
},
|
|
48
65
|
"ci": {
|
|
@@ -53,11 +70,32 @@
|
|
|
53
70
|
"types",
|
|
54
71
|
"dist"
|
|
55
72
|
],
|
|
73
|
+
"jest": {
|
|
74
|
+
"runner": "jest-runner",
|
|
75
|
+
"testEnvironment": "jsdom",
|
|
76
|
+
"testEnvironmentOptions": {
|
|
77
|
+
"url": "https://jestjs.io/",
|
|
78
|
+
"userAgent": "Agent/007"
|
|
79
|
+
},
|
|
80
|
+
"preset": "ts-jest",
|
|
81
|
+
"collectCoverage": true,
|
|
82
|
+
"testRegex": "(/tests/.*\\.(test|spec))\\.ts?$",
|
|
83
|
+
"collectCoverageFrom": [
|
|
84
|
+
"src/**/*.ts"
|
|
85
|
+
],
|
|
86
|
+
"transform": {
|
|
87
|
+
"^.+\\.js$": "babel-jest",
|
|
88
|
+
"^.+\\.ts$": "ts-jest"
|
|
89
|
+
},
|
|
90
|
+
"transformIgnorePatterns": [
|
|
91
|
+
"node_modules/(?!(.*@esotericsoftware/spine-core.*))"
|
|
92
|
+
]
|
|
93
|
+
},
|
|
56
94
|
"scripts": {
|
|
57
95
|
"example": "vite",
|
|
58
|
-
"test": "
|
|
59
|
-
"test
|
|
60
|
-
"test
|
|
96
|
+
"test": "jest",
|
|
97
|
+
"test:cov": "jest --coverage",
|
|
98
|
+
"test:debug": "cross-env DEBUG_MODE=1 jest",
|
|
61
99
|
"dev": "rollup -cw",
|
|
62
100
|
"build": "npm run b:types && cross-env BUILD_TYPE=ALL rollup -c",
|
|
63
101
|
"build:watch": "npm run b:types && cross-env BUILD_TYPE=ALL rollup -c --watch",
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { Skeleton, SkeletonData, AnimationState, AnimationStateData } from "@esotericsoftware/spine-core";
|
|
2
2
|
import { Buffer, Renderer, Entity, Material, Engine, BoundingBox, Primitive, SubPrimitive } from "@galacean/engine";
|
|
3
3
|
import { SkeletonDataResource } from "./loader/SkeletonDataResource";
|
|
4
|
-
declare module '@esotericsoftware/spine-core' {
|
|
5
|
-
interface SkeletonData {
|
|
6
|
-
refCount: number;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
4
|
interface InitialState {
|
|
10
5
|
animationName: string;
|
|
11
6
|
skinName: string;
|
|
@@ -82,10 +77,6 @@ export declare class SpineAnimation extends Renderer {
|
|
|
82
77
|
* @internal
|
|
83
78
|
*/
|
|
84
79
|
update(delta: number): void;
|
|
85
|
-
/**
|
|
86
|
-
* @internal
|
|
87
|
-
*/
|
|
88
|
-
_updateRendererShaderData(context: any): void;
|
|
89
80
|
/**
|
|
90
81
|
* @internal
|
|
91
82
|
*/
|
|
@@ -95,8 +86,8 @@ export declare class SpineAnimation extends Renderer {
|
|
|
95
86
|
*/
|
|
96
87
|
_updateBounds(worldBounds: BoundingBox): void;
|
|
97
88
|
/**
|
|
98
|
-
|
|
99
|
-
|
|
89
|
+
* @internal
|
|
90
|
+
*/
|
|
100
91
|
_calculateGeneratorBounds(worldBounds: BoundingBox): void;
|
|
101
92
|
/**
|
|
102
93
|
* @internal
|
|
@@ -129,11 +120,7 @@ export declare class SpineAnimation extends Renderer {
|
|
|
129
120
|
/**
|
|
130
121
|
* @internal
|
|
131
122
|
*/
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* @internal
|
|
135
|
-
*/
|
|
136
|
-
_onTransformChanged(): void;
|
|
123
|
+
_onWorldVolumeChanged(): void;
|
|
137
124
|
private onAnimationStart;
|
|
138
125
|
private onAnimationComplete;
|
|
139
126
|
private _clearMaterialCache;
|
|
@@ -147,7 +134,7 @@ export declare enum SpineAnimationUpdateFlags {
|
|
|
147
134
|
/** On Animation start play */
|
|
148
135
|
AnimationVolume = 2,
|
|
149
136
|
/** On skeleton data asset changed */
|
|
150
|
-
|
|
137
|
+
InitialVolume = 4
|
|
151
138
|
}
|
|
152
139
|
/**
|
|
153
140
|
* @internal
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { Engine, Texture2D } from "@galacean/engine";
|
|
1
|
+
import { AssetPromise, Engine, Texture2D } from "@galacean/engine";
|
|
2
2
|
import { TextureAtlas, SkeletonData, Texture, TextureFilter, TextureWrap } from "@esotericsoftware/spine-core";
|
|
3
3
|
export declare function createSkeletonData(textureAtlas: TextureAtlas, skeletonTextData: string | ArrayBuffer, skeletonFileType: 'json' | 'skel'): SkeletonData;
|
|
4
4
|
export declare function loadTexturesByPath(imagePaths: string[], imageExtensions: string[], engine: Engine): Promise<Texture2D[]>;
|
|
5
5
|
export declare function loadTextureAtlas(atlasPath: string, engine: Engine): Promise<TextureAtlas>;
|
|
6
6
|
export declare function createTextureAtlas(atlasText: string, textures: Texture2D[]): TextureAtlas;
|
|
7
|
+
export declare function loadTexture(url: string, engine: Engine, imageLoaderType?: string): AssetPromise<Texture2D>;
|
|
8
|
+
export declare function createAdaptiveTexture(texture: Texture2D): AdaptiveTexture;
|
|
7
9
|
export declare function getBaseUrl(url: string): string;
|
|
8
10
|
export declare class AdaptiveTexture extends Texture {
|
|
9
11
|
texture: Texture2D;
|
|
@@ -14,4 +16,3 @@ export declare class AdaptiveTexture extends Texture {
|
|
|
14
16
|
dispose(): void;
|
|
15
17
|
private _convertWrapMode;
|
|
16
18
|
}
|
|
17
|
-
export declare function getUrlExtension(url: string, fileExtension: string): string | null;
|
|
@@ -20,6 +20,7 @@ export declare class SpineLoader extends Loader<SkeletonDataResource> {
|
|
|
20
20
|
static parseAndAssignSpineAsset(url: string, fileExtension: string | null, bundle: SpineAssetBundle): void;
|
|
21
21
|
static deriveAndAssignSpineAsset(url: string, fileExtension: string | null, bundle: SpineAssetBundle): void;
|
|
22
22
|
static verifyFileExtensions(fileExtensions: string | string[], expectArray: boolean): string | string[] | null;
|
|
23
|
+
static getUrlExtension(url: string, fileExtension: string): string | null;
|
|
23
24
|
load(item: SpineLoadItem, resourceManager: ResourceManager): AssetPromise<SkeletonDataResource>;
|
|
24
25
|
private _handleEditorAsset;
|
|
25
26
|
private _handleOriginAsset;
|