Commit Graph
56 Commits
Author SHA1 Message Date
FredApps fcdb2ec432 Merge pull request #1751 from alehel/port/odt-style-edit-keeps-other-styles
craft-odf: a style or list change keeps the file's other definitions
2026-11-26 11:03:22 +01:00
FredApps 8b17a649d2 Merge branch 'main' into port/odt-list-item-paragraphs 2026-11-26 10:18:16 +01:00
FredApps 667a6e6dbc Merge branch 'main' into port/odt-style-edit-keeps-other-styles 2026-11-26 10:18:01 +01:00
alehelandClaude Opus 5.5 8836ed3873 Merge main into port/odt-list-item-paragraphs
para_html takes whether to write spacing and indents: a list item's further
paragraph does not, like the item itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 02:57:42 +01:00
alehelandClaude Opus 5.5 ec4247be6a fix(odf): a sublist's header written from the model stays in its parent item
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 01:54:25 +01:00
alehel 2ca5586810 test(odf): replace style export deadline with lookup work bound 2026-11-23 09:32:29 +01:00
David MannandClaude Opus 5.5 1929e79ebb Merge storytold main into next (20 Nov, second sync)
Merges main at 8f92ed1334 (#2550 and the rest of main since the 20 Nov sync).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 16:38:55 +01:00
keithcsqueensu 4e5f883c93 Merge storytold/craft-libs main into math-ports 2026-11-20 00:40:38 +00:00
Aleksander Helgaker aeb03cca95 Merge branch 'main' into port/odt-list-item-paragraphs 2026-11-19 06:45:44 +01:00
aiongg e8e713ee26 Merge storytold main into next (18 Nov sync)
Merges main at 3b8e426a26.

- crates/ui: main's e-sign dialog (crates/ui/src/esign) moves to craft-cloud-ui beside the
  share dialog, behind craft-cloud-ui's esign feature; craft-ui forwards `esign` and
  re-exports the module.
- crates/proof: main's can_suggest_cased goes to affix/check.rs and its tests to
  affix/tests.rs (next split affix.rs); French wiring in lib.rs.
- crates/svg: main's validated resolver and raster validation stay under tree-render, which
  now also enables gif and image-webp; the shared image-codec helpers are gated on tree.
- craft-ai-agents: main's rev (craft-ai-integrations main), one entry.
- crates/craft: facade dependencies, features and re-exports for main's new crates.
2026-11-18 23:07:38 +00:00
alehel 4efe28f2ab Preserve list headers and resolved continuation indents 2026-11-18 22:25:40 +01:00
Kevin JosephandNghiathan13 6242f65262 craft-docx: a table border without w:sz is width 0, and ODT and RTF keep it (#2203)
* craft-docx: a DOCX border without w:sz is an eighth of a point

* craft-docx: a table border without w:sz is width 0, and ODT and RTF keep it

A table, cell or table-style border without w:sz gives the same output in
Word as w:sz="0" and takes no room; read as half a point, rows below a
pandoc table's header rule moved down half a point. PropCtx::table_borders
now reads it as 0, as PropCtx::borders does since #1488.

ODT and RTF have no border that is drawn and takes no room, so a drawn
width-0 cell side is written at Border::THINNEST instead of being dropped.
Where two ODT cells share an edge, a line with a width wins over a width-0
one, whichever cell states it.

Table half of storytold/wordcraft#5764.

---------

Co-authored-by: Nghiathan13 <201675788+Nghiathan13@users.noreply.github.com>
2026-11-18 15:35:29 -05:00
Hamza Naveed bd5c93cf50 craft-odf: taking inline items out of a flat document is linear (#2219) (#2237)
take_out searched the whole rest of the document for the next picture and the next inline
object on every item, so a document with many of one kind and none (or few) of the other cost
items × size. It now keeps where the next of each is and searches for a kind again only once
it has been passed. The output is the same.
2026-11-18 15:23:21 -05:00
aiongg ac3dfd1f53 Merge storytold main into next (17 Nov sync)
storytold main 83cb1133dd (291 commits) into the integration head bab1a99b85; 47 conflicted files.

- Domain test files (metafile, prepress, pdf plates, settings store, heif, media-testkit, atomic): tests next cut stay cut; tests new on main are kept, as trials where the crate's test target runs trials.
- atomic: main's group-bits test and Faulty::set_group go to src/tests.rs. audio: main's GSM and SBC oracles join tests/main.rs. cms constructors, pdf knockout_backdrop and testing_pdf join their crates' one test binary; timeline's preflight tests become src/preflight_tests.rs trials.
- update: main's changes to detect, install (linux, macos) and the tests land in next's split modules. The app's own offer is inspected on a thread of its own, picked up by tick's polling; settle_for_tests settles offers too. Later on a ready update drops the close it asked for. updater_pin_tests.rs stays deleted; its new pin test is in tests/it/update.rs.
- craft-color: main added a different crate at crates/color (the colour tags of compositor and display frames); it is next's craft-color module `tags`, re-exported at the root.
- Old crates/ui (combo, docking, testing, README) and keymap's ui/view.rs stay deleted; main's new crates/ui/src/testing files are dropped with them.
- New crates in the craft facade: ai, control, dds, frame, ipc, media-source, palette, press-print, score, ssip. testkit and xtask are listed outside it.
- Cargo.lock: the union of both locks, resolved by cargo metadata. Workflow: main's nextest Windows leg, with next's --keep-going clippy.
2026-11-17 12:44:52 +00:00
alehel f988a285dc Merge remote-tracking branch 'origin/main' into r1754-merge 2026-11-17 09:30:15 +01:00
alehel b549ece3a6 Merge remote-tracking branch 'origin/main' into n1751-merge
# Conflicts:
#	crates/odf/src/text/package.rs
2026-11-17 07:45:38 +01:00
FredApps cc22854ea4 Preserve ODF lookahead and stacking normalization together 2026-11-17 04:59:07 +01:00
FredApps 0dbd888f3c Integrate page background preservation with stacking normalization 2026-11-17 04:12:46 +01:00
alehel bdee100625 Merge remote-tracking branch 'origin/main' into m1751-merge
# Conflicts:
#	crates/odf/src/text/tests_more/kept.rs
2026-11-17 03:55:52 +01:00
alehel 28d2040903 Merge remote-tracking branch 'origin/main' into m1754-merge
# Conflicts:
#	crates/html/src/doc/tests.rs
2026-11-17 03:51:32 +01:00
Aleksander Helgaker 31af9e1613 craft-odf: a picture holding a paragraph stays in its own (#1753) 2026-11-16 21:31:21 -05:00
Joseph Anglada 38e5614b9c SmartArt: an item's opacity is read, written and drawn (#1906) 2026-11-16 21:30:04 -05:00
keithcsqueensu 738bf6fafe docx: write a font table naming the fonts a document uses (#1948) 2026-11-16 21:29:43 -05:00
alehelandClaude Opus 5.5 41c7c80e8a ODT: a rewritten style definition keeps the package files it names
A file style that `rewritten_defs` writes back as read (an unread namesake,
`MyCustom` beside an edited `My_20_Custom`) was left out of the package
files to keep, so a picture only it named was dropped while its href
stayed in styles.xml. The files kept now follow the markup the rewrite
writes for each key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 03:14:30 +01:00
FredApps 1612dd35b9 Integrate current drawing readers and preserve retained OLE stacking 2026-11-17 03:11:41 +01:00
alehelandClaude Opus 5.5 937d0a9d68 ODT: package files of a style definition follow it per definition
main's page background change (#1809) asked `KeptXml::styles_as_read`,
which this branch replaces with per-definition fingerprints, to tell
whether the file's style definitions are written as read. `with_kept_files`
now asks per definition instead: one the document changed or that is
written from the model doesn't keep its package files, as a drawing
definition WordCraft writes its own of doesn't. `common_changes` gives both
it and `styles_as_read` the same answer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 02:38:29 +01:00
alehel 606051f642 Merge remote-tracking branch 'origin/main' into pr1751e-merge 2026-11-17 02:36:24 +01:00
Dylan M. Taylor ec1523c024 Merge pull request #1809 from batistalucasv/fix/1784-preserve-page-background-bitmap-fill
craft-odf: preserve page background bitmap fill and legacy fallback (#1784)
2026-11-16 20:08:10 -05:00
alehelandClaude Opus 5.5 2ceddfd4ae ODT: a new style derives from the file's style under the file's name
A style WordCraft writes that the file didn't have, based on a style the
import read under another name (`Base_20_Style`, WordCraft's `BaseStyle`),
named WordCraft's name as its parent. That resolved to WordCraft's own copy
of the style, without what WordCraft doesn't model of the file's. Its parent
and next style now take the file's name for every style read under another
name (`kept::file_names`), not only where an unread namesake collides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 21:46:56 +01:00
FredApps 98f50bc151 Preserve retained ODF markup while normalizing stacking orders 2026-11-16 20:01:11 +01:00
alehelandClaude Opus 5.5 e994f6ce33 flow: a heading in a list item stays in its item
A text:h inside a text:list-item is read as one of the item's further
paragraphs, but continues_list accepted only plain paragraphs, so the
HTML, Markdown and ODT writers ended the list at the heading and the
numbering restarted after it.

continues_list now also accepts headings. HTML writes the heading tag
inside the li, ODT writes a text:h inside the text:list-item, and
Markdown writes the ATX heading indented under the item. Quotes, code
and other kinds still end the list, as the writers cannot put them in
an item.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 19:36:36 +01:00
FredApps c2068fc90b fix(import): normalize maximum drawing stacking orders without replay 2026-11-16 18:54:38 +01:00
FredApps 37d7236d86 fix(odf): preserve boundary stacking and inline drawing metadata 2026-11-16 18:24:18 +01:00
alehelandClaude Opus 5.5 9087ce027e ODT: a new style derives from the file's style beside an unread namesake
A style WordCraft writes that the file didn't have (one made after reading)
is added as written, so one based on a read style whose WordCraft name is an
unread style of the file's (`MyCustom` beside `My_20_Custom`) derived from
that namesake. Its parent and next style now take the file's name, as text
written from the model does. `kept::read_names` gives the names unescaped;
the writer escapes them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 18:21:28 +01:00
alehelandClaude Opus 5.5 116914c8f2 ODT: text written from the model names the file's style beside an unread namesake
A file style the import read (My_20_Custom) whose WordCraft name (MyCustom) is
another of the file's styles the import didn't read keeps that namesake's own
definition. A paragraph or text span written from the model now names the
file's style it was read with, directly or as its automatic style's parent,
instead of resolving to the namesake.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 18:13:20 +01:00
alehelandClaude Opus 5.5 9b94448103 List item further paragraphs: fixes from review
- flow: each piece of a further paragraph split at a page break keeps its item.
- flow: body text resets the per-level item text positions, so a list starting with a
  header after an earlier, further-indented list keeps the header in its list.
- flow: a further paragraph in a table-style-formatted cell keeps its list_item marker.
- html: a further paragraph is written through para_html, keeping alignment and page break.
- markdown: a quoted list item's further paragraph joins the item with a line break, so the
  quoted list stays one list and keeps its numbers.
- odf: a further paragraph opening or closing a kept section ends the list run, as an item does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 17:44:17 +01:00
FredApps d60d1b0a45 Merge pull request #1868 from tsw2k/fix/docx-frame-shape
craft-docx: a frame preset shape is a border with a hole
2026-11-16 16:24:26 +01:00
FredApps bb965ed3c9 Merge remote-tracking branch 'origin/main' into t1729 2026-11-16 16:09:39 +01:00
alehelandClaude Opus 5.5 96320ea146 ODT: an edited style keeps its parent's and an unread namesake's file definitions
An edited style the file names as WordCraft does (`Eigen`) was skipped by
the rewrite, so its parent kept WordCraft's name (`BaseStyle`) instead of
the file's (`Base_20_Style`). It is now rewritten like any other.

A style the import didn't read whose name is the one WordCraft writes a
read style under (`MyCustom` beside `My_20_Custom`) took that style's edit
or deletion. It now keeps its own definition.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 15:21:24 +01:00
tsw2k 8b876291a1 craft-docx: a frame preset shape is a border with a hole
Moves the format part of storytold/wordcraft#6162 into craft-wordmodel,
craft-docx, craft-flow and craft-odf, where WordCraft's DOCX and ODT I/O now
live (#778).

A DrawingML `prstGeom frame` (a letterhead's page border) was read as a
rectangle, so its fill covered the whole page behind the text. It is now
ShapeKind::Frame, its border width read from `adj1` (capped, as a rounded
rectangle's corner is) and written back as the same preset.
connector::frame_width gives the border in points. Formats with no frame
shape (ODT and the other flow formats) get the freeform it draws: its
outline and, wound the other way, its hole, so the hole stays empty under
either fill rule.
2026-11-16 11:46:35 +00:00
tsw2k fe68ce8c51 craft-flow: narrow table columns keep their width on import
Moves the import part of storytold/wordcraft#4964 into craft-flow, where
WordCraft's RTF and ODT import now builds its tables (#778).

Import raised every column under 6 pt to 6 pt, so a form with many narrow
columns came out wider than its source. Columns over 1 pt now keep the
width the file gives; one of a point or less, none or not a number still
gives the table equal columns, so nothing below a point, negative or NaN
reaches layout.

craft-rtf merged grid columns under 6 pt that no row needed, because import
would widen them. With import keeping them, that merge only moved cell
edges, so it goes: grid columns merge only while there are over 63 or one
is a point or less.

Stacked on the craft-rtf column grid change.
2026-11-16 11:40:14 +00:00
FredApps cccb00b6b4 craft-odf: a group member's stored stacking order counts for the unset draw:z-index (wordcraft#2638)
unset_z_index only looked at the floating objects' orders, so a group
member without a stored order could be written below a member that has
one. It now also walks the groups' members.
2026-11-16 10:01:22 +01:00
Diego Guerini f8388e2293 craft-odf: an object without a stored stacking order is written above every stored one (wordcraft#2638) 2026-11-16 08:59:48 +01:00
batistalucasv 2e5e69091a craft-odf: preserve page background bitmap fill and legacy fallback (#1784)
- Preserves page background images and bitmap fills (`draw:fill="bitmap"`) alongside legacy `<style:background-image>` fallbacks on ODT export, preventing orphaned duplicate backgrounds and resolving naming collisions with header pictures.
- Reuses kept picture files or fill images with identical bytes on export instead of duplicating background files and definitions on every save.
- Allocates distinct fill names for replaced page pictures and maps colliding names in linear time.
- Falls back to legacy `<style:background-image>` when modern bitmap fill is missing or contains non-image bytes.
- Adds comprehensive round-trip tests in `crates/odf/src/text/tests_more/page_setup.rs`.
2026-11-16 00:41:54 -03:00
aiongg dffc61a7e0 Merge storytold main 832883b5 (sync 16 Nov)
961 upstream commits since 7bb6c900. Resolutions:
- Test-only conflicts: upstream tests from before the base that our side
  cut stay cut; tests new upstream are kept (audio aac/config, layout,
  encode_format; cms lutfile; media mux; print windows_native, ticket;
  update self_update; xml hostile).
- Code our side moved, with upstream's change carried to the new place:
  craft-media mux roll sample groups (mux/boxes.rs) and writer-start
  offsets with overflow checks (mux/progressive.rs); craft-print's
  shrink-to-fit scale guard (sheets/plan.rs); craft-update's nextest
  archive detection (self_update/detect.rs); craft-vectorcraft-format's
  Tail::write_to_with (container.rs); craft-i18n's pedantic fixes
  (bidi.rs, negotiation.rs).
- craft-ui: the old crate's modules stay removed; gpu_test_lock guarded
  their per-test wgpu renderers, which the snapshot kit does not have.
- New upstream tests in crates that build their integration tests into
  the library's test executable are modules of tests/main.rs (audio
  flac_decode and qoa_oracle, cms, docpath, pcraft-format,
  vectorcraft-format).
- The 22 new crates are optional members of the craft facade.
2026-11-16 01:52:09 +00:00
alehelandClaude Opus 5.5 9c27cebc14 ODT: a list item's further paragraphs stay paragraphs
LibreOffice writes an unnumbered list entry as an item's second paragraph.
The ODT reader joined it to the first with a line break, so a save could
bring the file back with the wrong paragraphs, and a list header got a
number. Such paragraphs are now read as paragraphs of their own, with no
number, at the item's text indent, and marked with the new
`ParaProps::list_item` (the flow model's `Para::item`).

- HTML and Markdown export keep the paragraph in its item, so one numbered
  list continues across it.
- Markdown `parse_list` joins a code block, quote or heading inside an item
  back to the item (also after a sublist), so it gets no number.
- The writers keep a paragraph in its item only while it sits at the item's
  text indent, so text outdented to the margin leaves the list.
- ODT written from the model puts a further paragraph inside its
  `text:list-item`.
- A level first used after an unnumbered paragraph keeps the file's label.

Ported from storytold/wordcraft#5723 after the readers and writers moved here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 21:57:23 +01:00
alehelandClaude Opus 5.5 ed8c7c2621 ODT: a style or list change keeps the file's other definitions
Any style or list change threw away every definition in the file's
office:styles and wrote them all from the model, which does not hold
everything: gradients, fill pictures, styles the model doesn't have and
the default style's settings were lost.

The import now records, per office:styles child, a hash of what the
writer would write for it (KeptXml::style_prints, replacing the single
styles_fp fingerprint) and which of the file's style names it read into
which style id (KeptXml::style_ids). A save rewrites only the
definitions whose hash changed, under the file's own names, escaped,
with parent and next style named as the file named them; a deleted
style stays deleted; everything else is written as read.

Ported from storytold/wordcraft#5702 (the ODT reader and writer now
live here).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 21:57:18 +01:00
kiwi4boy 8a26ca7e3f Merge remote-tracking branch 'origin/main' into math-ports 2026-11-14 12:39:05 -05:00
vangel76andClaude Sonnet 5.5 b6a2df0c1d docx: chart axis and series formatting
Add the series formatting (fill, line, markers, smooth, labels, number
format) and the category/value axis formatting (title, bounds, number
format, gridlines, tick labels, axis line) to the chart model, and read
and write them in the DOCX chart part. GraphicItem::Text gets an angle
for the rotated vertical axis title. With none of the new fields set the
chart part is written as before.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 11:27:03 +01:00
aiongg deeb91802f Lints: doc links, test lint allowances, struct update in tests, wildcard imports, dead code 2026-11-14 02:35:35 +00:00