|
1 | 1 | # @textcortex/slidewise |
2 | 2 |
|
| 3 | +## 1.21.0 |
| 4 | + |
| 5 | +### Minor Changes |
| 6 | + |
| 7 | +- 652f804: feat(pptx): layout-instantiation in `applyEdits` (lossless scale-with-variety) |
| 8 | + |
| 9 | + `applyEdits` now supports `source: { layoutId, fills? }` in a `PlannedSlide` — |
| 10 | + instantiating a fresh slide from one of the template's **own** layouts inside |
| 11 | + the lossless byte-patch path. Because the layout is already a part of `source`, |
| 12 | + the new slide binds to `ppt/slideLayouts/<layoutId>.xml` (inheriting theme / |
| 13 | + master / background chrome) while every other part stays byte-identical. This |
| 14 | + unlocks lossless **and** scale-with-variety in one deck: clone slides where you |
| 15 | + want the exact thing, instantiate from layouts where you want variety. |
| 16 | + |
| 17 | + Each layout placeholder is materialised as an addressable, positioned element |
| 18 | + with a deterministic id — `layoutSlotElementId(layoutId, key)` (exported) where |
| 19 | + `key` is the `placeholderKey` / `summarizeLayouts` slot key. Text/`obj` slots |
| 20 | + are populated from `fills` and editable via `setText`; picture slots become a |
| 21 | + `<p:pic>` with a transparent placeholder blip so `setImage` can repoint them; |
| 22 | + chart/table/other slots expose their geometry so the host fills them with |
| 23 | + `addChart` / `addDiagram`. Placeholder geometry is read EMU-native from the |
| 24 | + layout (falling back to the matching master slot), so it stays correct without a |
| 25 | + canvas-px round-trip. An unresolvable `layoutId` is surfaced via `onWarning` and |
| 26 | + the slide is skipped rather than shipped wrong. |
| 27 | + |
| 28 | +- 652f804: feat(render): headless `renderDeckToImages` + `deck.fontUsage` font transparency |
| 29 | + |
| 30 | + **Headless render-to-image (visual-QA loop).** New browser-free renderer that |
| 31 | + draws **what the editor draws** — native charts (`buildChartOption` + ECharts |
| 32 | + SSR), diagrams (`layoutDiagram`), text/shapes/images/backgrounds in z-order — |
| 33 | + _not_ the OOXML raster fallbacks. No Playwright/Chromium/DOM. |
| 34 | + |
| 35 | + - `renderDeckToSvg(deck, opts?)` → one composed SVG per slide (ECharts is |
| 36 | + loaded on demand, so it never bloats the editor bundle). |
| 37 | + - `renderDeckToImages(deck, opts?)` / `renderSlideToImage(deck, i, opts?)` / |
| 38 | + `renderPptxToImages(bytes, opts?)` → raster bytes. Rasterisation is an |
| 39 | + injected hook (`opts.rasterizeSvg`, e.g. `@resvg/resvg-js`); when omitted the |
| 40 | + default tries a dynamic `@resvg/resvg-js` import and throws a clear error if |
| 41 | + it isn't installed — so there's no hard native dependency. |
| 42 | + - `opts`: `slides` (1-based subset), `dpi` (canvas scales by `dpi/96`), |
| 43 | + `format`, `maxWidth` (thumbnail cap). Deterministic (no animation). |
| 44 | + |
| 45 | + Enables the host's render → fresh-eyes inspect → targeted `applyEdits` fix → |
| 46 | + re-render cycle, rendering a final `applyEdits` output directly. |
| 47 | + |
| 48 | + **Font transparency.** `parsePptx` now stamps `deck.fontUsage: |
| 49 | +{ family, embedded }[]` — every font family the deck's text uses, flagged |
| 50 | + whether the source PPTX actually **embeds** it (`<p:embeddedFontLst>` → a real |
| 51 | + `ppt/fonts/*` part) or merely **references** it (system-fallback risk on |
| 52 | + viewers that don't ship the brand font). Hosts use it to warn at generation |
| 53 | + time ("missing fonts for some ppts"). It's a read-only diagnostic, distinct from |
| 54 | + `deck.fonts` (the embeddable payloads). |
| 55 | + |
3 | 56 | ## 1.20.0 |
4 | 57 |
|
5 | 58 | ### Minor Changes |
|
0 commit comments