betteroffice-pptx-edit
The collaborative PPTX deck model, backed by Yrs.
DeckSession owns the shared document. Slide order, slides, shapes, and text
stories are separate shared types, so reordering slides does not conflict with
editing text on one of them. Text stories reuse the same one-story-is-one-CRDT-
text rule as the DOCX editing core.
DeckUndoManager tracks local user-origin transactions only; remote updates
stay out of local history.
State vectors, diffs, and updates are standard Yrs v1, so any transport that speaks Yjs sync-v1 works.
Comments use a separate shared map. Saving patches existing XML and preserves untouched comment parts byte for byte. Deleting a thread removes its known replies; a reply added concurrently becomes a root when its parent is absent, so both clients and saved files retain it.
The current schema is v20. Older v1–v19 updates can be opened, and attaching the
original package with open_from_update_with_source imports source comments,
list styles, explicit numbering restarts, paragraph line spacing, picture
fills, unedited gradient outlines, chart-space fills and axis lines, explicit
text overflow settings, bitmap effects, and shape shadows with their scale and
alignment missing from older snapshots. Schema 20 recovers OLE preview pictures
after schema 19 restores character tracking.
Source attachment also restores run baseline and character spacing formatting
on surviving text while retaining edits and explicit zero overrides. Imported properties persist in
subsequent updates, and reattaching the source is idempotent.
Source-free loads defer the import until the package is attached. Older clients
reject new-schema updates; collaborators must upgrade together or exchange
saved PPTX files. The existing connector, slide-number, theme-formatting,
hidden-shape, custom-geometry, comment and list-style migrations run first,
followed by the schema-10 baseline migration, schema-11 numbering migration,
schema-12 line-spacing migration, schema-13 picture-fill migration, and
schema-14 gradient-outline migration, followed by the chart migration in
schema 15, the text-overflow migration in schema 16, and the bitmap-effect
migration in schema 17, then the outer-shadow migration in schema 18, and
character spacing in schema 19.
Default text overflow settings and starting slide numbers remain omitted from
package JSON.
Used by betteroffice-pptx. The
wasm feature exposes the JavaScript surface consumed by
@betteroffice/pptx.
Part of BetterOffice. Apache-2.0.