How is your experience with the OutSystems Community?
flowcraft
Reactive icon

FlowCraft

Stable version 1.0.1 (Compatible with OutSystems 11)
Uploaded
 on 27 Oct (14 hours ago)
 by 
0.0
 (0 ratings)
flowcraft

FlowCraft

Documentation
1.0.1

Overview

FlowCraft is a drag-and-drop canvas editor block for OutSystems 11 Reactive Web apps. Use it to build flows, diagrams, resumes, UI mock-ups and mind maps, then save them as JSON or export them as PNG.

  • Add cards, text, 14 shapes, images and your own HTML
  • Drag, resize, scale and rotate elements, with snapping guidelines
  • Multi-select with Shift+click or a drag box
  • Animated arrow connections that follow elements as they move
  • Layers panel, bring forward and send backward
  • Text formatting: font family, size, colour, bold, italic, alignment
  • Undo and redo, up to 100 steps
  • Save and restore the canvas as JSON
  • High-resolution PNG export
  • Theming through CSS variables

Requirements

FlowCraft needs OutSystems 11 Reactive Web, OutSystems UI (for its InlineSVG block) and a desktop browser. The canvas is at least 1200px wide and scrolls inside its container on smaller screens.

These libraries are bundled with the component, so there is nothing else to install:

Library

Used for

Moveable

Drag, resize, scale, rotate, snapping

Selecto

Click and drag-box selection

hotkeys-js

Keyboard shortcuts

html2canvas

PNG export

Getting started

Add the block to a screen inside a container that has a fixed height; that is the only required setup.

  1. Install FlowCraft from the Forge.
  2. In your app, open Manage Dependencies, select FlowCraft, tick the FlowCraft block and click Apply.
  3. Drag the FlowCraft block onto a screen.
  4. Place it in a container with a fixed height, for example height: 760px;. The editor fills 100% of its parent and is at least 600px tall.
  5. Optional: bind InitialStateJSON to restore a saved diagram, and handle the ExportedJSON event to save it.

Block API

The block has two optional inputs and one event. The parameter name CustomeDiv is kept as-is for backward compatibility.

Name

Kind

Type

Description

InitialStateJSON

Input (optional)

Text

Canvas state to load, in the format produced by ExportedJSON. Applied when the editor is ready and again whenever the value changes. Invalid JSON is rejected and the current canvas is kept.

CustomeDiv

Input (optional)

Text

HTML added when the user clicks Add custom element in the toolbar. Scripts, iframes, inline on* handlers and javascript: URLs are removed.

ExportedJSON

Event

JSON (Text)

Triggered when the user clicks Export JSON. Store JSON and pass it back through InitialStateJSON to restore the diagram.

Saving and restoring a diagram

Save the JSON from the ExportedJSON event, then bind it to InitialStateJSON to load it again.

  1. Create a screen action, for example OnCanvasExported, with an input parameter JSON (Text).
  2. Set it as the handler of the block's ExportedJSON event.
  3. In the action, save JSON to an entity attribute (Text, unlimited length) or a local variable.
  4. Bind InitialStateJSON to the saved value, for example GetDiagram.List.Current.Diagram.StateJSON.

InitialStateJSON only re-applies when its value changes. To reload identical JSON, add a toggled trailing space:

CanvasJSON = SavedJSON + If(ReloadToggle, " ", "")
ReloadToggle = not ReloadToggle

JSON format

{
  "elements": [
    {
      "id": "1",
      "html": "<div class=\"editable\">Editable Text</div>",
      "left": "100px",
      "top": "100px",
      "width": "280px",
      "height": "240px",
      "transform": "rotate(15deg)",
      "zIndex": "2"
    }
  ],
  "connections": [
    { "from": "1", "to": "2" }
  ]
}
  • id must be unique. If a duplicate is found when loading, the first element keeps the ID and later ones get new IDs.
  • connections link elements by id. Connections to missing elements are ignored.
  • A missing elements or connections key is treated as an empty list.
  • Images uploaded from the user's computer are stored inside html as Base64 data, so the JSON can get large. Use an unlimited-length Text attribute.

Using the editor

Every toolbar control shows its name on hover. Text formatting applies to the text currently being edited; size and layer actions apply to the selection.

Toolbar

Control

Action

Colour picker

Text colour of the element being edited; also the fill colour for new shapes

Font family, Font size

Applied to the text being edited

Add Shape menu

Square, Rectangle, Circle, Oval, Triangle Up, Triangle Down, Diamond, Pentagon, Hexagon, Star, Arrow Right, Parallelogram, Capsule

Undo, Redo, Clear canvas

History controls; Clear asks for confirmation

Add card (+)

Card with image, title and description

Add custom element

Adds the HTML from CustomeDiv

Add text

Editable text box

Add shape

Filled shape in the selected colour

Add image

Placeholder image

Connect two elements

Click it, then click the source and target elements

Duplicate, Delete

Applies to the selection

Bring forward, Send backward

Changes stacking order

Export JSON

Triggers the ExportedJSON event

Export PNG

Downloads file.png of the canvas

Bold, Italic, Align left / center / right

Applied to the text being edited

Increase size, Decrease size

Resizes the selection by 20px

Canvas interactions

Action

How

Select

Click an element, or drag a box on an empty part of the canvas

Multi-select

Shift + click

Move, resize, rotate

Use the handles around the selection

Edit text

Double-click the text; click outside it to finish

Change an image URL

Double-click the image

Upload an image

Right-click the image

Select from layers

Click an entry in the Layers panel

Keyboard shortcuts

Shortcuts are ignored while typing in inputs, text areas, dropdowns or text being edited.

Keys

Action

Delete / Backspace

Delete selection

Ctrl/Cmd + D

Duplicate selection

Ctrl/Cmd + Z

Undo

Ctrl/Cmd + Y

Redo

Arrow keys

Move selection 1px

Shift + Arrow keys

Move selection 10px

Theming

All FlowCraft styles are scoped to .flowcraft-root and don't affect the rest of your app. Override these CSS variables in your theme to change its look.

Variable

Default

Controls

--fc-accent

#2563eb

Selection handles, layer highlight, focus outlines, scrollbars

--fc-accent-2

#4f46e5

Second gradient colour

--fc-toolbar-bg

#ffffff

Toolbar background

--fc-canvas-bg

#ffffff

Canvas background

--fc-wrapper-bg

Light blue gradient

Area around the canvas

--fc-border

#e5e7eb

Toolbar border

--fc-text

#111827

Default text colour

.my-editor .flowcraft-root {
  --fc-accent: #e11d48;
  --fc-accent-2: #7f1d1d;
  --fc-wrapper-bg: linear-gradient(180deg, #1a1a22, #0f0f14);
}

Security

HTML from CustomeDiv and from imported JSON is sanitised before it reaches the canvas.

  • <script>, <iframe>, <object>, <embed>, <link>, <meta> and <base> tags are removed.
  • All on* attributes and javascript: URLs are removed; image URLs starting with javascript: are rejected.
  • Treat saved JSON as user content: store it per user or per diagram, and check access on the server before returning it.

Limitations

  • One editor per screen. FlowCraft uses a single shared editor instance.
  • External images in PNG export. Images from servers without cross-origin (CORS) access are left out of the PNG; uploaded and CORS-enabled images export correctly.
  • Placeholder images. Default card and image elements load from picsum.photos; replace them if users have no internet access.
  • Desktop-oriented. Designed for mouse and keyboard.

Troubleshooting

Problem

Fix

Editor not visible or has no height

Put the block in a container with a fixed height.

InitialStateJSON doesn't reload

The value didn't change; use the toggle in Saving and restoring a diagram.

Diagram didn't load

The JSON is invalid; check the browser console for FlowCraft: invalid JSON.

Image missing from the PNG

The image server blocks cross-origin requests; upload the image instead.

Keyboard shortcuts don't work

Click the canvas first; shortcuts are ignored while a text field has focus.

Demo

The FlowCraftDemo app shows every feature:

  • a live editor loaded with a sample diagram
  • a State Console that captures ExportedJSON, lets you edit the JSON and loads it back through InitialStateJSON
  • an invalid-JSON example showing the canvas stays intact
  • a reference card for the block's inputs, event and keyboard shortcuts

1.0.0

FlowCraft is a powerful drag-and-drop visual editor for OutSystems that allows users to create diagrams, workflows, resumes, UI layouts, mind maps, and custom visual structures dynamically inside applications.

The component is delivered as a Web Block containing a fully interactive canvas editor with support for:

  • Drag & Drop Elements
  • Resize / Rotate / Scale
  • Multi Selection
  • Element Connections
  • Layers Panel
  • Text Editing & Styling
  • JSON Import / Export
  • PNG Export
  • Custom HTML Rendering
  • Keyboard Shortcuts


Web Block Usage

Simply drag the FlowCraft web block into your screen.

The component automatically initializes the editor and toolbar.


Input Parameters

1. InitialStateJSON

Type

Text

Description

Used to load a previously saved editor state into the canvas.

Example

{
  "elements": [],
  "connections": []
}

2. CustomeDiv

Type

Text

Description

Allows rendering fully custom HTML blocks directly inside the FlowCraft canvas.

Example

<div class="editable">
    <h2>Resume Title</h2>
    <p>Custom HTML Content</p>
</div>