Scrivito JS SDK 1.4.0 Is Available

Editing interface improvements

Changes dialog displays last editor

On the changes dialog of a working copy, the individual items now include the name of the user who most recently edited them. So, should questions arise regarding the changes made to a page (for example when publishing), instead of navigating to the page and opening its properties, you can simply use the changes dialog to determine the person most recently involved.

Binaries can be renamed

You asked for this, and now it’s possible: Images and other binaries can be renamed. Just open the Content Browser, find and select the image to rename, and click the pen button next to the name!

Content Browser opens link sources in new window

In the page properties, on the “Linked by” tab of a page, the Scrivito UI now opens a source page in a new window instead of navigating the UI to this page. This way, the Content Browser doesn’t need to be reopened to visit another linking page.


Content Browser is faster with large SVGs and GIFs

Content Browser users will no longer experience slowdowns when scrolling through SVG and GIF image collections containing large files. If an SVG or GIF is too large to be shown as a thumbnail, the Content Browser now displays a simple placeholder instead.

Working copies sidebar panel remembers scroll position

For better usability, the scroll position of the working copies panel in the sidebar now stays in effect when closing and reopening the sidebar. Previously, the scroll position was lost on every close.

API improvements

Customizable page menu

Customizing Scrivito’s top-right menu can make the life of editors easier and increase productivity. Using our new API, Scrivito.extendMenu, you can now add your own commands, links, custom dialogs (see below), etc., to this menu.

The new API in action.

Custom dialogs

For adding custom functionality to Scrivito’s editing interface, the SDK now provides a function for opening dialogs with custom content, Scrivito.openDialog. Please refer to the API documentation for details about this new function.

Changes to the Scrivito.urlFor API

With Scrivito.urlFor, the fragment key in the options prop (for specifying the hash value to be appended to the URL) has been renamed to hash; fragment is now deprecated.
If the target is a Scrivito.Link, urlFor now includes the link’s query and hash information in the returned URL unless they are overridden by the options. So, if you don’t want urlFor to append a query or hash to the URL, use { query: '', hash: '' } as the value of options.

Introducing preloading

In conjunction with pre-rendering, the new Scrivito.preload API serves to pre-warm the Scrivito cache. This speeds up the process of making a pre-rendered page interactive and avoids flicker when changing from the pre-rendered HTML markup to the live React page. To support this preloading, the Scrivito.renderPage API now returns a preloadDump, which contains all the CMS content needed for rendering the page concerned. The dump can be stored along with the pre-rendered HTML markup and be used later with Scrivito.preload.

As prerendering is a brand new feature, neither usage examples nor a tutorial are available as of now but will be soon!

Links now have a “rel” attribute

Scrivito’s Link objects now have a rel attribute which can be set using the API.

New API method Widget#destroy

For programmatically deleting widgets from pages more easily, the Widget#destroy method has been provided. It allows you to remove a widget from the widgetlist attribute containing it without having access to this attribute.

More flexible widget hierarchy restrictions

Previously, when defining a widget class using createWidgetClass or provideWidgetClass, instances of this widget could (and still can) be restricted to a single parent widget class using the onlyInside parameter. For example, if you wanted ButtonWidgets to be contained only in BoxWidgets, you would specify onlyInside: "BoxWidget" for the ButtonWidget class.
Starting at this release, it is now possible to alternatively specify a list of parent widgets instead of just a single one:
onlyInside: ["BoxWidget", "SectionWidget"]

SDK package is significantly smaller

The Scrivito JS SDK is now compiled with webpack 4. Compared to webpack 3, the package size is around seven percent smaller now, causing it to be downloaded faster.

Bugfixes

Scrivito.LinkTag no longer accepts a binary as the link destination

The Scrivito.LinkTag component erroneously allowed specifying a Scrivito.Binary as the value of the to prop. The LinkTag was even rendered, but the link was not followed when clicked. The Binary value type is now refused and throws an error.
If you have been using this combination in your code, please use Scrivito.urlFor instead to obtain the URL of a binary value.