Skip to content

v4.1.0 – Visual Editor Upgrades

Latest

Choose a tag to compare

@alexcibotari alexcibotari released this 05 Oct 13:23
· 2 commits to main since this release

New Features

  1. Edit blocks from the page preview
    When you select a block in the Visual Editor preview, a small toolbar now appears on it. You can move the block up or down, duplicate it or delete it (delete asks you to click twice) without going back to the form. The form uses the same rules and keeps the changes as unsaved edits until you save.

  2. Flexible preview URLs
    Environment URLs now accept placeholders: {fullSlug}, {slug}, {parentSlug}, {documentId}, {locale} and {locale/}. The locale can even go in the host, as in https://{locale}.site.com/{slug}. Each URL field shows an example of the page it will open, and unknown placeholders are rejected. URLs without placeholders work as before.

  3. Clearer preview connection
    The preview tells you what's going on instead of failing silently:

    • If the page doesn't connect within a few seconds, a hint lists what to check.
    • The status tooltip shows which SDK version connected.
    • A warning appears when the page loads content from a different Localess deployment.
    • A notice appears when the page shows a different document than the one you're editing, with a button to go back.
    • Reloads and in-page navigation reconnect automatically.
  4. Raw translation export
    A new endpoint, GET /api/v1/spaces/:spaceId/translations/:locale/values, returns only the values actually stored for a locale, without fallback filling. You can pull a file, edit it and push it back without the fallback language's text being saved as translations. The CLI uses it for localess translation pull --raw.

  5. Choose whether to overwrite when translating a locale
    Translating a whole locale can now replace existing values instead of only filling the empty ones.

Improvements

  1. Sync script for multi-document pages and debugging

    • Editor events (save, publish, unpublish, input, change) now include documentId, so a page that renders several documents (for example a shared header plus the page) updates only the matching one.
    • on() and onChange() now return an unsubscribe function, and there is a new off().
    • Console logs and snackbar messages now only show when debug mode is on (data-debug on the script tag).
  2. Shareable space links
    The URL now decides which space is open. A link to another space opens that space instead of whatever was selected last. Links to deleted or unknown spaces redirect cleanly with a warning.

  3. More reliable live data
    The schema and document listeners now follow the selected space, retry with exponential backoff after an error and show a notification when something goes wrong.

  4. Correct translatable flags
    Reference, References, Schema and Schemas fields can no longer be marked translatable. Their value is the same in every locale, and nested blocks translate their own fields. Schemas pushed through the API have the flag removed, and old flags already stored are ignored. Fields that aren't translatable are read-only outside the default locale.

  5. Safer schema push
    Schema push (POST /api/v1/spaces/:spaceId/schemas) rejects Schema/Schemas fields that have no allowed schemas, because the editor couldn't add any block to them. The schema editor now requires this list too. Imports still accept such fields.

⚠️ Breaking Changes

  1. Translation push: delete-missing was split in two
    The type field of POST /api/v1/spaces/:spaceId/translations/:locale no longer accepts delete-missing. Use one of:

    • delete-missing-key deletes the whole translation, in every locale, for each ID not in values. Run it with a complete file, normally the source locale.
    • delete-missing-value removes only the pushed locale's value. Other locales keep theirs.
  2. Translation push response is simpler
    The counts object is gone, and ids is now a flat string[] with only the IDs that the request's type wrote (or would write, on a dry run). update-existing skips values that didn't change.

  3. schema is no longer a reserved field name in content
    A block's schema is now stored only in _schema, and the API no longer returns the legacy schema key. Blocks saved under the old key are still read, and they move to _schema the next time they're saved. If your frontend reads block.schema, switch it to block._schema.

Please upgrade @localess/cli and your Localess SDKs together with this release.

Bug fixes

  • CDN cache redirects now URL-encode the path and query values they copy into the redirect URL, so a crafted value (for example en&token=x) can no longer add parameters to the redirect.
  • Unsaved changes in the document editor are no longer lost or overwritten during quick edits or while the preview is connected.
  • Cloud Build now enables all the Firebase APIs it needs (Hosting, Firestore, Rules, Identity Toolkit) and no longer needs the Billing API.
  • The Docker image now uses Java 21 for the Firebase emulators.
  • Updated Firebase and AngularFire.