Download the PHP package tmonier/sylius-command-palette-plugin without Composer

On this page you can find all versions of the php package tmonier/sylius-command-palette-plugin. 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 sylius-command-palette-plugin

Sylius Command Palette Plugin

Français : README.fr.md

Build

A command palette (Ctrl+K / ⌘K) for the Sylius 2 back office: find any order, customer, product, promotion or admin page from anywhere.

The Sylius 2 admin has no global search: the navbar field only searches products, the sidebar field only filters menu items, and there is no keyboard shortcut. Finding "order 1042" or "the customer who called" means opening the right grid and filtering it first.

This plugin adds a keyboard-first search dialog to every admin page, free and open source.

Features

Need What the plugin does
Open an order from its number Orders: exact number match first, typed as 1042, #1042 or 000001042, then the latest orders of customers whose e-mail or last name starts with the query. Subtitle: customer, total, state; badge: payment state. Carts are never listed.
Find a customer Customers: e-mail, first name, last name or phone number prefix, and "first last" (john do). Subtitle: e-mail and group.
Jump to a product or a variant Products: name in the administrator's language (contains) or code (prefix), then variants by code, linked to the product / variant edit page. Disabled products are flagged.
Edit a promotion Promotions by name or code, coupons by code (linked to the coupons page of their promotion).
Navigate without the sidebar Pages: every page of the admin main menu (including the items added by other plugins), with its section, and actions (new product, taxon, customer, promotion…). Filtered instantly in the browser from 1 character.
Search other data Your own sources: tag a service implementing SearchProviderInterface.

Also included: keyboard navigation, accessible dialog (combobox / listbox pattern, focus trap, focus restored on close), light and dark themes, translations in English, French, German, Spanish, Italian, Dutch and Polish, no build step and no JavaScript dependency.

Screenshots

Command palette (Cmd+K) searching "claire": her latest orders with status, then the customer

Requirements

Version
PHP 8.2+
Sylius 2.2, 2.3
Symfony 6.4, 7.4, 8.0

Installation

  1. Require the package:

  2. Register the bundle in config/bundles.php (Symfony Flex does it automatically once a recipe exists):

  3. Import the configuration in config/packages/tmonier_sylius_command_palette.yaml:

  4. Import the admin route in config/routes/tmonier_sylius_command_palette.yaml:

  5. Install the assets (a JavaScript and a CSS file, nothing to build):

No migration: the plugin has no table.

Configuration

Rate limiting

The search endpoint runs DQL queries on every keystroke. The built-in rate limiter (symfony/rate-limiter + symfony/lock) caps requests at 120 per minute per admin user (keyed on the user identifier; falls back to the client IP when no user is found). Requests that exceed the limit receive a 429 Too Many Requests JSON response ({"error": "too_many_requests"}) with a Retry-After header (seconds).

The rate limiter is enabled by default and is automatically disabled if the symfony/rate-limiter package is not installed. To disable it explicitly:

Keyboard shortcuts

Keys Action
Ctrl+K / ⌘+K Open / close the palette (from anywhere, even in a form field)
/ Open the palette when the focus is not in a form field
↑ ↓ Move between results
Enter Open the selected result
Ctrl+Enter / ⌘+Enter Open the selected result in a new tab
Esc Close the palette and return to where you were

The Search… ⌘K button in the navbar opens it too. The Sylius product search field is kept.

Add your own provider

Implement SearchProviderInterface and tag the service with tmonier_command_palette.provider. The priority sets the position of the group (built-in: orders 500, customers 400, products 300, promotions 200, coupons 100).

Guidelines:

Admin menu items added through the sylius.menu.admin.main event (or a menu builder) appear in the Pages group automatically.

Customisation

The admin parts are added with Twig Hooks:

Hook Content
sylius_admin.common.component.navbar.menu → tmonier_command_palette Search… ⌘K button (before the product search)
sylius_admin.base#stylesheets → tmonier_command_palette Stylesheet
sylius_admin.base#javascripts → tmonier_command_palette Dialog, icons and script (administrators only)

Templates can be overridden in templates/bundles/TmonierSyliusCommandPalettePlugin/. To hide the navbar button and keep the shortcuts:

The search endpoint is GET /admin/command-palette/search?q=… (route tmonier_command_palette_admin_search), returning {"query": "…", "groups": [{"key", "label", "results": [{"title", "subtitle", "url", "icon", "badge"}]}]}.

How it works

Limitations

Development

B2B demo

This plugin is used in the Sylius B2B demo: a Sylius 2.3 shop with fictitious sample data where the B2B plugins work together. The source code, setup and fixtures of the demo are in that repository.

The demo is an example, not a production setup.

License

MIT. See LICENSE.


All versions of sylius-command-palette-plugin with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
sylius/sylius Version ^2.2
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 tmonier/sylius-command-palette-plugin contains the following files

Loading the files please wait ...