Download the PHP package goldnead/statamic-flow-canvas without Composer

On this page you can find all versions of the php package goldnead/statamic-flow-canvas. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package statamic-flow-canvas

Flow Canvas

The node-graph editor that statamic-automations and statamic-funnels share.

It exists so there is one editor, not two that drift. Every look-and-feel incident in this addon family has traced back to a copy, so the pieces that are not about a particular domain live here and both addons consume them.

What is in here, and what is not

In: the canvas, the node card, the node library, the config panel, the control bar, the adder node, the insertable edge, and the composables for auto-layout, history, autosave, validation and key-value rows.

Out: what a node means. An automation node is an event and an action; a funnel node is a page somebody walks onto. This package knows how to draw a graph and let someone rearrange it; the host addon says what the boxes are.

The seam: kinds are data

Nothing in here knows the word "trigger". A host passes a map of kinds:

unique means at most one of these may exist, which is also why it cannot be duplicated. hasInput: false means no incoming handle is drawn. replaceable offers "Replace" instead of "Delete" — the way a flow with exactly one entry point has to be edited.

Nodes, and the picture on one

A node is { node_key, type, label, config, disabled }. One more field is optional:

thumbnail is a URL. The card draws it as a 16:10 tile the full width of the card, above the title. The tile has a fixed height and the image loads lazily inside it, so a card is the same size before and after the picture arrives; the layout grows its rows by that height as soon as any node on the canvas has one, and not before. Where the picture comes from is the host's business — a funnel screenshots its pages, an automation may never have anything to show. Leave the field off and the card looks exactly as it always has.

<Canvas :show-thumbnails="false"> switches the tiles off without stripping the field.

Requirements

Installation

The service provider is discovered by Laravel and registers nothing: it exists so Statamic lists the package on the Addons screen. The JavaScript is consumed the same way @statamic/cms is, from the vendor directory:

Composer therefore has to run before npm, exactly as it already does for @statamic/cms.

npm links that path, so the package's files sit outside the host project and would resolve vue from the wrong place. Two lines in the host's vite.config.js keep one Vue and one flow library on the page:

Usage

Everything is exported from the barrel; deep imports work as well (@goldnead/flow-canvas/components/Canvas.vue, @goldnead/flow-canvas/composables/useHistory.js).

The page that owns the editor tells the canvas which handles each node type has, once, from the node library the server rendered, and wires the undo stack to its own graph state:

The canvas draws nothing it was not told about: kinds (see above) says what the boxes are, node-icon maps a type to an icon, and every label the host wants translated comes in as a prop (adder-labels, pick-labels), because Statamic's __() does not know the host's language file from inside a shared component.

The stylesheets ship with the package and go into the host's CP stylesheet, the theme first:

When the published bundle is older than the server

A node whose output spec is newer than this canvas understands falls back to a single default handle and reports it once per type, to the browser console by default. A host that wants it somewhere else registers a handler:

Development


All versions of statamic-flow-canvas with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
statamic/cms Version ^6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package goldnead/statamic-flow-canvas contains the following files

Loading the files please wait ...