Repository navigation
v2.0.0
A tables release, and the first breaking one: custom table styles are gone,
because PowerPoint never rendered them. Everything else here is the table
surface growing to cover what that API was reaching for.
npm install @shbernal/ts-pptxRemoved
-
BREAKING:
Presentation.defineTableStyle()andTableProps.styleDrivenCells
are gone, along with theTableStyleProps/TableStyleRegionPropstypes.
PowerPoint resolves<a:tableStyleId>against its own table-style gallery
and never reads a style definition out of the package — measured by rendering
in PowerPoint desktop 16.0, not inferred from the schema. The API emitted
well-formed, schema-valid XML that can never paint.Migration — style tables with direct formatting, which is what carried them
all along:// before const brand = pptx.defineTableStyle({ name: 'Brand', wholeTbl: { border: { type: 'solid', color: 'D9D9D9', width: 0.5 } }, firstRow: { fill: '1A2B3C', color: 'FFFFFF', bold: true }, }) slide.addTable(rows, { tableStyle: brand, hasHeader: true, styleDrivenCells: true }) // after slide.addTable(rows, { hasHeader: true, border: { type: 'solid', color: 'D9D9D9', width: 0.5 }, headerRow: { fill: { color: '1A2B3C' }, color: 'FFFFFF', bold: true }, })
TableProps.tableStylestill exists and still works — it is now typed as
TableStylealone, since only a built-in GUID renders. The read side is
unaffected:Table.resolvedStyle,TableCell.resolvedFilland
importSlideMasters({ tableStyles })still resolve style graphs out of
imported decks, because PowerPoint honours its own definitions.
Added
- Table editing on
@shbernal/ts-pptx/read— cell properties, rows, columns
and merges, where the read proxies were previously read-plus-text-edit only. TableProps.tableFill— the table's own background, as a reala:tblPr
fill.TableProps.outerBorder— a border for the table's perimeter only, as
distinct fromTableProps.border, which is a per-cell default.BorderProps.dashType— the exacta:prstDashpreset, instead of
collapsing every dashed border ontosysDash.ShapeLineProps.dashTypenow
spans the wholeST_PresetLineDashValset.TableCellProps.diagonal,.anchorCtr,.cell3D,.horzOverflow— cell
corner-to-corner rules, horizontal block centring, a 3-D bevel, and clip vs.
overflow behaviour.TableCell.gradientFill/.patternFill/.hasOwnFill/.id/
.headerIds(read) — non-solid cell fills and cell/header association.border/unknown-key— a new diagnostic reporting an unrecognized
BorderPropskey instead of silently dropping it.docs/tables.md
— the table guide, which did not exist. Tables were the most-used object after
text and the only major one with no prose doc.
Fixed
tableToSlidescell padding is now converted from px to inches. A computed
CSSpadding: 4pxwas assigned straight toTableCellProps.margin, which is
inches — emitting a 4 inch text inset. Padding now resolves at 96px/in.
This changes emitted bytes for any padded HTML table; cells will look
substantially tighter, because they are now inset by what was asked for.fitColumns: 'shrink'measured against the wrong slide margin — it
subtracted the left margin where the right one bounds the space. Invisible with
the default symmetric margins, wrong for any asymmetric master.- A styled table cell's own fill is no longer dropped by
pptx-to-script. - A theme-indexed picture background reported the wrong part — a
p:bgRef
a:blipFillcomes out of the theme part, so itsr:embedis scoped to the
theme's relationships, not the owning slide/layout/master's. - A table-level
borderside withwidth: 0is now emitted as the hairline it
asks for, matching what per-cell borders already did.
Documentation: https://shbernal.github.io/ts-pptx/
Full changelog: https://github.com/shbernal/ts-pptx/blob/v2.0.0/CHANGELOG.md