Skip to content

documents.js: write tracked-change regions and ODF index wrappers; embed objects in odf shapes - #1200

Merged
Mearman merged 2 commits into
mainfrom
fix/1190-builder-regions
Sep 10, 2026
Merged

documents.js: write tracked-change regions and ODF index wrappers; embed objects in odf shapes#1200
Mearman merged 2 commits into
mainfrom
fix/1190-builder-regions

Conversation

@Mearman

@Mearman Mearman commented Sep 10, 2026

Copy link
Copy Markdown
Member

Closes #1190 -- all three items:

  • tracked-change regions in the docx builder: openProvenanceRegion opens w:ins/w:del/w:moveFrom/w:moveTo (minted w:id, author/date from the descriptor), and closeRegion re-spells a deletion or move-from interior's w:t as w:delText -- Word's own spelling; ooxml.js's reader reads both identically, so the round trip holds either way. formatChange stays refused by name: its w:rPrChange/w:pPrChange spellings are property-layer children with no block-level element to open (pinned by test with content still written)
  • ODF index wrappers in the odt builder: openIndexRegion builds the wrapper element (tag from the descriptor's *-source residue naming which of the seven wrappers, text:name, the bare *-source child the ODF schema requires) with appends landing in its own text:index-body, mirroring odf.js's writeOdfIndexWrapper element-for-element -- now exported from odf.js's barrel for exactly this reuse. No geometry, so no style-interner wall. A residue-less index descriptor stays refused (nothing names the wrapper), pinned by test
  • embedded objects in odf shapes, reader first: readDrawFrameContent gains the draw:object branch, opt-in per format (odp and odg pass it; ods deliberately does not -- its cell-anchored reader resolves the reference itself and would see a second, differently-shaped copy), and the shape writer admits a lone embedded-object block through the identical writeEmbeddedObject machinery odt body embeddings use, refusing one found alongside other content by name

Every implemented region round-trips through the corresponding reader's real bytes. The construct-marker README passage now states every body-scope wrapper kind survives both builders, with the two named refusals.

Closes #1190.

readDrawFrameContent gains the draw:object branch (checked first, ahead
of every other content, for the identical ObjectReplacements-preview
reason the odt and ods readers already order it that way), opted into
per format so ods's own cell-anchored resolution keeps its shape; the
shape writer admits a lone embedded-object block through the identical
writeEmbeddedObject machinery an odt body embedding uses, refusing one
found alongside other content by name. The root barrel now exports
odfIndexWrapperTag and writeOdfIndexWrapper so documents.js's odt
editor can open real index-wrapper regions (the follow-up commit).
… the builders

The docx builder's marker walk opens a provenance pair as a real
w:ins/w:del/w:moveFrom/w:moveTo region -- author and date riding the
element, deletion interiors re-spelling their runs' text w:delText on
close, Word's own spelling -- the exact inverse ooxml.js's reader
recovers; formatChange stays dropped by name (property-layer
spellings, no block-level element). The odt builder opens an index
contentControl pair as a real wrapper region (text:table-of-content or
the sibling the descriptor's *-source residue names) whose cached
blocks land inside its own text:index-body, mirroring odf.js's
writeOdfIndexWrapper; a residue-less index descriptor stays dropped
(nothing names which of the seven wrappers to write).
@Mearman
Mearman marked this pull request as ready for review September 10, 2026 13:15
@Mearman

Mearman commented Sep 10, 2026

Copy link
Copy Markdown
Member Author

@codex security review

@Mearman
Mearman enabled auto-merge (rebase) September 10, 2026 13:15
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ⚠️ Failed 2026-09-10T13:38:34.368559Z ab6cb06 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Mearman
Mearman merged commit 02d914f into main Sep 10, 2026
22 checks passed
@Mearman
Mearman deleted the fix/1190-builder-regions branch September 10, 2026 13:20
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 7.18.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

builders: tracked-change regions (docx), ODF index wrappers (odt), and embedded objects in shapes (odf)

1 participant