clideck 1.22.4 → 1.22.6
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/package.json +1 -1
- package/public/js/app.js +4 -1
- package/public/js/creator.js +19 -19
package/package.json
CHANGED
package/public/js/app.js
CHANGED
|
@@ -296,7 +296,10 @@ function showModeToast() {
|
|
|
296
296
|
});
|
|
297
297
|
}
|
|
298
298
|
|
|
299
|
-
document.getElementById('btn-new').addEventListener('click',
|
|
299
|
+
document.getElementById('btn-new').addEventListener('click', () => {
|
|
300
|
+
send({ type: 'checkAvailability' });
|
|
301
|
+
openCreator();
|
|
302
|
+
});
|
|
300
303
|
document.getElementById('btn-new-project').addEventListener('click', () => {
|
|
301
304
|
closeCreator();
|
|
302
305
|
openProjectCreator();
|
package/public/js/creator.js
CHANGED
|
@@ -21,6 +21,21 @@ function randomName() {
|
|
|
21
21
|
return `${a} ${b}`;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
function renderPresetButtons() {
|
|
25
|
+
return sortedPresets().map(p => {
|
|
26
|
+
const hasConfigured = state.cfg.commands.some(c => binName(c.command) === binName(p.command) && c.enabled !== false);
|
|
27
|
+
const missing = p.available === false && !hasConfigured;
|
|
28
|
+
return `
|
|
29
|
+
<button class="preset-btn w-full flex items-center gap-2.5 px-3 py-2 rounded-md hover:bg-slate-700/70 text-sm transition-colors text-left ${missing ? 'text-slate-500' : 'text-slate-300'}" data-preset="${p.presetId}">
|
|
30
|
+
<span class="${missing ? 'opacity-40' : ''}">${agentIcon(p.icon, 24)}</span>
|
|
31
|
+
<span class="flex-1 min-w-0">
|
|
32
|
+
<span>${esc(p.name)}</span>
|
|
33
|
+
${missing ? `<span class="block text-[10px] text-slate-600 truncate">${esc(p.installCmd || 'Not installed')}</span>` : ''}
|
|
34
|
+
</span>
|
|
35
|
+
</button>`;
|
|
36
|
+
}).join('');
|
|
37
|
+
}
|
|
38
|
+
|
|
24
39
|
function sortedPresets() {
|
|
25
40
|
const all = [...state.presets].filter(p => {
|
|
26
41
|
const cmd = state.cfg.commands.find(c =>
|
|
@@ -77,8 +92,6 @@ export function openCreator() {
|
|
|
77
92
|
// Close project creator if open
|
|
78
93
|
document.getElementById('project-creator')?.remove();
|
|
79
94
|
if (!state.presets.length) return;
|
|
80
|
-
// Recheck binary availability on the server
|
|
81
|
-
send({ type: 'checkAvailability' });
|
|
82
95
|
|
|
83
96
|
const fallbackName = randomName();
|
|
84
97
|
const presets = sortedPresets();
|
|
@@ -103,19 +116,8 @@ export function openCreator() {
|
|
|
103
116
|
${FOLDER_SVG}
|
|
104
117
|
</button>
|
|
105
118
|
</div>
|
|
106
|
-
<div class="space-y-0.5">
|
|
107
|
-
${
|
|
108
|
-
const hasConfigured = state.cfg.commands.some(c => binName(c.command) === binName(p.command) && c.enabled !== false);
|
|
109
|
-
const missing = p.available === false && !hasConfigured;
|
|
110
|
-
return `
|
|
111
|
-
<button class="preset-btn w-full flex items-center gap-2.5 px-3 py-2 rounded-md hover:bg-slate-700/70 text-sm transition-colors text-left ${missing ? 'text-slate-500' : 'text-slate-300'}" data-preset="${p.presetId}">
|
|
112
|
-
<span class="${missing ? 'opacity-40' : ''}">${agentIcon(p.icon, 24)}</span>
|
|
113
|
-
<span class="flex-1 min-w-0">
|
|
114
|
-
<span>${esc(p.name)}</span>
|
|
115
|
-
${missing ? `<span class="block text-[10px] text-slate-600 truncate">${esc(p.installCmd || 'Not installed')}</span>` : ''}
|
|
116
|
-
</span>
|
|
117
|
-
</button>`;
|
|
118
|
-
}).join('')}
|
|
119
|
+
<div id="creator-presets" class="space-y-0.5">
|
|
120
|
+
${renderPresetButtons()}
|
|
119
121
|
</div>`;
|
|
120
122
|
|
|
121
123
|
const list = document.getElementById('session-list');
|
|
@@ -215,10 +217,8 @@ export function openCreator() {
|
|
|
215
217
|
}
|
|
216
218
|
|
|
217
219
|
export function refreshCreator() {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
openCreator();
|
|
221
|
-
}
|
|
220
|
+
const container = document.getElementById('creator-presets');
|
|
221
|
+
if (container) container.innerHTML = renderPresetButtons();
|
|
222
222
|
}
|
|
223
223
|
|
|
224
224
|
export function closeCreator() {
|