This past week we released `Inline` mode in `v0.10.0` of `@makeswift/runtime`. `Inline` mode is a configuration option for `RichText` that allows you to edit text without affecting styles or HTML structure. It's great for editing the content of inline elements like buttons and links, and prevents you from creating hydration mismatch errors.
While implementing `Inline` mode, we reworked the architecture of the `RichText` control so that real-time collaboration is faster and rapid changes like holding `undo` are more performant.
To switch between `Block` and `Inline` mode, change your component registration like so:
ReactRuntime.registerComponent(Component, {
type: 'component',
label: 'Component',
props: {
- text: RichText(),
+ text: RichText({
+ mode: RichText.Mode.Inline,
+ }),
},
})
Under the hood, the `Text` component that ships with all sites uses the `RichText` control. After upgrading to `v0.10.0` and selecting a `Text` component, you'll be prompted to update the component in the right sidebar.
This update migrates data and renders the new version of the `Text` component with some small visual changes:
We have tested the upgrade extensively, but if you do see any changes other than the three listed above simply "cmd/ctrl + z" and reach out to us in Discord.
Don't have a Next.js project yet? Get started with our no code builder and extend when you're ready.