rspress-plugin-live2d 0.3.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 CHANGED
@@ -1,5 +1,7 @@
1
1
  # rspress-plugin-live2d ![NPM Version](https://img.shields.io/npm/v/rspress-plugin-live2d)
2
2
 
3
+ [简体中文](./README.zh-CN.md)
4
+
3
5
  Rspress plugin for live2d, powered by [on-my-live2d](https://oml2d.com/).
4
6
 
5
7
  ![example](image.png)
@@ -0,0 +1,41 @@
1
+ # rspress-plugin-live2d ![NPM Version](https://img.shields.io/npm/v/rspress-plugin-live2d)
2
+
3
+ Rspress 的看板娘插件, 基于 [on-my-live2d](https://oml2d.com/).
4
+
5
+ ![example](image.png)
6
+
7
+ ## 使用
8
+
9
+ ```bash
10
+ npm install rspress-plugin-live2d
11
+ pnpm install rspress-plugin-live2d
12
+ ```
13
+
14
+ ```ts
15
+ import * as path from 'path';
16
+ import { defineConfig } from 'rspress/config';
17
+ import live2d from 'rspress-plugin-live2d';
18
+
19
+ export default defineConfig({
20
+ root: path.join(__dirname, 'docs'),
21
+ title: 'Rspress x Live2d Example',
22
+ plugins: [
23
+ live2d({
24
+ models: [
25
+ {
26
+ path: 'https://model.oml2d.com/HK416-1-normal/model.json',
27
+ position: [0, 60],
28
+ scale: 0.08,
29
+ stageStyle: {
30
+ height: 450,
31
+ },
32
+ },
33
+ ],
34
+ }),
35
+ ],
36
+ });
37
+ ```
38
+
39
+ ## 配置
40
+
41
+ 参考 [On My Live2D](https://oml2d.com/guide/models.html) 来查找更多模型和配置。
@@ -1,12 +1,13 @@
1
1
  import React, { useEffect } from 'react';
2
2
 
3
- import { loadOml2d } from 'oh-my-live2d';
4
-
5
3
  import type { Live2DWidgetProps } from '../src/typings';
6
4
 
7
5
  const Live2DWidget: React.FC<Live2DWidgetProps> = (options) => {
8
6
  useEffect(() => {
9
- loadOml2d(options);
7
+ import('oh-my-live2d').then(({ loadOml2d }) => {
8
+ console.log(1111111);
9
+ loadOml2d(options);
10
+ });
10
11
  }, []);
11
12
 
12
13
  return null;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { RspressPlugin } from '@rspress/shared';
1
+ import type { RspressPlugin } from '@rspress/core';
2
2
  import type { Live2DWidgetProps } from './typings';
3
3
  export interface RspressPluginLive2dOptions extends Live2DWidgetProps {
4
4
  }
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "rspress-plugin-live2d",
3
- "version": "0.3.0",
3
+ "version": "1.0.0",
4
4
  "description": "Rspress plugin with live 2d.",
5
+ "type": "module",
5
6
  "files": [
6
7
  "dist",
7
8
  "components"
@@ -27,9 +28,8 @@
27
28
  "access": "public"
28
29
  },
29
30
  "dependencies": {
30
- "@rspress/shared": "^1.17.1",
31
31
  "oh-my-live2d": "^0.15.2",
32
- "rspress-plugin-devkit": "^0.3.0"
32
+ "rspress-plugin-devkit": "^1.0.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/node": "^20.12.5",
@@ -37,7 +37,7 @@
37
37
  "typescript": "^5.4.4"
38
38
  },
39
39
  "peerDependencies": {
40
- "rspress": "*"
40
+ "@rspress/core": "^2.0.0-rc.4 || ^2.0.0"
41
41
  },
42
42
  "scripts": {
43
43
  "build": "tsc --declarationMap false",
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import type { Live2DWidgetProps } from '../src/typings';
3
- declare const Live2DWidget: React.FC<Live2DWidgetProps>;
4
- export default Live2DWidget;
@@ -1,9 +0,0 @@
1
- import { useEffect } from 'react';
2
- import { loadOml2d } from 'oh-my-live2d';
3
- const Live2DWidget = (options) => {
4
- useEffect(() => {
5
- loadOml2d(options);
6
- }, []);
7
- return null;
8
- };
9
- export default Live2DWidget;