Commit Graph
707 Commits
Author SHA1 Message Date
aiongg 977b4b26f3 Integration: #753 Fixed Width columns resize the frame to fit them; columnWidth and firstBaselineMin are range-checked 2026-10-13 19:32:38 +00:00
aiongg 1907d14699 Merge #753: Text Frame Options laid out as InDesign's: columns type and width, inset link, Ignore Text Wrap, Baseline Options 2026-10-13 19:31:44 +00:00
aiongg 0c45a8420f Merge t13-epub: EPUB/HTML export PRs #785 #787 #783 #789 #779 #780 #782 #791 #121 2026-10-13 19:23:54 +00:00
aiongg 1486f82212 Merge #782: EPUB: the navigation lists the headings, with a title in the book's language
# Conflicts:
#	crates/engine/src/cmd/export.rs
#	crates/epub/src/lib.rs
2026-10-13 19:14:13 +00:00
aiongg 033611d518 Integration: cargo fmt 2026-10-13 19:09:21 +00:00
aiongg 6477435e81 fix(transform): rotate and flip turn about the chosen reference point 2026-10-13 19:08:36 +00:00
aiongg ee2c450829 Merge #789: Styles: name the attributes in the params docs, and a wrong one in the command's error
# Conflicts:
#	crates/engine/src/cmd/style.rs
2026-10-13 19:07:52 +00:00
aiongg 6eae3620ed Integration: #783 reads the cover image with a size cap (256 MiB), devices included 2026-10-13 19:07:02 +00:00
aiongg 3cb3f342c8 Integration: #812's test (overset preflight names the page of a frame in a moved group) 2026-10-13 19:07:02 +00:00
aiongg 73112e882f Merge #783: EPUB: real modified time, a stable unique identifier, and a cover image file
# Conflicts:
#	crates/engine/src/cmd/export.rs
#	crates/epub/src/lib.rs
2026-10-13 19:06:49 +00:00
aiongg 5917b24aaa Integration: #819 a pasted missing graphic always gets a fresh asset id from the target 2026-10-13 19:06:46 +00:00
aiongg 0016b8260e Merge #819: Keep a missing graphic missing when it is pasted into another document (#720)
# Conflicts:
#	crates/engine/src/cmd/object.rs
2026-10-13 19:06:14 +00:00
aiongg 8f54d1cce4 Integration: #787 refuses bitmap-only fonts for embedding, and styles name the face's numeric weight 2026-10-13 19:05:28 +00:00
aiongg 11e4a7f60e Merge #787: EPUB/HTML: generic font fallback from the font's class, and optional font embedding
# Conflicts:
#	crates/engine/src/cmd/export.rs
#	crates/epub/src/lib.rs
2026-10-13 19:04:24 +00:00
aiongg 5f3a2fbb61 Merge #785: EPUB/HTML: no file name as alt text, readable image names in the package 2026-10-13 19:02:00 +00:00
aiongg b4f7286482 Merge text-autosize: opening a file keeps its auto-size frame sizes (#632)
# Conflicts:
#	ROADMAP.md
#	crates/engine/src/cmd/interchange.rs
#	docs/gaps.md
#	docs/target-app-parity.md
2026-10-13 18:40:15 +00:00
aiongg 935741d47c Text frames: opening a file keeps its auto-size frame sizes 2026-10-13 18:40:01 +00:00
MarekSpodBiedry ec4ff485df Keep a missing graphic missing when it is pasted into another document (#720) 2026-10-13 18:43:16 +02:00
aiongg fca75a3302 Merge locked-paths: tests for path edits on locked layers and groups (#735)
# Conflicts:
#	crates/ui-egui/src/panel_docking_tests.rs
2026-10-13 14:58:15 +00:00
aiongg e08f3c5997 test(paths): path edits on a locked layer change nothing (#735) 2026-10-13 14:51:53 +00:00
Gert Pellin 2a3d1dc183 Styles: name the attributes in the params docs, and a wrong one in the command's error (#777)
- describe style.paragraph.create (and .edit, style.character.create,
  .edit) gave chars?: {…} and para?: {…}. The descriptions now say they
  take type.char's and type.para's attributes and name the common ones.
- A wrong attribute gave "invalid parameters for `style`: unknown
  attribute `font`". The error now names the command and the group,
  and the attribute meant (nearest name, or one the key starts or ends)
  or else lists them all: "invalid parameters for
  `style.paragraph.create`: chars: unknown attribute `font`; did you
  mean `fontFamily`?". The suggestion comes from set_json, so
  type.char, type.para and find.change get it too.
- chars or para that isn't an object is an error instead of ignored.

Fixes #777
2026-10-13 16:48:27 +02:00
aiongg d9c766dd16 Integration (editor-undo): Story Editor test focuses the text input, not its text run; paste test sets its stale selection after Undo restores the selection 2026-10-13 14:47:23 +00:00
Gert Pellin 6fafa9b0a3 EPUB/HTML: generic font fallback from the font's class, and optional font embedding (#775)
- Every font-family fell back to serif, sans-serif typefaces included.
  The fallback now comes from the font's classification (PANOSE, OS/2
  class, name: serif, sans-serif, monospace, cursive, fantasy), passed
  in by the engine; without one, from the family name.
- file.exportEpub takes embedFonts: the faces the stylesheet names are
  packaged (OEBPS/fonts, @font-face, manifest items with font/ttf, otf,
  woff or woff2). Faces that aren't available, whose licence (OS/2
  fsType) forbids embedding, or that sit in a font collection are left
  out and listed in the new warnings array. Fonts are packaged whole;
  subsetting is a follow-up.

Fixes #775
2026-10-13 16:41:08 +02:00
Gert Pellin f420639276 EPUB/HTML: no file name as alt text, readable image names in the package (#774)
- An image without alt text (Object Export Options) got its file name as
  alt, which a screen reader then reads aloud. It is now decorative
  (alt=""), and file.exportEpub lists those images in a new warnings
  array so they can be given alt text.
- Images and media were packaged as images/<asset id>.<ext>. They are
  now <name>-<asset id>.<ext>, the name from the original file name
  (lowercase ASCII); the id keeps two files of the same name apart.

Fixes #774
2026-10-13 16:35:36 +02:00
Gert Pellin 7be88b4484 EPUB: real modified time, a stable unique identifier, and a cover image file (#771, #773)
- dcterms:modified was always 2026-01-01T00:00:00Z. It is now the
  export time (from the command; on the web, and in the crate without
  one, the document's last save or creation time).
- The default dc:identifier was urn:designcraft:<title>, shared by
  books with the same title. It is now a urn:uuid derived from the
  title and the document's creation time: stable from export to export,
  different between documents. file.exportEpub takes identifier to set
  it (an ISBN, say).
- file.exportEpub takes coverImage, a PNG or JPEG file used as the
  cover (cover-image); a JPEG is packaged as cover.jpg/image/jpeg.

Fixes #771
Fixes #773
2026-10-13 16:33:34 +02:00
aiongg d087c035b2 Merge recovery-dirs: fix(recovery): an explicit recovery folder never overwrites or deletes another run's checkpoints (#715) 2026-10-13 14:32:52 +00:00
aiongg 4e3a5364e5 Merge docx-tables: fix(textimport): Word table cells skip deleted text and field codes; Normal comes in as its own style (#721, #722) 2026-10-13 14:31:03 +00:00
aiongg a39bb70c5b Merge locked-paths: fix(paths): path edits refuse a path on a locked layer or in a locked group (#735); fix(properties): links to other panels open them when panel docking is on (#736) 2026-10-13 14:28:19 +00:00
aiongg a418a8a309 Merge editor-undo: fix(editing): Story Editor stays with its document; Undo restores the selection from before the command (#729, #716) 2026-10-13 14:27:42 +00:00
aiongg 3d3f02e621 Merge save-result: fix(file): saving never reports success without a file (#741, #708) 2026-10-13 14:27:03 +00:00
Gert Pellin 1fc302f695 EPUB: the navigation lists the headings, with a title in the book's language (#769, #770)
nav.xhtml had one entry per placed story, labelled with its first
paragraph (body text too), and always the title "Contents".

- Headings (h1-h6) get an id in the EPUB, and the navigation lists the
  h1-h3 headings of the stories in reading order, nested by level and
  linked to them. A document without headings keeps one entry per
  story (its first paragraph).
- The navigation's title follows the language (Inhoud, Inhalt, Table
  des matières, Índice, Indice, 目次, 目录; Contents otherwise), and
  file.exportEpub takes tocTitle to set it.

Fixes #769
Fixes #770
2026-10-13 16:26:32 +02:00
aiongg debec75166 fix(textimport): Word table cells skip deleted text and field codes; Normal comes in as its own style (#721, #722)
Table cell paragraphs go through the same run and inline path as body paragraphs, so deleted and moved-from text and field instructions stay out of cells, and field results, tabs and breaks come in.

Word's Normal imports as a paragraph style named Normal whose definition is w:docDefaults with Normal's own properties on top; paragraphs without a style use Word's default paragraph style. A styleMap entry can still map Normal to [Basic Paragraph].
2026-10-13 14:23:08 +00:00
aiongg 4eb786e880 fix(recovery): an explicit recovery folder never overwrites or deletes another run's checkpoints (#715) 2026-10-13 14:22:58 +00:00
aiongg eb83d23040 fix(file): saving never reports success without a file (#741, #708)
to_bytes returns a Result and every caller propagates it, so a document
that can't be written is an error: the existing file, the unsaved state
and the recovery checkpoint stay. Asset entries near or over 4 GiB are
written with zip64 sizes. On the web, Save marks the document saved only
after the browser download has started.
2026-10-13 14:22:27 +00:00
aiongg 8817e07013 fix(paths): path edits refuse a path on a locked layer or in a locked group (#735) 2026-10-13 14:19:56 +00:00
aiongg 2c7e3e53f0 fix(editing): Story Editor stays with its document; Undo restores the selection from before the command (#729, #716) 2026-10-13 14:19:00 +00:00
aiongg 73af5d7f63 Merge script-dollar: GREP replacements like $1 stay literal in scripts (#749)
# Conflicts:
#	ROADMAP.md
2026-10-13 13:01:31 +00:00
aiongg d227ee84e9 fix(script): only a well-formed $N reference is replaced; $$ is a literal $ (#749) 2026-10-13 13:00:34 +00:00
moppeeerandClaude Opus 5.5 61ea089149 feat(ui): Text Frame Options laid out as InDesign's, with its General options
InDesign's Text Frame Options has a section list (General, Baseline
Options, Column Rules, ...). General holds Columns (Fixed Number / Fixed
Width with Number, Width, Gutter), Balance Columns, Inset Spacing as a
2x2 grid with a link button, Vertical Justification and Ignore Text
Wrap; Baseline Options holds First Baseline Offset and Min. DesignCraft
showed one flat list without the columns type, width, balance, link,
ignore-wrap or baseline settings, although the model keeps them.

- dialogs: a section list (General, Baseline Options, Column Rules);
  General as above (Width shows what Fixed Number columns get, editable
  for Fixed Width; a side typed while linked sets all four insets);
  Baseline Options; Column Rules as before. Enum captions translated.
- OK sends the new fields only when edited, as before.
- engine: `object.textFrameOptions` takes `columnWidth` (Fixed Width)
  and `firstBaselineMin`, which compose already honours.

LYH Studio episode 14 sets two columns (9:45) and a 0.1875 in inset
(10:57) here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 14:46:54 +02:00
moppeeer a255dc99b5 feat(tools): resize a selected placed graphic by its own handles (#699)
With a placed graphic selected (Direct Selection, or the content
grabber), the graphic's own brown bounding box has eight handles:
dragging one resizes the image inside its frame (Shift keeps its
proportions, Alt from its centre) and leaves the frame as it is.

- tools: a content-handle hit test on the selected graphic's bounds
  (after the frame's anchors under Direct Selection), a ContentResize
  drag previewing `transform.set {content, bounds}`, the handle cursors,
  and the content ghost while dragging. The frame's handles don't resize
  the frame while its graphic is selected.
- engine: `transform.set` takes `bounds` for content: the graphic's new
  bounding box on the spread (normalized, never empty).
- canvas: the brown content box gets its handles; the frame's handles
  are hidden while the graphic is selected.

(cherry picked from commit 8e0e6c2f2e)
2026-10-13 12:29:32 +00:00
aiongg 1533665af8 Merge pr/688: Create Outlines makes one compound path per line, so Ungroup separates the lines (#688) 2026-10-13 12:28:22 +00:00
aiongg 3f489a1273 Merge pr/689: Ungroup leaves frames with pasted-in content whole; name them by their shape (#689) 2026-10-13 12:27:49 +00:00
aiongg 0eb1ecfe1b Merge pr/691: Copy a selected placed graphic on its own, so Paste Into puts the whole image in place (#691) 2026-10-13 12:27:29 +00:00
aiongg 23eb86988f Merge pr/704: fix(tables): keep each table anchor in its own paragraph (#704) 2026-10-13 12:26:51 +00:00
aiongg d234ede3a2 Merge craft-atomic: Save: delegate atomic writes to craft-atomic 2026-10-13 12:12:16 +00:00
aiongg 004e585e34 Merge upstream main e862e0a6 into next 2026-10-13 12:11:25 +00:00
aiongg e81a21e645 refactor(save): delegate atomic writes to craft-atomic
The engine's atomic module keeps its functions and signatures and delegates to craft-libs/craft-atomic (pinned to e9546e19), so every save and export caller is unchanged. write_atomic_with also turns a panicking writer into an error, so its temporary file is removed. Recovery checkpoints and package output keep their own writers, which replace links instead of following them.

On Unix, new files follow the umask and replaced files keep their permissions.
2026-10-13 11:56:42 +00:00
moppeeerandClaude Opus 5.5 6c65a55905 fix(object): Ungroup leaves frames with pasted-in content whole
A frame holding items pasted into it isn't a group. Ungroup took it
apart like one, leaving its content loose and losing the clipping shape,
and the Properties panel called it "Group" with an Ungroup quick action.
As in InDesign, Ungroup now only takes real groups apart; other objects
stay as they are and stay selected (Ungroup used to clear them from the
selection). Such frames are labelled by their shape (<ellipse>, ...), so
Properties shows "Ellipse" with Convert Shape.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 11:01:30 +02:00
moppeeerandClaude Opus 5.5 f55b94f3ff fix(type): Create Outlines makes one compound path per line
As in InDesign, outlining a text frame gives a group with one compound
path per line (split further by text colour within a line), so Ungroup
leaves each line on its own: LYH Studio episode 14 ungroups the outlined
title at 4:56 to tighten the space between its lines before making one
compound path again. A single line in one colour stays a single compound
path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 10:21:39 +02:00
Noah Scholz 65bb4e3f66 fix(tables): keep each table anchor in its own paragraph
Backspace at the start of the second of two consecutive tables merged their
anchor paragraphs: Story::delete kept one table id, the other table was
dropped and the paragraph held two anchors. Pasting a table next to an anchor
replaced the existing table the same way, and pasting several paragraphs
right before an anchor left its table unreferenced. Saving succeeded;
reopening failed with "paragraph must hold exactly one anchor".

fix_tables now splits a table paragraph that holds further anchors, so every
anchor gets its own paragraph again. delete and insert_story tell it which
table each surviving anchor belongs to (fix_tables_with), and insert_story
fixes tables up once after the whole paste instead of after every run.

Regression tests in doc (Backspace between tables, deleting the middle of
three, paste before/after an anchor, paragraphs pasted before an anchor) and
engine (text.delete and edit.paste through commands, then a file round-trip);
all failed before the fix.

Claude-Session: https://claude.ai/code/session_01La6SDgsmdZfgfDDmx3wiGU
2026-10-13 08:17:51 +00:00