Download the PHP package wwwision/neos-mermaideditor without Composer

On this page you can find all versions of the php package wwwision/neos-mermaideditor. 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 neos-mermaideditor

Neos Mermaid Editor

A custom Neos CMS inspector editor for authoring Mermaid diagrams, plus a Fusion component for rendering them on the frontend.

The editor renders a source <textarea> next to a live Mermaid preview. On Apply it can optionally pre-render the diagram to an SVG and persist it alongside the source, so the frontend can serve the SVG directly without loading Mermaid in the browser.


Screenshots

Empty Live preview Syntax error

Features


Requirements


Installation

Install the package via composer (from a Neos distribution root):

The package ships a pre-built editor plugin (Resources/Public/MermaidEditor/Plugin.js), so no build step is required for plain usage. If you change the editor sources, rebuild it as described under Development.


Usage

1. Use the editor on a node property

Reference the editor on any string property in a NodeType definition:

2. Render the property on the frontend

Pass the decoded property value into the Wwwision.Neos.MermaidEditor:Diagram component:

The component handles three cases:

State Output
empty / unset nothing on the frontend; an editing hint in the backend
envelope contains svg the stored SVG, inline (no client-side Mermaid)
source only client-side render via Resources/Public/MermaidDiagram.js

Editor options

Option Type Default Description
renderSvg bool false When true, the rendered SVG is generated on Apply and stored alongside the source. The frontend then serves that SVG directly. When false, only the source is stored and the diagram is rendered client-side on the frontend.

Stored data format

The property value is always a JSON envelope:

When renderSvg is enabled, the svg key is added on Apply:

If the source is syntactically invalid at Apply time, the SVG is omitted (the envelope stays source-only) so that saving is never blocked.


How it works

Editor (Resources/Private/Scripts/MermaidEditor/src)

Save hook

Neos UI save hooks run only when the editor change is applied (not on every keystroke). On Apply the hook renders the source to SVG and returns the {diagram, svg} envelope. Mermaid rendering is asynchronous; the hook returns a Promise, which Neos awaits. Errors are caught and the hook falls back to a source-only envelope — a throwing save hook would abort the entire save.

Frontend rendering

The Wwwision.Neos.MermaidEditor:Diagram Fusion component (Resources/Private/Fusion/Root.fusion) decides per state (see the table above). For the source-only case it emits a <pre class="mermaid" data-mermaid-source="..."> (the source is passed via an attribute so it is reliably HTML-escaped) plus the loader script.

Resources/Public/MermaidDiagram.js:


Development

The editor plugin is built with esbuild from Resources/Private/Scripts/MermaidEditor into Resources/Public/MermaidEditor.

Outputs:

After building, you may need to flush Neos caches (and reload the Neos UI) for the changes to appear.


Notes & caveats


Contribution

Contributions in the form of issues or pull requests are highly appreciated


License

See LICENSE


All versions of neos-mermaideditor with dependencies

PHP Build Version
Package Version
Requires neos/neos-ui Version ^8 || ^9
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 wwwision/neos-mermaideditor contains the following files

Loading the files please wait ...