Skip to content

v0.9.0

Choose a tag to compare

@github-actions github-actions released this 15 Aug 01:29
· 5 commits to main since this release

DOCX & PPTX Document Preview Engine.

Added

  • High-Fidelity In-Browser Office Document & Presentation Preview Engines:
    • docx-preview.min.js & jszip.min.js: Client-side high-fidelity Word document rendering preserving pagination, margins, typography, tables, drawings, and embedded images.
    • pptx-viewer.umd.js: Client-side high-fidelity PowerPoint presentation rendering preserving slide aspect ratios, background themes, shapes, typography, tables, and slide deck layout.
    • Assets/js/office-viewer.js: Automated controller initializing .fic-docx-container and .fic-pptx-container viewers, fetching binary payloads via stream routes, and providing slide navigation controls (Prev, Next, slide counter, tabs, keyboard shortcuts).
    • Stream route integration in FileStreamController with docx, dotx, pptx, potx in INLINE_MIME_TYPES and MAGIC_SIGNATURES.
  • OpenXML Word Document (.docx, .dotx, .doc) Preview Engine:
    • DocxParserService: Pure-PHP memory-safe OpenXML DOM parser extracting headings (H1-H4), formatted text runs (bold, italic, underline, strike, monospace code), bullet/numbered lists, and tables with pre-escaped HTML (htmlspecialchars()).
    • DocxPreviewHandler: Handler for Word documents returning structured HTML and metadata (paragraphCount, headingCount, tableCount, wordCount). Gracefully detects legacy .doc (OLE2 binary format) to emit safe download notices without memory bloat.
    • Template/file/docx_preview.php: Word Document reading pane with summary badges and clean typography.
  • OpenXML PowerPoint Presentation (.pptx, .potx, .ppt) Preview Engine:
    • PptxParserService: Pure-PHP memory-safe presentation parser resolving slide ordering via ppt/presentation.xml & ppt/_rels/presentation.xml.rels, extracting slide titles, bullet points, text blocks, and structured slide tables.
    • PptxPreviewHandler: Handler for PowerPoint presentations returning slide deck arrays and metadata (slideCount, title). Gracefully detects legacy .ppt format.
    • Template/file/pptx_preview.php: Interactive presentation viewer with slide switcher tabs (Slide 1, Slide 2...), active slide canvas, and presentation title header.
  • Expanded Test Suite:
    • 30 new unit and integration tests covering synthetic OpenXML ZIP document & presentation parsing, slide ordering, bullet point extraction, table extraction, legacy format notices, streaming MIME types, and template rendering (total 755 tests, 2562 assertions).

Changed

  • Updated FileValidationService to whitelist docx, dotx, doc (10 MB cap) and pptx, potx, ppt (15 MB cap) with strict MIME mappings.
  • Updated PreviewViewModeRegistry with "Word Document" and "PowerPoint Presentation" labels.
  • Updated FilePreviewController to register DocxPreviewHandler and PptxPreviewHandler and route to docx_preview and pptx_preview templates.
  • Updated Template/file/dropdown.php to include docx and pptx extensions in the Safe Preview menu.
  • Bumped plugin version to 0.9.0 in Plugin.php.