Update Version: 1.4.5

This commit is contained in:
2026-05-21 21:17:10 -04:00
parent c42ae39bb8
commit 18738c399d
13 changed files with 7 additions and 47 deletions
+3 -2
View File
@@ -1,6 +1,6 @@
# TypstDrive
[![Version](https://img.shields.io/badge/version-1.4.0-blue.svg)](https://github.com/your-username/typstdrive)
[![Version](https://img.shields.io/badge/version-1.4.5-blue.svg)](https://github.com/your-username/typstdrive)
[![Typst Version](https://img.shields.io/badge/Typst-0.14.2-239dad?logo=typst&logoColor=white)](https://typst.app/)
[![Rust](https://img.shields.io/badge/Rust-1.82+-orange?logo=rust&logoColor=white)](https://www.rust-lang.org/)
[![SvelteKit](https://img.shields.io/badge/SvelteKit-5-ff3e00?logo=svelte)](https://kit.svelte.dev/)
@@ -18,7 +18,8 @@ TypstDrive is a collaborative web editor for Typst. With built-in dark mode, mul
- **Instant Preview**: Compile Typst to SVG on the fly with sub-second latency, featuring interactive document zoom controls and a collapsible preview pane.
- **Customizable Themes**: Choose from multiple editor themes (Catppuccin, Arch Linux, Cerberus) and toggle global dark mode.
- **Export Options**: Export your compiled documents directly to PDF, PNG, SVG, HTML, Markdown, Word, or LaTeX formats using internal conversion and Pandoc integrations.
- **User Authentication & Document Access**: Secure accounts, workspaces, and sharing features via email-based collaborator invitations (Editor or Viewer roles) for all your documents.
- **Document Sharing**: Invite collaborators by email with Editor or Viewer roles. Collaborators' uploaded fonts and images are available to the compiler. A dedicated "Shared with me" folder on the dashboard surfaces all documents others have shared with you. Manage and remove collaborators directly from the Share modal in the editor.
- **Public REST API**: Programmatically render Typst documents to PNG or PDF via `POST /v1/render`. Manage API keys from the Settings panel, with a live usage chart supporting 1-hour, 1-day, and 1-week views. Full API reference available at `/api-docs`.
- **Admin System**: First-run setup wizard creates an admin account. Admins can manage all users, create new accounts with temporary passwords, toggle admin privileges, and delete accounts from the Settings panel.
- **Presentation Mode**: Turn your documents into instant slideshows with built-in slide controls and a live drawing/annotation tool overlay.
- **Asset Management**: Upload and seamlessly use custom fonts and images directly within your documents.
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "typstdrive",
"private": true,
"version": "1.4.0",
"version": "1.4.5",
"type": "module",
"scripts": {
"dev": "vite dev --host",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "server"
version = "1.4.0"
version = "1.4.5"
edition = "2021"
[dependencies]
@@ -96,7 +96,6 @@
</script>
<div class="fixed right-0 top-0 bottom-0 w-80 bg-[var(--theme-bg)] backdrop-blur-xl border-l shadow-2xl flex flex-col z-[70] transform transition-transform duration-300 border-[var(--theme-border)]">
<!-- Header -->
<div class="flex items-center justify-between px-4 py-3 border-b bg-[var(--theme-bg)] text-[var(--theme-text)] border-[var(--theme-border)]">
<div class="flex items-center gap-2">
<Icon icon="mdi:comment-text-multiple-outline" class="text-lg" />
@@ -108,7 +107,6 @@
</button>
</div>
<!-- Feed -->
<div class="flex-1 overflow-y-auto p-4 space-y-4">
{#if loading}
<div class="flex justify-center items-center h-full">
@@ -137,7 +135,6 @@
</div>
</div>
<!-- Actions -->
<div class="flex opacity-0 group-hover:opacity-100 transition-opacity gap-1">
{#if $userStore?.id === comment.user_id}
<button onclick={() => deleteComment(comment.id)} class="p-1 hover:text-red-500 rounded hover:bg-red-50 dark:hover:bg-red-500/10 transition-colors" title="Delete">
@@ -155,7 +152,6 @@
{/if}
</div>
<!-- Input Area -->
<div class="p-4 border-t bg-[var(--theme-bg)] text-[var(--theme-text)] border-[var(--theme-border)]">
<div class="relative">
<textarea
+2 -9
View File
@@ -248,9 +248,6 @@
const msg = JSON.parse(data);
if (msg.type === 'init') {
lspInitialized = true;
// Recreate the client because the backend started a completely new LSP process
// which requires a fresh 'initialize' handshake.
client = new LSPClient({
rootUri: msg.rootUri,
timeout: 10000,
@@ -262,9 +259,7 @@
});
return;
}
} catch (err) {
// Fallthrough
}
} catch (err) {}
}
let processedData = data;
@@ -281,9 +276,7 @@
for (let h of lsHandlers) h(processedData);
};
lsSocket.onopen = () => {
// Waiting for init message from server
};
lsSocket.onopen = () => {};
}
connectLsp();
@@ -14,7 +14,6 @@
let isDrawing = false;
let currentPath = $state<{x: number, y: number}[]>([]);
// New feature states
let tool = $state<'pen' | 'highlighter' | 'eraser' | 'laser'>('laser');
let selectedColor = $state('#ef4444');
let showGrid = $state(false);
@@ -23,7 +22,6 @@
const colors = ['#ef4444', '#f97316', '#eab308', '#22c55e', '#3b82f6', '#a855f7', '#ffffff', '#000000'];
// Map from slide index to image data url so we can persist drawings when switching slides
let drawings = $state<Record<number, string>>({});
let undoStack = $state<Record<number, string[]>>({});
let redoStack = $state<Record<number, string[]>>({});
@@ -41,7 +39,6 @@
}
onMount(() => {
// Find the preview svgs from the main DOM
const previewContainers = document.querySelectorAll('.preview-container svg');
const svgStrings: string[] = [];
previewContainers.forEach(container => {
@@ -49,7 +46,6 @@
});
svgs = svgStrings;
// Request fullscreen
const el = document.getElementById('presentation-container');
if (el && el.requestFullscreen) {
el.requestFullscreen().catch(err => console.error(err));
@@ -104,7 +100,6 @@
$effect(() => {
if (canvas && currentSlide !== undefined && !showGrid) {
// Resize canvas to match the svg
const svgEl = document.getElementById('presentation-svg')?.querySelector('svg');
if (svgEl) {
const rect = svgEl.getBoundingClientRect();
@@ -126,7 +121,6 @@
ctx.lineCap = 'round';
ctx.lineJoin = 'round';
// Load previous drawing if any
if (drawings[currentSlide]) {
const img = new Image();
img.onload = () => {
@@ -302,7 +296,6 @@
<div id="presentation-container" class="fixed inset-0 z-[100] flex flex-col items-center justify-center">
<!-- Laser Pointer Overlay -->
{#if tool === 'laser' && laserPos.visible && !showGrid}
<div
class="pointer-events-none fixed z-[150] w-3 h-3 bg-red-500 rounded-full shadow-[0_0_15px_5px_rgba(239,68,68,0.8)] -translate-x-1/2 -translate-y-1/2"
@@ -310,7 +303,6 @@
></div>
{/if}
<!-- Thumbnail Grid UI -->
{#if showGrid}
<div class="absolute inset-0 z-[50] p-8 overflow-y-auto">
<div class="grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-6 max-w-7xl mx-auto pb-24">
@@ -331,7 +323,6 @@
</div>
{/if}
<!-- Top toolbar -->
<div class="absolute top-0 inset-x-0 h-16 bg-gradient-to-b from-black/80 to-transparent flex items-center justify-between px-6 transition-opacity duration-300 z-[110] {uiVisible || showGrid ? 'opacity-100' : 'opacity-0'}">
<div class="flex items-center gap-4 bg-zinc-900/80 backdrop-blur-md px-4 py-2 rounded-xl border shadow-2xl border-[var(--theme-border)]">
<button class="p-2 rounded-lg transition-colors {tool === 'laser' ? 'bg-red-500/20 text-red-400' : 'text-gray-300 hover:bg-white/10'}" onclick={() => tool = 'laser'} title="Laser Pointer">
@@ -383,19 +374,16 @@
</div>
</div>
<!-- Slide Area -->
<div class="relative w-full h-full flex items-center justify-center p-8">
{#if svgs.length > 0 && !showGrid}
<div id="presentation-svg" class="relative max-h-full max-w-full shadow-2xl flex items-center justify-center bg-[var(--theme-bg)] text-[var(--theme-text)]">
{@html svgs[currentSlide]}
<!-- Drawing Canvas Overlay -->
<canvas
bind:this={canvas}
class="absolute inset-0 z-10 touch-none pointer-events-none"
></canvas>
<!-- Active Stroke Canvas Overlay -->
<canvas
bind:this={activeCanvas}
class="absolute inset-0 z-20 touch-none {tool === 'laser' ? 'cursor-none' : 'cursor-crosshair'}"
@@ -413,7 +401,6 @@
{/if}
</div>
<!-- Bottom Navigation -->
{#if svgs.length > 0}
<div class="absolute bottom-6 flex items-center gap-4 bg-zinc-900/80 backdrop-blur-md px-6 py-3 rounded-full border shadow-2xl transition-opacity duration-300 z-[110] {uiVisible || showGrid ? 'opacity-100' : 'opacity-0'} border-[var(--theme-border)]">
{#if svgs.length > 1}
-1
View File
@@ -414,7 +414,6 @@
{title}
</h1>
<!-- Sync status removed from here and moved to Footer -->
</div>
@@ -55,7 +55,6 @@
</script>
<div class="fixed right-0 top-0 bottom-0 w-80 bg-[var(--theme-bg)] backdrop-blur-xl border-l shadow-2xl flex flex-col z-[70] transform transition-transform duration-300 border-[var(--theme-border)]">
<!-- Header -->
<div class="flex items-center justify-between px-4 py-3 border-b bg-gray-50/50 bg-[var(--theme-bg)] text-[var(--theme-text)] border-[var(--theme-border)]">
<div class="flex items-center gap-2">
<Icon icon="mdi:history" class="text-lg" />
@@ -67,7 +66,6 @@
</button>
</div>
<!-- Feed -->
<div class="flex-1 overflow-y-auto p-4 space-y-4">
{#if loading}
<div class="flex justify-center items-center h-full">
@@ -21,7 +21,6 @@
} else {
const button = e.currentTarget as HTMLElement;
const rect = button.getBoundingClientRect();
// If there's less than 200px below the button, open upwards
if (window.innerHeight - rect.bottom < 200) {
dropUp = true;
} else {
-4
View File
@@ -358,7 +358,6 @@
try {
data = JSON.parse(dataString);
} catch (err) {
// For backward compatibility if it's just an id
data = { type: 'document', id: dataString };
}
@@ -512,13 +511,11 @@
</div>
</div>
{:else}
<!-- Folders section — always visible at root (includes "Shared with me" virtual folder) -->
{#if currentFolderId === null || folders.length > 0}
<div class="mb-8">
<div class="px-2 py-3 text-sm font-semibold text-gray-700 dark:text-gray-300">Folders</div>
<div class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4">
{#if currentFolderId === null}
<!-- Shared with me — permanent, undeletable virtual folder -->
<div
class="flex flex-row items-center p-3 bg-white/50 dark:bg-black/20 border border-gray-200 dark:border-white/10 rounded-xl shadow-sm hover:shadow-md cursor-pointer group transition-all duration-200 hover:-translate-y-0.5 hover:border-purple-300 dark:hover:border-purple-500/30"
role="button"
@@ -565,7 +562,6 @@
</div>
{/if}
<!-- Empty states -->
{#if documents.length === 0 && files.length === 0 && currentFolderId !== null && folders.length === 0}
<div class="min-h-[30vh] flex items-center justify-center">
<p class="text-gray-500 dark:text-gray-400">This folder is empty.</p>
-2
View File
@@ -24,7 +24,6 @@
const view = $editorViewStore;
if (!view) return;
// Ensure context menu only triggers on editor
const target = e.target as HTMLElement;
if (!target.closest('.cm-editor') && !target.closest('.cm-content')) return;
@@ -148,7 +147,6 @@
<DocFooter />
</div>
<!-- Custom Context Menu for Editor -->
{#if contextMenu.show}
<div
class="fixed z-[9999] bg-[var(--theme-bg)] text-[var(--theme-text)] rounded-lg shadow-xl border border-[var(--theme-border)] py-1 min-w-[200px] overflow-hidden"
-2
View File
@@ -36,7 +36,6 @@
return;
}
// Auto login after successful registration using email
const loginRes = await fetch('/api/auth/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
@@ -65,7 +64,6 @@
<div class="min-h-screen flex flex-col relative overflow-hidden">
<div class="flex-grow flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8 relative z-10">
<!-- Background decorative elements -->
<div class="absolute -top-40 right-20 w-96 h-96 bg-emerald-400/20 dark:bg-emerald-600/10 rounded-full blur-3xl mix-blend-multiply z-0"></div>
<div class="absolute top-40 -left-20 w-96 h-96 bg-teal-400/20 dark:bg-teal-600/10 rounded-full blur-3xl mix-blend-multiply z-0"></div>
<div class="absolute -bottom-40 right-40 w-96 h-96 bg-blue-400/20 dark:bg-blue-600/10 rounded-full blur-3xl mix-blend-multiply z-0"></div>
-5
View File
@@ -62,7 +62,6 @@
let confirmRegenerateId = $state<string | null>(null);
let regeneratingKeyId = $state<string | null>(null);
// Usage chart
type UsagePoint = { date: string; count: number };
type UsagePeriod = '1hr' | '1day' | '1week';
let usageData = $state<UsagePoint[]>([]);
@@ -200,7 +199,6 @@
const labels: string[] = [];
const counts: number[] = [];
if (period === '1hr') {
// Floor to current UTC minute, then step back 59 more
const now = new Date();
const baseMs = now.getTime() - (now.getUTCSeconds() * 1000 + now.getUTCMilliseconds());
for (let i = 59; i >= 0; i--) {
@@ -211,7 +209,6 @@
counts.push(pt ? pt.count : 0);
}
} else if (period === '1day') {
// Floor to current UTC hour, then step back 23 more
const now = new Date();
const baseMs = now.getTime() - (now.getUTCMinutes() * 60000 + now.getUTCSeconds() * 1000 + now.getUTCMilliseconds());
for (let i = 23; i >= 0; i--) {
@@ -626,7 +623,6 @@
<a href="/api-docs" class="text-blue-600 dark:text-blue-400 hover:underline ml-1">View API docs →</a>
</p>
<!-- Usage chart -->
<div class="mb-6 p-4 rounded-xl border border-gray-200 dark:border-white/10 bg-gray-50 dark:bg-black/30">
<div class="flex items-center justify-between mb-3">
<p class="text-xs font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400">
@@ -814,7 +810,6 @@
</div>
{/if}
<!-- Admin Section -->
{#if activeSection === 'admin' && $userStore?.is_admin}
<div class="bg-white dark:bg-black/20 rounded-xl shadow-sm border border-gray-200 dark:border-white/10 overflow-hidden">
<div class="p-6 sm:p-8">