Add browse dashboard, tags, visibility control, export, QR sharing, and embed mode

- Browse dashboard at / with search, framework filter, tag pills, and pagination
- Tags system with autocomplete datalist and per-fiddle tag management
- Listed/unlisted toggle for visibility control (unlisted still accessible via direct URL)
- Export standalone HTML with inlined CSS/JS and framework CDN tags
- QR code modal for sharing fiddle URLs
- Embed mode at /embed/:id for minimal preview-only rendering
- Extract shared loadScript() utility from 4 files into utils.js
- Database schema: listed column, tags and fiddle_tags tables with index
This commit is contained in:
root
2026-02-26 14:19:52 -06:00
parent 7f51af17a3
commit e41c3e7dc4
18 changed files with 921 additions and 78 deletions

View File

@@ -24,6 +24,18 @@ export function updateFiddle(id, data) {
return request(`${BASE}/${id}`, { method: 'PUT', body: JSON.stringify(data) });
}
export function listFiddles() {
return request(BASE);
export function listFiddles({ q, js_type, tag, page, limit, sort } = {}) {
const params = new URLSearchParams();
if (q) params.set('q', q);
if (js_type) params.set('js_type', js_type);
if (tag) params.set('tag', tag);
if (page) params.set('page', String(page));
if (limit) params.set('limit', String(limit));
if (sort) params.set('sort', sort);
const qs = params.toString();
return request(`${BASE}${qs ? '?' + qs : ''}`);
}
export function listTags() {
return request('/api/tags');
}