webiny-website-builder
ما الذي تفعله
يشرح كيفية إنشاء مكونات المحرر والإعدادات المدخلة والسمات لموقع Website Builder مبني بـNext.js. وهي لمطوري الواجهات الأمامية الذين يريدون لبنات بناء خاصة بهم داخل محرر Webiny.
متى تستخدمها
- ✓عندما يريد مطور إنشاء مكوّن جديد لمحرر Webiny Website Builder.
- ✓عندما يحتاج مطور إلى إضافة مدخلات مثل إعدادات النص أو اللون أو الصورة إلى مكوّن.
- ✓عندما يريد مطور ضبط سمة بمتغيرات CSS لموقع Website Builder.
رابط المهارة
https://github.com/webiny/webiny-js/blob/next/skills/user-skills/website-builder/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“كيف أصنع زرًا مخصصًا أستطيع تحريره في Webiny Website Builder؟”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
تشرح المهارة أن المحرر يحمّل تطبيق Next.js الحقيقي، وأن المكونات تُسجَّل في الكود. وتُظهر كيفية تعريف المدخلات التي يستطيع المستخدمون تغييرها، وكيفية تنسيق السمة.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
Website Builder
TL;DR
The Webiny Website Builder uses a unique architecture: the Admin editor loads your Next.js app inside an iframe. All component code and styles live in your Next.js project -- Webiny only stores the page structure (which components and what input values). You build editor components with @webiny/website-builder-nextjs, register them via createComponent(), define configurable inputs, and manage theming through CSS custom properties and createTheme().
Architecture
+----------------------------------------------------------+
| Webiny Admin |
| +----------------------------------------------------+ |
| | Website Builder Editor | |
| | | |
| | sidebar +------------------------------+ | |
| | (inputs) | your Next.js app (iframe) | | |
| | | real components | | |
| | | real styles | | |
| | +------------------------------+ | |
| +----------------------------------------------------+ |
+----------------------------------------------------------+
postMessage (SDK)
+----------------------------------------------------------+
| Your Next.js App (running separately) |
| @webiny/website-builder-nextjs SDK installed |
+----------------------------------------------------------+
Key implications:
- No style clashes -- your components, your styles, full ownership
- Genuine WYSIWYG -- editors see your real app, not a simulation
- Framework-owned code -- all React components live in your Next.js repo
Setup
Starter Kit
git clone https://github.com/webiny/website-builder-nextjs.git my-website
cd my-website
npm install
Ensure @webiny/website-builder-nextjs and @webiny/sdk versions in package.json match your Webiny version (yarn webiny --version in your Webiny project).
Environment Variables
# .env
NEXT_PUBLIC_WEBSITE_BUILDER_API_KEY=your_wb_api_key
NEXT_PUBLIC_WEBSITE_BUILDER_API_HOST=https://your-cloudfront-url.cloudfront.net
NEXT_PUBLIC_WEBSITE_BUILDER_ADMIN_HOST=http://localhost:3001
NEXT_PUBLIC_WEBSITE_BUILDER_API_TENANT=root
Editor Components
An editor component has two parts:
- React component -- renders the UI, receives configured values via
inputsprop - Manifest -- metadata (name, label, group, inputs) that tells the editor about the component
Creating a Component
// src/editorComponents/Banner.tsx
import React from "react";
import { ComponentProps } from "@webiny/website-builder-nextjs";
interface BannerInputs {
headline: string;
ctaLabel: string;
ctaUrl: string;
}
export function Banner({ inputs: { headline, ctaLabel, ctaUrl } }: ComponentProps<BannerInputs>) {
return (
<div className="bg-primary py-12 px-6 text-center text-white">
<h2 className="text-3xl font-bold mb-4">{headline}</h2>
{ctaLabel && ctaUrl && (
<a
href={ctaUrl}
className="inline-block bg-white text-primary font-semibold px-6 py-3 rounded-md"
>
{ctaLabel}
</a>
)}
</div>
);
}
Registering Components
The editorComponents array must be in a "use client" file:
// src/editorComponents/index.tsx
"use client";
import { createComponent, createTextInput } from "@webiny/website-builder-nextjs";
import { Banner } from "./Banner";
export const editorComponents = [
createComponent(Banner, {
name: "Custom/Banner",
label: "Banner",
group: "custom",
inputs: [
createTextInput({
name: "headline",
label: "Headline",
description: "The main headline text.",
defaultValue: "Ready to get started?"
}),
createTextInput({
name: "ctaLabel",
label: "Button Label",
defaultValue: "Get started"
}),
createTextInput({
name: "ctaUrl",
label: "Button URL",
defaultValue: "/"
})
]
})
];
Important: The "use client" directive is required because component registration communicates with the editor via the browser. However, components imported here can still be Server Components if they don't have their own "use client" directive.
Component Name Convention
Use a namespaced string: `"YourNamespace/C
الأسئلة الشائعة
أين يوجد كود المكوّن؟
في مشروع Next.js، وليس في Webiny. تخزن Webiny فقط المكونات التي تستخدمها الصفحة والقيم المُدخلة لها.
ما أنواع المدخلات التي يمكن أن يملكها المكوّن؟
تذكر المهارة مدخلات مثل النص والرقم والقيمة المنطقية واللون والاختيار والملف أو الصورة والفتحة والنص المنسّق والكائن والوسوم.
كيف تعمل السمات؟
تشرح المهارة كيفية إدارة الألوان والأنماط بخصائص CSS المخصصة ودالة إعداد السمة.
التفاصيل
الوصف الأصلي من المؤلف
Building Website Builder editor components, theming, and CMS integration using @webiny/website-builder-nextjs. Use this skill when the developer wants to create editor components for the Website Builder, register components with createComponent, define configurable inputs (text, number, boolean, color, select, file/image, slot, lexical, object, tags), type the component's props correctly (especially file/image inputs, which are objects with { src, width, height, ... } and NOT plain strings, and lexical inputs which are { html, state } objects), set up component groups, customize the theme (CSS
repo: webiny/webiny-js
الشعبية
- نجوم GitHub
- 8.1k
- الترتيب
- #12618
- الترخيص
- —
- آخر تحديث
- 2/11/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
prd-to-plan
8.1kيساعد وكيلك على تحويل وثيقة متطلبات منتج إلى خطة مرحلية من شرائح صغيرة متكاملة من البداية إلى النهاية، تُحفظ كملف Markdown.
webiny-admin-architect
8.1kيعلّم وكيلك بناء شاشات الإدارة لمنصة Webiny، باستخدام طبقات منطق العمل وأسلوب الـpresenter.
webiny-admin-permissions
8.1kيعلّم وكيلك إضافة ضوابط الصلاحيات إلى شاشات إدارة Webiny، مع نماذج صلاحيات مولَّدة تلقائيًا وفحوص لإظهار الأجزاء أو إخفائها.
webiny-form-model
8.1kيعلّم وكيلك بناء النماذج في Webiny باستخدام منشئ حقول تصريحي، مع التخطيطات والتحقق والقواعد الشرطية.
مهارات مشابهة
angular-developer
280kيساعد وكيلك على كتابة شيفرة Angular وتقديم نصائح لبنية المشروع، ويفيد في بدء المشاريع الجديدة وإنشاء المكونات وتحسين الأداء وإمكانية الوصول.
frontend-a11y
280kيساعد وكيلك على جعل واجهات الويب متاحة للجميع، فيضمن أن المواقع والتطبيقات تعمل جيدًا مع قارئات الشاشة والتنقل بلوحة المفاتيح.
frontend-patterns
280kيطبّق وكيلك أنماط تطوير الواجهات الحديثة، فيحسّن الأداء ويدير الحالة ويتبع أفضل الممارسات في React وNext.js.