clideck 1.22.5 → 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/creator.js +19 -17
package/package.json
CHANGED
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 =>
|
|
@@ -101,19 +116,8 @@ export function openCreator() {
|
|
|
101
116
|
${FOLDER_SVG}
|
|
102
117
|
</button>
|
|
103
118
|
</div>
|
|
104
|
-
<div class="space-y-0.5">
|
|
105
|
-
${
|
|
106
|
-
const hasConfigured = state.cfg.commands.some(c => binName(c.command) === binName(p.command) && c.enabled !== false);
|
|
107
|
-
const missing = p.available === false && !hasConfigured;
|
|
108
|
-
return `
|
|
109
|
-
<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}">
|
|
110
|
-
<span class="${missing ? 'opacity-40' : ''}">${agentIcon(p.icon, 24)}</span>
|
|
111
|
-
<span class="flex-1 min-w-0">
|
|
112
|
-
<span>${esc(p.name)}</span>
|
|
113
|
-
${missing ? `<span class="block text-[10px] text-slate-600 truncate">${esc(p.installCmd || 'Not installed')}</span>` : ''}
|
|
114
|
-
</span>
|
|
115
|
-
</button>`;
|
|
116
|
-
}).join('')}
|
|
119
|
+
<div id="creator-presets" class="space-y-0.5">
|
|
120
|
+
${renderPresetButtons()}
|
|
117
121
|
</div>`;
|
|
118
122
|
|
|
119
123
|
const list = document.getElementById('session-list');
|
|
@@ -213,10 +217,8 @@ export function openCreator() {
|
|
|
213
217
|
}
|
|
214
218
|
|
|
215
219
|
export function refreshCreator() {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
openCreator();
|
|
219
|
-
}
|
|
220
|
+
const container = document.getElementById('creator-presets');
|
|
221
|
+
if (container) container.innerHTML = renderPresetButtons();
|
|
220
222
|
}
|
|
221
223
|
|
|
222
224
|
export function closeCreator() {
|