Skip to content

0.3.0 - Framework wrappers

Choose a tag to compare

@kojak8791 kojak8791 released this 20 Oct 13:46
· 32 commits to main since this release
Immutable release. Only release title and notes can be modified.

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: the StiloEditor component with the default toolbar and the useStiloEditor hook 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: the StiloEditor component with the default toolbar and the useStiloEditor composable for a UI of your own. Vue 3.4 and later, server-side rendering. Vue guide
  • Svelte wrapper, stilo-editor/svelte: the StiloEditor component for Svelte 5, with bind:editor, and the actions stiloEditorWithUI (default toolbar) and stiloEditor (a UI of your own) for Svelte 4 and 5, also from stilo-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 returns false, also from .can(), and the toolbar disables its buttons, except find. setEditable now emits transaction, 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