vibespot 1.0.7 → 1.0.9
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 +130 -125
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/ui/chat.js +15 -6
- package/ui/index.html +5 -1
- package/ui/styles.css +1 -0
package/package.json
CHANGED
package/ui/chat.js
CHANGED
|
@@ -542,17 +542,26 @@ const DOC_TYPES = new Set([
|
|
|
542
542
|
"text/markdown", "text/plain",
|
|
543
543
|
]);
|
|
544
544
|
const SUPPORTED_TYPES = new Set([...IMAGE_TYPES, ...DOC_TYPES]);
|
|
545
|
+
// Browsers often report .md files as application/octet-stream or empty string
|
|
546
|
+
const EXT_MIME_MAP = { ".md": "text/markdown", ".txt": "text/plain", ".markdown": "text/markdown" };
|
|
545
547
|
|
|
546
548
|
function addPendingFile(file) {
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
549
|
+
let f = file;
|
|
550
|
+
if (!SUPPORTED_TYPES.has(f.type)) {
|
|
551
|
+
const ext = f.name.slice(f.name.lastIndexOf(".")).toLowerCase();
|
|
552
|
+
const mapped = EXT_MIME_MAP[ext];
|
|
553
|
+
if (mapped) {
|
|
554
|
+
f = new File([f], f.name, { type: mapped });
|
|
555
|
+
} else {
|
|
556
|
+
showToast(`Unsupported file type: ${f.name}`);
|
|
557
|
+
return;
|
|
558
|
+
}
|
|
550
559
|
}
|
|
551
|
-
if (
|
|
552
|
-
showToast(`File too large (>10MB): ${
|
|
560
|
+
if (f.size > MAX_FILE_SIZE) {
|
|
561
|
+
showToast(`File too large (>10MB): ${f.name}`);
|
|
553
562
|
return;
|
|
554
563
|
}
|
|
555
|
-
pendingFiles.push(
|
|
564
|
+
pendingFiles.push(f);
|
|
556
565
|
renderFileChips();
|
|
557
566
|
}
|
|
558
567
|
|
package/ui/index.html
CHANGED
|
@@ -24,6 +24,10 @@
|
|
|
24
24
|
<div class="project-rail__items" id="project-rail-items"></div>
|
|
25
25
|
<button class="project-rail__add" id="project-rail-add" title="New project">+</button>
|
|
26
26
|
<div class="project-rail__footer">
|
|
27
|
+
<a class="project-rail__settings-btn" href="https://buymeacoffee.com/vibespot" target="_blank" title="Buy me a coffee">
|
|
28
|
+
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="M17 8h1a4 4 0 0 1 0 8h-1"/><path d="M3 8h14v9a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V8z"/><line x1="6" y1="2" x2="6" y2="4"/><line x1="10" y1="2" x2="10" y2="4"/><line x1="14" y1="2" x2="14" y2="4"/></svg>
|
|
29
|
+
<span class="project-rail__settings-label">Coffee</span>
|
|
30
|
+
</a>
|
|
27
31
|
<a class="project-rail__settings-btn" href="/docs/" target="_blank" title="Documentation">
|
|
28
32
|
<svg width="14" height="14" viewBox="0 0 18 18" fill="none"><path d="M3 2.5h4.5a2 2 0 0 1 2 2V16a1.5 1.5 0 0 0-1.5-1.5H3V2.5Z" stroke="currentColor" stroke-width="1.3" stroke-linejoin="round"/><path d="M15 2.5h-4.5a2 2 0 0 0-2 2V16a1.5 1.5 0 0 1 1.5-1.5H15V2.5Z" stroke="currentColor" stroke-width="1.3" stroke-linejoin="round"/></svg>
|
|
29
33
|
<span class="project-rail__settings-label">Docs</span>
|
|
@@ -426,7 +430,7 @@
|
|
|
426
430
|
<button class="chat__input-icon" id="btn-attach-file" title="Attach files (images, PDFs, docs)">
|
|
427
431
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"/></svg>
|
|
428
432
|
</button>
|
|
429
|
-
<input type="file" id="file-input" multiple accept="image/png,image/jpeg,image/svg+xml,image/webp,image/gif,application/pdf,application/vnd.openxmlformats-officedocument.wordprocessingml.document,text/markdown,text/plain" style="display:none">
|
|
433
|
+
<input type="file" id="file-input" multiple accept="image/png,image/jpeg,image/svg+xml,image/webp,image/gif,application/pdf,application/vnd.openxmlformats-officedocument.wordprocessingml.document,text/markdown,text/plain,.md,.markdown,.txt" style="display:none">
|
|
430
434
|
<button class="chat__input-icon" id="btn-starter-templates" title="Templates">
|
|
431
435
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="3" y="3" width="18" height="18" rx="2"/><path d="M3 9h18"/><path d="M9 21V9"/></svg>
|
|
432
436
|
</button>
|