cladogram 0.5.3 → 0.5.4
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/README.md +19 -0
- package/bin/clado.js +13 -2
- package/docs/plugin-development.md +135 -0
- package/docs/plugin-ui.md +43 -0
- package/docs/release.md +7 -0
- package/package.json +7 -1
- package/plugins/agent/index.js +181 -0
- package/plugins/agent/style.css +105 -0
- package/plugins/brand/index.js +262 -0
- package/plugins/brand/style.css +162 -0
- package/plugins/directory/capabilities.json +27 -0
- package/plugins/directory/index.js +146 -0
- package/plugins/directory/style.css +48 -0
- package/plugins/view-controls/index.js +58 -0
- package/plugins/view-controls/style.css +46 -0
- package/skills/clado/SKILL.md +4 -0
- package/src/html/app-css.js +9 -40
- package/src/html/canvas-chain.js +5 -6
- package/src/html/canvas-focus.js +2 -4
- package/src/html/canvas-screenshot.js +199 -0
- package/src/html/canvas-ui.css +5 -9
- package/src/html/canvas-ui.js +35 -27
- package/src/html/page.js +11 -37
- package/src/html/plugin-assets.js +33 -0
- package/src/html/plugin-ui.css +176 -0
- package/src/html/plugin-ui.js +45 -0
- package/src/html/runtime-api.js +41 -0
- package/src/html/runtime.js +15 -12
- package/src/server/agent.js +222 -0
- package/src/server/assets/clado-plugin-sdk.js +111 -0
- package/src/server/assets/library-canvas.js +12 -9
- package/src/server/assets/library-plugin-bridge.js +84 -0
- package/src/server/assets/library-plugins.css +39 -0
- package/src/server/assets/library-plugins.js +200 -0
- package/src/server/assets/library.css +3 -6
- package/src/server/assets/library.html +2 -12
- package/src/server/assets/library.js +227 -44
- package/src/server/canvas-capture.js +47 -0
- package/src/server/export.js +5 -2
- package/src/server/mcp.js +29 -6
- package/src/server/plugin-capabilities.js +172 -0
- package/src/server/plugin-settings.js +117 -0
- package/src/server/plugins.js +236 -0
- package/src/server/workspace.js +127 -11
- package/src/vendor/html-to-image.min.js +24 -0
- package/src/server/assets/tree.js +0 -26
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
(() => {
|
|
2
|
+
const themes = [
|
|
3
|
+
['light', '日间模式', '<circle cx="12" cy="12" r="4"/><path d="M12 2v2m0 16v2M2 12h2m16 0h2M4.9 4.9l1.4 1.4m11.4 11.4 1.4 1.4M6.3 17.7l-1.4 1.4M17.7 6.3l1.4-1.4"/>'],
|
|
4
|
+
['dark', '夜间模式', '<path d="M19.8 15.2A8.4 8.4 0 0 1 8.8 4.1 8.5 8.5 0 1 0 19.8 15.2Z"/>'],
|
|
5
|
+
];
|
|
6
|
+
const icon = shape => '<svg aria-hidden="true" viewBox="0 0 24 24">' + shape + '</svg>';
|
|
7
|
+
const camera = '<path d="M8 3H5a2 2 0 0 0-2 2v3m13-5h3a2 2 0 0 1 2 2v3M3 16v3a2 2 0 0 0 2 2h3m13-5v3a2 2 0 0 1-2 2h-3"/><rect x="8" y="8" width="8" height="8" rx="1.5"/>';
|
|
8
|
+
const pluginIcons = {
|
|
9
|
+
'clado.brand': '<circle cx="12" cy="12" r="7"/><circle cx="12" cy="12" r="2"/>',
|
|
10
|
+
'clado.view-controls': '<rect x="3" y="6" width="18" height="12" rx="3"/><path d="M9 6v12m6-12v12"/>',
|
|
11
|
+
'clado.directory': '<path d="M4 7h6l2 2h8v10H4z"/>',
|
|
12
|
+
'clado.agent': '<path d="M10 20h4m-4-3h4v-2c0-.7.3-1.2.9-1.7a4.5 4.5 0 1 0-5.8 0c.6.5.9 1 .9 1.7zM18 3v4m-2-2h4"/>',
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
function mountInstaller(dialog, plugins) {
|
|
16
|
+
const trigger = dialog.querySelector('[data-install-trigger]');
|
|
17
|
+
if (!plugins.install) { trigger.hidden = true; return () => {}; }
|
|
18
|
+
const pick = dialog.querySelector('[type="file"]');
|
|
19
|
+
const review = dialog.querySelector('.clado-plugin-install');
|
|
20
|
+
const status = review.querySelector('[role="status"]');
|
|
21
|
+
const confirm = review.querySelector('[data-install-confirm]');
|
|
22
|
+
let selected, epoch = 0;
|
|
23
|
+
const clear = () => {
|
|
24
|
+
epoch++;
|
|
25
|
+
selected = null;
|
|
26
|
+
pick.value = '';
|
|
27
|
+
confirm.disabled = false;
|
|
28
|
+
review.hidden = true;
|
|
29
|
+
};
|
|
30
|
+
trigger.onclick = () => { clear(); pick.click(); };
|
|
31
|
+
review.querySelector('[data-install-cancel]').onclick = clear;
|
|
32
|
+
pick.onchange = async () => {
|
|
33
|
+
const request = ++epoch;
|
|
34
|
+
review.hidden = false;
|
|
35
|
+
confirm.hidden = true;
|
|
36
|
+
status.textContent = '正在读取插件清单…';
|
|
37
|
+
const files = [...pick.files].map(file => ({ file, path: file.webkitRelativePath.split('/').slice(1).join('/') }))
|
|
38
|
+
.filter(({ path }) => path === 'clado-plugin.json' || path.startsWith('ui/') && !path.split('/').some(part => part.startsWith('.')));
|
|
39
|
+
try {
|
|
40
|
+
const manifest = files.find(({ path }) => path === 'clado-plugin.json');
|
|
41
|
+
if (!manifest) throw new Error('请选择包含 clado-plugin.json 的插件根目录。');
|
|
42
|
+
if (manifest.file.size > 65536 || files.length > 256 || files.reduce((sum, item) => sum + item.file.size, 0) > 8 * 1024 * 1024) throw new Error('插件目录超过安装大小限制。');
|
|
43
|
+
const data = JSON.parse(await manifest.file.text());
|
|
44
|
+
if (request !== epoch) return;
|
|
45
|
+
if (typeof data?.name !== 'string') throw new Error('插件清单缺少名称。');
|
|
46
|
+
selected = files;
|
|
47
|
+
const permissions = Array.isArray(data.permissions) ? data.permissions.join('、') : '';
|
|
48
|
+
status.textContent = data.name + (permissions ? ' · 请求权限:' + permissions : ' · 无额外权限');
|
|
49
|
+
confirm.hidden = false;
|
|
50
|
+
} catch (error) {
|
|
51
|
+
if (request === epoch) status.textContent = error.message;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
confirm.onclick = async () => {
|
|
55
|
+
if (!selected || confirm.disabled) return;
|
|
56
|
+
confirm.disabled = true;
|
|
57
|
+
status.textContent = '正在安装…';
|
|
58
|
+
try {
|
|
59
|
+
const files = await Promise.all(selected.map(({ file, path }) => new Promise((resolve, reject) => {
|
|
60
|
+
const reader = new FileReader();
|
|
61
|
+
reader.onload = () => resolve({ path, data: reader.result.split(',')[1] });
|
|
62
|
+
reader.onerror = reject;
|
|
63
|
+
reader.readAsDataURL(file);
|
|
64
|
+
})));
|
|
65
|
+
await plugins.install(files);
|
|
66
|
+
plugins.refresh();
|
|
67
|
+
} catch (error) {
|
|
68
|
+
status.textContent = error.message || '安装失败。';
|
|
69
|
+
confirm.disabled = false;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
return clear;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function settingsEditor(brand, edit) {
|
|
76
|
+
const dialog = document.createElement('dialog');
|
|
77
|
+
dialog.className = 'clado-ui-dialog clado-plugin-editor';
|
|
78
|
+
dialog.setAttribute('aria-labelledby', 'clado-plugin-editor-title');
|
|
79
|
+
dialog.innerHTML = `
|
|
80
|
+
<header><h2 id="clado-plugin-editor-title"></h2><button type="button" class="clado-ui-button" aria-label="关闭配置">×</button></header>
|
|
81
|
+
<p class="clado-plugin-editor-path"></p>
|
|
82
|
+
<textarea rows="10" spellcheck="false" aria-label="插件配置 JSON"></textarea>
|
|
83
|
+
<details><summary>查看字段和默认值</summary><pre></pre></details>
|
|
84
|
+
<footer><span role="status"></span><button type="button" class="clado-ui-button clado-ui-button-primary">保存并应用</button></footer>`;
|
|
85
|
+
const field = dialog.querySelector('textarea'), save = dialog.querySelector('footer button');
|
|
86
|
+
const status = dialog.querySelector('[role="status"]');
|
|
87
|
+
let request = 0;
|
|
88
|
+
dialog.querySelector('header button').onclick = () => dialog.close();
|
|
89
|
+
dialog.addEventListener('close', () => { request++; });
|
|
90
|
+
brand.append(dialog);
|
|
91
|
+
return async plugin => {
|
|
92
|
+
const current = ++request;
|
|
93
|
+
dialog.querySelector('h2').textContent = plugin.name + '设置';
|
|
94
|
+
dialog.querySelector('.clado-plugin-editor-path').textContent = '.clado/plugin-settings.json';
|
|
95
|
+
dialog.querySelector('pre').textContent = '';
|
|
96
|
+
field.value = '';
|
|
97
|
+
field.disabled = save.disabled = true;
|
|
98
|
+
status.textContent = '正在读取配置…';
|
|
99
|
+
dialog.showModal();
|
|
100
|
+
try {
|
|
101
|
+
const { value, schema, defaults, path } = await edit(plugin.id);
|
|
102
|
+
if (current !== request) return;
|
|
103
|
+
field.value = JSON.stringify(value, null, 2);
|
|
104
|
+
dialog.querySelector('.clado-plugin-editor-path').textContent = path;
|
|
105
|
+
dialog.querySelector('pre').textContent = JSON.stringify({ schema, defaults }, null, 2);
|
|
106
|
+
field.disabled = save.disabled = false;
|
|
107
|
+
status.textContent = '';
|
|
108
|
+
save.onclick = async () => {
|
|
109
|
+
let next;
|
|
110
|
+
try { next = JSON.parse(field.value); }
|
|
111
|
+
catch { status.textContent = 'JSON 格式有误,请修改后再保存。'; field.focus(); return; }
|
|
112
|
+
field.disabled = save.disabled = true;
|
|
113
|
+
try { await edit(plugin.id, next, value); }
|
|
114
|
+
catch (error) {
|
|
115
|
+
if (current !== request) return;
|
|
116
|
+
status.textContent = error.message;
|
|
117
|
+
field.disabled = save.disabled = false;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
} catch (error) {
|
|
121
|
+
if (current === request) status.textContent = error.message;
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function mountBrand(host, { setTheme, capture, plugins }) {
|
|
127
|
+
const brand = document.createElement('div');
|
|
128
|
+
brand.className = 'clado-brand-plugin';
|
|
129
|
+
brand.innerHTML = `
|
|
130
|
+
<button type="button" class="clado-ui-glass clado-ui-button clado-brand" aria-label="Clado 设置" aria-expanded="false" aria-controls="clado-brand-settings" title="Clado 设置">
|
|
131
|
+
<span class="clado-brand-mark" aria-hidden="true">C</span><strong>clado</strong>
|
|
132
|
+
</button>
|
|
133
|
+
<div class="clado-ui-glass clado-ui-glass-panel clado-brand-settings" id="clado-brand-settings" role="group" aria-labelledby="clado-brand-settings-title" hidden>
|
|
134
|
+
<p id="clado-brand-settings-title">设置</p>
|
|
135
|
+
</div>`;
|
|
136
|
+
const trigger = brand.querySelector('.clado-brand');
|
|
137
|
+
const panel = brand.querySelector('.clado-brand-settings');
|
|
138
|
+
function setOpen(open, returnFocus = false) {
|
|
139
|
+
panel.hidden = !open;
|
|
140
|
+
trigger.setAttribute('aria-expanded', String(open));
|
|
141
|
+
if (returnFocus) trigger.focus();
|
|
142
|
+
}
|
|
143
|
+
const choices = themes.map(([theme, label, shape]) => {
|
|
144
|
+
const choice = document.createElement('button');
|
|
145
|
+
choice.type = 'button';
|
|
146
|
+
choice.className = 'clado-ui-button clado-brand-choice';
|
|
147
|
+
choice.innerHTML = icon(shape) + '<span>' + label + '</span>' +
|
|
148
|
+
'<span class="clado-brand-check">' + icon('<path d="m5 12 4 4L19 6"/>') + '</span>';
|
|
149
|
+
choice.onclick = () => { setTheme(theme); setOpen(false, true); };
|
|
150
|
+
panel.append(choice);
|
|
151
|
+
return { theme, choice };
|
|
152
|
+
});
|
|
153
|
+
if (capture) {
|
|
154
|
+
const action = document.createElement('button');
|
|
155
|
+
action.type = 'button';
|
|
156
|
+
action.className = 'clado-ui-button clado-brand-choice clado-brand-capture';
|
|
157
|
+
action.innerHTML = icon(camera) + '<span>截取当前画布</span>';
|
|
158
|
+
action.onclick = async () => {
|
|
159
|
+
setOpen(false, true);
|
|
160
|
+
action.disabled = true;
|
|
161
|
+
action.querySelector('span').textContent = '正在截图…';
|
|
162
|
+
try { await capture(); }
|
|
163
|
+
finally {
|
|
164
|
+
action.disabled = false;
|
|
165
|
+
action.querySelector('span').textContent = '截取当前画布';
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
panel.append(action);
|
|
169
|
+
}
|
|
170
|
+
if (plugins) {
|
|
171
|
+
const action = document.createElement('button');
|
|
172
|
+
action.type = 'button';
|
|
173
|
+
action.className = 'clado-ui-button clado-brand-choice clado-brand-capture';
|
|
174
|
+
action.innerHTML = icon('<rect x="3" y="3" width="7" height="7" rx="1.5"/><rect x="14" y="3" width="7" height="7" rx="1.5"/><rect x="3" y="14" width="7" height="7" rx="1.5"/><rect x="14" y="14" width="7" height="7" rx="1.5"/>') + '<span>插件管理</span>';
|
|
175
|
+
const dialog = document.createElement('dialog');
|
|
176
|
+
dialog.className = 'clado-ui-dialog clado-plugin-manager';
|
|
177
|
+
dialog.setAttribute('aria-labelledby', 'clado-plugin-manager-title');
|
|
178
|
+
dialog.innerHTML = `
|
|
179
|
+
<header><h2 id="clado-plugin-manager-title">插件管理</h2><div class="clado-plugin-manager-actions">
|
|
180
|
+
<button type="button" class="clado-ui-button clado-plugin-install-trigger" data-install-trigger>安装插件</button>
|
|
181
|
+
<button type="button" class="clado-ui-button" aria-label="关闭插件管理">×</button>
|
|
182
|
+
</div></header>
|
|
183
|
+
<input type="file" webkitdirectory multiple hidden aria-label="选择本地插件文件夹">
|
|
184
|
+
<section class="clado-plugin-install" hidden><p role="status"></p><div class="clado-plugin-manager-actions">
|
|
185
|
+
<button type="button" class="clado-ui-button" data-install-cancel>取消</button>
|
|
186
|
+
<button type="button" class="clado-ui-button clado-plugin-install-trigger" data-install-confirm>确认安装</button>
|
|
187
|
+
</div></section>
|
|
188
|
+
<div class="clado-plugin-manager-list"></div>
|
|
189
|
+
<footer><span role="status"></span><button type="button" class="clado-ui-button clado-ui-button-primary" disabled>应用并刷新</button></footer>`;
|
|
190
|
+
const list = dialog.querySelector('.clado-plugin-manager-list');
|
|
191
|
+
const apply = dialog.querySelector('footer button');
|
|
192
|
+
const status = dialog.querySelector('footer [role="status"]');
|
|
193
|
+
const clearInstaller = mountInstaller(dialog, plugins);
|
|
194
|
+
const editSettings = plugins.edit && settingsEditor(brand, plugins.edit);
|
|
195
|
+
const controls = plugins.items.map(plugin => {
|
|
196
|
+
const row = document.createElement('article');
|
|
197
|
+
row.innerHTML = '<span class="clado-plugin-card-icon">' + icon(pluginIcons[plugin.id] || '<path d="m12 3 8 5v8l-8 5-8-5V8z"/>') + '</span>';
|
|
198
|
+
const name = document.createElement('strong');
|
|
199
|
+
name.textContent = plugin.name;
|
|
200
|
+
const toggle = document.createElement('input');
|
|
201
|
+
toggle.type = 'checkbox';
|
|
202
|
+
toggle.setAttribute('role', 'switch');
|
|
203
|
+
toggle.setAttribute('aria-label', plugin.name);
|
|
204
|
+
toggle.checked = plugins.isEnabled(plugin.id);
|
|
205
|
+
toggle.disabled = !!plugin.reason;
|
|
206
|
+
row.append(name);
|
|
207
|
+
if (plugin.reason || plugin.detail || plugin.version) {
|
|
208
|
+
const detail = document.createElement('small');
|
|
209
|
+
detail.textContent = plugin.reason || plugin.detail || 'v' + plugin.version;
|
|
210
|
+
row.append(detail);
|
|
211
|
+
}
|
|
212
|
+
row.append(toggle);
|
|
213
|
+
const settings = document.createElement('button');
|
|
214
|
+
settings.type = 'button';
|
|
215
|
+
settings.className = 'clado-ui-button';
|
|
216
|
+
settings.textContent = '设置';
|
|
217
|
+
settings.setAttribute('aria-label', plugin.name + '配置');
|
|
218
|
+
settings.disabled = !editSettings || !!plugin.pending;
|
|
219
|
+
if (settings.disabled) settings.title = '插件启用后可编辑配置';
|
|
220
|
+
settings.onclick = () => editSettings(plugin);
|
|
221
|
+
row.append(settings);
|
|
222
|
+
list.append(row);
|
|
223
|
+
return { plugin, toggle };
|
|
224
|
+
});
|
|
225
|
+
list.onchange = () => {
|
|
226
|
+
apply.disabled = controls.every(({ plugin, toggle }) => toggle.checked === plugins.isEnabled(plugin.id));
|
|
227
|
+
status.textContent = apply.disabled ? '' : '刷新会结束当前对话';
|
|
228
|
+
};
|
|
229
|
+
apply.onclick = () => {
|
|
230
|
+
try { plugins.save(controls.filter(({ toggle }) => !toggle.checked && !toggle.disabled).map(({ plugin }) => plugin.id)); }
|
|
231
|
+
catch { status.textContent = '保存失败,请检查浏览器的本地存储设置。'; }
|
|
232
|
+
};
|
|
233
|
+
dialog.querySelector('[aria-label="关闭插件管理"]').onclick = () => dialog.close();
|
|
234
|
+
dialog.onclose = () => { clearInstaller(); trigger.focus(); };
|
|
235
|
+
action.onclick = () => {
|
|
236
|
+
for (const { plugin, toggle } of controls) toggle.checked = plugins.isEnabled(plugin.id);
|
|
237
|
+
apply.disabled = true;
|
|
238
|
+
status.textContent = '';
|
|
239
|
+
setOpen(false);
|
|
240
|
+
dialog.showModal();
|
|
241
|
+
};
|
|
242
|
+
brand.append(dialog);
|
|
243
|
+
panel.append(action);
|
|
244
|
+
}
|
|
245
|
+
trigger.onclick = () => setOpen(panel.hidden);
|
|
246
|
+
document.addEventListener('pointerdown', event => {
|
|
247
|
+
if (!panel.hidden && !brand.contains(event.target)) setOpen(false);
|
|
248
|
+
});
|
|
249
|
+
document.addEventListener('keydown', event => {
|
|
250
|
+
if (event.key === 'Escape' && !panel.hidden) setOpen(false, true);
|
|
251
|
+
});
|
|
252
|
+
host.mount('top-left', brand, 'clado.brand');
|
|
253
|
+
return {
|
|
254
|
+
sync(theme) {
|
|
255
|
+
for (const entry of choices) entry.choice.setAttribute('aria-pressed', String(entry.theme === theme));
|
|
256
|
+
},
|
|
257
|
+
close: () => setOpen(false),
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
window.CladoPluginUI.mountBrand = mountBrand;
|
|
262
|
+
})();
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
.clado-brand-plugin { position: relative; }
|
|
2
|
+
.clado-brand {
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
gap: 8px;
|
|
6
|
+
height: 44px;
|
|
7
|
+
padding: 6px 11px 6px 7px;
|
|
8
|
+
color: var(--clado-ui-text);
|
|
9
|
+
border-radius: var(--clado-ui-radius);
|
|
10
|
+
}
|
|
11
|
+
.clado-brand strong { font-size: 17px; font-weight: 680; letter-spacing: -.05em; }
|
|
12
|
+
.clado-brand-mark {
|
|
13
|
+
display: grid;
|
|
14
|
+
place-items: center;
|
|
15
|
+
width: 28px;
|
|
16
|
+
height: 28px;
|
|
17
|
+
border-radius: 9px;
|
|
18
|
+
background: linear-gradient(145deg, #424242, #1c1c1c 78%);
|
|
19
|
+
box-shadow: inset 0 1px 1px #fff4, 0 2px 4px #17171738;
|
|
20
|
+
color: #fff;
|
|
21
|
+
font-weight: 750;
|
|
22
|
+
font-size: 15px;
|
|
23
|
+
flex: none;
|
|
24
|
+
}
|
|
25
|
+
.clado-brand-settings {
|
|
26
|
+
position: absolute;
|
|
27
|
+
inset: calc(100% + 8px) auto auto 0;
|
|
28
|
+
width: min(182px, calc(100vw - 32px));
|
|
29
|
+
display: grid;
|
|
30
|
+
gap: 4px;
|
|
31
|
+
padding: 8px;
|
|
32
|
+
}
|
|
33
|
+
.clado-brand-settings p {
|
|
34
|
+
margin: 0;
|
|
35
|
+
padding: 3px 8px 2px;
|
|
36
|
+
color: var(--clado-ui-muted);
|
|
37
|
+
font-size: 11px;
|
|
38
|
+
font-weight: 600;
|
|
39
|
+
}
|
|
40
|
+
.clado-brand-choice {
|
|
41
|
+
min-height: 34px;
|
|
42
|
+
padding-inline: 8px;
|
|
43
|
+
display: grid;
|
|
44
|
+
grid-template-columns: 16px 1fr 14px;
|
|
45
|
+
align-items: center;
|
|
46
|
+
gap: 8px;
|
|
47
|
+
text-align: start;
|
|
48
|
+
}
|
|
49
|
+
.clado-brand-choice[aria-pressed="true"] { font-weight: 600; }
|
|
50
|
+
.clado-brand-choice svg {
|
|
51
|
+
display: block;
|
|
52
|
+
width: 16px;
|
|
53
|
+
height: 16px;
|
|
54
|
+
fill: none;
|
|
55
|
+
stroke: currentColor;
|
|
56
|
+
stroke-width: 1.7;
|
|
57
|
+
stroke-linecap: round;
|
|
58
|
+
stroke-linejoin: round;
|
|
59
|
+
}
|
|
60
|
+
.clado-brand-check { visibility: hidden; }
|
|
61
|
+
.clado-brand-choice[aria-pressed="true"] .clado-brand-check { visibility: visible; }
|
|
62
|
+
.clado-brand-check svg { width: 14px; height: 14px; }
|
|
63
|
+
.clado-brand-capture {
|
|
64
|
+
margin-block-start: 3px;
|
|
65
|
+
grid-template-columns: 16px 1fr;
|
|
66
|
+
}
|
|
67
|
+
.clado-brand:is(:hover,[aria-expanded="true"]) { color: var(--clado-ui-text); }
|
|
68
|
+
.clado-plugin-manager, .clado-plugin-editor {
|
|
69
|
+
position: fixed;
|
|
70
|
+
inset: 0;
|
|
71
|
+
margin: auto;
|
|
72
|
+
width: min(454px, calc(100vw - 32px));
|
|
73
|
+
max-height: calc(100dvh - 40px);
|
|
74
|
+
padding: 20px;
|
|
75
|
+
overflow: auto;
|
|
76
|
+
}
|
|
77
|
+
:is(.clado-plugin-manager,.clado-plugin-editor) :is(header,footer) {
|
|
78
|
+
display: flex;
|
|
79
|
+
align-items: center;
|
|
80
|
+
justify-content: space-between;
|
|
81
|
+
gap: 12px;
|
|
82
|
+
}
|
|
83
|
+
.clado-plugin-editor { width: min(600px, calc(100vw - 32px)); }
|
|
84
|
+
:is(.clado-plugin-manager,.clado-plugin-editor) h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
|
|
85
|
+
.clado-plugin-manager-actions { display: flex; align-items: center; gap: 6px; }
|
|
86
|
+
.clado-plugin-manager .clado-plugin-install-trigger {
|
|
87
|
+
background: #242424;
|
|
88
|
+
border-color: #242424;
|
|
89
|
+
color: #fff;
|
|
90
|
+
}
|
|
91
|
+
.clado-plugin-manager .clado-plugin-install-trigger:hover { background: #444; }
|
|
92
|
+
.clado-plugin-install {
|
|
93
|
+
margin-top: 12px;
|
|
94
|
+
padding: 10px 12px;
|
|
95
|
+
border: 1px solid #dedede;
|
|
96
|
+
border-radius: 11px;
|
|
97
|
+
background: #f7f7f7;
|
|
98
|
+
}
|
|
99
|
+
.clado-plugin-install p { margin: 0 0 8px; overflow-wrap: anywhere; color: #454545; }
|
|
100
|
+
.clado-plugin-install .clado-plugin-manager-actions { justify-content: end; }
|
|
101
|
+
.clado-plugin-manager-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
|
|
102
|
+
.clado-plugin-manager-list article {
|
|
103
|
+
display: grid;
|
|
104
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
105
|
+
grid-template-rows: auto auto 1fr auto;
|
|
106
|
+
align-items: start;
|
|
107
|
+
gap: 6px;
|
|
108
|
+
min-height: 116px;
|
|
109
|
+
padding: 12px;
|
|
110
|
+
border: 1px solid #e4e4e4;
|
|
111
|
+
border-radius: calc(var(--clado-ui-radius) - 4px);
|
|
112
|
+
background: linear-gradient(150deg, #fbfbfb, #f2f2f2);
|
|
113
|
+
}
|
|
114
|
+
.clado-plugin-manager-list article:has(input:not(:checked)) { background: #fff; }
|
|
115
|
+
.clado-plugin-card-icon { grid-area: 1 / 1; display: grid; place-items: center; width: 31px; height: 31px; border: 1px solid #e0e0e0; border-radius: 9px; background: #fff; }
|
|
116
|
+
.clado-plugin-card-icon svg { width: 17px; height: 17px; fill: none; stroke: #343434; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
|
|
117
|
+
.clado-plugin-manager-list strong {
|
|
118
|
+
grid-area: 2 / 1 / auto / -1;
|
|
119
|
+
align-self: center;
|
|
120
|
+
overflow-wrap: anywhere;
|
|
121
|
+
}
|
|
122
|
+
.clado-plugin-manager-list small { grid-area: 3 / 1 / auto / -1; color: var(--clado-ui-muted); }
|
|
123
|
+
.clado-plugin-manager-list article button { grid-area: 4 / 2; min-height: 28px; padding: 4px 7px; }
|
|
124
|
+
.clado-plugin-manager-list input {
|
|
125
|
+
grid-area: 1 / 2;
|
|
126
|
+
align-self: center;
|
|
127
|
+
appearance: none;
|
|
128
|
+
position: relative;
|
|
129
|
+
width: 33px;
|
|
130
|
+
height: 19px;
|
|
131
|
+
margin: 0;
|
|
132
|
+
border-radius: 99px;
|
|
133
|
+
background: var(--clado-ui-edge);
|
|
134
|
+
cursor: pointer;
|
|
135
|
+
}
|
|
136
|
+
.clado-plugin-manager-list input::before {
|
|
137
|
+
content: "";
|
|
138
|
+
position: absolute;
|
|
139
|
+
inset: 3px auto auto 3px;
|
|
140
|
+
width: 13px;
|
|
141
|
+
height: 13px;
|
|
142
|
+
border-radius: 50%;
|
|
143
|
+
background: white;
|
|
144
|
+
}
|
|
145
|
+
.clado-plugin-manager-list input:checked { background: var(--clado-ui-accent); }
|
|
146
|
+
.clado-plugin-manager-list input:checked::before { transform: translateX(14px); }
|
|
147
|
+
.clado-plugin-manager-list input:focus-visible { outline: 2px solid var(--clado-ui-accent); outline-offset: 2px; }
|
|
148
|
+
.clado-plugin-manager-list input:disabled { opacity: .5; cursor: default; }
|
|
149
|
+
:is(.clado-plugin-manager,.clado-plugin-editor) footer span { color: var(--clado-ui-muted); font-size: 12px; }
|
|
150
|
+
.clado-plugin-editor-path { color: var(--clado-ui-muted); font: 12px ui-monospace, monospace; }
|
|
151
|
+
.clado-plugin-editor textarea {
|
|
152
|
+
box-sizing: border-box;
|
|
153
|
+
width: 100%;
|
|
154
|
+
padding: 10px;
|
|
155
|
+
border: 1px solid #dfdfdf;
|
|
156
|
+
border-radius: 10px;
|
|
157
|
+
background: #f8f8f8;
|
|
158
|
+
font: 13px/1.5 ui-monospace, monospace;
|
|
159
|
+
resize: vertical;
|
|
160
|
+
}
|
|
161
|
+
.clado-plugin-editor details { padding: 10px 0; color: var(--clado-ui-muted); }
|
|
162
|
+
.clado-plugin-editor pre { max-height: 180px; overflow: auto; }
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "directory.open",
|
|
4
|
+
"mount": "directory",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"description": "在指定 Clado 标签页打开工作区内的 Markdown 画布。沿用当前视图,并等待目标画布加载。",
|
|
7
|
+
"exposeToAgent": true,
|
|
8
|
+
"inputSchema": {
|
|
9
|
+
"type": "object",
|
|
10
|
+
"properties": {
|
|
11
|
+
"file": { "type": "string", "minLength": 1, "maxLength": 1500, "pattern": "\\.[mM][dD][cC]?$", "description": "文档目录下的相对文件路径,例如 design/checkout.mdc。" }
|
|
12
|
+
},
|
|
13
|
+
"required": ["file"],
|
|
14
|
+
"additionalProperties": false
|
|
15
|
+
},
|
|
16
|
+
"outputSchema": {
|
|
17
|
+
"type": "object",
|
|
18
|
+
"properties": {
|
|
19
|
+
"file": { "type": "string" },
|
|
20
|
+
"title": { "type": "string" },
|
|
21
|
+
"mode": { "enum": ["mindmap", "cards", "doc"] }
|
|
22
|
+
},
|
|
23
|
+
"required": ["file", "title", "mode"],
|
|
24
|
+
"additionalProperties": false
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
]
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
(() => {
|
|
2
|
+
function renderTree(container, documents, { selected='', query='', onOpen=()=>{}, folders=new Set() } = {}) {
|
|
3
|
+
const needle=query.trim().toLocaleLowerCase(), root={folders:new Map(),files:[]};
|
|
4
|
+
for(const doc of documents) {
|
|
5
|
+
if(needle && !(doc.title+' '+doc.file).toLocaleLowerCase().includes(needle))continue;
|
|
6
|
+
const parts=doc.file.split('/');let node=root;
|
|
7
|
+
parts.slice(0,-1).forEach((name,i)=>{const path=parts.slice(0,i+1).join('/');if(!node.folders.has(name))node.folders.set(name,{path,folders:new Map(),files:[]});node=node.folders.get(name);});node.files.push(doc);
|
|
8
|
+
}
|
|
9
|
+
container.replaceChildren();
|
|
10
|
+
function render(node, parent) {
|
|
11
|
+
for(const [name,folder] of node.folders) {
|
|
12
|
+
const details=document.createElement('details');details.className='tree-folder';details.open=!!needle||!folders.has('closed:'+folder.path);
|
|
13
|
+
const summary=document.createElement('summary');summary.textContent=name;details.append(summary);
|
|
14
|
+
details.addEventListener('toggle',()=>{if(!needle){if(details.open)folders.delete('closed:'+folder.path);else folders.add('closed:'+folder.path);}});
|
|
15
|
+
const children=document.createElement('div');children.className='tree-children';details.append(children);render(folder,children);parent.append(details);
|
|
16
|
+
}
|
|
17
|
+
for(const doc of node.files) {
|
|
18
|
+
const button=document.createElement('button');button.className='clado-ui-button document-button';button.dataset.file=doc.file;if(doc.file===selected)button.setAttribute('aria-current','page');
|
|
19
|
+
const strong=document.createElement('strong');strong.textContent=doc.title;
|
|
20
|
+
const small=document.createElement('small');small.textContent=doc.file.split('/').pop();button.append(strong,small);button.onclick=()=>onOpen(doc.file);parent.append(button);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
render(root,container);
|
|
24
|
+
if(!container.childElementCount){const empty=document.createElement('p');empty.className='tree-empty';empty.textContent=needle?'没有匹配的文档':'还没有可展示的文档';container.append(empty);}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
window.CladoDirectoryPlugin = (host, actions) => {
|
|
28
|
+
const content = document.createElement('div');
|
|
29
|
+
content.className = 'clado-directory-plugin';
|
|
30
|
+
content.innerHTML = `
|
|
31
|
+
<button type="button" id="directoryButton" class="clado-ui-glass clado-ui-button directory-toggle" aria-expanded="false" aria-controls="directory" title="切换 Markdown 画布">
|
|
32
|
+
<svg aria-hidden="true" viewBox="0 0 24 24"><path d="M4 7a2 2 0 0 1 2-2h4l2 2h6a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2Z"/></svg>
|
|
33
|
+
文档 <span id="fileCount">…</span><span id="currentFileName" hidden></span>
|
|
34
|
+
</button>
|
|
35
|
+
<aside id="directory" class="clado-ui-glass clado-ui-glass-panel" aria-label="Markdown 画布目录" hidden>
|
|
36
|
+
<div class="directory-scroll">
|
|
37
|
+
<div class="directory-heading"><strong>Markdown/</strong></div>
|
|
38
|
+
<label class="directory-search"><input id="documentSearch" type="search" aria-label="搜索文档" placeholder="搜索名称或路径…"></label>
|
|
39
|
+
<nav id="documentList" aria-label="可用 Markdown"></nav>
|
|
40
|
+
<div class="directory-current"><span id="syncStatus" role="status">连接本地目录</span></div>
|
|
41
|
+
<div class="directory-actions"><button class="clado-ui-button" id="backButton" disabled>← 返回</button><button class="clado-ui-button" id="refreshButton" title="重新扫描目录并刷新当前文档">刷新</button><button class="clado-ui-button" id="sourceButton">源文</button></div>
|
|
42
|
+
<button id="skippedButton" class="clado-ui-button skipped" hidden></button>
|
|
43
|
+
</div>
|
|
44
|
+
</aside>
|
|
45
|
+
<dialog id="details" class="clado-ui-dialog"><header><strong id="detailsTitle"></strong><button id="closeDetails" class="clado-ui-button" aria-label="关闭详情">×</button></header><div id="detailsBody"></div></dialog>`;
|
|
46
|
+
host.mount('bottom-left', content, 'clado.directory');
|
|
47
|
+
host.capabilities('clado.directory', 'directory')?.provide(
|
|
48
|
+
({ input }) => actions.openFromCapability(input.file)).catch(error => console.warn('Clado 目录能力注册失败', error));
|
|
49
|
+
const $ = selector => content.querySelector(selector);
|
|
50
|
+
const trigger = $('#directoryButton'), directory = $('#directory'), search = $('#documentSearch'), dialog = $('#details');
|
|
51
|
+
const fileName = $('#currentFileName');
|
|
52
|
+
const folders = new Set();
|
|
53
|
+
let index = { documents: [], skipped: [] }, selected = '', canGoBack = false, signature = '', request = 0;
|
|
54
|
+
function setOpen(open) {
|
|
55
|
+
if (open && actions.isLocked()) return;
|
|
56
|
+
directory.hidden = !open;
|
|
57
|
+
trigger.setAttribute('aria-expanded', String(open));
|
|
58
|
+
if (open) search.focus();
|
|
59
|
+
}
|
|
60
|
+
function details(title, elements) {
|
|
61
|
+
if (actions.isLocked() || !content.isConnected) return;
|
|
62
|
+
$('#detailsTitle').textContent = title;
|
|
63
|
+
$('#detailsBody').replaceChildren(...elements);
|
|
64
|
+
if (!dialog.open) dialog.showModal();
|
|
65
|
+
}
|
|
66
|
+
function text(tag, value) {
|
|
67
|
+
const item = document.createElement(tag);
|
|
68
|
+
item.textContent = value;
|
|
69
|
+
return item;
|
|
70
|
+
}
|
|
71
|
+
function showMessage(title, message) { details(title, [text('p', message)]); }
|
|
72
|
+
function render() {
|
|
73
|
+
const query = search.value;
|
|
74
|
+
const next = JSON.stringify([index.documents.map(doc => [doc.file, doc.title]), index.skipped.length, selected, query, canGoBack, index.root]);
|
|
75
|
+
if (next === signature) return;
|
|
76
|
+
signature = next;
|
|
77
|
+
$('#fileCount').textContent = index.documents.length;
|
|
78
|
+
$('.directory-heading strong').textContent = index.root || 'Markdown';
|
|
79
|
+
renderTree($('#documentList'), index.documents, {
|
|
80
|
+
selected, query, folders, onOpen: file => { setOpen(false); actions.open(file); },
|
|
81
|
+
});
|
|
82
|
+
$('#skippedButton').hidden = !index.skipped.length;
|
|
83
|
+
$('#skippedButton').textContent = index.skipped.length + ' 份文档未收录 · 查看原因';
|
|
84
|
+
$('#backButton').disabled = actions.isLocked() || !canGoBack;
|
|
85
|
+
$('#sourceButton').disabled = actions.isLocked() || !selected;
|
|
86
|
+
}
|
|
87
|
+
trigger.onclick = () => setOpen(directory.hidden);
|
|
88
|
+
search.oninput = render;
|
|
89
|
+
document.addEventListener('pointerdown', event => {
|
|
90
|
+
if (!content.contains(event.target)) setOpen(false);
|
|
91
|
+
});
|
|
92
|
+
document.addEventListener('keydown', event => {
|
|
93
|
+
if (event.key === 'Escape' && !directory.hidden && !dialog.open) { setOpen(false); trigger.focus(); }
|
|
94
|
+
});
|
|
95
|
+
$('#refreshButton').onclick = actions.refresh;
|
|
96
|
+
$('#backButton').onclick = actions.back;
|
|
97
|
+
$('#closeDetails').onclick = () => dialog.close();
|
|
98
|
+
$('#skippedButton').onclick = () => details('扫描后未收录的 Markdown', index.skipped.map(item => {
|
|
99
|
+
const section = document.createElement('section');
|
|
100
|
+
section.className = 'skip-item';
|
|
101
|
+
section.append(text('strong', item.file), ...item.diagnostics.map(d => text('p', d.code + ' · ' + d.message)));
|
|
102
|
+
return section;
|
|
103
|
+
}));
|
|
104
|
+
$('#sourceButton').onclick = async () => {
|
|
105
|
+
if (actions.isLocked()) return;
|
|
106
|
+
const current = ++request;
|
|
107
|
+
try {
|
|
108
|
+
const result = await actions.readSource();
|
|
109
|
+
if (current !== request || selected !== result.file) return;
|
|
110
|
+
const note = result.offline ? '这是 HTML 内嵌的只读源文。通过 MCP 修改工作区后重新构建以更新交付文件。' : '源文只读预览。通过 Clado MCP 修改内容,当前画布会自动同步。';
|
|
111
|
+
details(result.file, [text('p', note), text('pre', result.source)]);
|
|
112
|
+
} catch {
|
|
113
|
+
if (current === request) showMessage('暂时读不到源文', '请检查文档是否已删除,或是否出现解析错误。');
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
return {
|
|
117
|
+
close: () => setOpen(false),
|
|
118
|
+
showMessage,
|
|
119
|
+
update(next, file, hasHistory) {
|
|
120
|
+
if (file !== selected) {
|
|
121
|
+
request++;
|
|
122
|
+
fileName.textContent = file.split('/').pop();
|
|
123
|
+
fileName.title = file;
|
|
124
|
+
fileName.hidden = !file || actions.showFilename === false;
|
|
125
|
+
}
|
|
126
|
+
index = next; selected = file; canGoBack = hasHistory;
|
|
127
|
+
render();
|
|
128
|
+
},
|
|
129
|
+
status(message, error = false) {
|
|
130
|
+
const indicator = $('#syncStatus');
|
|
131
|
+
if (indicator.textContent !== message) indicator.textContent = message;
|
|
132
|
+
indicator.className = error ? 'sync-error' : 'sync-good';
|
|
133
|
+
trigger.dataset.sync = error ? 'error' : 'ok';
|
|
134
|
+
trigger.title = '切换 Markdown 画布 · ' + message;
|
|
135
|
+
},
|
|
136
|
+
setLocked(locked) {
|
|
137
|
+
if (locked) { setOpen(false); if (dialog.open) dialog.close(); request++; }
|
|
138
|
+
trigger.disabled = locked;
|
|
139
|
+
$('#refreshButton').disabled = locked;
|
|
140
|
+
$('#backButton').disabled = locked || !canGoBack;
|
|
141
|
+
$('#sourceButton').disabled = locked || !selected;
|
|
142
|
+
$('#skippedButton').disabled = locked;
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
})();
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
.clado-directory-plugin { position: relative; }
|
|
2
|
+
.directory-toggle { display: inline-flex; align-items: center; gap: 8px; height: 42px; max-width: min(400px, calc(100vw - 32px)); padding: 7px 13px; border-radius: 15px; color: var(--clado-ui-text); font-size: 13px; }
|
|
3
|
+
.directory-toggle svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; width: 16px; height: 16px; flex: none; }
|
|
4
|
+
#fileCount { flex: none; font-size: 11px; color: var(--clado-ui-muted); }
|
|
5
|
+
#currentFileName { min-width: 0; padding-inline-start: 8px; border-inline-start: 1px solid var(--clado-ui-edge); color: var(--clado-ui-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
|
|
6
|
+
.directory-toggle[data-sync="error"] #fileCount { color: #a45900; }
|
|
7
|
+
[data-theme="dark"] .directory-toggle[data-sync="error"] #fileCount { color: #f1ba73; }
|
|
8
|
+
#directory { position: absolute; left: 0; bottom: calc(100% + 8px); width: min(308px, calc(100vw - 32px)); }
|
|
9
|
+
.directory-scroll { max-height: calc(100dvh - 94px); overflow: auto; border-radius: inherit; padding: 14px 10px 10px; }
|
|
10
|
+
.directory-heading{padding:0 9px 13px}.directory-heading strong{font-size:12px;font-weight:600}.directory-heading span{display:block;font-size:10px;color:var(--muted);margin-top:5px}#documentList{display:flex;flex-direction:column;gap:4px}.document-button{display:block;text-align:left;padding:9px 10px;white-space:normal;width:100%}.document-button strong{font-size:11px;font-weight:500;display:block;color:var(--ink)}.document-button small{font-size:9px;color:var(--muted);display:block;margin-top:4px;overflow-wrap:anywhere}.directory-current{padding:12px 10px 8px;margin-top:10px;border-top:1px solid var(--line)}.directory-current strong{font-size:10px;font-weight:500;display:block;color:var(--muted)}.directory-current span{display:block;color:var(--muted);font-size:9px;margin-top:4px;overflow-wrap:anywhere}.directory-actions{display:flex;gap:7px;padding:0 10px}.directory-actions button{min-height:28px;font-size:10px;padding:4px 7px}.directory-actions #sourceButton{margin-left:auto}.skipped{margin-top:10px;border:0;border-top:1px solid var(--line);border-radius:0;width:100%;text-align:left;padding:11px 10px 2px;font-size:9px;color:var(--muted);white-space:normal}
|
|
11
|
+
.document-button[aria-current="page"] strong {
|
|
12
|
+
color: var(--clado-ui-accent);
|
|
13
|
+
font-weight: 600;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.sync-error{color:#b88628!important}.sync-good:before{content:'';display:inline-block;width:4px;height:4px;border-radius:50%;background:#69a57f;vertical-align:middle;margin-right:5px}
|
|
17
|
+
.clado-directory-plugin dialog {
|
|
18
|
+
position: fixed;
|
|
19
|
+
width: min(660px, calc(100vw - 32px));
|
|
20
|
+
max-height: calc(100vh - 36px);
|
|
21
|
+
border: 1px solid var(--line);
|
|
22
|
+
border-radius: var(--clado-ui-radius);
|
|
23
|
+
padding: 0;
|
|
24
|
+
}
|
|
25
|
+
.clado-directory-plugin dialog > header {
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
gap: 12px;
|
|
29
|
+
padding: 15px 20px;
|
|
30
|
+
border-bottom: 1px solid var(--line);
|
|
31
|
+
}
|
|
32
|
+
.clado-directory-plugin dialog > header strong { font-size: 13px; font-weight: 600; }
|
|
33
|
+
.clado-directory-plugin dialog > header button {
|
|
34
|
+
margin-left: auto;
|
|
35
|
+
font-size: 19px;
|
|
36
|
+
line-height: 1;
|
|
37
|
+
border: 0;
|
|
38
|
+
}
|
|
39
|
+
#detailsBody { padding: 18px 20px; max-height: calc(100vh - 130px); overflow: auto; }
|
|
40
|
+
#detailsBody p { font-size: 11px; color: var(--muted); line-height: 1.8; margin: 0 0 14px; }
|
|
41
|
+
#detailsBody pre {
|
|
42
|
+
font: 11px/1.9 ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
43
|
+
white-space: pre-wrap;
|
|
44
|
+
overflow-wrap: anywhere;
|
|
45
|
+
margin: 0;
|
|
46
|
+
}
|
|
47
|
+
.skip-item{padding:10px 0;border-bottom:1px solid var(--line)}.skip-item strong{font-size:12px}.skip-item p{margin:5px 0!important}.skip-item code{font-size:10px}
|
|
48
|
+
.directory-search{display:block;padding:0 9px 10px}.directory-search input{box-sizing:border-box;width:100%;border:1px solid var(--line);border-radius:7px;background:var(--clado-ui-well);color:var(--ink);font:inherit;padding:8px 10px;outline-color:var(--accent)}.tree-folder>summary{cursor:pointer;padding:8px;color:var(--ink);font-size:12px;font-weight:550}.tree-children{margin-left:11px;padding-left:5px;border-left:1px solid var(--line)}.tree-empty{padding:8px;color:var(--muted);font-size:12px}
|