@lrplrplrp/dsh-live2d 0.1.2 → 0.1.3

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/cordis.patch.yml CHANGED
@@ -7,5 +7,5 @@
7
7
  # pnpm dsh plugin --profile web add link:./dsh-live2d
8
8
 
9
9
  - insert:
10
- - id: dsh-live2d
11
- name: 'dsh-live2d'
10
+ - id: '@lrplrplrp/dsh-live2d'
11
+ name: '@lrplrplrp/dsh-live2d'
package/lib/client.js CHANGED
@@ -11,7 +11,7 @@
11
11
  //
12
12
  // 移除了原项目的:对话框、小飞机游戏、关闭/关于/GitHub 按钮。
13
13
 
14
- window.__ModuleLoader__.load({ id: 'dsh-live2d', factory: (require) => {
14
+ window.__ModuleLoader__.load({ id: '@lrplrplrp/dsh-live2d', factory: (require) => {
15
15
  var module = { exports: {} }
16
16
  var exports = module.exports
17
17
 
@@ -27,6 +27,9 @@ window.__ModuleLoader__.load({ id: 'dsh-live2d', factory: (require) => {
27
27
  const POSITION_KEY = 'dsh-live2d.position'
28
28
  const ACTIVE_MODEL_KEY = 'dsh-live2d.activeModel'
29
29
 
30
+ // 容器默认屏幕位置(无本地存档时使用),对应 position:fixed 的 left/top
31
+ const DEFAULT_POSITION = { x: 1240, y: 330 }
32
+
30
33
  // 本地文件路由前缀(由 host 端 index.js 注册)
31
34
  const LIB_BASE = '/plugins/dsh-live2d/lib/'
32
35
  const ASSETS_BASE = '/plugins/dsh-live2d/assets/'
@@ -69,13 +72,13 @@ window.__ModuleLoader__.load({ id: 'dsh-live2d', factory: (require) => {
69
72
  url: ASSETS_BASE + 'deepseek_l2d/deepseek.model3.json',
70
73
  canvasWidth: 300,
71
74
  canvasHeight: 400,
72
- config: { x: -50, y: 100, scaleX: 2, scaleY: 2 },
75
+ config: { x: 0, y: 0, scaleX: 1.5, scaleY: 1.5 },
73
76
  animations: {
74
77
  IDLE: { motion: { group: 'Idle', index: 0 }, loop: false },
75
- THINKING: { motion: { group: 'Anima', index: 2 }, loop: false },
78
+ THINKING: { motion: { group: 'Anima', index: 2 }, loop: true },
76
79
  THINK_END: { motion: { group: 'Anima', index: 1 }, loop: false },
77
- WORKING: { motion: { group: 'Anima', index: 0 }, loop: false },
78
- SPEAKING: { motion: { group: 'Anima', index: 0 }, loop: false },
80
+ WORKING: { expression: 'puzzled' },
81
+ SPEAKING: { motion: { group: 'Anima', index: 0 }, loop: true },
79
82
  SUCCESS: { expression: 'happy' },
80
83
  ERROR: { expression: 'unhappy' },
81
84
  },
@@ -204,8 +207,8 @@ window.__ModuleLoader__.load({ id: 'dsh-live2d', factory: (require) => {
204
207
  const LIVE2D_CSS = [
205
208
  '#dsh-live2d-container {',
206
209
  ' position: fixed;',
207
- ' top: 24px;',
208
- ' left: 24px;',
210
+ ' top: 330px;',
211
+ ' left: 1240px;',
209
212
  ' bottom: auto;',
210
213
  ' z-index: 9999;',
211
214
  // 容器本身不拦截指针事件,画布区域点击完全穿透到页面,不影响输入;
@@ -733,6 +736,9 @@ window.__ModuleLoader__.load({ id: 'dsh-live2d', factory: (require) => {
733
736
  const saved = getPosition()
734
737
  if (saved && Number.isFinite(saved.x) && Number.isFinite(saved.y)) {
735
738
  place(containerEl, saved.x, saved.y)
739
+ } else {
740
+ // 无本地存档时使用默认位置
741
+ place(containerEl, DEFAULT_POSITION.x, DEFAULT_POSITION.y)
736
742
  }
737
743
 
738
744
  const finish = () => {
package/lib/index.js CHANGED
@@ -37,7 +37,7 @@ const PLUGIN_ROOT = resolvedDir ? join(resolvedDir, '..') : null
37
37
  const LIB_DIR = PLUGIN_ROOT ? join(PLUGIN_ROOT, 'lib') : null
38
38
  const ASSETS_DIR = PLUGIN_ROOT ? join(PLUGIN_ROOT, 'assets') : null
39
39
 
40
- export const name = 'dsh-live2d'
40
+ export const name = '@lrplrplrp/dsh-live2d'
41
41
 
42
42
  const STATE_ENDPOINT = '/plugins/dsh-live2d/state'
43
43
  const CONFIG_ENDPOINT = '/plugins/dsh-live2d/config'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lrplrplrp/dsh-live2d",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Live2D 看板娘插件 for DeepSeek Harness — 可拖动的 Live2D 模型,支持 DSH 状态驱动动画、本地模型导入和完整配置页。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",