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
elementor / assets / js / packages / elementor-kit-mcp / elementor-kit-mcp.min.js

elementor-kit-mcp.min.js in Elementor Website Builder – more than just a page builder trunk, at assets/js/packages/elementor-kit-mcp/elementor-kit-mcp.min.js

25 lines 9.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (function(){var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,__commonJSMin=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),__copyProps=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},__toESM=(n,r,a)=>(a=n==null?{}:e(i(n)),__copyProps(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),o=__toESM(__commonJSMin(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,__export=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},__copyProps=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},__toCommonJS=e=>__copyProps(n({},`__esModule`,{value:!0}),e),o={};__export(o,{createElementorKitServer:()=>createElementorKitServer,init:()=>init}),t.exports=__toCommonJS(o);var s=globalThis.elementorV2.editorMcp,c=globalThis.elementorV2.elementorMcpCommon,l=globalThis.elementorV2.schema,u=`elementor://kit/server-description`,d=`## Elementor Kit Settings Management
2
3 ### Capabilities:
4 **Global Design System:**
5 - Create, update, name, and delete global colors (both system and custom)
6 - Create, update, name, and delete global fonts (both system and custom)
7
8 **Site Identity:**
9 - Insert site logo
10 - Set site favicon
11 - Update site name
12 - Modify site description
13
14 ### Limitations:
15 **Theme Style Settings:**
16 - Cannot set or update Elementor Theme Style settings including typography, buttons, images, form fields, Hello Theme header, or Hello Theme footer that affect the entire website appearance
17
18 **Site-Wide Settings:**
19 - Cannot set site-wide background (color or image)
20 - Cannot configure mobile browser background
21 - Cannot modify global layout settings such as content width, container padding, and widget gaps (the default space between widgets)
22
23 **Note**: Angie can adjust all of these layout properties at the container or page level - just not site-wide.`;function addKitDescriptionResource(e){e.registerResource(`elementor-kit-server-description`,u,{title:`Elementor Kit Server Description`,description:`Elementor Kit capabilities and limitations`,mimeType:`text/plain`},async e=>({contents:[{uri:e.href,mimeType:`text/plain`,text:d}]}))}var f=`elementor-kit-fonts`,p=`elementor://kit/fonts`,m=`elementor-kit-schema`,h=`elementor://kit/schema/{tab}`,g=`elementor-kit-settings`,_=`elementor://kit/settings`,v=`2.0.0`;async function fetchKitFonts(){return(0,c.callWpApi)(`/angie/v1/elementor-kit/fonts`,`GET`)}async function fetchKitSchema(){return(0,c.callWpApi)(`/angie/v1/elementor-kit/schema`,`GET`)}async function fetchKitSettings(){return(0,c.callWpApi)(`/angie/v1/elementor-kit`,`GET`)}async function validateFonts(e,t){let n=await fetchKitFonts(),r=Object.keys(n.data.fonts||{}),i=[];return[e,t].forEach(e=>{e&&e.forEach(e=>{e.typography_font_family&&!r.includes(e.typography_font_family)&&i.push(e.typography_font_family)})}),i.length>0?`Please use available fonts only. Invalid fonts: ${i.join(`, `)}. Available fonts: ${r.join(`, `)}`:``}function sanitizeMediaFields(e){let t=[`site_logo`,`site_icon`],n={...e};for(let e of t)e in n&&n[e]===``&&(n[e]=0);return n}var y=l.z.object({title:l.z.string(),color:l.z.string()}),b=l.z.object({title:l.z.string(),typography_typography:l.z.string(),typography_font_family:l.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.`),typography_font_weight:l.z.string(),typography_font_size:l.z.object({unit:l.z.string(),size:l.z.number()}).optional(),typography_font_size_tablet:l.z.object({unit:l.z.string(),size:l.z.number()}).optional(),typography_font_size_mobile:l.z.object({unit:l.z.string(),size:l.z.number()}).optional(),typography_line_height:l.z.object({unit:l.z.string(),size:l.z.number()}).optional()}).passthrough(),x=y.extend({_id:l.z.enum([`primary`,`secondary`,`text`,`accent`])}),S=b.extend({_id:l.z.enum([`primary`,`secondary`,`text`,`accent`])}),C=y.extend({_id:l.z.string()}),w=b.extend({_id:l.z.string()}),T=l.z.array(x).length(4),E=l.z.array(S).length(4),D=l.z.array(C),O=l.z.array(w),k=l.z.record(l.z.unknown()).describe(`General patch object for any other Elementor kit settings like spacing, buttons, forms, layout settings, etc.`),A=`Manages Elementor global design system: colors, typography, and site identity.`;async function createElementorKitServer(){await(0,c.waitForElementorEditor)();let e=new s.McpServer({name:`elementor-kit-server`,version:v,title:`Elementor Kit`},{instructions:A,capabilities:{resources:{subscribe:!0}}});addKitDescriptionResource(e);let getAvailableTabs=async()=>{let e=await fetchKitSchema();return Object.keys(e.data||{})};e.registerResource(f,p,{title:`Elementor Kit Available Fonts`,description:`Complete list of all available font families that can be used in Elementor, including system fonts, Google fonts, and custom uploaded fonts`},async e=>{let t=await fetchKitFonts();return{contents:[{uri:e.href,mimeType:`application/json`,text:JSON.stringify(t,null,2)}]}}),e.registerResource(g,_,{title:`Elementor Kit Current Settings`,description:`Complete current Elementor global kit configuration including all system and custom colors, typography settings, spacing, buttons, forms, and other site-wide design settings`},async e=>{let t=await fetchKitSettings();return{contents:[{uri:e.href,mimeType:`application/json`,text:JSON.stringify(t,null,2)}]}}),e.registerResource(m,new s.ResourceTemplate(h,{list:async()=>({resources:(await getAvailableTabs()).map(e=>({uri:`elementor://kit/schema/${e}`,name:`${m}-${e}`,title:`Elementor Kit Schema - ${e}`,description:`Schema definition for Elementor kit ${e} settings tab`,mimeType:`application/json`}))})}),{title:`Elementor Kit Schema`,description:`Complete schema definition for a specific Elementor kit settings tab, showing all available fields, their types, valid values, and configuration options`},async(e,t)=>{let n=Array.isArray(t.tab)?t.tab[0]:t.tab;if(!n)throw Error(`Tab parameter is required`);let r=await fetchKitSchema(),i=r.data?.[n];if(!i)throw Error(`No schema found for tab '${n}'. Available tabs: ${Object.keys(r.data).join(`, `)}`);return{contents:[{uri:e.toString(),mimeType:`application/json`,text:JSON.stringify(i,null,2)}]}}),e.registerTool(`update-elementor-kit-settings-colors-and-fonts`,{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.
24
25 The tool will permanently update the site's global design settings and return a success confirmation with the updated configuration data.`,inputSchema:{systemColors:T.optional().nullable().describe(`System colors array with exactly 4 items having IDs: primary, secondary, text, accent`),systemTypography:E.optional().nullable().describe(`System typography array with exactly 4 items having IDs: primary, secondary, text, accent`),customColors:D.optional().nullable().describe(`Custom colors array - flexible structure for additional color definitions`),customTypography:O.optional().nullable().describe(`Custom typography array - flexible structure for additional font definitions (no color field needed)`),patchObject:k.optional().nullable().describe(`General patch object for any other Elementor kit settings like spacing, buttons, forms, layout settings, etc.`),confirmationMessage:l.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."')},annotations:{title:`Update Elementor Kit Settings`,destructiveHint:!0},_meta:{"angie/requiredResources":[{uri:u,whenToUse:`Read first for kit capabilities and limitations`}]}},async({systemColors:e,systemTypography:t,customColors:n,customTypography:r,patchObject:i,confirmationMessage:a})=>{(0,c.requireConfirmationMessage)(a,`Elementor kit settings`);let o=await validateFonts(t,r);if(o)throw Error(o);let s={...e&&{system_colors:e},...t&&{system_typography:t},...n&&{custom_colors:n},...r&&{custom_typography:r},...sanitizeMediaFields(i||{})};if(Object.keys(s).length===0)throw Error(`At least one update must be provided (systemColors, systemTypography, customColors, customTypography, or patchObject)`);let l=await(0,c.callWpApi)(`/angie/v1/elementor-kit`,`POST`,s);return{content:[{type:`text`,text:JSON.stringify({success:!0,message:`Settings updated successfully`,data:l,appliedSettings:s},null,2)}]}});let t=(0,s.getAngieSdk)();return await t.waitForReady(),t.registerLocalServer({server:e,version:v,description:A,name:`elementor-kit-server`}),e}function init(){createElementorKitServer()}0&&(t.exports={createElementorKitServer,init})}))());(window.elementorV2=window.elementorV2||{}).elementorKitMcp=o})(),window.elementorV2.elementorKitMcp?.init?.();