better-dsh-pet 0.2.6 → 0.3.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 +272 -36
- package/assets/preview/zhongqiu-shangyue-chi-yuebing.gif +0 -0
- package/assets/tray-icon.png +0 -0
- package/cordis.patch.yml +51 -42
- package/lib/client.js +161 -1
- package/lib/index.js +1073 -636
- package/lib/pet-helper-process.js +7 -0
- package/lib/sensevoice.js +148 -0
- package/lib/types/client/index.d.ts +58 -49
- package/lib/types/index.d.ts +97 -77
- package/package.json +16 -6
- package/runtime/electron-helper/index.html +256 -0
- package/runtime/electron-helper/main.js +740 -206
- package/runtime/electron-helper/preload.js +47 -0
- package/runtime/electron-helper/renderer.js +2792 -1349
- package/scripts/download-sensevoice.mjs +92 -0
|
@@ -109,6 +109,260 @@
|
|
|
109
109
|
color: #25282d;
|
|
110
110
|
}
|
|
111
111
|
#menu button:hover { background: #f2f3f5; }
|
|
112
|
+
#settings-panel {
|
|
113
|
+
position: absolute;
|
|
114
|
+
top: 50%;
|
|
115
|
+
left: 50%;
|
|
116
|
+
transform: translate(-50%, -50%);
|
|
117
|
+
width: 440px;
|
|
118
|
+
max-height: 86vh;
|
|
119
|
+
overflow-y: auto;
|
|
120
|
+
background: #fff;
|
|
121
|
+
border: 1px solid #e3e5e8;
|
|
122
|
+
border-radius: 14px;
|
|
123
|
+
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
|
|
124
|
+
padding: 16px;
|
|
125
|
+
display: none;
|
|
126
|
+
pointer-events: auto;
|
|
127
|
+
z-index: 20;
|
|
128
|
+
color: #25282d;
|
|
129
|
+
user-select: text;
|
|
130
|
+
}
|
|
131
|
+
#settings-panel.visible { display: block; }
|
|
132
|
+
#settings-panel h2 { margin: 0 0 10px; font-size: 16px; }
|
|
133
|
+
#settings-panel .settings-section { margin-bottom: 14px; padding-top: 10px; border-top: 1px solid #eee; }
|
|
134
|
+
#settings-panel .settings-section h3 { margin: 0 0 8px; font-size: 13px; color: #555; }
|
|
135
|
+
#settings-panel .field {
|
|
136
|
+
display: flex;
|
|
137
|
+
align-items: center;
|
|
138
|
+
justify-content: space-between;
|
|
139
|
+
gap: 10px;
|
|
140
|
+
margin-bottom: 8px;
|
|
141
|
+
font-size: 13px;
|
|
142
|
+
}
|
|
143
|
+
#settings-panel .field label { min-width: 90px; color: #333; }
|
|
144
|
+
#settings-panel .field input[type="number"],
|
|
145
|
+
#settings-panel .field select {
|
|
146
|
+
width: 120px;
|
|
147
|
+
padding: 5px 8px;
|
|
148
|
+
border: 1px solid #d8d8d8;
|
|
149
|
+
border-radius: 6px;
|
|
150
|
+
font-size: 13px;
|
|
151
|
+
}
|
|
152
|
+
#settings-panel .field input[type="range"] { flex: 1; min-width: 120px; }
|
|
153
|
+
#settings-panel .field textarea {
|
|
154
|
+
width: 220px;
|
|
155
|
+
height: 52px;
|
|
156
|
+
padding: 5px 8px;
|
|
157
|
+
border: 1px solid #d8d8d8;
|
|
158
|
+
border-radius: 6px;
|
|
159
|
+
font-size: 12px;
|
|
160
|
+
resize: vertical;
|
|
161
|
+
}
|
|
162
|
+
#settings-panel .field .checkbox-field { display: flex; align-items: center; gap: 6px; }
|
|
163
|
+
#settings-panel .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
|
|
164
|
+
#settings-panel .actions button {
|
|
165
|
+
padding: 7px 16px;
|
|
166
|
+
border: 0;
|
|
167
|
+
border-radius: 8px;
|
|
168
|
+
font-size: 13px;
|
|
169
|
+
cursor: pointer;
|
|
170
|
+
background: #4a7cff;
|
|
171
|
+
color: #fff;
|
|
172
|
+
}
|
|
173
|
+
#settings-panel .actions button.secondary { background: #e8e8e8; color: #333; }
|
|
174
|
+
#menu .ms-field {
|
|
175
|
+
display: flex;
|
|
176
|
+
align-items: center;
|
|
177
|
+
gap: 6px;
|
|
178
|
+
margin: 4px 0;
|
|
179
|
+
font-size: 12px;
|
|
180
|
+
color: #333;
|
|
181
|
+
}
|
|
182
|
+
#menu .ms-field span { width: 64px; flex-shrink: 0; }
|
|
183
|
+
#menu .ms-field input[type="number"],
|
|
184
|
+
#menu .ms-field select {
|
|
185
|
+
width: 80px;
|
|
186
|
+
padding: 3px 6px;
|
|
187
|
+
border: 1px solid #d8d8d8;
|
|
188
|
+
border-radius: 6px;
|
|
189
|
+
font-size: 12px;
|
|
190
|
+
}
|
|
191
|
+
#menu .ms-field input[type="range"] { flex: 1; min-width: 80px; }
|
|
192
|
+
#menu .ms-field textarea {
|
|
193
|
+
width: 140px;
|
|
194
|
+
height: 42px;
|
|
195
|
+
padding: 3px 6px;
|
|
196
|
+
border: 1px solid #d8d8d8;
|
|
197
|
+
border-radius: 6px;
|
|
198
|
+
font-size: 12px;
|
|
199
|
+
resize: vertical;
|
|
200
|
+
}
|
|
201
|
+
#menu .ms-field em { font-style: normal; font-size: 11px; color: #777; width: 36px; text-align: right; }
|
|
202
|
+
#menu .ms-check { display: flex; align-items: center; gap: 6px; font-size: 12px; margin: 4px 0; color: #333; }
|
|
203
|
+
#menu input[type="text"],
|
|
204
|
+
#menu textarea {
|
|
205
|
+
user-select: text;
|
|
206
|
+
-webkit-user-select: text;
|
|
207
|
+
pointer-events: auto;
|
|
208
|
+
cursor: text;
|
|
209
|
+
}
|
|
210
|
+
#menu .ms-seg { display: inline-flex; gap: 4px; flex-wrap: wrap; pointer-events: auto; }
|
|
211
|
+
#menu .ms-order-preview,
|
|
212
|
+
#menu .ms-list { pointer-events: auto; }
|
|
213
|
+
#menu .ms-list {
|
|
214
|
+
max-height: 120px;
|
|
215
|
+
overflow-y: auto;
|
|
216
|
+
border: 1px solid #eee;
|
|
217
|
+
border-radius: 6px;
|
|
218
|
+
padding: 4px 6px;
|
|
219
|
+
flex: 1;
|
|
220
|
+
min-width: 150px;
|
|
221
|
+
}
|
|
222
|
+
#menu .ms-order-preview {
|
|
223
|
+
margin: 2px 0 6px;
|
|
224
|
+
padding: 4px;
|
|
225
|
+
border: 1px dashed #d8d8d8;
|
|
226
|
+
border-radius: 6px;
|
|
227
|
+
min-height: 28px;
|
|
228
|
+
font-size: 12px;
|
|
229
|
+
}
|
|
230
|
+
/* 覆盖 #menu button 的全局 block 样式,让设置页里的分段按钮/排序按钮保持小按钮形态 */
|
|
231
|
+
#menu .ms-seg button,
|
|
232
|
+
#menu .ms-order-preview button {
|
|
233
|
+
display: inline-block;
|
|
234
|
+
width: auto;
|
|
235
|
+
text-align: center;
|
|
236
|
+
border: 1px solid #d8d8d8;
|
|
237
|
+
background: #fff;
|
|
238
|
+
color: #333;
|
|
239
|
+
padding: 4px 8px;
|
|
240
|
+
border-radius: 6px;
|
|
241
|
+
font-size: 12px;
|
|
242
|
+
cursor: pointer;
|
|
243
|
+
}
|
|
244
|
+
#menu .ms-order-preview button {
|
|
245
|
+
padding: 0 4px;
|
|
246
|
+
border: 0;
|
|
247
|
+
background: transparent;
|
|
248
|
+
font-size: 12px;
|
|
249
|
+
line-height: 1.4;
|
|
250
|
+
}
|
|
251
|
+
#menu .ms-order-preview button:hover { background: #eef2ff; border-radius: 4px; }
|
|
252
|
+
/* 动作切换区域美化 */
|
|
253
|
+
#menu .ms-list {
|
|
254
|
+
background: #fafbfc;
|
|
255
|
+
border-color: #e3e5e8;
|
|
256
|
+
border-radius: 8px;
|
|
257
|
+
padding: 6px 8px;
|
|
258
|
+
max-height: 140px;
|
|
259
|
+
}
|
|
260
|
+
#menu .ms-list label:hover { background: #f2f4f7; border-radius: 4px; }
|
|
261
|
+
#menu .ms-order-preview {
|
|
262
|
+
background: #f8f9fc;
|
|
263
|
+
border-color: #d0d5e0;
|
|
264
|
+
border-radius: 8px;
|
|
265
|
+
padding: 6px;
|
|
266
|
+
}
|
|
267
|
+
#menu .ms-order-preview > span {
|
|
268
|
+
background: #e7edff;
|
|
269
|
+
border: 1px solid #ccd8ff;
|
|
270
|
+
border-radius: 6px;
|
|
271
|
+
}
|
|
272
|
+
#menu .ms-order-preview > span > span {
|
|
273
|
+
background: transparent;
|
|
274
|
+
border: 0;
|
|
275
|
+
}
|
|
276
|
+
#chat-panel {
|
|
277
|
+
position: absolute;
|
|
278
|
+
top: 50%;
|
|
279
|
+
left: 50%;
|
|
280
|
+
transform: translate(-50%, -50%);
|
|
281
|
+
width: 420px;
|
|
282
|
+
height: 520px;
|
|
283
|
+
max-height: 86vh;
|
|
284
|
+
background: #fff;
|
|
285
|
+
border: 1px solid #e3e5e8;
|
|
286
|
+
border-radius: 14px;
|
|
287
|
+
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
|
|
288
|
+
display: none;
|
|
289
|
+
flex-direction: column;
|
|
290
|
+
pointer-events: auto;
|
|
291
|
+
z-index: 30;
|
|
292
|
+
overflow: hidden;
|
|
293
|
+
color: #25282d;
|
|
294
|
+
}
|
|
295
|
+
#chat-panel.visible { display: flex; }
|
|
296
|
+
#chat-panel .chat-header {
|
|
297
|
+
padding: 12px 14px;
|
|
298
|
+
border-bottom: 1px solid #eee;
|
|
299
|
+
font-weight: 600;
|
|
300
|
+
font-size: 14px;
|
|
301
|
+
display: flex;
|
|
302
|
+
justify-content: space-between;
|
|
303
|
+
align-items: center;
|
|
304
|
+
}
|
|
305
|
+
#chat-panel .chat-close {
|
|
306
|
+
cursor: pointer;
|
|
307
|
+
color: #888;
|
|
308
|
+
font-size: 16px;
|
|
309
|
+
padding: 0 4px;
|
|
310
|
+
}
|
|
311
|
+
#chat-panel .chat-messages {
|
|
312
|
+
flex: 1;
|
|
313
|
+
overflow-y: auto;
|
|
314
|
+
padding: 12px;
|
|
315
|
+
display: flex;
|
|
316
|
+
flex-direction: column;
|
|
317
|
+
gap: 8px;
|
|
318
|
+
background: #fafbfc;
|
|
319
|
+
}
|
|
320
|
+
#chat-panel .chat-msg {
|
|
321
|
+
max-width: 80%;
|
|
322
|
+
padding: 8px 10px;
|
|
323
|
+
border-radius: 10px;
|
|
324
|
+
font-size: 13px;
|
|
325
|
+
line-height: 1.5;
|
|
326
|
+
white-space: pre-wrap;
|
|
327
|
+
word-break: break-word;
|
|
328
|
+
}
|
|
329
|
+
#chat-panel .chat-msg.user {
|
|
330
|
+
align-self: flex-end;
|
|
331
|
+
background: #4a7cff;
|
|
332
|
+
color: #fff;
|
|
333
|
+
border-bottom-right-radius: 2px;
|
|
334
|
+
}
|
|
335
|
+
#chat-panel .chat-msg.pet {
|
|
336
|
+
align-self: flex-start;
|
|
337
|
+
background: #fff;
|
|
338
|
+
border: 1px solid #e8e8e8;
|
|
339
|
+
border-bottom-left-radius: 2px;
|
|
340
|
+
}
|
|
341
|
+
#chat-panel .chat-input-row {
|
|
342
|
+
display: flex;
|
|
343
|
+
gap: 8px;
|
|
344
|
+
padding: 10px;
|
|
345
|
+
border-top: 1px solid #eee;
|
|
346
|
+
background: #fff;
|
|
347
|
+
}
|
|
348
|
+
#chat-panel .chat-input-row input {
|
|
349
|
+
flex: 1;
|
|
350
|
+
padding: 8px 10px;
|
|
351
|
+
border: 1px solid #d8d8d8;
|
|
352
|
+
border-radius: 8px;
|
|
353
|
+
font-size: 13px;
|
|
354
|
+
outline: none;
|
|
355
|
+
}
|
|
356
|
+
#chat-panel .chat-input-row span {
|
|
357
|
+
padding: 8px 14px;
|
|
358
|
+
background: #4a7cff;
|
|
359
|
+
color: #fff;
|
|
360
|
+
border-radius: 8px;
|
|
361
|
+
font-size: 13px;
|
|
362
|
+
cursor: pointer;
|
|
363
|
+
user-select: none;
|
|
364
|
+
text-align: center;
|
|
365
|
+
}
|
|
112
366
|
@media (prefers-reduced-motion: reduce) {
|
|
113
367
|
video.pet-video { transition: none; }
|
|
114
368
|
}
|
|
@@ -128,6 +382,8 @@
|
|
|
128
382
|
</div>
|
|
129
383
|
</div>
|
|
130
384
|
<div id="menu"></div>
|
|
385
|
+
<div id="settings-panel"></div>
|
|
386
|
+
<div id="chat-panel"></div>
|
|
131
387
|
</div>
|
|
132
388
|
<script src="./renderer.js"></script>
|
|
133
389
|
</body>
|