Download the PHP package flexible-ux/lexical-bundle without Composer

On this page you can find all versions of the php package flexible-ux/lexical-bundle. 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 lexical-bundle

FlexibleUxLexicalBundle

A reusable Symfony bundle providing LexicalFormType — a lightweight rich-text editor form field built on Meta's Lexical, wired for AssetMapper, Stimulus and UX Icons.

The field renders a toolbar (undo / redo, cut / copy / paste — including paste from Word —, bold, italic, underline, strikethrough, subscript / superscript, remove format, text alignment, bulleted / numbered lists, indentation, link, unlink, HTML source editing) and a contenteditable surface around a hidden <textarea>. The editor reads the textarea's HTML on load and writes HTML back on every change, so it is a drop-in replacement for a plain textarea and degrades to that textarea when JavaScript is disabled. No build step is required — everything runs through AssetMapper's importmap.

Requirements

Installation

Make sure Composer is installed globally.

Step 1: Download the bundle

With Symfony Flex, composer require already wires the front-end for you: the Lexical packages are added to your importmap.php (from the bundle's assets/package.json) and the Stimulus controller is enabled in your assets/controllers.json. Skip to step 3.

Step 2 (without Flex): wire the front-end manually

Add the Lexical packages to your importmap:

and enable the Stimulus controller in assets/controllers.json:

Step 3: Enable the bundle

The bundle does not ship a Flex recipe yet, so register it in config/bundles.php (Flex and non-Flex alike):

That's it. The bundle registers its AssetMapper path, the form theme and the toolbar icons automatically; the editor's CSS is imported by the controller, so there is nothing else to include.

Usage

With options:

Options

Option Type Default Description
toolbar string[] all 24 buttons in eight \|-separated groups Ordered toolbar entries: button names and \| separators.
height string '200px' Minimum editable height (any CSS length).
allowed_link_schemes string[] ['http','https','mailto','tel'] URL schemes the link modal accepts.

Toolbar and grouping

Available buttons:

undo · redo · cut · copy · paste · paste-word · bold · italic · underline · strikethrough · subscript · superscript · remove-format · align-left · align-center · align-right · align-justify · bullet · number · indent · outdent · link · unlink · source

The paste and paste-word buttons read the system clipboard through the asynchronous Clipboard API, so they need a secure context and (browser-dependent) the user's permission; when access is denied the editor shows a translated hint to paste with Ctrl+V instead. paste-word additionally cleans Word's markup and rebuilds its lists — see docs/index.md for details.

The toolbar renders exactly the order you give, and | draws a separator — so grouping is entirely yours to decide:

Every button is optional and independent: only what you list is rendered. A field that does not want the alignment features simply leaves the align-* entries out (and existing text-align styles in stored content are still preserved when edited — only the toolbar control disappears):

Leading, trailing and repeated separators are dropped, so a list can never render a stray or doubled divider. An unknown button name raises a clear InvalidOptionsException listing the valid ones.

The field extends TextareaType, so all textarea/text field options (label, required, attr, constraints, …) apply too.

Link schemes

Restrict (or widen) which link schemes the editor may produce — entries may be written with or without the trailing colon, and anything outside the list is rejected in the link modal:

Application-wide defaults

Rather than repeating options at every call site, set defaults once. Every key mirrors a form option, and per-field options still win:

This is also how a feature is opted out for the whole application at once — the toolbar above, for instance, has no alignment buttons, so no field gets them unless it overrides the option.

Run php bin/console config:dump-reference flexible_ux_lexical to see the full reference.

The editor stores HTML. When you render that HTML on a public page, output it as trusted markup (e.g. Twig's |raw) — links are restricted to allowed_link_schemes by the editor, but you remain responsible for sanitising any HTML that reaches the field from other sources.

How it works

The bundle is deliberately split into four layers so each can be understood and overridden on its own:

See docs/index.md for customisation, theming and translation details.

License

Released under the MIT License. Bundled icons are from Lucide (ISC License).


All versions of lexical-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
symfony/asset-mapper Version ^7.4 || ^8.0
symfony/config Version ^7.4 || ^8.0
symfony/dependency-injection Version ^7.4 || ^8.0
symfony/form Version ^7.4 || ^8.0
symfony/http-kernel Version ^7.4 || ^8.0
symfony/options-resolver Version ^7.4 || ^8.0
symfony/stimulus-bundle Version ^2.20 || ^3.0
symfony/translation Version ^7.4 || ^8.0
symfony/twig-bundle Version ^7.4 || ^8.0
symfony/ux-icons Version ^2.20 || ^3.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 flexible-ux/lexical-bundle contains the following files

Loading the files please wait ...