Repository navigation
0.5.0 - Compact toolbar and UI polish
A compact toolbar for phones and narrow panels, figures with captions and an image dialog, and a lighter look for the popovers. No breaking API changes: the new toolbar item image is on as soon as you update, and --stilo-color-border no longer draws the borders of popovers and fields.
Added
- Figures: an image in its own block with a caption under it (
<figure>,<figcaption>). The caption is written in the document and takes every formatting of the editor (bold, links, colors, …) and line breaks, but no blocks or images: pasted blocks become lines. Enter leaves the caption for a new paragraph, Backspace at its start selects the figure. An empty caption shows only while its figure is selected, with the hint of the newImageoptioncaptionPlaceholder(default'Caption'). - Toolbar item
image(aftertablein the default toolbar): a dialog that inserts a figure from an address or a local file (embedded as a data URL), with a preview, alternative text, title, width and a plain-text caption. With an image or a figure selected it edits it instead, without the caption, which is edited in the document. An edit button in the corner of the image under the mouse opens the same dialog.ToolbarContextgainsopenImageDialog(). - Commands
insertFigureandupdateImage, with the typesImageAttributesandFigureAttributes. - Drop of image files: embedded where they are dropped, with the size limit and the
imageRejectedevent of paste. - Compact toolbar for phones and narrow panels: the toolbar option
layout: 'compact', or'auto'to switch below the widthcompactBelow(default 576 px). Undo, redo, bold, italic and four group buttons (Text, Paragraph, Insert, More) that open their items in a second row; a row that does not fit scrolls sideways. Bigger buttons on touch screens. The optioncompactarranges the items in your own way (DEFAULT_COMPACT_TOOLBAR, typesCompactToolbarandCompactToolbarGroup). - Documentation of your own extensions (API.md §4.1 and the framework guides): existing ProseMirror plugins, shortcuts and input rules go in through
extensionswhen the editor is created, and your commands get their types.
Changed
- Touch screens: the toolbar buttons no longer keep the hover color after a tap, and no longer flash when tapped.
- A lighter look for the popovers, the find bar and their forms: no borders, popovers of translucent glass with a blur and a deeper shadow, text fields that stand out by a slightly darker background (lighter in dark) and show a ring when focused, flat secondary buttons. Fields and form buttons have one height everywhere (26px), whatever the font and line height of the page; labels and other secondary text are 1px smaller than the text. Smaller image dialog and character picker; the table size grid has no borders. New custom properties
--stilo-color-popover-bg,--stilo-color-field,--stilo-color-button,--stilo-color-button-hover,--stilo-color-ringand--stilo-popover-blur;--stilo-color-borderno longer draws popover and field borders. - HTML with a
<figure>holding an image loads as a figure; before, the image became an inline image and the caption a paragraph. maxInlineBytesalso limits thedata:URLs of dropped files,insertFigureandupdateImage.- After a redo, the cursor goes next to the change instead of selecting again the text that was selected (prosemirror-history 1.5.2).
- Tested with prosemirror-view 1.43, prosemirror-schema-list 1.6.1, prosemirror-inputrules 1.7, prosemirror-history 1.5.2, prosemirror-model 1.25.13, prosemirror-transform 1.12.7 and DOMPurify 3.4.18 (security fixes), the latest versions in the ranges of
stilo-editor.
Fixed
- Checklists: Enter in the middle of a checked item made the second half unchecked with prosemirror-schema-list 1.6.1 or later, which new installs get. It stays checked again.