@yushaw/sanqian-chat 0.2.19 → 0.2.21
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/dist/core/index.d.mts +2 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +46 -1
- package/dist/core/index.mjs +46 -1
- package/dist/renderer/index.d.mts +11 -3
- package/dist/renderer/index.d.ts +11 -3
- package/dist/renderer/index.js +619 -358
- package/dist/renderer/index.mjs +577 -317
- package/package.json +2 -2
- package/src/renderer/styles/chat.css +39 -0
- package/src/renderer/styles/coreCss.ts +39 -0
- package/src/renderer/styles/safe.css +39 -0
- package/src/renderer/styles/variables.css +10 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yushaw/sanqian-chat",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.21",
|
|
4
4
|
"description": "Floating chat window SDK for Sanqian AI Assistant",
|
|
5
5
|
"main": "./dist/main/index.js",
|
|
6
6
|
"types": "./dist/main/index.d.ts",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"test:watch": "vitest"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@yushaw/sanqian-sdk": "^0.3.
|
|
47
|
+
"@yushaw/sanqian-sdk": "^0.3.24",
|
|
48
48
|
"react-virtuoso": "^4.15.0",
|
|
49
49
|
"rehype-harden": "^1.1.6",
|
|
50
50
|
"remark-gfm": "^4.0.1",
|
|
@@ -41,6 +41,35 @@
|
|
|
41
41
|
user-select: text;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
/* ========================================
|
|
45
|
+
Draggable Regions (Electron)
|
|
46
|
+
======================================== */
|
|
47
|
+
.chat-drag-region {
|
|
48
|
+
-webkit-app-region: drag;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/*
|
|
52
|
+
* Interactive descendants inside drag regions must explicitly opt out of drag,
|
|
53
|
+
* otherwise icon-only click targets can become non-clickable in Electron.
|
|
54
|
+
*/
|
|
55
|
+
.chat-drag-region button,
|
|
56
|
+
.chat-drag-region button *,
|
|
57
|
+
.chat-drag-region a,
|
|
58
|
+
.chat-drag-region a *,
|
|
59
|
+
.chat-drag-region input,
|
|
60
|
+
.chat-drag-region textarea,
|
|
61
|
+
.chat-drag-region select,
|
|
62
|
+
.chat-drag-region [role="button"],
|
|
63
|
+
.chat-drag-region [role="button"] * {
|
|
64
|
+
-webkit-app-region: no-drag;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* Modal overlays should get click priority over drag regions. */
|
|
68
|
+
:root[data-window-drag-locked="true"] .chat-drag-region {
|
|
69
|
+
-webkit-app-region: no-drag !important;
|
|
70
|
+
pointer-events: none !important;
|
|
71
|
+
}
|
|
72
|
+
|
|
44
73
|
/* ========================================
|
|
45
74
|
Font Size Scaling
|
|
46
75
|
Applies zoom to scale entire chat UI including rem units.
|
|
@@ -236,6 +265,16 @@ code {
|
|
|
236
265
|
animation: chat-cursor-breathing 1s ease-in-out infinite;
|
|
237
266
|
}
|
|
238
267
|
|
|
268
|
+
/* Streaming cursor - version-agnostic fallback (works across streamdown 1.x/2.x) */
|
|
269
|
+
.chat-streaming-cursor {
|
|
270
|
+
--streamdown-caret: '▌';
|
|
271
|
+
}
|
|
272
|
+
.chat-streaming-cursor > *:last-child::after {
|
|
273
|
+
content: var(--streamdown-caret, '▌');
|
|
274
|
+
color: var(--chat-accent) !important;
|
|
275
|
+
animation: chat-cursor-breathing 1s ease-in-out infinite !important;
|
|
276
|
+
}
|
|
277
|
+
|
|
239
278
|
@keyframes chat-fade-in {
|
|
240
279
|
from {
|
|
241
280
|
opacity: 0;
|
|
@@ -48,6 +48,35 @@ export const CSS_VARIABLES = `/**
|
|
|
48
48
|
user-select: text;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
/* ========================================
|
|
52
|
+
Draggable Regions (Electron)
|
|
53
|
+
======================================== */
|
|
54
|
+
.chat-drag-region {
|
|
55
|
+
-webkit-app-region: drag;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/*
|
|
59
|
+
* Interactive descendants inside drag regions must explicitly opt out of drag,
|
|
60
|
+
* otherwise icon-only click targets can become non-clickable in Electron.
|
|
61
|
+
*/
|
|
62
|
+
.chat-drag-region button,
|
|
63
|
+
.chat-drag-region button *,
|
|
64
|
+
.chat-drag-region a,
|
|
65
|
+
.chat-drag-region a *,
|
|
66
|
+
.chat-drag-region input,
|
|
67
|
+
.chat-drag-region textarea,
|
|
68
|
+
.chat-drag-region select,
|
|
69
|
+
.chat-drag-region [role="button"],
|
|
70
|
+
.chat-drag-region [role="button"] * {
|
|
71
|
+
-webkit-app-region: no-drag;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* Modal overlays should get click priority over drag regions. */
|
|
75
|
+
:root[data-window-drag-locked="true"] .chat-drag-region {
|
|
76
|
+
-webkit-app-region: no-drag !important;
|
|
77
|
+
pointer-events: none !important;
|
|
78
|
+
}
|
|
79
|
+
|
|
51
80
|
/* ========================================
|
|
52
81
|
Font Size Scaling
|
|
53
82
|
Applies zoom to scale entire chat UI including rem units.
|
|
@@ -243,6 +272,16 @@ code {
|
|
|
243
272
|
animation: chat-cursor-breathing 1s ease-in-out infinite;
|
|
244
273
|
}
|
|
245
274
|
|
|
275
|
+
/* Streaming cursor - version-agnostic fallback (works across streamdown 1.x/2.x) */
|
|
276
|
+
.chat-streaming-cursor {
|
|
277
|
+
--streamdown-caret: '▌';
|
|
278
|
+
}
|
|
279
|
+
.chat-streaming-cursor > *:last-child::after {
|
|
280
|
+
content: var(--streamdown-caret, '▌');
|
|
281
|
+
color: var(--chat-accent) !important;
|
|
282
|
+
animation: chat-cursor-breathing 1s ease-in-out infinite !important;
|
|
283
|
+
}
|
|
284
|
+
|
|
246
285
|
@keyframes chat-fade-in {
|
|
247
286
|
from {
|
|
248
287
|
opacity: 0;
|
|
@@ -41,6 +41,35 @@
|
|
|
41
41
|
user-select: text;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
/* ========================================
|
|
45
|
+
Draggable Regions (Electron)
|
|
46
|
+
======================================== */
|
|
47
|
+
.chat-drag-region {
|
|
48
|
+
-webkit-app-region: drag;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/*
|
|
52
|
+
* Interactive descendants inside drag regions must explicitly opt out of drag,
|
|
53
|
+
* otherwise icon-only click targets can become non-clickable in Electron.
|
|
54
|
+
*/
|
|
55
|
+
.chat-drag-region button,
|
|
56
|
+
.chat-drag-region button *,
|
|
57
|
+
.chat-drag-region a,
|
|
58
|
+
.chat-drag-region a *,
|
|
59
|
+
.chat-drag-region input,
|
|
60
|
+
.chat-drag-region textarea,
|
|
61
|
+
.chat-drag-region select,
|
|
62
|
+
.chat-drag-region [role="button"],
|
|
63
|
+
.chat-drag-region [role="button"] * {
|
|
64
|
+
-webkit-app-region: no-drag;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* Modal overlays should get click priority over drag regions. */
|
|
68
|
+
:root[data-window-drag-locked="true"] .chat-drag-region {
|
|
69
|
+
-webkit-app-region: no-drag !important;
|
|
70
|
+
pointer-events: none !important;
|
|
71
|
+
}
|
|
72
|
+
|
|
44
73
|
/* ========================================
|
|
45
74
|
Font Size Scaling
|
|
46
75
|
Applies zoom to scale entire chat UI including rem units.
|
|
@@ -236,6 +265,16 @@ code {
|
|
|
236
265
|
animation: chat-cursor-breathing 1s ease-in-out infinite;
|
|
237
266
|
}
|
|
238
267
|
|
|
268
|
+
/* Streaming cursor - version-agnostic fallback (works across streamdown 1.x/2.x) */
|
|
269
|
+
.chat-streaming-cursor {
|
|
270
|
+
--streamdown-caret: '▌';
|
|
271
|
+
}
|
|
272
|
+
.chat-streaming-cursor > *:last-child::after {
|
|
273
|
+
content: var(--streamdown-caret, '▌');
|
|
274
|
+
color: var(--chat-accent) !important;
|
|
275
|
+
animation: chat-cursor-breathing 1s ease-in-out infinite !important;
|
|
276
|
+
}
|
|
277
|
+
|
|
239
278
|
@keyframes chat-fade-in {
|
|
240
279
|
from {
|
|
241
280
|
opacity: 0;
|
|
@@ -181,6 +181,16 @@ code {
|
|
|
181
181
|
animation: chat-cursor-breathing 1s ease-in-out infinite;
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
+
/* Streaming cursor - version-agnostic fallback (works across streamdown 1.x/2.x) */
|
|
185
|
+
.chat-streaming-cursor {
|
|
186
|
+
--streamdown-caret: '▌';
|
|
187
|
+
}
|
|
188
|
+
.chat-streaming-cursor > *:last-child::after {
|
|
189
|
+
content: var(--streamdown-caret, '▌');
|
|
190
|
+
color: var(--chat-accent) !important;
|
|
191
|
+
animation: chat-cursor-breathing 1s ease-in-out infinite !important;
|
|
192
|
+
}
|
|
193
|
+
|
|
184
194
|
@keyframes chat-fade-in {
|
|
185
195
|
from { opacity: 0; transform: translateY(4px); }
|
|
186
196
|
to { opacity: 1; transform: translateY(0); }
|