@doki-land/live2d 0.0.4 → 0.0.5

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/package.json CHANGED
@@ -1,50 +1,53 @@
1
1
  {
2
- "name": "@doki-land/live2d",
3
- "version": "0.0.4",
4
- "keywords": [
5
- "live2d",
6
- "pixi",
7
- "typescript"
8
- ],
9
- "description": "Live2D TypeScript runtime based on pixi-live2d-display",
10
- "author": "Aster <192608617@qq.com>",
11
- "license": "LGPL-3.0-or-later",
12
- "type": "module",
13
- "main": "dist/l2d.umd.js",
14
- "module": "dist/l2d.esm.js",
15
- "types": "src/index.ts",
16
- "exports": {
17
- ".": {
18
- "types": "./src/index.ts",
19
- "require": "./dist/l2d.umd.js",
20
- "import": "./dist/l2d.esm.js"
21
- },
22
- "./fs": {
23
- "types": "./src/fs/index.ts",
24
- "import": "./src/fs/index.ts"
25
- }
2
+ "name": "@doki-land/live2d",
3
+ "version": "0.0.5",
4
+ "keywords": [
5
+ "live2d",
6
+ "pixi",
7
+ "typescript"
8
+ ],
9
+ "description": "Live2D TypeScript runtime based on pixi-live2d-display",
10
+ "author": "Aster <192608617@qq.com>",
11
+ "license": "LGPL-3.0-or-later",
12
+ "type": "module",
13
+ "main": "dist/l2d.umd.js",
14
+ "module": "dist/l2d.esm.js",
15
+ "types": "src/index.ts",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./src/index.ts",
19
+ "require": "./dist/l2d.umd.js",
20
+ "import": "./src/index.ts"
26
21
  },
27
- "files": [
28
- "dist",
29
- "lib",
30
- "src"
31
- ],
32
- "publishConfig": {
33
- "registry": "https://registry.npmjs.org",
34
- "access": "public"
22
+ "./fs": {
23
+ "types": "./src/fs/index.ts",
24
+ "import": "./src/fs/index.ts"
35
25
  },
36
- "scripts": {
37
- "dev": "vite",
38
- "build": "vite build",
39
- "preview": "vite preview",
40
- "prepublishOnly": "pnpm build"
41
- },
42
- "dependencies": {
43
- "@pixi/core": "^7.4.3",
44
- "@pixi/display": "^7.4.3",
45
- "@pixi/ticker": "^7.4.3",
46
- "minimatch": "^10.0.1",
47
- "pixi-live2d-display-lipsyncpatch": "0.5.0-ls-7",
48
- "pixi.js": "^7.4.3"
26
+ "./types": {
27
+ "types": "./src/types/index.ts",
28
+ "import": "./src/types/index.ts"
49
29
  }
50
- }
30
+ },
31
+ "files": [
32
+ "dist",
33
+ "lib",
34
+ "src"
35
+ ],
36
+ "publishConfig": {
37
+ "registry": "https://registry.npmjs.org",
38
+ "access": "public"
39
+ },
40
+ "dependencies": {
41
+ "@pixi/core": "^7.4.3",
42
+ "@pixi/display": "^7.4.3",
43
+ "@pixi/ticker": "^7.4.3",
44
+ "minimatch": "^10.0.1",
45
+ "pixi-live2d-display-lipsyncpatch": "0.5.0-ls-7",
46
+ "pixi.js": "^7.4.3"
47
+ },
48
+ "scripts": {
49
+ "dev": "vite",
50
+ "build": "vite build",
51
+ "preview": "vite preview"
52
+ }
53
+ }
package/src/fs/index.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { minimatch } from 'minimatch';
2
- import * as fs from 'node:fs';
3
- import * as path from 'node:path';
4
- import { ModelOptions } from '@/types';
2
+ import * as fs from 'fs';
3
+ import * as path from 'path';
4
+ import { ModelOptions } from '@/types/index.js';
5
5
 
6
6
  /**
7
7
  * 判断根据当前路径和指定的包含/排除规则,是否允许显示 Live2D 功能。
package/src/index.ts CHANGED
@@ -1,20 +1,18 @@
1
1
  import '../lib/cubism2.min.js';
2
2
  import '../lib/cubism5.min.js';
3
3
  import * as PIXI from 'pixi.js';
4
- import { Live2dOptions } from './types';
4
+
5
5
  import { Ticker, TickerPlugin } from '@pixi/ticker';
6
6
  import {
7
- Live2DFactory,
8
7
  Live2DModel,
9
8
  MotionManager,
10
9
  SoundManager
11
10
  } from 'pixi-live2d-display-lipsyncpatch';
12
11
  import { Application, } from 'pixi.js';
13
- import { icons } from './icons/icons';
14
12
  import './icons/style.css';
13
+ import { Live2dOptions } from '@/types/index.js';
15
14
 
16
-
17
- export { MotionManager, SoundManager, Live2DModel, PIXI, type Live2dOptions };
15
+ export { MotionManager, SoundManager, Live2DModel, PIXI };
18
16
 
19
17
  /**
20
18
  * 创建Live2D模型
@@ -79,7 +77,7 @@ export async function createLive2D(options: Live2dOptions): Promise<Live2DModel>
79
77
  }
80
78
 
81
79
  // 创建右侧图标栏
82
- createIconPanel(model, element);
80
+ // createIconPanel(model, element);
83
81
 
84
82
  return model;
85
83
  }
@@ -186,7 +184,7 @@ async function startIdleAnimation(model: Live2DModel) {
186
184
  * @param cubism2 可选的CubismCore对象,如果在非浏览器环境中使用,需要传入
187
185
  * @param cubism5
188
186
  */
189
- export async function initializeLive2D(cubism2?: any, cubism5?: any) {
187
+ export async function initializeLive2D() {
190
188
  // 首先初始化 Cubism2 SDK
191
189
  // console.log('sdk2:', Cubism2);
192
190
  // console.log('sdk5:', Cubism5);
@@ -1,4 +1,4 @@
1
- import { ModelOptions } from './ModelOptions';
1
+ import { ModelOptions } from './ModelOptions.js';
2
2
 
3
3
  /**
4
4
  * Live2D模型配置选项
@@ -1,2 +1,2 @@
1
- export type { Live2dOptions } from './Live2dOptions';
2
- export type { ModelOptions, ModelPosition, ModelMobileAdaptation, ModelMainOptions } from './ModelOptions';
1
+ export * from './Live2dOptions.js';
2
+ export * from './ModelOptions.js';