feat(preview): inline .pptx rendering via PptxViewJS (#297) #319
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/pptx-preview"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Third and final slice of #297. Renders
.pptxinline (canvas, slide-by-slide with prev/next nav) instead of the download card.Approach
vendor-pptxviewjs.min.js(PptxViewJS 1.1.9, MIT, 621 KB) +vendor-chart.umd.min.js(Chart.js 4.4.1, MIT, 205 KB), flat inweb/static/, served from Cairn's own origin behind auth. Reuses the already-vendored JSZip. Lazy-loaded on first.pptxpreview.Chart.register(...registerables)to replicatechart.js/auto, so chart slides render) → PptxViewJS. PptxViewJS's UMD reads globalsJSZipandChart.new PptxViewJS.PPTXViewer({ canvas })→loadFile(blob)→render(); a small footer bar gives‹ / ›navigation and ani / Ncounter viaprevSlide/nextSlide/getCurrentSlideIndex/getSlideCount. 40 MB guard;pvPathstaleness guard after each await; every viewer call is defensively wrapped, so any failure (including a slide the renderer can't handle) falls back to thepvNoPreviewcard.pptx(OOXML)..ppt(legacy binary) still falls through to the card.Verification
node --checkon all page script blocks (passed in the build workflow). pptx fidelity varies by deck and is the operator's visual check on the dogfood after deploy; the defensive wrapping guarantees a graceful card fallback rather than a broken panel on anything PptxViewJS can't render.Closes the three preview slices of #297 (docx #317, xlsx #318, pptx here). Recommend a follow-up pass on #297 to spot-check real-world fidelity and decide whether
.doc/.ppt/.odtlegacy formats are worth additional converters.