Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计提醒

grapesjsgrapesjs 搜索

Agent Skill

grapesjs 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

408

周安装

17

GitHub Stars

公开资料未说明

下载量

136
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:grapesjs(grapesjs 搜索)
来源仓库:https://github.com/harold18m/grapesjs-mjml
仓库路径:skills/grapesjs
安装命令:
npx skills add https://github.com/harold18m/grapesjs-mjml --skill grapesjs
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/harold18m/grapesjs-mjml --skill grapesjs

简介

grapesjs 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。

  • 它能帮助 Agent 搜索 grapesjs 相关资源、匹配组件库或复用模板片段。
  • 通过 npx skills add 命令从指定仓库安装,具体用法请参考原始 README。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • grapesjs 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

GrapesJS Skill

Quick Start

Initialize the editor:

import 'grapesjs/dist/css/grapes.min.css';
import grapesjs from 'grapesjs';

const editor = grapesjs.init({
  container: '#gjs',
  fromElement: true,
  storageManager: false,
  plugins: [],
});

Core API Modules

Access modules from the editor instance:

editor.DomComponents   // Component management (alias: editor.Components)
editor.BlockManager     // Block management (alias: editor.Blocks)
editor.StyleManager     // Style properties
editor.Panels           // UI panels
editor.Commands         // Command system
editor.Canvas           // Canvas control
editor.StorageManager   // Data persistence (alias: editor.Storage)
editor.DeviceManager    // Responsive devices
editor.SelectorManager  // CSS selectors/classes
editor.Modal            // Modal dialogs
editor.Pages            // Multi-page support
editor.I18n             // Internationalization
editor.AssetManager     // Asset/media management (alias: editor.Assets)
editor.LayerManager     // Layer tree (alias: editor.Layers)
editor.TraitManager     // Trait/settings (alias: editor.Traits)
editor.RichTextEditor   // RTE customization
editor.Keymaps          // Keyboard shortcuts
editor.UndoManager      // Undo/Redo
editor.Parser           // HTML/CSS parser

Key Editor Methods

editor.getHtml()              // Get HTML output
editor.getCss()               // Get CSS output
editor.getJs()                // Get JS output
editor.getProjectData()       // Get full project JSON
editor.loadProjectData(json)  // Load project from JSON
editor.getWrapper()           // Root component
editor.getSelected()          // Last selected component
editor.getSelectedAll()       // All selected components
editor.select(component)      // Select a component
editor.selectAdd(component)   // Add to selection
editor.selectRemove(component)// Remove from selection
editor.addComponents(html)    // Add components
editor.setComponents(html)    // Replace components
editor.addStyle(css)          // Add CSS rules
editor.setStyle(css)          // Replace all CSS rules
editor.on(event, callback)    // Listen to events
editor.off(event, callback)   // Remove listener
editor.once(event, callback)  // Listen once
editor.runCommand(id, opts)   // Run command
editor.stopCommand(id, opts)  // Stop command
editor.store()                // Save to storage
editor.load()                 // Load from storage
editor.getDevice()            // Get current device name
editor.setDevice('Mobile')    // Switch device
editor.getDirtyCount()        // Unsaved changes count
editor.clearDirtyCount()      // Reset changes counter
editor.getContainer()         // Editor container HTMLElement
editor.onReady(callback)      // Run when editor is fully loaded
editor.destroy()              // Destroy editor
editor.refresh()              // Update editor dimensions
editor.setCustomRte(obj)      // Replace built-in RTE
editor.setDragMode(mode)      // 'absolute' | 'translate'

Plugins

Plugins are functions executed on editor init. Always define custom component types inside plugins (necessary so types exist before templates are loaded from storage).

const myPlugin = (editor, options) => {
  editor.DomComponents.addType('my-type', { /* ... */ });
  editor.BlockManager.add('my-block', { /* ... */ });
};

grapesjs.init({
  plugins: [myPlugin],
  pluginsOpts: { [myPlugin]: { opt1: 'value' } },
});

TypeScript Usage

import grapesjs, { usePlugin } from 'grapesjs';
import type { Plugin } from 'grapesjs';

interface MyPluginOptions { opt1: string; opt2?: number; }

const myPlugin: Plugin<MyPluginOptions> = (editor, options) => { /* ... */ };

grapesjs.init({
  plugins: [usePlugin(myPlugin, { opt1: 'A', opt2: 1 })],
});

Default Commands

Built-in commands use core:* namespace. Full list in references/commands-reference.md. Key commands:

core:canvas-clear, core:component-delete, core:component-enter (select child), core:component-exit (select parent), core:component-next/prev, core:component-outline, core:component-offset, core:component-select, core:copy/core:paste, core:preview, core:fullscreen, core:open-code, core:open-layers, core:open-styles, core:open-traits, core:open-blocks, core:open-assets, core:undo/core:redo.

Editor Init Config Reference

Key grapesjs.init({...}) options:

grapesjs.init({
  container: '#gjs',           // Selector or HTMLElement
  fromElement: false,          // Load content from container
  height: '100%',              // Editor height
  width: 'auto',               // Editor width
  projectData: {},             // Initial project data (skips storage load)
  mediaCondition: 'max-width', // or 'min-width' for mobile-first
  plugins: [],
  pluginsOpts: {},
  panels: { defaults: [] },
  blockManager: { blocks: [], appendTo: '.container' },
  layerManager: { appendTo: '.container' },
  styleManager: { appendTo: '.container', sectors: [] },
  selectorManager: { appendTo: '.container', componentFirst: false },
  traitManager: { appendTo: '.container' },
  storageManager: { type: 'local', autosave: true, autoload: true },
  deviceManager: { devices: [] },
  assetManager: { assets: [], upload: false },
  canvas: {
    scripts: [],               // JS files to load in canvas iframe
    styles: [],                // CSS files to load in canvas iframe
  },
  keymaps: { defaults: {} },   // Custom keyboard shortcuts
});

Common Pitfalls

1. Component scripts run in an isolated iframe

All component scripts execute inside the canvas iframe, NOT in the editor's document. You cannot reference external variables, editor APIs, or outer-scope libraries inside script. Use script-props to pass data. See references/components-js-reference.md.

2. find() only works after render, findType() works always

component.find('.my-class') uses CSS selectors and requires the component to be rendered in the canvas. Use component.findType('image') or component.closestType('section') when working with components before render (e.g., in init() hooks or plugins).

3. Don't put styles or scripts in blocks

Block content should be component-oriented. Declare styles in the component type defaults, not in the block content. Scripts belong in the component type definition, not in block HTML.

4. isComponent is NOT called for objects or data-gjs-type

When you add components via objects ({type: 'my-type'}) or HTML with data-gjs-type, the isComponent function is skipped. It only runs for plain HTML strings without data-gjs-type.

5. Component-scoped styles are grouped per type

Styles defined in defaults.styles are shared across all instances of that type and auto-removed only when ALL instances of that type are removed. Follow component-oriented styling: each type owns its own styles.

6. locked cascades to children

Setting locked: true on a component disables selection for it AND all its children. A child can opt out by explicitly setting its own locked: false.

7. propagate applies to NEW children only

The propagate array only affects components appended AFTER the property is set. Existing children are not retroactively updated.

8. UndoManager tracks components and CSS rules automatically

You don't need to manually add components or CSS rules to the UndoManager — they're auto-tracked. Use um.skip(() => {...}) for batch programmatic changes you don't want in the undo stack.

9. Aborting component removal

Listen to component:remove:before and set opts.abort = true to prevent deletion. Call the provided removeFn() later to complete it.

10. Canvas dependencies are NOT in exported HTML

Scripts/styles added via canvas.scripts / canvas.styles config are loaded in the editor's iframe but NOT included in editor.getHtml() output. You must include them separately in your final template.

Detailed References

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.03%
按下载量换算48

Claude

30.75%
按下载量换算42

Cursor

16.58%
按下载量换算23

Gemini CLI

9.83%
按下载量换算13

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills