Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions .changeset/applyedits-layout-instantiation.md

This file was deleted.

31 changes: 0 additions & 31 deletions .changeset/render-and-font-transparency.md

This file was deleted.

53 changes: 53 additions & 0 deletions packages/slidewise/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,58 @@
# @textcortex/slidewise

## 1.21.0

### Minor Changes

- 652f804: feat(pptx): layout-instantiation in `applyEdits` (lossless scale-with-variety)

`applyEdits` now supports `source: { layoutId, fills? }` in a `PlannedSlide` —
instantiating a fresh slide from one of the template's **own** layouts inside
the lossless byte-patch path. Because the layout is already a part of `source`,
the new slide binds to `ppt/slideLayouts/<layoutId>.xml` (inheriting theme /
master / background chrome) while every other part stays byte-identical. This
unlocks lossless **and** scale-with-variety in one deck: clone slides where you
want the exact thing, instantiate from layouts where you want variety.

Each layout placeholder is materialised as an addressable, positioned element
with a deterministic id — `layoutSlotElementId(layoutId, key)` (exported) where
`key` is the `placeholderKey` / `summarizeLayouts` slot key. Text/`obj` slots
are populated from `fills` and editable via `setText`; picture slots become a
`<p:pic>` with a transparent placeholder blip so `setImage` can repoint them;
chart/table/other slots expose their geometry so the host fills them with
`addChart` / `addDiagram`. Placeholder geometry is read EMU-native from the
layout (falling back to the matching master slot), so it stays correct without a
canvas-px round-trip. An unresolvable `layoutId` is surfaced via `onWarning` and
the slide is skipped rather than shipped wrong.

- 652f804: feat(render): headless `renderDeckToImages` + `deck.fontUsage` font transparency

**Headless render-to-image (visual-QA loop).** New browser-free renderer that
draws **what the editor draws** — native charts (`buildChartOption` + ECharts
SSR), diagrams (`layoutDiagram`), text/shapes/images/backgrounds in z-order —
_not_ the OOXML raster fallbacks. No Playwright/Chromium/DOM.

- `renderDeckToSvg(deck, opts?)` → one composed SVG per slide (ECharts is
loaded on demand, so it never bloats the editor bundle).
- `renderDeckToImages(deck, opts?)` / `renderSlideToImage(deck, i, opts?)` /
`renderPptxToImages(bytes, opts?)` → raster bytes. Rasterisation is an
injected hook (`opts.rasterizeSvg`, e.g. `@resvg/resvg-js`); when omitted the
default tries a dynamic `@resvg/resvg-js` import and throws a clear error if
it isn't installed — so there's no hard native dependency.
- `opts`: `slides` (1-based subset), `dpi` (canvas scales by `dpi/96`),
`format`, `maxWidth` (thumbnail cap). Deterministic (no animation).

Enables the host's render → fresh-eyes inspect → targeted `applyEdits` fix →
re-render cycle, rendering a final `applyEdits` output directly.

**Font transparency.** `parsePptx` now stamps `deck.fontUsage:
{ family, embedded }[]` — every font family the deck's text uses, flagged
whether the source PPTX actually **embeds** it (`<p:embeddedFontLst>` → a real
`ppt/fonts/*` part) or merely **references** it (system-fallback risk on
viewers that don't ship the brand font). Hosts use it to warn at generation
time ("missing fonts for some ppts"). It's a read-only diagnostic, distinct from
`deck.fonts` (the embeddable payloads).

## 1.20.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/slidewise/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@textcortex/slidewise",
"version": "1.20.0",
"version": "1.21.0",
"description": "Embeddable React PPTX editor.",
"license": "MIT",
"type": "module",
Expand Down
8 changes: 8 additions & 0 deletions website/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# website

## 0.0.35

### Patch Changes

- Updated dependencies [652f804]
- Updated dependencies [652f804]
- @textcortex/slidewise@1.21.0

## 0.0.34

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "website",
"version": "0.0.34",
"version": "0.0.35",
"private": true,
"type": "module",
"scripts": {
Expand Down
Loading