Files
hyperframes/packages
Miguel Angel Simon Sierra 38768e1456 feat(studio): edit and style text in the preview
Double-press a text element in the canvas and the caret opens where you
pressed, in the element itself rather than in a panel. Select characters
and a small toolbar offers colour, bold, italic and underline, applied to
exactly those characters.

Styling text needed a capability Studio did not have. The patch vocabulary
was inline-style, attribute, html-attribute and text-content, and
text-content assigns textContent; the text-field model escapes markup on
the way out and refuses a change in child structure. No route existed for
a span to reach a composition file.

Adds a rich-text operation that has one, guarded by a single sanitiser in
packages/core called on both ends of the trip: in the browser so the
preview shows what will be saved, and on the server because that is where
the file is written. Tags and style properties are a small allowlist, and
an unexpected tag loses its formatting rather than its words.

Styling is applied by reading the element into a flat list of runs and
rebuilding it, not by wrapping a DOM range. Replacing a colour, removing
one, and styling across an existing run stop being special cases, and the
markup cannot grow with repeated edits. In a flex or grid container the
runs go inside one wrapper so a coloured word cannot reflow the element.

Also fixes the keyboard: the shortcut guards matched contenteditable=true
only, so playback shortcuts ate letters typed into the composition.
2026-08-07 12:01:57 -07:00
..
2026-08-07 15:31:57 +00:00
2026-08-07 15:31:57 +00:00
2026-08-07 15:31:57 +00:00
2026-08-07 15:31:57 +00:00
2026-08-07 15:31:57 +00:00
2026-08-07 15:31:57 +00:00
2026-08-07 15:31:57 +00:00
2026-08-07 15:31:57 +00:00
2026-08-07 15:31:57 +00:00