fix(pdf): bundle the branding assets into the app (no fetch at export), export returns its warnings and the editor reports missing elements
This commit is contained in:
1 parent
80e95ca61d
commit
293a6e0b36
22 files changed
+199
-185
No files matched your search
@@ -153,10 +153,11 @@ pnpm format # Prettier write
|
||||
```
|
||||
faunosteo/
|
||||
├─ apps/app/ ← @faunosteo/app (everything below until packages/)
|
||||
├─ public/ ← logos only (no anatomy asset: the sheet is bundled)
|
||||
├─ public/ ← favicons, env.js, site header logo only (PDF logos live in src/assets/brand; no anatomy asset)
|
||||
├─ vite/sheet-bundle.ts ← Vite plugin: `virtual:faunosteo-sheet` (SHEET_BUNDLE=draft|none)
|
||||
├─ scripts/compare-reports.ts ← `pnpm report:compare`: archive PDF vs v3 reading (pure part in scripts/compare/report.ts)
|
||||
├─ src/
|
||||
│ ├─ assets/brand/ ← the four PDF branding logos, bundled by Vite (?inline / ?raw / ?url), never fetched
|
||||
│ ├─ app/
|
||||
│ │ ├─ App.tsx ← root router
|
||||
│ │ ├─ routes/{Home,NewReport,Editor,NotFound}Route.tsx
|
||||
@@ -187,7 +188,7 @@ faunosteo/
|
||||
│ │ └─ brand/{Brand,AppHeader,Footer,LanguageSwitcher}.tsx
|
||||
│ ├─ pdf/ ← app side of @faunosteo/pdf (engine in packages/pdf)
|
||||
│ │ ├─ export.ts + import.ts ← exportReportToPdf (sheet snapshot + branding + browser rasterizer → engine), importReportFromPdf (ArchiveReadOutcome, ImportError kinds)
|
||||
│ │ └─ branding.ts + browserRasterizer.ts ← public/ logos → Branding; Image/canvas Rasterizer adapter
|
||||
│ │ └─ branding.ts + browserRasterizer.ts ← bundled src/assets/brand logos (?inline / ?raw) → Branding; Image/canvas Rasterizer adapter
|
||||
│ ├─ lib/{dates,id,assert,supabase}.ts ← supabase.ts: getSupabaseClient() | null
|
||||
│ ├─ styles/{index,tokens}.css ← Tailwind v4 CSS-first
|
||||
│ └─ main.tsx
|
||||
@@ -258,12 +259,12 @@ SVG interaction
|
||||
|
||||
PDF export (app side: apps/app/src/pdf, engine: packages/pdf)
|
||||
→ exportReportToPdf(report, index, { locale })
|
||||
→ buildSheetSnapshot(index.sheet, report) + loadBranding() (4 public/ files, each may fail alone) + defaultPdfLabels
|
||||
→ buildSheetSnapshot(index.sheet, report) + loadBranding() (4 logos bundled at build time, no network) + defaultPdfLabels
|
||||
→ exportReportArchive({ report, sheet, branding, labels, locale, rasterizer: browserRasterizer, exportedAt })
|
||||
assertSnapshot (caps, integrity, sheet invariant) → fonts (WinAnsi StandardFonts, safeText guard)
|
||||
→ per observation: composeHighlightedViewSvg (xmldom: sanitise allowlist → composeViewSvg highlight) → rasterizer → page
|
||||
→ conclusion page, footer, envelope v1 attached as osteo-report.json, Keywords faunosteo-archive/1
|
||||
→ { pdf, envelope, warnings } → browser download
|
||||
→ { pdf, envelope, warnings } → { pdf, warnings } to EditorRoute → browser download, alert naming failed logo slots / views
|
||||
→ exportFromEnvelope(envelope, …) re-exports an archive from its own snapshot, branding and labels (no sheet)
|
||||
|
||||
PDF import
|
||||
|
||||
Reference in new issue
Block a user