@seayoo-web/pixi-live2d 0.1.0 → 1.0.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/README.md +75 -61
- package/dist/core-DBA9LYvt.js +7111 -0
- package/dist/cubism4.es-DbGCrqOi.js +3116 -0
- package/dist/index.js +7110 -4
- package/package.json +22 -20
- package/types/index.d.ts +10 -6
- package/dist/cubism4.es-lCEfB7RP.js +0 -3608
- package/dist/index-CuNStzp0.js +0 -18424
package/package.json
CHANGED
|
@@ -1,30 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seayoo-web/pixi-live2d",
|
|
3
|
+
"version": "1.0.0",
|
|
3
4
|
"description": "pixi-live2d viewer",
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"
|
|
5
|
+
"keywords": [
|
|
6
|
+
"pixi-live2d"
|
|
7
|
+
],
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"author": "web@seayoo.com",
|
|
8
10
|
"source": "./index.ts",
|
|
9
|
-
"types": "./types/index.d.ts",
|
|
10
|
-
"sideEffects": false,
|
|
11
11
|
"files": [
|
|
12
12
|
"dist",
|
|
13
13
|
"types",
|
|
14
14
|
"docs",
|
|
15
15
|
"README.md"
|
|
16
16
|
],
|
|
17
|
+
"type": "module",
|
|
18
|
+
"sideEffects": false,
|
|
19
|
+
"main": "./dist/index.js",
|
|
20
|
+
"module": "./dist/index.js",
|
|
21
|
+
"types": "./types/index.d.ts",
|
|
17
22
|
"publishConfig": {
|
|
18
23
|
"access": "public"
|
|
19
24
|
},
|
|
20
|
-
"engines": {
|
|
21
|
-
"node": ">=22"
|
|
22
|
-
},
|
|
23
|
-
"keywords": [
|
|
24
|
-
"pixi-live2d"
|
|
25
|
-
],
|
|
26
|
-
"author": "web@seayoo.com",
|
|
27
|
-
"license": "MIT",
|
|
28
25
|
"dependencies": {
|
|
29
26
|
"@pixi/constants": "6.5.2",
|
|
30
27
|
"@pixi/core": "6.5.2",
|
|
@@ -42,15 +39,20 @@
|
|
|
42
39
|
},
|
|
43
40
|
"devDependencies": {
|
|
44
41
|
"@types/node": "^22.13.1",
|
|
45
|
-
"@
|
|
46
|
-
"
|
|
42
|
+
"@vitest/coverage-istanbul": "^4.1.4",
|
|
43
|
+
"happy-dom": "^13.10.1",
|
|
44
|
+
"vitest": "^4.1.4",
|
|
45
|
+
"@seayoo-web/utils": "^4.5.4",
|
|
46
|
+
"@seayoo-web/tsconfig": "^1.0.6"
|
|
47
|
+
},
|
|
48
|
+
"engines": {
|
|
49
|
+
"node": ">=22"
|
|
47
50
|
},
|
|
48
51
|
"scripts": {
|
|
49
|
-
"build": "vite build && tsc --build --
|
|
52
|
+
"build": "vite build && tsc --build --emitDeclarationOnly",
|
|
50
53
|
"type-check": "tsc --noEmit",
|
|
51
|
-
"lint": "
|
|
52
|
-
"lint:fix": "
|
|
53
|
-
"prepublish": "pnpm lint:fix && pnpm build",
|
|
54
|
+
"lint": "oxlint -c ../../oxlint.config.mjs",
|
|
55
|
+
"lint:fix": "oxlint -c ../../oxlint.config.mjs --fix",
|
|
54
56
|
"test": "vitest --dom",
|
|
55
57
|
"coverage": "vitest run --coverage"
|
|
56
58
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import * as PIXI from "pixi.js";
|
|
2
|
-
declare const coreLoadPromise: Promise<boolean>;
|
|
3
|
-
export { coreLoadPromise };
|
|
4
2
|
import type { InternalModel as InternalModelType, Live2DModel as Live2DModelType } from "pixi-live2d-display/cubism4";
|
|
5
3
|
export type { MotionPriority } from "pixi-live2d-display/cubism4";
|
|
6
4
|
declare global {
|
|
@@ -43,12 +41,16 @@ export declare class Live2DViewer {
|
|
|
43
41
|
* @param url - Core 库的 URL 地址
|
|
44
42
|
*/
|
|
45
43
|
static loadCubismCore(url?: string): Promise<void>;
|
|
46
|
-
/** PIXI
|
|
44
|
+
/** PIXI 应用实例(每个 viewer 独立,持有各自的 canvas / stage / WebGL context) */
|
|
47
45
|
app: PIXI.Application;
|
|
48
46
|
/** Live2D 模型实例 */
|
|
49
47
|
model: Live2DModelType<InternalModelType> | null;
|
|
50
|
-
/**
|
|
48
|
+
/** 配置项 */
|
|
51
49
|
private options;
|
|
50
|
+
/** 最新发起的加载任务 token,防同一实例内频繁加载的竞态泄漏 */
|
|
51
|
+
private loadingToken;
|
|
52
|
+
/** 该实例(WebGL context)的渲染管线是否已完成首次预热 */
|
|
53
|
+
private hasWarmedUp;
|
|
52
54
|
/**
|
|
53
55
|
* 创建 Live2D 查看器实例
|
|
54
56
|
* @param canvas - 用于渲染的 Canvas 元素或其 ID
|
|
@@ -60,8 +62,10 @@ export declare class Live2DViewer {
|
|
|
60
62
|
/** 设置点击交互 */
|
|
61
63
|
private setupInteraction;
|
|
62
64
|
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
+
* 禁用模型的自然晃动(呼吸、身体/头部摇摆等)。
|
|
66
|
+
*
|
|
67
|
+
* 实现方式是把 internalModel 的 updateNaturalMovements 覆写为空操作。
|
|
68
|
+
* 注意:尽管方法名含 head,实际会关闭**全部**自然动作,而不仅是头部角度。
|
|
65
69
|
*/
|
|
66
70
|
lockHeadAngle(): void;
|
|
67
71
|
/** 窗口大小改变的处理函数 */
|