PluginProbe
Elementor Website Builder – more than just a page builder / trunk
Elementor Website Builder – more than just a page builder vtrunk
4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 All 457 releases
← All changes | assets/js/packages/elementor-kit-mcp/elementor-kit-mcp.js +247 -431 4.2.0-dev2 → trunk View file →
@@ -1,312 +1,32 @@
1 -/******/ (function() { // webpackBootstrap
2 -/******/ "use strict";
3 -/******/ var __webpack_modules__ = ({
1 +(function(_elementor_editor_mcp, _elementor_elementor_mcp_common, _elementor_schema) {
4 2
5 -/***/ "./packages/packages/core/elementor-kit-mcp/src/elementor-kit-mcp-server.ts":
6 -/*!**********************************************************************************!*\
7 - !*** ./packages/packages/core/elementor-kit-mcp/src/elementor-kit-mcp-server.ts ***!
8 - \**********************************************************************************/
9 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
3 +//#region \0rolldown/runtime.js
4 + var __defProp = Object.defineProperty;
5 + var __name = (target, value) => __defProp(target, "name", {
6 + value,
7 + configurable: true
8 + });
9 + var __exportAll = (all, no_symbols) => {
10 + let target = {};
11 + for (var name in all) {
12 + __defProp(target, name, {
13 + get: all[name],
14 + enumerable: true
15 + });
16 + }
17 + if (!no_symbols) {
18 + __defProp(target, Symbol.toStringTag, { value: "Module" });
19 + }
20 + return target;
21 + };
10 22
11 -__webpack_require__.r(__webpack_exports__);
12 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
13 -/* harmony export */ createElementorKitServer: function() { return /* binding */ createElementorKitServer; }
14 -/* harmony export */ });
15 -/* harmony import */ var _elementor_editor_mcp__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @elementor/editor-mcp */ "@elementor/editor-mcp");
16 -/* harmony import */ var _elementor_editor_mcp__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_elementor_editor_mcp__WEBPACK_IMPORTED_MODULE_0__);
17 -/* harmony import */ var _elementor_elementor_mcp_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/elementor-mcp-common */ "@elementor/elementor-mcp-common");
18 -/* harmony import */ var _elementor_elementor_mcp_common__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_elementor_mcp_common__WEBPACK_IMPORTED_MODULE_1__);
19 -/* harmony import */ var _elementor_schema__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @elementor/schema */ "@elementor/schema");
20 -/* harmony import */ var _elementor_schema__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_elementor_schema__WEBPACK_IMPORTED_MODULE_2__);
21 -/* harmony import */ var _mcp_description_resource__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mcp-description-resource */ "./packages/packages/core/elementor-kit-mcp/src/mcp-description-resource.ts");
23 +//#endregion
22 24
25 +//#region packages/packages/core/elementor-kit-mcp/src/mcp-description-resource.ts
26 + var KIT_DESCRIPTION_URI = "elementor://kit/server-description";
27 + var KIT_DESCRIPTION = `## Elementor Kit Settings Management
23 28
24 -
25 -
26 -const RESOURCE_NAME_KIT_FONTS = 'elementor-kit-fonts';
27 -const RESOURCE_URI_KIT_FONTS = 'elementor://kit/fonts';
28 -const RESOURCE_NAME_KIT_SCHEMA = 'elementor-kit-schema';
29 -const RESOURCE_URI_KIT_SCHEMA_TEMPLATE = 'elementor://kit/schema/{tab}';
30 -const RESOURCE_NAME_KIT_SETTINGS = 'elementor-kit-settings';
31 -const RESOURCE_URI_KIT_SETTINGS = 'elementor://kit/settings';
32 -const VERSION = '2.0.0';
33 -async function fetchKitFonts() {
34 - return (0,_elementor_elementor_mcp_common__WEBPACK_IMPORTED_MODULE_1__.callWpApi)(`/angie/v1/elementor-kit/fonts`, 'GET');
35 -}
36 -async function fetchKitSchema() {
37 - return (0,_elementor_elementor_mcp_common__WEBPACK_IMPORTED_MODULE_1__.callWpApi)(`/angie/v1/elementor-kit/schema`, 'GET');
38 -}
39 -async function fetchKitSettings() {
40 - return (0,_elementor_elementor_mcp_common__WEBPACK_IMPORTED_MODULE_1__.callWpApi)(`/angie/v1/elementor-kit`, 'GET');
41 -}
42 -async function validateFonts(systemTypography, customTypography) {
43 - const fontsResponse = await fetchKitFonts();
44 - const availableFonts = Object.keys(fontsResponse.data.fonts || {});
45 - const invalidFonts = [];
46 - [systemTypography, customTypography].forEach(typography => {
47 - if (typography) {
48 - typography.forEach(item => {
49 - if (item.typography_font_family && !availableFonts.includes(item.typography_font_family)) {
50 - invalidFonts.push(item.typography_font_family);
51 - }
52 - });
53 - }
54 - });
55 - if (invalidFonts.length > 0) {
56 - return `Please use available fonts only. Invalid fonts: ${invalidFonts.join(', ')}. Available fonts: ${availableFonts.join(', ')}`;
57 - }
58 - return '';
59 -}
60 -function sanitizeMediaFields(obj) {
61 - const mediaFields = ['site_logo', 'site_icon'];
62 - const sanitized = {
63 - ...obj
64 - };
65 - for (const field of mediaFields) {
66 - if (field in sanitized && sanitized[field] === '') {
67 - sanitized[field] = 0;
68 - }
69 - }
70 - return sanitized;
71 -}
72 -const baseColorSchema = _elementor_schema__WEBPACK_IMPORTED_MODULE_2__.z.object({
73 - title: _elementor_schema__WEBPACK_IMPORTED_MODULE_2__.z.string(),
74 - color: _elementor_schema__WEBPACK_IMPORTED_MODULE_2__.z.string()
75 -});
76 -const baseTypographySchema = _elementor_schema__WEBPACK_IMPORTED_MODULE_2__.z.object({
77 - title: _elementor_schema__WEBPACK_IMPORTED_MODULE_2__.z.string(),
78 - typography_typography: _elementor_schema__WEBPACK_IMPORTED_MODULE_2__.z.string(),
79 - typography_font_family: _elementor_schema__WEBPACK_IMPORTED_MODULE_2__.z.string().describe('Font family name that must be from the available Elementor fonts list. Use the get-fonts endpoint (/angie/v1/elementor-kit/fonts) to get the complete list of available fonts. Only use fonts that exist in this list to avoid validation errors.'),
80 - typography_font_weight: _elementor_schema__WEBPACK_IMPORTED_MODULE_2__.z.string(),
81 - typography_font_size: _elementor_schema__WEBPACK_IMPORTED_MODULE_2__.z.object({
82 - unit: _elementor_schema__WEBPACK_IMPORTED_MODULE_2__.z.string(),
83 - size: _elementor_schema__WEBPACK_IMPORTED_MODULE_2__.z.number()
84 - }).optional(),
85 - typography_font_size_tablet: _elementor_schema__WEBPACK_IMPORTED_MODULE_2__.z.object({
86 - unit: _elementor_schema__WEBPACK_IMPORTED_MODULE_2__.z.string(),
87 - size: _elementor_schema__WEBPACK_IMPORTED_MODULE_2__.z.number()
88 - }).optional(),
89 - typography_font_size_mobile: _elementor_schema__WEBPACK_IMPORTED_MODULE_2__.z.object({
90 - unit: _elementor_schema__WEBPACK_IMPORTED_MODULE_2__.z.string(),
91 - size: _elementor_schema__WEBPACK_IMPORTED_MODULE_2__.z.number()
92 - }).optional(),
93 - typography_line_height: _elementor_schema__WEBPACK_IMPORTED_MODULE_2__.z.object({
94 - unit: _elementor_schema__WEBPACK_IMPORTED_MODULE_2__.z.string(),
95 - size: _elementor_schema__WEBPACK_IMPORTED_MODULE_2__.z.number()
96 - }).optional()
97 -}).passthrough();
98 -const systemColorItemSchema = baseColorSchema.extend({
99 - _id: _elementor_schema__WEBPACK_IMPORTED_MODULE_2__.z.enum(['primary', 'secondary', 'text', 'accent'])
100 -});
101 -const systemTypographyItemSchema = baseTypographySchema.extend({
102 - _id: _elementor_schema__WEBPACK_IMPORTED_MODULE_2__.z.enum(['primary', 'secondary', 'text', 'accent'])
103 -});
104 -const customColorItemSchema = baseColorSchema.extend({
105 - _id: _elementor_schema__WEBPACK_IMPORTED_MODULE_2__.z.string()
106 -});
107 -const customTypographyItemSchema = baseTypographySchema.extend({
108 - _id: _elementor_schema__WEBPACK_IMPORTED_MODULE_2__.z.string()
109 -});
110 -const systemColorsSchema = _elementor_schema__WEBPACK_IMPORTED_MODULE_2__.z.array(systemColorItemSchema).length(4);
111 -const systemTypographySchema = _elementor_schema__WEBPACK_IMPORTED_MODULE_2__.z.array(systemTypographyItemSchema).length(4);
112 -const customColorsSchema = _elementor_schema__WEBPACK_IMPORTED_MODULE_2__.z.array(customColorItemSchema);
113 -const customTypographySchema = _elementor_schema__WEBPACK_IMPORTED_MODULE_2__.z.array(customTypographyItemSchema);
114 -const generalPatchSchema = _elementor_schema__WEBPACK_IMPORTED_MODULE_2__.z.record(_elementor_schema__WEBPACK_IMPORTED_MODULE_2__.z.unknown()).describe('General patch object for any other Elementor kit settings like spacing, buttons, forms, layout settings, etc.');
115 -const SERVER_INSTRUCTIONS = 'Manages Elementor global design system: colors, typography, and site identity.';
116 -async function createElementorKitServer() {
117 - await (0,_elementor_elementor_mcp_common__WEBPACK_IMPORTED_MODULE_1__.waitForElementorEditor)();
118 - const server = new _elementor_editor_mcp__WEBPACK_IMPORTED_MODULE_0__.McpServer({
119 - name: 'elementor-kit-server',
120 - version: VERSION,
121 - title: 'Elementor Kit'
122 - }, {
123 - instructions: SERVER_INSTRUCTIONS,
124 - capabilities: {
125 - resources: {
126 - subscribe: true
127 - }
128 - }
129 - });
130 - (0,_mcp_description_resource__WEBPACK_IMPORTED_MODULE_3__.addKitDescriptionResource)(server);
131 - const getAvailableTabs = async () => {
132 - const kitSchema = await fetchKitSchema();
133 - return Object.keys(kitSchema.data || {});
134 - };
135 - server.registerResource(RESOURCE_NAME_KIT_FONTS, RESOURCE_URI_KIT_FONTS, {
136 - title: 'Elementor Kit Available Fonts',
137 - description: 'Complete list of all available font families that can be used in Elementor, including system fonts, Google fonts, and custom uploaded fonts'
138 - }, async uri => {
139 - const fontsResponse = await fetchKitFonts();
140 - return {
141 - contents: [{
142 - uri: uri.href,
143 - mimeType: 'application/json',
144 - text: JSON.stringify(fontsResponse, null, 2)
145 - }]
146 - };
147 - });
148 - server.registerResource(RESOURCE_NAME_KIT_SETTINGS, RESOURCE_URI_KIT_SETTINGS, {
149 - title: 'Elementor Kit Current Settings',
150 - description: 'Complete current Elementor global kit configuration including all system and custom colors, typography settings, spacing, buttons, forms, and other site-wide design settings'
151 - }, async uri => {
152 - const currentSettings = await fetchKitSettings();
153 - return {
154 - contents: [{
155 - uri: uri.href,
156 - mimeType: 'application/json',
157 - text: JSON.stringify(currentSettings, null, 2)
158 - }]
159 - };
160 - });
161 - server.registerResource(RESOURCE_NAME_KIT_SCHEMA, new _elementor_editor_mcp__WEBPACK_IMPORTED_MODULE_0__.ResourceTemplate(RESOURCE_URI_KIT_SCHEMA_TEMPLATE, {
162 - list: async () => {
163 - const availableTabs = await getAvailableTabs();
164 - return {
165 - resources: availableTabs.map(tab => {
166 - return {
167 - uri: `elementor://kit/schema/${tab}`,
168 - name: `${RESOURCE_NAME_KIT_SCHEMA}-${tab}`,
169 - title: `Elementor Kit Schema - ${tab}`,
170 - description: `Schema definition for Elementor kit ${tab} settings tab`,
171 - mimeType: 'application/json'
172 - };
173 - })
174 - };
175 - }
176 - }), {
177 - title: 'Elementor Kit Schema',
178 - description: 'Complete schema definition for a specific Elementor kit settings tab, showing all available fields, their types, valid values, and configuration options'
179 - }, async (uri, variables) => {
180 - const tab = Array.isArray(variables.tab) ? variables.tab[0] : variables.tab;
181 - if (!tab) {
182 - throw new Error('Tab parameter is required');
183 - }
184 - const kitSchema = await fetchKitSchema();
185 - const tabSchema = kitSchema.data?.[tab];
186 - if (!tabSchema) {
187 - throw new Error(`No schema found for tab '${tab}'. Available tabs: ${Object.keys(kitSchema.data).join(', ')}`);
188 - }
189 - return {
190 - contents: [{
191 - uri: uri.toString(),
192 - mimeType: 'application/json',
193 - text: JSON.stringify(tabSchema, null, 2)
194 - }]
195 - };
196 - });
197 - server.registerTool('update-elementor-kit-settings-colors-and-fonts', {
198 - description: `This tool applies configuration changes to Elementor global kit settings that control site-wide design elements. Use this when you need to modify global colors, typography, spacing, buttons, form fields, or other theme-wide settings that affect the entire website appearance.
199 -
200 -The tool will permanently update the site's global design settings and return a success confirmation with the updated configuration data.`,
201 - inputSchema: {
202 - systemColors: systemColorsSchema.optional().nullable().describe('System colors array with exactly 4 items having IDs: primary, secondary, text, accent'),
203 - systemTypography: systemTypographySchema.optional().nullable().describe('System typography array with exactly 4 items having IDs: primary, secondary, text, accent'),
204 - customColors: customColorsSchema.optional().nullable().describe('Custom colors array - flexible structure for additional color definitions'),
205 - customTypography: customTypographySchema.optional().nullable().describe('Custom typography array - flexible structure for additional font definitions (no color field needed)'),
206 - patchObject: generalPatchSchema.optional().nullable().describe('General patch object for any other Elementor kit settings like spacing, buttons, forms, layout settings, etc.'),
207 - confirmationMessage: _elementor_schema__WEBPACK_IMPORTED_MODULE_2__.z.string().describe('REQUIRED: Provide a clear explanation in **markdown format** of what Elementor kit settings will be changed and their potential impact on the site\'s global design. This message will be shown to the user before proceeding. Be specific about which design elements are being modified (colors, typography, spacing, etc.) and how they will affect the entire website. Examples: "You\'re about to update the global **primary color** from `blue` to `green`. This will change **buttons**, **links**, and **accent colors** throughout your entire site." or "You\'re about to change the **primary font** from `Roboto` to `Open Sans`. This will affect **headings** across all pages."')
208 - },
209 - annotations: {
210 - title: 'Update Elementor Kit Settings',
211 - destructiveHint: true
212 - },
213 - _meta: {
214 - 'angie/requiredResources': [{
215 - uri: _mcp_description_resource__WEBPACK_IMPORTED_MODULE_3__.KIT_DESCRIPTION_URI,
216 - whenToUse: 'Read first for kit capabilities and limitations'
217 - }]
218 - }
219 - }, async ({
220 - systemColors,
221 - systemTypography,
222 - customColors,
223 - customTypography,
224 - patchObject,
225 - confirmationMessage
226 - }) => {
227 - (0,_elementor_elementor_mcp_common__WEBPACK_IMPORTED_MODULE_1__.requireConfirmationMessage)(confirmationMessage, 'Elementor kit settings');
228 - const invalidFonts = await validateFonts(systemTypography, customTypography);
229 - if (invalidFonts) {
230 - throw new Error(invalidFonts);
231 - }
232 - const completePatchObject = {
233 - ...(systemColors && {
234 - system_colors: systemColors
235 - }),
236 - ...(systemTypography && {
237 - system_typography: systemTypography
238 - }),
239 - ...(customColors && {
240 - custom_colors: customColors
241 - }),
242 - ...(customTypography && {
243 - custom_typography: customTypography
244 - }),
245 - ...sanitizeMediaFields(patchObject || {})
246 - };
247 - if (Object.keys(completePatchObject).length === 0) {
248 - throw new Error('At least one update must be provided (systemColors, systemTypography, customColors, customTypography, or patchObject)');
249 - }
250 - const response = await (0,_elementor_elementor_mcp_common__WEBPACK_IMPORTED_MODULE_1__.callWpApi)(`/angie/v1/elementor-kit`, 'POST', completePatchObject);
251 - return {
252 - content: [{
253 - type: 'text',
254 - text: JSON.stringify({
255 - success: true,
256 - message: 'Settings updated successfully',
257 - data: response,
258 - appliedSettings: completePatchObject
259 - }, null, 2)
260 - }]
261 - };
262 - });
263 - const sdk = (0,_elementor_editor_mcp__WEBPACK_IMPORTED_MODULE_0__.getAngieSdk)();
264 - await sdk.waitForReady();
265 - sdk.registerLocalServer({
266 - server,
267 - version: VERSION,
268 - description: SERVER_INSTRUCTIONS,
269 - name: 'elementor-kit-server'
270 - });
271 - return server;
272 -}
273 -
274 -/***/ }),
275 -
276 -/***/ "./packages/packages/core/elementor-kit-mcp/src/init.ts":
277 -/*!**************************************************************!*\
278 - !*** ./packages/packages/core/elementor-kit-mcp/src/init.ts ***!
279 - \**************************************************************/
280 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
281 -
282 -__webpack_require__.r(__webpack_exports__);
283 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
284 -/* harmony export */ init: function() { return /* binding */ init; }
285 -/* harmony export */ });
286 -/* harmony import */ var _elementor_kit_mcp_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./elementor-kit-mcp-server */ "./packages/packages/core/elementor-kit-mcp/src/elementor-kit-mcp-server.ts");
287 -
288 -function init() {
289 - (0,_elementor_kit_mcp_server__WEBPACK_IMPORTED_MODULE_0__.createElementorKitServer)();
290 -}
291 -
292 -/***/ }),
293 -
294 -/***/ "./packages/packages/core/elementor-kit-mcp/src/mcp-description-resource.ts":
295 -/*!**********************************************************************************!*\
296 - !*** ./packages/packages/core/elementor-kit-mcp/src/mcp-description-resource.ts ***!
297 - \**********************************************************************************/
298 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
299 -
300 -__webpack_require__.r(__webpack_exports__);
301 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
302 -/* harmony export */ KIT_DESCRIPTION: function() { return /* binding */ KIT_DESCRIPTION; },
303 -/* harmony export */ KIT_DESCRIPTION_URI: function() { return /* binding */ KIT_DESCRIPTION_URI; },
304 -/* harmony export */ addKitDescriptionResource: function() { return /* binding */ addKitDescriptionResource; }
305 -/* harmony export */ });
306 -const KIT_DESCRIPTION_URI = 'elementor://kit/server-description';
307 -const KIT_DESCRIPTION = `## Elementor Kit Settings Management
308 -
309 29 ### Capabilities:
310 30 **Global Design System:**
311 31 - Create, update, name, and delete global colors (both system and custom)
312 32 - Create, update, name, and delete global fonts (both system and custom)
@@ -326,139 +46,235 @@
326 46 - Cannot configure mobile browser background
327 47 - Cannot modify global layout settings such as content width, container padding, and widget gaps (the default space between widgets)
328 48
329 49 **Note**: Angie can adjust all of these layout properties at the container or page level - just not site-wide.`;
330 -function addKitDescriptionResource(server) {
331 - server.registerResource('elementor-kit-server-description', KIT_DESCRIPTION_URI, {
332 - title: 'Elementor Kit Server Description',
333 - description: 'Elementor Kit capabilities and limitations',
334 - mimeType: 'text/plain'
335 - }, async uri => ({
336 - contents: [{
337 - uri: uri.href,
338 - mimeType: 'text/plain',
339 - text: KIT_DESCRIPTION
340 - }]
341 - }));
342 -}
50 + function addKitDescriptionResource(server) {
51 + server.registerResource("elementor-kit-server-description", KIT_DESCRIPTION_URI, {
52 + title: "Elementor Kit Server Description",
53 + description: "Elementor Kit capabilities and limitations",
54 + mimeType: "text/plain"
55 + }, async (uri) => ({ contents: [{
56 + uri: uri.href,
57 + mimeType: "text/plain",
58 + text: KIT_DESCRIPTION
59 + }] }));
60 + }
343 61
344 -/***/ }),
62 +//#endregion
63 +//#region packages/packages/core/elementor-kit-mcp/src/elementor-kit-mcp-server.ts
64 + var RESOURCE_NAME_KIT_FONTS = "elementor-kit-fonts";
65 + var RESOURCE_URI_KIT_FONTS = "elementor://kit/fonts";
66 + var RESOURCE_NAME_KIT_SCHEMA = "elementor-kit-schema";
67 + var RESOURCE_URI_KIT_SCHEMA_TEMPLATE = "elementor://kit/schema/{tab}";
68 + var RESOURCE_NAME_KIT_SETTINGS = "elementor-kit-settings";
69 + var RESOURCE_URI_KIT_SETTINGS = "elementor://kit/settings";
70 + var VERSION = "2.0.0";
71 + async function fetchKitFonts() {
72 + return (0, _elementor_elementor_mcp_common.callWpApi)(`/angie/v1/elementor-kit/fonts`, "GET");
73 + }
74 + async function fetchKitSchema() {
75 + return (0, _elementor_elementor_mcp_common.callWpApi)(`/angie/v1/elementor-kit/schema`, "GET");
76 + }
77 + async function fetchKitSettings() {
78 + return (0, _elementor_elementor_mcp_common.callWpApi)(`/angie/v1/elementor-kit`, "GET");
79 + }
80 + async function validateFonts(systemTypography, customTypography) {
81 + const fontsResponse = await fetchKitFonts();
82 + const availableFonts = Object.keys(fontsResponse.data.fonts || {});
83 + const invalidFonts = [];
84 + [systemTypography, customTypography].forEach((typography) => {
85 + if (typography) typography.forEach((item) => {
86 + if (item.typography_font_family && !availableFonts.includes(item.typography_font_family)) invalidFonts.push(item.typography_font_family);
87 + });
88 + });
89 + if (invalidFonts.length > 0) return `Please use available fonts only. Invalid fonts: ${invalidFonts.join(", ")}. Available fonts: ${availableFonts.join(", ")}`;
90 + return "";
91 + }
92 + function sanitizeMediaFields(obj) {
93 + const mediaFields = ["site_logo", "site_icon"];
94 + const sanitized = { ...obj };
95 + for (const field of mediaFields) if (field in sanitized && sanitized[field] === "") sanitized[field] = 0;
96 + return sanitized;
97 + }
98 + var baseColorSchema = _elementor_schema.z.object({
99 + title: _elementor_schema.z.string(),
100 + color: _elementor_schema.z.string()
101 + });
102 + var baseTypographySchema = _elementor_schema.z.object({
103 + title: _elementor_schema.z.string(),
104 + typography_typography: _elementor_schema.z.string(),
105 + typography_font_family: _elementor_schema.z.string().describe("Font family name that must be from the available Elementor fonts list. Use the get-fonts endpoint (/angie/v1/elementor-kit/fonts) to get the complete list of available fonts. Only use fonts that exist in this list to avoid validation errors."),
106 + typography_font_weight: _elementor_schema.z.string(),
107 + typography_font_size: _elementor_schema.z.object({
108 + unit: _elementor_schema.z.string(),
109 + size: _elementor_schema.z.number()
110 + }).optional(),
111 + typography_font_size_tablet: _elementor_schema.z.object({
112 + unit: _elementor_schema.z.string(),
113 + size: _elementor_schema.z.number()
114 + }).optional(),
115 + typography_font_size_mobile: _elementor_schema.z.object({
116 + unit: _elementor_schema.z.string(),
117 + size: _elementor_schema.z.number()
118 + }).optional(),
119 + typography_line_height: _elementor_schema.z.object({
120 + unit: _elementor_schema.z.string(),
121 + size: _elementor_schema.z.number()
122 + }).optional()
123 + }).passthrough();
124 + var systemColorItemSchema = baseColorSchema.extend({ _id: _elementor_schema.z.enum([
125 + "primary",
126 + "secondary",
127 + "text",
128 + "accent"
129 + ]) });
130 + var systemTypographyItemSchema = baseTypographySchema.extend({ _id: _elementor_schema.z.enum([
131 + "primary",
132 + "secondary",
133 + "text",
134 + "accent"
135 + ]) });
136 + var customColorItemSchema = baseColorSchema.extend({ _id: _elementor_schema.z.string() });
137 + var customTypographyItemSchema = baseTypographySchema.extend({ _id: _elementor_schema.z.string() });
138 + var systemColorsSchema = _elementor_schema.z.array(systemColorItemSchema).length(4);
139 + var systemTypographySchema = _elementor_schema.z.array(systemTypographyItemSchema).length(4);
140 + var customColorsSchema = _elementor_schema.z.array(customColorItemSchema);
141 + var customTypographySchema = _elementor_schema.z.array(customTypographyItemSchema);
142 + var generalPatchSchema = _elementor_schema.z.record(_elementor_schema.z.unknown()).describe("General patch object for any other Elementor kit settings like spacing, buttons, forms, layout settings, etc.");
143 + var SERVER_INSTRUCTIONS = "Manages Elementor global design system: colors, typography, and site identity.";
144 + async function createElementorKitServer() {
145 + await (0, _elementor_elementor_mcp_common.waitForElementorEditor)();
146 + const server = new _elementor_editor_mcp.McpServer({
147 + name: "elementor-kit-server",
148 + version: VERSION,
149 + title: "Elementor Kit"
150 + }, {
151 + instructions: SERVER_INSTRUCTIONS,
152 + capabilities: { resources: { subscribe: true } }
153 + });
154 + addKitDescriptionResource(server);
155 + const getAvailableTabs = async () => {
156 + const kitSchema = await fetchKitSchema();
157 + return Object.keys(kitSchema.data || {});
158 + };
159 + server.registerResource(RESOURCE_NAME_KIT_FONTS, RESOURCE_URI_KIT_FONTS, {
160 + title: "Elementor Kit Available Fonts",
161 + description: "Complete list of all available font families that can be used in Elementor, including system fonts, Google fonts, and custom uploaded fonts"
162 + }, async (uri) => {
163 + const fontsResponse = await fetchKitFonts();
164 + return { contents: [{
165 + uri: uri.href,
166 + mimeType: "application/json",
167 + text: JSON.stringify(fontsResponse, null, 2)
168 + }] };
169 + });
170 + server.registerResource(RESOURCE_NAME_KIT_SETTINGS, RESOURCE_URI_KIT_SETTINGS, {
171 + title: "Elementor Kit Current Settings",
172 + description: "Complete current Elementor global kit configuration including all system and custom colors, typography settings, spacing, buttons, forms, and other site-wide design settings"
173 + }, async (uri) => {
174 + const currentSettings = await fetchKitSettings();
175 + return { contents: [{
176 + uri: uri.href,
177 + mimeType: "application/json",
178 + text: JSON.stringify(currentSettings, null, 2)
179 + }] };
180 + });
181 + server.registerResource(RESOURCE_NAME_KIT_SCHEMA, new _elementor_editor_mcp.ResourceTemplate(RESOURCE_URI_KIT_SCHEMA_TEMPLATE, { list: async () => {
182 + return { resources: (await getAvailableTabs()).map((tab) => {
183 + return {
184 + uri: `elementor://kit/schema/${tab}`,
185 + name: `${RESOURCE_NAME_KIT_SCHEMA}-${tab}`,
186 + title: `Elementor Kit Schema - ${tab}`,
187 + description: `Schema definition for Elementor kit ${tab} settings tab`,
188 + mimeType: "application/json"
189 + };
190 + }) };
191 + } }), {
192 + title: "Elementor Kit Schema",
193 + description: "Complete schema definition for a specific Elementor kit settings tab, showing all available fields, their types, valid values, and configuration options"
194 + }, async (uri, variables) => {
195 + const tab = Array.isArray(variables.tab) ? variables.tab[0] : variables.tab;
196 + if (!tab) throw new Error("Tab parameter is required");
197 + const kitSchema = await fetchKitSchema();
198 + const tabSchema = kitSchema.data?.[tab];
199 + if (!tabSchema) throw new Error(`No schema found for tab '${tab}'. Available tabs: ${Object.keys(kitSchema.data).join(", ")}`);
200 + return { contents: [{
201 + uri: uri.toString(),
202 + mimeType: "application/json",
203 + text: JSON.stringify(tabSchema, null, 2)
204 + }] };
205 + });
206 + server.registerTool("update-elementor-kit-settings-colors-and-fonts", {
207 + description: `This tool applies configuration changes to Elementor global kit settings that control site-wide design elements. Use this when you need to modify global colors, typography, spacing, buttons, form fields, or other theme-wide settings that affect the entire website appearance.
345 208
346 -/***/ "@elementor/editor-mcp":
347 -/*!********************************************!*\
348 - !*** external ["elementorV2","editorMcp"] ***!
349 - \********************************************/
350 -/***/ (function(module) {
209 +The tool will permanently update the site's global design settings and return a success confirmation with the updated configuration data.`,
210 + inputSchema: {
211 + systemColors: systemColorsSchema.optional().nullable().describe("System colors array with exactly 4 items having IDs: primary, secondary, text, accent"),
212 + systemTypography: systemTypographySchema.optional().nullable().describe("System typography array with exactly 4 items having IDs: primary, secondary, text, accent"),
213 + customColors: customColorsSchema.optional().nullable().describe("Custom colors array - flexible structure for additional color definitions"),
214 + customTypography: customTypographySchema.optional().nullable().describe("Custom typography array - flexible structure for additional font definitions (no color field needed)"),
215 + patchObject: generalPatchSchema.optional().nullable().describe("General patch object for any other Elementor kit settings like spacing, buttons, forms, layout settings, etc."),
216 + confirmationMessage: _elementor_schema.z.string().describe("REQUIRED: Provide a clear explanation in **markdown format** of what Elementor kit settings will be changed and their potential impact on the site's global design. This message will be shown to the user before proceeding. Be specific about which design elements are being modified (colors, typography, spacing, etc.) and how they will affect the entire website. Examples: \"You're about to update the global **primary color** from `blue` to `green`. This will change **buttons**, **links**, and **accent colors** throughout your entire site.\" or \"You're about to change the **primary font** from `Roboto` to `Open Sans`. This will affect **headings** across all pages.\"")
217 + },
218 + annotations: {
219 + title: "Update Elementor Kit Settings",
220 + destructiveHint: true
221 + },
222 + _meta: { "angie/requiredResources": [{
223 + uri: KIT_DESCRIPTION_URI,
224 + whenToUse: "Read first for kit capabilities and limitations"
225 + }] }
226 + }, async ({ systemColors, systemTypography, customColors, customTypography, patchObject, confirmationMessage }) => {
227 + (0, _elementor_elementor_mcp_common.requireConfirmationMessage)(confirmationMessage, "Elementor kit settings");
228 + const invalidFonts = await validateFonts(systemTypography, customTypography);
229 + if (invalidFonts) throw new Error(invalidFonts);
230 + const completePatchObject = {
231 + ...systemColors && { system_colors: systemColors },
232 + ...systemTypography && { system_typography: systemTypography },
233 + ...customColors && { custom_colors: customColors },
234 + ...customTypography && { custom_typography: customTypography },
235 + ...sanitizeMediaFields(patchObject || {})
236 + };
237 + if (Object.keys(completePatchObject).length === 0) throw new Error("At least one update must be provided (systemColors, systemTypography, customColors, customTypography, or patchObject)");
238 + const response = await (0, _elementor_elementor_mcp_common.callWpApi)(`/angie/v1/elementor-kit`, "POST", completePatchObject);
239 + return { content: [{
240 + type: "text",
241 + text: JSON.stringify({
242 + success: true,
243 + message: "Settings updated successfully",
244 + data: response,
245 + appliedSettings: completePatchObject
246 + }, null, 2)
247 + }] };
248 + });
249 + const sdk = (0, _elementor_editor_mcp.getAngieSdk)();
250 + await sdk.waitForReady();
251 + sdk.registerLocalServer({
252 + server,
253 + version: VERSION,
254 + description: SERVER_INSTRUCTIONS,
255 + name: "elementor-kit-server"
256 + });
257 + return server;
258 + }
351 259
352 -module.exports = window["elementorV2"]["editorMcp"];
260 +//#endregion
261 +//#region packages/packages/core/elementor-kit-mcp/src/init.ts
262 + function init() {
263 + createElementorKitServer();
264 + }
353 265
354 -/***/ }),
266 +//#endregion
267 +//#region packages/packages/core/elementor-kit-mcp/src/index.ts
268 + var src_exports = /* @__PURE__ */ __exportAll({
269 + createElementorKitServer: () => createElementorKitServer,
270 + init: () => init
271 + });
355 272
356 -/***/ "@elementor/elementor-mcp-common":
357 -/*!*****************************************************!*\
358 - !*** external ["elementorV2","elementorMcpCommon"] ***!
359 - \*****************************************************/
360 -/***/ (function(module) {
273 +//#endregion
274 +//#region \0elementor-package-library-entry
275 + (window.elementorV2 = window.elementorV2 || {}).elementorKitMcp = src_exports;
361 276
362 -module.exports = window["elementorV2"]["elementorMcpCommon"];
363 -
364 -/***/ }),
365 -
366 -/***/ "@elementor/schema":
367 -/*!*****************************************!*\
368 - !*** external ["elementorV2","schema"] ***!
369 - \*****************************************/
370 -/***/ (function(module) {
371 -
372 -module.exports = window["elementorV2"]["schema"];
373 -
374 -/***/ })
375 -
376 -/******/ });
377 -/************************************************************************/
378 -/******/ // The module cache
379 -/******/ var __webpack_module_cache__ = {};
380 -/******/
381 -/******/ // The require function
382 -/******/ function __webpack_require__(moduleId) {
383 -/******/ // Check if module is in cache
384 -/******/ var cachedModule = __webpack_module_cache__[moduleId];
385 -/******/ if (cachedModule !== undefined) {
386 -/******/ return cachedModule.exports;
387 -/******/ }
388 -/******/ // Create a new module (and put it into the cache)
389 -/******/ var module = __webpack_module_cache__[moduleId] = {
390 -/******/ // no module.id needed
391 -/******/ // no module.loaded needed
392 -/******/ exports: {}
393 -/******/ };
394 -/******/
395 -/******/ // Execute the module function
396 -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
397 -/******/
398 -/******/ // Return the exports of the module
399 -/******/ return module.exports;
400 -/******/ }
401 -/******/
402 -/************************************************************************/
403 -/******/ /* webpack/runtime/compat get default export */
404 -/******/ !function() {
405 -/******/ // getDefaultExport function for compatibility with non-harmony modules
406 -/******/ __webpack_require__.n = function(module) {
407 -/******/ var getter = module && module.__esModule ?
408 -/******/ function() { return module['default']; } :
409 -/******/ function() { return module; };
410 -/******/ __webpack_require__.d(getter, { a: getter });
411 -/******/ return getter;
412 -/******/ };
413 -/******/ }();
414 -/******/
415 -/******/ /* webpack/runtime/define property getters */
416 -/******/ !function() {
417 -/******/ // define getter functions for harmony exports
418 -/******/ __webpack_require__.d = function(exports, definition) {
419 -/******/ for(var key in definition) {
420 -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
421 -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
422 -/******/ }
423 -/******/ }
424 -/******/ };
425 -/******/ }();
426 -/******/
427 -/******/ /* webpack/runtime/hasOwnProperty shorthand */
428 -/******/ !function() {
429 -/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
430 -/******/ }();
431 -/******/
432 -/******/ /* webpack/runtime/make namespace object */
433 -/******/ !function() {
434 -/******/ // define __esModule on exports
435 -/******/ __webpack_require__.r = function(exports) {
436 -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
437 -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
438 -/******/ }
439 -/******/ Object.defineProperty(exports, '__esModule', { value: true });
440 -/******/ };
441 -/******/ }();
442 -/******/
443 -/************************************************************************/
444 -var __webpack_exports__ = {};
445 -// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
446 -!function() {
447 -/*!***************************************************************!*\
448 - !*** ./packages/packages/core/elementor-kit-mcp/src/index.ts ***!
449 - \***************************************************************/
450 -__webpack_require__.r(__webpack_exports__);
451 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
452 -/* harmony export */ createElementorKitServer: function() { return /* reexport safe */ _elementor_kit_mcp_server__WEBPACK_IMPORTED_MODULE_0__.createElementorKitServer; },
453 -/* harmony export */ init: function() { return /* reexport safe */ _init__WEBPACK_IMPORTED_MODULE_1__.init; }
454 -/* harmony export */ });
455 -/* harmony import */ var _elementor_kit_mcp_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./elementor-kit-mcp-server */ "./packages/packages/core/elementor-kit-mcp/src/elementor-kit-mcp-server.ts");
456 -/* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./init */ "./packages/packages/core/elementor-kit-mcp/src/init.ts");
457 -
458 -
459 -}();
460 -(window.elementorV2 = window.elementorV2 || {}).elementorKitMcp = __webpack_exports__;
461 -/******/ })()
462 -;
277 +//#endregion
278 +})(elementorV2.editorMcp, elementorV2.elementorMcpCommon, elementorV2.schema);
463 279 window.elementorV2.elementorKitMcp?.init?.();
464 280 //# sourceMappingURL=elementor-kit-mcp.js.map