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

unlayer-integration单层集成

Agent Skill

unlayer-integration 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,557

周安装

63

GitHub Stars

5

下载量

489
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/unlayer/unlayer-skills --skill unlayer-integration

简介

单层集成技能用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合在系统集成和协作流程中统一管理变更。
  • 通过 npx skills add 命令从 unlayer-skills 仓库安装。
  • 建议确认集成后的兼容性和维护支持情况。
  • unlayer-integration 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Integrate Unlayer Editor

Overview

Unlayer provides official wrappers for React, Vue, and Angular, plus a plain JavaScript embed. All wrappers share the same underlying API — only the editor access pattern differs.

Which Framework?

FrameworkPackageInstallEditor Access
Reactreact-email-editornpm i react-email-editoruseRef<EditorRef>ref.current?.editor
Vuevue-email-editornpm i vue-email-editorthis.$refs.emailEditor.editor
Angularangular-email-editornpm i angular-email-editor@ViewChildthis.emailEditor.editor
Plain JSCDN script tag<script> embedGlobal unlayer object
⚠️ Before installing any Unlayer package, verify the version exists on npm: ``bash npm view react-email-editor version # check latest published version ` Never pin a version number you haven't verified. Use npm install <package> --save without a version to get the latest, or run npm view <package> versions --json` to see all available versions.

React (Complete Working Example)

npm install react-email-editor --save
import React, { useRef, useState } from 'react';
import EmailEditor, { EditorRef, EmailEditorProps } from 'react-email-editor';

const EmailBuilder = () => {
  const emailEditorRef = useRef<EditorRef>(null);
  const [saving, setSaving] = useState(false);

  // Save design JSON + export HTML to your backend
  const handleSave = () => {
    const unlayer = emailEditorRef.current?.editor;
    if (!unlayer) return;

    setSaving(true);
    unlayer.exportHtml(async (data) => {
      try {
        const response = await fetch('/api/templates', {
          method: 'POST',
          headers: { 'Content-Type': 'application/json' },
          body: JSON.stringify({
            design: data.design,  // Save this — needed to edit later
            html: data.html,      // The rendered HTML output
          }),
        });
        if (!response.ok) throw new Error('Save failed');
        console.log('Saved successfully');
      } catch (err) {
        console.error('Save error:', err);
      } finally {
        setSaving(false);
      }
    });
  };

  // Load a saved design when editor is ready
  const onReady: EmailEditorProps['onReady'] = async (unlayer) => {
    try {
      const response = await fetch('/api/templates/123');
      if (response.ok) {
        const saved = await response.json();
        unlayer.loadDesign(saved.design); // Pass the saved design JSON
      }
    } catch (err) {
      console.log('No saved design, starting blank');
    }
  };

  return (
    <div>
      <button onClick={handleSave} disabled={saving}>
        {saving ? 'Saving...' : 'Save'}
      </button>
      <EmailEditor
        ref={emailEditorRef}
        onReady={onReady}
        options={{
          projectId: 123456, // Dashboard > Project > Settings
          displayMode: 'email',
        }}
      />
    </div>
  );
};

export default EmailBuilder;

Your backend should accept and return:

// POST /api/templates — save
{ design: object, html: string }

// GET /api/templates/:id — load
{ design: object, html: string, updatedAt: string }

React Props:

PropTypeDefaultDescription
optionsObject{}All unlayer.init() options (projectId, displayMode, etc.)
toolsObject{}Per-tool configuration
appearanceObject{}Theme and panel settings
onReadyFunctionCalled when editor is ready (receives unlayer instance)
onLoadFunctionCalled when iframe loads (before ready)
styleObject{}Container inline styles
minHeightString'500px'Minimum editor height
Docs: https://docs.unlayer.com/builder/react-component GitHub: https://github.com/unlayer/react-email-editor

Vue (Complete Working Example)

npm install vue-email-editor --save
<template>
  <div id="app">
    <button v-on:click="handleSave" :disabled="saving">
      {{ saving ? 'Saving...' : 'Save' }}
    </button>
    <EmailEditor ref="emailEditor" v-on:load="editorLoaded" />
  </div>
</template>

<script>
import { EmailEditor } from 'vue-email-editor';

export default {
  components: { EmailEditor },
  data() {
    return { saving: false };
  },
  methods: {
    async editorLoaded() {
      try {
        const response = await fetch('/api/templates/123');
        if (response.ok) {
          const saved = await response.json();
          this.$refs.emailEditor.editor.loadDesign(saved.design);
        }
      } catch (err) {
        console.log('No saved design, starting blank');
      }
    },
    handleSave() {
      this.saving = true;
      this.$refs.emailEditor.editor.exportHtml(async (data) => {
        try {
          await fetch('/api/templates', {
            method: 'POST',
            headers: { 'Content-Type': 'application/json' },
            body: JSON.stringify({ design: data.design, html: data.html }),
          });
        } catch (err) {
          console.error('Save error:', err);
        } finally {
          this.saving = false;
        }
      });
    },
  },
};
</script>

Props: minHeight, options, tools, appearance, locale, projectId.

Docs: https://docs.unlayer.com/builder/vue-component GitHub: https://github.com/unlayer/vue-email-editor

Angular (Complete Working Example)

npm install angular-email-editor --save

Module (app.module.ts):

import { EmailEditorModule } from 'angular-email-editor';

@NgModule({ imports: [EmailEditorModule] })
export class AppModule {}

Component (app.component.ts):

import { Component, ViewChild } from '@angular/core';
import { EmailEditorComponent } from 'angular-email-editor';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
})
export class AppComponent {
  @ViewChild(EmailEditorComponent)
  private emailEditor: EmailEditorComponent;
  saving = false;

  async editorLoaded() {
    try {
      const response = await fetch('/api/templates/123');
      if (response.ok) {
        const saved = await response.json();
        this.emailEditor.editor.loadDesign(saved.design);
      }
    } catch (err) {
      console.log('No saved design');
    }
  }

  handleSave() {
    this.saving = true;
    this.emailEditor.editor.exportHtml(async (data) => {
      try {
        await fetch('/api/templates', {
          method: 'POST',
          headers: { 'Content-Type': 'application/json' },
          body: JSON.stringify({ design: data.design, html: data.html }),
        });
      } catch (err) {
        console.error('Save error:', err);
      } finally {
        this.saving = false;
      }
    });
  }
}

Template (app.component.html):

<div>
  <button (click)="handleSave()" [disabled]="saving">
    {{ saving ? 'Saving...' : 'Save' }}
  </button>
  <email-editor (loaded)="editorLoaded($event)"></email-editor>
</div>
Docs: https://docs.unlayer.com/builder/angular-component

Plain JavaScript

<script src="https://editor.unlayer.com/embed.js"></script>
<div id="editor-container" style="height: 700px;"></div>

<script>
  unlayer.init({
    id: 'editor-container',
    projectId: 1234,
    displayMode: 'email',
  });

  unlayer.addEventListener('editor:ready', async function () {
    try {
      const response = await fetch('/api/templates/123');
      if (response.ok) {
        const saved = await response.json();
        unlayer.loadDesign(saved.design);
      }
    } catch (err) {
      console.log('Starting blank');
    }
  });

  function handleSave() {
    unlayer.exportHtml(async function (data) {
      await fetch('/api/templates', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({ design: data.design, html: data.html }),
      });
    });
  }
</script>
Docs: https://docs.unlayer.com/builder/installation

Multiple Editor Instances

Use createEditor() instead of init():

const editor1 = unlayer.createEditor({ id: 'email-editor', displayMode: 'email' });
const editor2 = unlayer.createEditor({ id: 'web-editor', displayMode: 'web' });

editor1.loadDesign(emailDesign);
editor2.loadDesign(webDesign);

Common Mistakes

MistakeFix
Container too smallMinimum 1024px wide x 700px tall. Editor fills its container.
Calling methods before readyAlways wait for editor:ready event or onReady callback
Using init() for multiple editorsUse unlayer.createEditor() instead
Missing projectIdGet it from Dashboard > Project > Settings
Only saving HTML, not design JSONAlways save both — design JSON lets users edit later
No loading state while savingDisable the save button to prevent double saves
Pinning a non-existent package versionRun npm view <package> version to verify before pinning. Use npm install <package> --save without a version to get the latest.

Troubleshooting

ErrorCauseFix
Editor shows blank white spaceContainer div has 0 heightSet explicit height: min-height: 700px
editor:ready never firesScript not loaded or wrong idCheck id matches an existing div, check network tab for embed.js
ref.current?.editor is undefinedAccessed before mountOnly use inside onReady callback
Design doesn't loadMalformed JSONValidate JSON, check schemaVersion field

Resources

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

32.98%
按下载量换算161

Claude

30.5%
按下载量换算149

Cursor

18.83%
按下载量换算92

Gemini CLI

8.54%
按下载量换算42

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

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

安装前确认

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

来源信息

继续浏览同类 Skills