ibc-ai-web-sdk 2.0.1 → 2.0.2
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/index.cjs.js +3 -37
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +3 -37
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +3 -37
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
// 机器人图标 - 内联轻量 SVG(尺寸 ~900 bytes,替换原 1.9MB 的 base64 GIF)
|
|
2
|
-
// 设计为圆形类属色背景 + 白色几何机器人脸,适配 border-radius 截切
|
|
3
|
-
var robotIcon = 'data:image/svg+xml,' + encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
|
|
4
|
-
<defs>
|
|
5
|
-
<linearGradient id="g" x1="0" y1="0" x2="1" y2="1">
|
|
6
|
-
<stop offset="0%" stop-color="#2563eb"/>
|
|
7
|
-
<stop offset="100%" stop-color="#7c3aed"/>
|
|
8
|
-
</linearGradient>
|
|
9
|
-
</defs>
|
|
10
|
-
<circle cx="50" cy="50" r="50" fill="url(#g)"/>
|
|
11
|
-
<rect x="24" y="36" width="14" height="14" rx="4" fill="#fff" opacity=".9"/>
|
|
12
|
-
<rect x="62" y="36" width="14" height="14" rx="4" fill="#fff" opacity=".9"/>
|
|
13
|
-
<circle cx="28" cy="40" r="3.5" fill="#2563eb"/>
|
|
14
|
-
<circle cx="66" cy="40" r="3.5" fill="#2563eb"/>
|
|
15
|
-
<rect x="38" y="26" width="4" height="10" rx="2" fill="#fff" opacity=".8"/>
|
|
16
|
-
<circle cx="40" cy="24" r="5" fill="#fff" opacity=".7"/>
|
|
17
|
-
<path d="M36 62 Q50 76 64 62" fill="none" stroke="#fff" stroke-width="3" stroke-linecap="round" opacity=".8"/>
|
|
18
|
-
</svg>`);
|
|
19
|
-
|
|
20
1
|
/**
|
|
21
2
|
* 错误码常量
|
|
22
3
|
* 统一定义所有错误码,方便维护
|
|
@@ -3680,16 +3661,6 @@ class AIChatDialog extends HTMLElement {
|
|
|
3680
3661
|
padding: 0 0 18px;
|
|
3681
3662
|
}
|
|
3682
3663
|
.welcome-content { margin-bottom: 0; width: 100%; }
|
|
3683
|
-
/* 欢迎页图标(与Vue一致:使用img而非emoji) */
|
|
3684
|
-
.welcome-icon {
|
|
3685
|
-
width: 52px;
|
|
3686
|
-
height: auto;
|
|
3687
|
-
margin-bottom: 12px;
|
|
3688
|
-
opacity: 1;
|
|
3689
|
-
animation: none;
|
|
3690
|
-
border-radius: 999px;
|
|
3691
|
-
box-shadow: 0 8px 26px rgba(15, 23, 42, 0.08);
|
|
3692
|
-
}
|
|
3693
3664
|
@keyframes floatUp { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
|
|
3694
3665
|
|
|
3695
3666
|
/* 欢迎标题 - 渐变品牌色 */
|
|
@@ -4207,9 +4178,11 @@ class AIChatDialog extends HTMLElement {
|
|
|
4207
4178
|
color: var(--ai-primary);
|
|
4208
4179
|
background: rgba(37, 99, 235, 0.08);
|
|
4209
4180
|
}
|
|
4181
|
+
.input-tool.attach-tool { display: none; }
|
|
4210
4182
|
|
|
4211
4183
|
/* 发送按钮(与Vue .send-btn 完全一致,含光泽动画)*/
|
|
4212
4184
|
.send-btn {
|
|
4185
|
+
margin-left: auto;
|
|
4213
4186
|
flex-shrink: 0;
|
|
4214
4187
|
width: 28px;
|
|
4215
4188
|
height: 28px;
|
|
@@ -4294,8 +4267,6 @@ class AIChatDialog extends HTMLElement {
|
|
|
4294
4267
|
box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
|
|
4295
4268
|
}
|
|
4296
4269
|
.float-button:hover::before { opacity: 1; animation-play-state: initial; }
|
|
4297
|
-
.float-icon { width: 24px; height: auto; transition: none; border-radius: 50%; }
|
|
4298
|
-
.float-button:hover .float-icon { transform: none; }
|
|
4299
4270
|
|
|
4300
4271
|
/* 错误提示toast */
|
|
4301
4272
|
.error-toast {
|
|
@@ -4515,7 +4486,6 @@ class AIChatDialog extends HTMLElement {
|
|
|
4515
4486
|
.message-list { gap: 9px; }
|
|
4516
4487
|
.message-item { max-width: 100%; width: 100%; }
|
|
4517
4488
|
.message-bubble { padding: 11px 15px; font-size: 14px; }
|
|
4518
|
-
.welcome-icon { width: 48px; margin-bottom: 10px; }
|
|
4519
4489
|
.welcome-text { font-size: 22px; line-height: 1.3; margin-bottom: 9px; }
|
|
4520
4490
|
.welcome-desc { font-size: 13px; line-height: 1.55; margin-bottom: 18px; }
|
|
4521
4491
|
.quick-suggestions { gap: 10px; margin-top: 0; }
|
|
@@ -4526,7 +4496,6 @@ class AIChatDialog extends HTMLElement {
|
|
|
4526
4496
|
.message-input { font-size: 16px; padding: 10px 12px 6px; min-height: 44px; }
|
|
4527
4497
|
.send-btn { width: 28px; height: 28px; }
|
|
4528
4498
|
.float-button { height: 42px; min-width: 96px; }
|
|
4529
|
-
.float-icon { width: 22px; }
|
|
4530
4499
|
.action-icon { width: 30px; height: 30px; }
|
|
4531
4500
|
}
|
|
4532
4501
|
|
|
@@ -4612,9 +4581,7 @@ class AIChatDialog extends HTMLElement {
|
|
|
4612
4581
|
</div>
|
|
4613
4582
|
|
|
4614
4583
|
<!-- 悬浮按钮 -->
|
|
4615
|
-
<div class="float-button" id="floatBtn" title="打开AI助手">
|
|
4616
|
-
<img class="float-icon" src="${robotIcon}" alt="打开AI助手" />
|
|
4617
|
-
</div>
|
|
4584
|
+
<div class="float-button" id="floatBtn" title="打开AI助手"></div>
|
|
4618
4585
|
</div>
|
|
4619
4586
|
`;
|
|
4620
4587
|
|
|
@@ -4915,7 +4882,6 @@ class AIChatDialog extends HTMLElement {
|
|
|
4915
4882
|
this._body.innerHTML = `
|
|
4916
4883
|
<div class="empty-state">
|
|
4917
4884
|
<div class="welcome-content">
|
|
4918
|
-
<img class="welcome-icon" src="${robotIcon}" alt="AI助手" />
|
|
4919
4885
|
<p class="welcome-text">${this.escapeHtml(this._config?.welcomeText || '您好!我是 AI 智能助理')}</p>
|
|
4920
4886
|
<p class="welcome-desc">${this.escapeHtml(this._config?.welcomeDesc || '我可以帮您解答系统使用问题')}</p>
|
|
4921
4887
|
${chipsHtml}
|