Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@silexlabs/grapesjs-advanced-selector

Package Overview
Dependencies
Maintainers
2
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@silexlabs/grapesjs-advanced-selector

A GrapesJS plugin for managing advanced CSS selectors with a visual interface

latest
Source
npmnpm
Version
1.3.0
Version published
Weekly downloads
69
-76.85%
Maintainers
2
Weekly downloads
 
Created
Source

Documentation

GrapesJS Advanced Selector Manager

An advanced selector management plugin for GrapesJS, designed for cases where the default Selector Manager falls short

This code is part of a larger project: about Silex v3 The Advanced Selector Manager comes pre-installed in Silex v3, give it a try here

Before: GrapesJs default Selector Manager

GrapesJs default Selector Manager

After:

GrapesJs Advanced Selector Manager

With body h1.btn selected:

Advanced Selector Manager with complex selector

Roadmap

Feature Goals

  • Replace the default Selector Manager UI with a custom interface
  • Integrate with the Style Manager for editing complex CSS selectors

Selector Examples

  • .child (already possible with the default Selector Manager)
  • .child:pseudo (already possible with the default Selector Manager)
  • .parent > .child
  • .parent:pseudo > .child
  • .parent:pseudo .child
  • tag .child
  • Pseudo selectors with parameters, e.g., :nth-child(2)
  • Pseudo selectors with a selector, e.g., :not(.child)

Installation

Choose one of the following methods:

CDN

<script src="https://unpkg.com/@silexlabs/grapesjs-advanced-selector"></script>

NPM

npm i @silexlabs/grapesjs-advanced-selector

GIT

git clone https://github.com/silexlabs/grapesjs-advanced-selector.git

Usage

Basic HTML Setup

Include the plugin with GrapesJS in your HTML:

<link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet">
<script src="https://unpkg.com/grapesjs"></script>
<script src="https://unpkg.com/@silexlabs/grapesjs-advanced-selector"></script>

<div id="gjs"></div>

Basic JS Initialization

const editor = grapesjs.init({
  container: '#gjs',
  height: '100%',
  fromElement: true,
  storageManager: false,
  plugins: ['@silexlabs/grapesjs-advanced-selector'],
});

Options

Customize the plugin’s behavior by passing options:

OptionDescriptionDefault
i18nInternationalization object see the files in src/i18nThe content of src/i18n/en.ts
helpLinksLinks to help resources{}
helpLinks.actionBarLink to help resources for the action barhttps://docs.silex.me/en/user/selectors

Advanced Usage

Use the plugin with modern JavaScript imports:

import grapesjs from 'grapesjs';
import plugin from '@silexlabs/grapesjs-advanced-selector';
import 'grapesjs/dist/css/grapes.min.css';

const editor = grapesjs.init({
  container: '#gjs',
  plugins: [plugin],
  pluginsOpts: {
    [plugin]: { /* options */ }
  },
});

Development

To contribute, follow these steps:

  • Clone the Repository:

    git clone https://github.com/silexlabs/grapesjs-advanced-selector.git
    cd @silexlabs/grapesjs-advanced-selector
    
  • Install Dependencies:

    npm install
    
  • Start Development Server:

    npm start
    
  • Build the Plugin:

    npm run build
    

License

AGPL-3.0

Keywords

silex

FAQs

Package last updated on 30 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts