Repository navigation
Releases
0.5.2 - Images on touch screens
A fix for images on touch screens: they can be selected with a tap and resized with a finger.
Fixed
- Images on touch screens (#1): a tap selects the image without opening the virtual keyboard. It had stopped working with
prosemirror-view1.43 and later. - Images on touch screens: the resize handles have a larger touch area, and a drag cancelled by the browser no longer changes the size.
0.5.1 - Table handles fix
A fix for the table handles, which covered the row menu. Only the styles change.
Fixed
- Table handles: the handles of the column and of the table were drawn over the row menu when it opened upwards. They now stay under every menu and the find bar.
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.
0.4.0 - Dark theme and full screen
Dark theme, full screen, and an option to turn the Markdown shortcuts off. No breaking changes: the new toolbar item is on as soon as you update, the dark colors only when your page sets color-scheme.
Added
- Editor option
markdownShortcuts(defaulttrue):falseturns the Markdown shortcuts off, so#,>,*and the other Markdown characters are typed as text. Also a prop of the React, Vue and Svelte components. - Dark theme: every color of the toolbar, of the popovers and of
content.csshas a dark value, used when the page setscolor-scheme: dark(orlight darkto follow the system). Withoutcolor-scheme, and in browsers withoutlight-dark(), nothing changes. The gap cursor takes the color of the text. - Toolbar item
fullscreen, last in the default toolbar: the element that holds the toolbar and the editor fills the browser window, over the whole page (the browser's top layer, through the Popover API; older browsers:--stilo-z-fullscreen). Only the text scrolls: the toolbar and the status bar stay at the top and the bottom, with or withoutsticky. Esc in the editor leaves full screen, and the page scrolls back where it was. Meanwhile the page does not scroll and shows no scrollbar (classstilo-fullscreen-pageon<html>).ToolbarContextgainstoggleFullscreen()andisFullscreen(), andisActiveof a custom button receives the context as second argument.
0.3.1 - Package keywords
The package keywords name React, Vue, Svelte and Next.js, so that npm search finds the wrappers. No change in the code.
0.3.0 - Framework wrappers
Stilo now ships wrappers for React, Vue and Svelte, in the same package: npm install stilo-editor and import from stilo-editor/react, stilo-editor/vue or stilo-editor/svelte.
Added
- React wrapper,
stilo-editor/react: theStiloEditorcomponent with the default toolbar and theuseStiloEditorhook for a UI of your own. React 18 and 19, server-side rendering, marked'use client'for React Server Components (Next.js App Router). React guide - Vue wrapper,
stilo-editor/vue: theStiloEditorcomponent with the default toolbar and theuseStiloEditorcomposable for a UI of your own. Vue 3.4 and later, server-side rendering. Vue guide - Svelte wrapper,
stilo-editor/svelte: theStiloEditorcomponent for Svelte 5, withbind:editor, and the actionsstiloEditorWithUI(default toolbar) andstiloEditor(a UI of your own) for Svelte 4 and 5, also fromstilo-editor/svelte/action. Server-side rendering. Svelte guide - A guide for each framework, React, Vue and Svelte: every task with code in the idiom of the framework, from install to a UI of your own.
Changed
- The editable area has a small default padding (
12px 16px) and height (min-height: 6em), so an editor without styles of your own no longer has its text against the toolbar. Any rule of yours replaces them; if you put the padding on the container instead, set.stilo-content { padding: 0 }.
Fixed
- A read-only editor (
editable: false) can no longer be changed through the toolbar or the commands: a command that would change the content returnsfalse, also from.can(), and the toolbar disables its buttons, except find.setEditablenow emitstransaction, so the toolbar and your own buttons follow the switch. - After select all in a large document the toolbar refreshes about 10 times faster, so the selection shows sooner (50,000 paragraphs: 11 s → 1 s).
Full changelog: v0.2.1...v0.3.0
0.2.1 - Documentation
Documentation release: no code changes.
Changed
- Shorter README, quick start first. The full list of features, shortcuts and Markdown shortcuts moves to docs/FEATURES.md.
- New: CHANGELOG.md.
- The npm page links to the live demo as the homepage.
0.2.0 - Tables, images, find and replace
Second preview release. No breaking changes: with defaultExtensions() the new features are on as soon as you update.
Added
- Tables: insert from a grid, merge and split cells, header row and column, resizable columns, handles on rows and columns that select them and open their menu.
- Images: paste an image or a screenshot (embedded in the HTML, up to 5 MB by default), resize with side handles.
- Checklists, with the
[ ]and[x]Markdown shortcuts. - Code blocks, with an optional language (
class="language-js"). - Find and replace, with match case, whole word and an exact count of the matches.
- Word and character count:
getWordCount()and an optional status bar (createStatusBar). - Font family and font size in the toolbar.
- Text alignment and line spacing of paragraphs and headings.
- Text case: UPPERCASE, lowercase, Title Case, Sentence case, tOGGLE cASE.
- Paste from Word and Google Docs: real lists, column widths of tables kept, the body font, size and color dropped.
Changed
defaultExtensions()includes the new extensions. Each one can be turned off withfalse, e.g.defaultExtensions({ table: false }).- New dependency:
prosemirror-search.
Fixed
setHTML/setJSONwere slow on large documents while the selection was inside the editor.- Changes to every block of a large document (text case, replace all) took quadratic time.
- The
#heading shortcuts dropped the alignment and the line spacing.
0.1.0 - First preview
First preview release.
Added
Editorwith HTML and JSON in and out, a strict allowlist for tags, attributes and styles, undo and redo.- Text: bold, italic, underline, strikethrough, inline code, subscript, superscript, text color, highlight, clear formatting.
- Links, with a popover and a bubble to open, edit or remove them.
- Blocks: paragraphs, headings 1–6, quotes, horizontal lines, line breaks, moving blocks up and down.
- Bulleted and numbered lists.
- Markdown shortcuts as you type, keyboard shortcuts for every command.
- Paste cleanup: pasted HTML is cleaned up, plain text lines become paragraphs.
- Default toolbar (
stilo-editor/ui): sticky option, keyboard navigation, special characters and emoji picker.