Skip to content

Commit 5d0ddff

Browse files
committed
fix: excalidraw export — Insert/PNG/SVG now working with native APIs and compact gen-img insert
1 parent 5fa2aaf commit 5d0ddff

5 files changed

Lines changed: 992 additions & 45 deletions

File tree

CHANGELOG-view-lock-sharing.md

Lines changed: 0 additions & 45 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ TextAgent has undergone significant evolution since its inception. What started
459459

460460
| Date | Commits | Feature / Update |
461461
|------|---------|-----------------:|
462+
| **2026-03-17** | | 🎨 **Excalidraw Export Fix** — fixed broken Insert/PNG/SVG export buttons (`excalidrawAPI` was `null` due to Excalidraw 0.17+ using `excalidrawAPI` prop instead of `ref`); replaced canvas-scraping with native `exportToBlob`/`exportToSvg` APIs; Insert now replaces `{{Draw:}}` tag with image and closes whiteboard; inserted images use compact `gen-img:` registry (no raw base64 in editor) |
462463
| **2026-03-17** | | 🔒 **View-Locked Sharing & Shared Versions** — sharers can lock recipients to PPT or Preview mode via new pill selector in share modal; view lock stored server-side in Firestore (tamper-proof — stripping `&view=ppt` from URL doesn't bypass); `setViewMode()` guard blocks mode switching; non-matching view buttons visually disabled; "Previously Shared" section in share modal shows past shares per document with timestamps, view-mode badges (PPT/Preview), secure badge, and Copy/Delete buttons; shared versions tracked in localStorage keyed by parent cloud doc ID |
463464
| **2026-03-17** | | 🎨 **Three-Level Header & Read-Only Pill** — new three-level header visibility toggle (Full → Compact QAB → fully Hidden with floating "TextAgent" restore pill at top-center, 35% opacity, hover to reveal); header level persists via `localStorage`; "Read-only" shared-view pill repositioned from top-right to bottom-right corner with upward slide-in animation |
464465
| **2026-03-17** | | 🎨 **Shared Banner Auto-Dismiss UX** — green "Viewing shared markdown (read-only)" banner now auto-hides after 4s with smooth slide-up animation; collapses to a floating green "🔒 Read-only" pill in the top-right corner; clicking the editor or pill re-expands the full banner with Edit Copy/Close buttons (auto-hides again after 5s); dynamic `SHARE_BASE_URL` uses `localhost` in dev and `textagent.github.io` in production |
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Changelog — Excalidraw Export Fix
2+
3+
## Excalidraw Insert / PNG / SVG Export
4+
5+
- Fixed broken Excalidraw diagram export (Insert, PNG, SVG buttons were silently failing)
6+
- **Root cause**: Excalidraw 0.17+ uses `excalidrawAPI` prop callback instead of `ref` — the old `ref` never fired, leaving the API as `null`
7+
- Replaced fragile canvas-scraping export with Excalidraw's native `exportToBlob` (PNG) and `exportToSvg` (SVG) APIs
8+
- Insert now **replaces** the `{{Draw:}}` tag with image markdown and **closes** the whiteboard (instead of appending at cursor)
9+
- Inserted images use compact `gen-img:` registry pattern (same as `{{Image:}}` tag) — no raw base64 blob in the editor
10+
- Added error logging when export requests arrive before API is ready
11+
12+
### Files Modified
13+
- `public/excalidraw-embed.html``excalidrawAPI` prop, native export APIs, error logging
14+
- `js/draw-docgen.js` — Insert replaces Draw tag, gen-img registry, iframe cleanup, delayed SVG blob revocation

0 commit comments

Comments
 (0)