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.
craft-flow
The model every text format maps to and from: a Flow is blocks, a block a paragraph (Para:
a Kind — normal, heading, title, quote, code line, rule — list membership, alignment, spacing
and formatted Inline spans: text, pictures, links, bookmarks, fields, notes, equations, ruby,
charts, shapes) or a table (FTable of Cells holding blocks), with the document's Meta.
to_doc and from_doc convert a flow to and from a craft_wordmodel::Document. A format reader
builds a flow and calls to_doc; a writer calls from_doc (or from_doc_with and FlowOpts for
what that format keeps: fields, boxes, paragraph formatting, tracked changes) and walks the flow.
Formats that keep more than the flow holds (ODT) carry it in the optional fields (extra,
kept, …), which the plain formats leave empty.
use craft_flow::{FBlock, Flow, Fmt, Inline, Kind, Para, from_doc, to_doc};
let p = Para { kind: Kind::Heading(1), inlines: vec![Inline::Text("Title".into(), Fmt::default())], ..Default::default() };
let doc = to_doc(&Flow { blocks: vec![FBlock::Para(p)], ..Default::default() });
let back = from_doc(&doc);
assert!(matches!(&back.blocks[..], [FBlock::Para(p)] if p.kind == Kind::Heading(1) && p.text() == "Title"));
Also here: picture sniffing and sizing (sniff_image, image_px, make_img), CSS colours
(parse_color), base64 and data: URIs, list labels (ListCounter), and the one-warning-per-kind
report of what an importer leaves out to stay within a limit (Dropped, begin_import,
dropped).
Provenance
WordCraft's crates/formats/src/model (at 07f97737), moved as it is onto craft-wordmodel.
Image decoding for re-encoding (decode_bounded) stays with the RTF writer that needs it.