Skip to content

1.4.0

Choose a tag to compare

@mittwald-machine mittwald-machine released this 30 Sep 08:42
· 108 commits to main since this release
f41f796

Select all in menus and filters, file uploads in the MarkdownEditor

Highlights

  • ContextMenu gets showSelectAll for multiple selection, and List filters offer "Select all" from six values on (#3274).
  • MarkdownEditor takes files by drop, paste or a toolbar button and inserts them as markdown at the cursor (#3265).
  • Image has rounded corners by default; withBorder only draws the border now, in a quieter color (#3266).
  • CopyButton gets onCopy, called with the copied text once it is in the clipboard (#3282).
  • Action with a bare closeOverlay closes the overlay it sits in, whatever component that is (#3191).
  • The upgrade and list commands of @mittwald/flow-codemods report which peer ranges the Flow packages ask for (#3204).

Select all in ContextMenu and List filters

Picking all but one value of a long filter used to mean clicking almost every option. With showSelectAll, a ContextMenu in selectionMode="multiple" starts with a "Select all" entry. It selects every enabled item, reads "Deselect all" once everything is selected, and shows as indeterminate for a partial selection. Each click fires onSelectionChange once with the full set.

List filters in some mode turn it on from six values on, both in the filter menu and in the all-filters modal. MenuItem gets an isIndeterminate prop for the same state. An older host ignores showSelectAll and shows no entry.

<ContextMenu selectionMode="multiple" showSelectAll>
  <MenuItem id="web">Webspace</MenuItem>
  <MenuItem id="mail">Mail</MenuItem>
  <MenuItem id="db">Database</MenuItem>
</ContextMenu>

File uploads in the MarkdownEditor

Pass uploadFile and the MarkdownEditor accepts files dropped onto it, pasted into it, or picked with the new attachment button in the toolbar. A placeholder goes to the cursor right away. When your promise resolves, it becomes an image embed or a link; when it rejects, the placeholder disappears. The upload itself stays with you — endpoint, auth and error handling — while Flow handles the interaction and the screen-reader announcements. It works in mStudio extensions too.

<MarkdownEditor
  accept="image/*"
  uploadFile={async (file) => ({ url: await upload(file) })}
>
  <Label>Message</Label>
</MarkdownEditor>

MarkdownEditor with the attachment button in the toolbar

Image corners and borders

withBorder now only draws the border. The new withRoundedCorners prop (default true) controls the corner radius on its own, so every Image is rounded unless it opts out. The border uses the same color as Separator and no longer stands out in dark mode.

Image by default, with withBorder, and with withRoundedCorners={false}

Smaller additions

  • CopyButton calls onCopy(text) after a successful copy and not when copying fails, so it counts copies, not clicks. It works in mStudio extensions as well.
  • <Action closeOverlay> closes the nearest enclosing overlay. A dismiss action no longer has to name the surrounding component; an explicit name like closeOverlay="Modal" still wins.
  • A new AIHosting icon, for AI Hosting specifically. Sparkles stays the general AI icon.
  • npx @mittwald/flow-codemods@latest upgrade and list <revision> print the peer ranges of the Flow packages you use, marked required or optional, before the install. list --json carries them as peers.

Migrations

Image without withBorder is rounded now. To keep square corners, pass withRoundedCorners={false}. No other code change is required — see MIGRATION.md.

- <Image src={src} alt="" />
+ <Image src={src} alt="" withRoundedCorners={false} />