Skip to content

v1.7.0

Choose a tag to compare

@github-actions github-actions released this 13 Nov 00:36
· 6 commits to main since this release

The workflow editor inside your own application

The editor is now a component any page can mount, and the workflow routes can be mounted under any prefix in your own FastAPI app. See Inside your own application.

Routes

  • workflow_router(models=None, process=True) builds the workflow routes. Mount them under any prefix with app.include_router(...).
    • models= loads models your app's own way.
    • process=False leaves out whole-source runs, for an app that runs jobs itself.
  • mozo's own server mounts the default router, so nothing changes for it.
  • The editor finds its files and its API from where it was served, so it works under any prefix, with or without a trailing slash, with no configuration.

Mounting the editor

import { mount } from "/workflow/assets/editor.js";
const editor = mount(element, { document: saved, toolbar: false });
  • getDocument() / setDocument(doc): read the workflow on the canvas, or open another.
  • test(file): run a test on a file and get the results back.
  • on("change", listener): called once each edit is done (not on every step of a drag).
  • destroy(): remove the editor.
  • Hide the toolbar: pass toolbar: false, or add ?toolbar=0 to the editor page's URL.
  • Isolated: the editor mounts in a shadow root, so your page's CSS and the editor's don't affect each other. Two editors on one page keep separate state.

New look

  • Bulma is gone. The editor has its own mz- prefixed styles, with dark mode and Heroicons. Its CSS drops from 706 KB to 28 KB.
  • Restyle it by setting any --mz-* token, or color-scheme, on the element you mounted it into.

Fixes

  • Missing nodes or ports: an edge to a node or port that doesn't exist is now left out and named, instead of silently freezing the editor.
  • Escape now works after clicking a node, and only affects the editor it was pressed in.

Full Changelog: v1.6.0...v1.7.0