@zhongqian97-code/ecode 0.5.32 → 0.5.33
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.js +53 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5500,7 +5500,14 @@ function generateAdminHtml(version2) {
|
|
|
5500
5500
|
padding: 4px 10px;
|
|
5501
5501
|
color: #8b949e;
|
|
5502
5502
|
font-size: 11px;
|
|
5503
|
+
cursor: pointer;
|
|
5504
|
+
user-select: none;
|
|
5505
|
+
display: flex;
|
|
5506
|
+
align-items: center;
|
|
5507
|
+
gap: 6px;
|
|
5503
5508
|
}
|
|
5509
|
+
.tool-box-header:hover { background: #2d333b; }
|
|
5510
|
+
.tool-box.collapsed .tool-box-body { display: none; }
|
|
5504
5511
|
.tool-box-body {
|
|
5505
5512
|
padding: 8px 10px;
|
|
5506
5513
|
color: #c9d1d9;
|
|
@@ -5678,12 +5685,15 @@ function generateAdminHtml(version2) {
|
|
|
5678
5685
|
padding: 10px 16px;
|
|
5679
5686
|
border-radius: 4px;
|
|
5680
5687
|
font-size: 13px;
|
|
5681
|
-
max-width:
|
|
5688
|
+
max-width: 360px;
|
|
5682
5689
|
background: #21262d;
|
|
5683
5690
|
color: #c9d1d9;
|
|
5684
5691
|
border: 1px solid #30363d;
|
|
5685
5692
|
pointer-events: auto;
|
|
5686
5693
|
animation: toast-in .2s ease;
|
|
5694
|
+
display: flex;
|
|
5695
|
+
align-items: flex-start;
|
|
5696
|
+
gap: 10px;
|
|
5687
5697
|
}
|
|
5688
5698
|
.toast-error {
|
|
5689
5699
|
background: #2d1b1b;
|
|
@@ -5695,6 +5705,19 @@ function generateAdminHtml(version2) {
|
|
|
5695
5705
|
color: #3fb950;
|
|
5696
5706
|
border-color: #2ea043;
|
|
5697
5707
|
}
|
|
5708
|
+
.toast-close {
|
|
5709
|
+
background: none;
|
|
5710
|
+
border: none;
|
|
5711
|
+
color: inherit;
|
|
5712
|
+
font-size: 16px;
|
|
5713
|
+
line-height: 1;
|
|
5714
|
+
cursor: pointer;
|
|
5715
|
+
padding: 0;
|
|
5716
|
+
opacity: 0.6;
|
|
5717
|
+
flex-shrink: 0;
|
|
5718
|
+
margin-left: auto;
|
|
5719
|
+
}
|
|
5720
|
+
.toast-close:hover { opacity: 1; }
|
|
5698
5721
|
@keyframes toast-in {
|
|
5699
5722
|
from { opacity: 0; transform: translateX(20px); }
|
|
5700
5723
|
to { opacity: 1; transform: translateX(0); }
|
|
@@ -5855,9 +5878,21 @@ function generateAdminHtml(version2) {
|
|
|
5855
5878
|
if (!container) return;
|
|
5856
5879
|
const el = document.createElement('div');
|
|
5857
5880
|
el.className = 'toast toast-' + (type || 'info');
|
|
5858
|
-
|
|
5881
|
+
const textSpan = document.createElement('span');
|
|
5882
|
+
textSpan.textContent = msg;
|
|
5883
|
+
el.appendChild(textSpan);
|
|
5884
|
+
if (type === 'error') {
|
|
5885
|
+
// \u9519\u8BEF Toast \u6301\u4E45\u5316\uFF1A\u4E0D\u81EA\u52A8\u6D88\u5931\uFF0C\u63D0\u4F9B\u5173\u95ED\u6309\u94AE
|
|
5886
|
+
const closeBtn = document.createElement('button');
|
|
5887
|
+
closeBtn.className = 'toast-close';
|
|
5888
|
+
closeBtn.textContent = '\xD7';
|
|
5889
|
+
closeBtn.setAttribute('aria-label', '\u5173\u95ED');
|
|
5890
|
+
closeBtn.onclick = () => el.remove();
|
|
5891
|
+
el.appendChild(closeBtn);
|
|
5892
|
+
} else {
|
|
5893
|
+
setTimeout(() => el.remove(), 4000);
|
|
5894
|
+
}
|
|
5859
5895
|
container.appendChild(el);
|
|
5860
|
-
setTimeout(() => el.remove(), 4000);
|
|
5861
5896
|
}
|
|
5862
5897
|
|
|
5863
5898
|
// \u2500\u2500 Helpers \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
@@ -6144,7 +6179,10 @@ function generateAdminHtml(version2) {
|
|
|
6144
6179
|
boxEl.className = 'tool-box';
|
|
6145
6180
|
boxEl.setAttribute('data-tool-id', msg.callId || name);
|
|
6146
6181
|
boxEl.innerHTML =
|
|
6147
|
-
'<div class="tool-box-header"
|
|
6182
|
+
'<div class="tool-box-header" onclick="toggleToolBox(this)">' +
|
|
6183
|
+
'<span class="tb-indicator">\u25BC</span>' +
|
|
6184
|
+
'<span class="tb-name">\u2699 ' + escHtml(name) + '</span>' +
|
|
6185
|
+
'</div>' +
|
|
6148
6186
|
'<div class="tool-box-body">\u2026</div>';
|
|
6149
6187
|
if (!state.showTools) boxEl.style.display = 'none';
|
|
6150
6188
|
msgsEl.appendChild(boxEl);
|
|
@@ -6156,8 +6194,8 @@ function generateAdminHtml(version2) {
|
|
|
6156
6194
|
if (boxEl) {
|
|
6157
6195
|
const body = boxEl.querySelector('.tool-box-body');
|
|
6158
6196
|
body.textContent = msg.output || '';
|
|
6159
|
-
boxEl.querySelector('.
|
|
6160
|
-
|
|
6197
|
+
const nameEl = boxEl.querySelector('.tb-name');
|
|
6198
|
+
if (nameEl) nameEl.textContent = '\u2713 ' + (msg.toolName || toolId);
|
|
6161
6199
|
}
|
|
6162
6200
|
setStatus('idle');
|
|
6163
6201
|
} else if (type === 'approval.requested') {
|
|
@@ -6195,6 +6233,15 @@ function generateAdminHtml(version2) {
|
|
|
6195
6233
|
.replace(/>/g, '>');
|
|
6196
6234
|
}
|
|
6197
6235
|
|
|
6236
|
+
// \u2500\u2500 Tool box collapse \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
6237
|
+
function toggleToolBox(headerEl) {
|
|
6238
|
+
const box = headerEl.closest('.tool-box');
|
|
6239
|
+
if (!box) return;
|
|
6240
|
+
const isNowCollapsed = box.classList.toggle('collapsed');
|
|
6241
|
+
const indicator = headerEl.querySelector('.tb-indicator');
|
|
6242
|
+
if (indicator) indicator.textContent = isNowCollapsed ? '\u25B6' : '\u25BC';
|
|
6243
|
+
}
|
|
6244
|
+
|
|
6198
6245
|
// \u2500\u2500 Skill dropdown \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
6199
6246
|
var selectedSkillIndex = -1;
|
|
6200
6247
|
|