|
1 | 1 | # @textcortex/slidewise |
2 | 2 |
|
| 3 | +## 1.19.0 |
| 4 | + |
| 5 | +### Minor Changes |
| 6 | + |
| 7 | +- 3e7c3f1: First-class **diagram** element (P3 / F3). A new `DiagramElement` models |
| 8 | + process / timeline / funnel / matrix / cycle / list visuals as an ordered set |
| 9 | + of labelled `nodes` instead of a hand-placed cluster of shapes and lines. The |
| 10 | + renderer and the PPTX writer share one layout function (`layoutDiagram`, also |
| 11 | + exported), so the on-canvas preview and the saved file can't drift. On export a |
| 12 | + diagram serialises to a single labelled `<p:grpSp>` of real shapes + connectors |
| 13 | + — so it stays grouped and editable in PowerPoint (move/resize as one unit) |
| 14 | + rather than collapsing to anonymous floating shapes. Exposed via the |
| 15 | + `DiagramElement` / `DiagramNode` / `DiagramKind` types and the `layoutDiagram` |
| 16 | + helper. |
| 17 | +- 3e7c3f1: Host deck-generation ergonomics (review follow-ups for layout instantiation): |
| 18 | + |
| 19 | + - **`summarizeLayouts(deck, options)`** — `{ compact: true }` returns the minimal |
| 20 | + `{ id, name?, role, fillable }` shape (no geometry) for a tight model-context |
| 21 | + budget; `{ dedupe: true }` collapses layouts that share a role + full |
| 22 | + placeholder-slot inventory (text **and** non-text chart/picture/table slots) |
| 23 | + into one representative carrying the rest as `aliases`, so an 85-layout |
| 24 | + template surfaces as its handful of distinct kinds — and a chart-bearing |
| 25 | + layout never collapses into a text-only twin. Composable. |
| 26 | + - **Robust `sourceLayoutId` resolution** — a host-authored slide's |
| 27 | + `sourceLayoutId` now resolves from `deck.layouts` **or**, when the host didn't |
| 28 | + carry the layouts array, by the `ppt/slideLayouts/<id>.xml` id convention |
| 29 | + against the `{ source }` archive. When it resolves to nothing, `serializeDeck` |
| 30 | + emits a structured `{ code: "layout-unresolved", slideIndex, layoutId }` |
| 31 | + warning instead of silently falling back. |
| 32 | + - **Richer `chrome-skipped` warning** — now carries the detected `sourceAspect` |
| 33 | + and `outputAspect` so a host can explain _why_ chrome was dropped. |
| 34 | + |
| 35 | + Plus README: the host "author-a-slide" contract (`{ sourceLayoutId, |
| 36 | +background: "transparent", elements }` without a JS call), the recipe for |
| 37 | + placing non-text slots from `summarizeLayouts` geometry, and the server-side |
| 38 | + `layoutDiagram` render recipe with its DOM-free guarantee. |
| 39 | + |
| 40 | +- 3e7c3f1: Round-trip fidelity fixes (P4): |
| 41 | + |
| 42 | + - **Image `crop` / `radius`** now round-trip. Previously an image's `crop` |
| 43 | + (`<a:srcRect>`) was read on import but silently dropped on export, and corner |
| 44 | + `radius` was neither parsed nor written. `serializeDeck` now routes any image |
| 45 | + carrying a `crop` or `radius` through a dedicated `<p:pic>` writer (emitting |
| 46 | + `<a:srcRect>` and `roundRect` geometry) instead of pptxgenjs — whose |
| 47 | + cover/contain sizing emits its own `<a:srcRect>` and would fight a user crop — |
| 48 | + and `parsePptx` reads a rounded picture's corner radius back. Plain |
| 49 | + (uncropped, square-cornered) images keep the existing path unchanged. |
| 50 | + - **Text-run letter-case (`cap`)** now round-trips. A run's `cap` |
| 51 | + (`"all"` / `"small"`, OOXML `<a:rPr cap>`) was parsed on import but dropped on |
| 52 | + export (pptxgenjs has no `cap` option). It's now re-applied per run in |
| 53 | + post-process, so all-caps / small-caps styling survives a save. |
| 54 | + |
| 55 | +- 3e7c3f1: Harden layout instantiation for AI deck generation (P1 / F1): |
| 56 | + |
| 57 | + - **Layout-instantiated slides now inherit their layout's background.** A slide minted by `addSlideFromLayout` with the default `transparent` background no longer serialises an explicit `<a:noFill/>` `<p:bg>` — that empty background was overriding the layout/master/theme inheritance, so instantiated slides lost their on-brand background. They now stay `<p:bg>`-less and paint from their `sourceLayoutId` layout's chrome (matching the source-slide guarantee for cloned/reordered slides). |
| 58 | + - **Layout-selection metadata.** `DeckLayout.type` now carries the raw OOXML `<p:sldLayout type>` role, and the new `summarizeLayouts(deck)` returns a compact, model-context-friendly layout menu (friendly `role` label, fillable `fills` keys, per-placeholder kind/category/geometry) so a host can have a model pick a layout per slide. `placeholderKey(ph)` exposes the exact `fills` key for a placeholder. |
| 59 | + |
| 60 | +- 3e7c3f1: Machine-readable serialization diagnostics (P2 / B3). `serializeDeck` now |
| 61 | + accepts `SerializeOptions.onWarning`, a callback invoked with a structured |
| 62 | + `SerializeWarning` when the output degrades. The key case is |
| 63 | + `"chrome-skipped"` — emitted when a `source` template's masters / layouts / |
| 64 | + theme / fonts can't be carried over because its slide size is unreadable, so |
| 65 | + the deck falls back to generic chrome. Hosts can now detect and surface the |
| 66 | + degradation instead of only seeing a console line. (Non-16:9 sizing for 4:3 / |
| 67 | + 16:10 / custom templates already drives the output slide size; this adds the |
| 68 | + escape-hatch signal when it can't.) |
| 69 | + |
3 | 70 | ## 1.18.1 |
4 | 71 |
|
5 | 72 | ### Patch Changes |
|
0 commit comments