@elementor/editor-elements 3.35.0-325 → 3.35.0-327

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -716,6 +716,7 @@ var updateElementSettings = ({ id, props, withHistory = true }) => {
716
716
  };
717
717
 
718
718
  // src/link-restriction.ts
719
+ var ANCHOR_SELECTOR = "a, [data-action-link]";
719
720
  function getLinkInLinkRestriction(elementId) {
720
721
  const anchoredDescendantId = getAnchoredDescendantId(elementId);
721
722
  if (anchoredDescendantId) {
@@ -742,7 +743,7 @@ function getAnchoredDescendantId(elementId) {
742
743
  if (!element) {
743
744
  return null;
744
745
  }
745
- for (const childAnchorElement of Array.from(element.querySelectorAll("a"))) {
746
+ for (const childAnchorElement of Array.from(element.querySelectorAll(ANCHOR_SELECTOR))) {
746
747
  const childElementId = findElementIdOf(childAnchorElement);
747
748
  if (childElementId !== elementId) {
748
749
  return childElementId;
@@ -755,7 +756,7 @@ function getAnchoredAncestorId(elementId) {
755
756
  if (!element || element.parentElement === null) {
756
757
  return null;
757
758
  }
758
- const parentAnchor = element.parentElement.closest("a");
759
+ const parentAnchor = element.parentElement.closest(ANCHOR_SELECTOR);
759
760
  return parentAnchor ? findElementIdOf(parentAnchor) : null;
760
761
  }
761
762
  function isElementAnchored(elementId) {
@@ -763,17 +764,17 @@ function isElementAnchored(elementId) {
763
764
  if (!element) {
764
765
  return false;
765
766
  }
766
- if (isAnchorTag(element.tagName)) {
767
+ if (element.matches(ANCHOR_SELECTOR)) {
767
768
  return true;
768
769
  }
769
770
  return doesElementContainAnchor(element);
770
771
  }
771
772
  function doesElementContainAnchor(element) {
772
- for (const child of element.children) {
773
+ for (const child of Array.from(element.children)) {
773
774
  if (isElementorElement(child)) {
774
775
  continue;
775
776
  }
776
- if (isAnchorTag(child.tagName)) {
777
+ if (child.matches(ANCHOR_SELECTOR)) {
777
778
  return true;
778
779
  }
779
780
  if (doesElementContainAnchor(child)) {
@@ -792,9 +793,6 @@ function getElementDOM(id) {
792
793
  return null;
793
794
  }
794
795
  }
795
- function isAnchorTag(tagName) {
796
- return tagName.toLowerCase() === "a";
797
- }
798
796
  function isElementorElement(element) {
799
797
  return element.hasAttribute("data-id");
800
798
  }
@@ -1006,613 +1004,6 @@ var playElementInteractions = (elementId, animationId) => {
1006
1004
  function setDocumentModifiedStatus2(status) {
1007
1005
  runCommandSync6("document/save/set-is-modified", { status }, { internal: true });
1008
1006
  }
1009
-
1010
- // src/mcp/index.ts
1011
- import { getMCPByDomain as getMCPByDomain2 } from "@elementor/editor-mcp";
1012
-
1013
- // src/mcp/elements-tool.ts
1014
- import { getMCPByDomain } from "@elementor/editor-mcp";
1015
- import { z } from "@elementor/schema";
1016
-
1017
- // src/mcp/handlers/create-element.ts
1018
- function handleCreateElement({
1019
- elementType,
1020
- containerId,
1021
- props = {},
1022
- styles
1023
- }) {
1024
- let container = containerId === "document" ? getCurrentDocumentContainer() : getContainer(containerId);
1025
- if (!container) {
1026
- if (containerId === "document") {
1027
- throw new Error("Document container not found. Please ensure the editor is initialized.");
1028
- }
1029
- throw new Error(`Container with ID "${containerId}" not found`);
1030
- }
1031
- const containerElType = container.model.get("elType");
1032
- const isDocument = container.id === "document" || containerElType === "document";
1033
- if (isDocument) {
1034
- const containerModel = {
1035
- elType: "e-div-block"
1036
- };
1037
- const createdContainer = createElement({
1038
- containerId: container.id,
1039
- model: containerModel,
1040
- options: { useHistory: true }
1041
- });
1042
- createElementStyle({
1043
- elementId: createdContainer.id,
1044
- classesProp: "classes",
1045
- label: "local",
1046
- meta: { breakpoint: "desktop", state: null },
1047
- props: {
1048
- display: { $$type: "string", value: "flex" },
1049
- "flex-direction": { $$type: "string", value: "row" },
1050
- "flex-wrap": { $$type: "string", value: "wrap" }
1051
- }
1052
- });
1053
- container = getContainer(createdContainer.id);
1054
- if (!container) {
1055
- throw new Error("Failed to create container for widget. Cannot create widgets directly in the document.");
1056
- }
1057
- }
1058
- const actualContainerId = container.id;
1059
- const elementTypeData = getElementType(elementType);
1060
- if (!elementTypeData) {
1061
- throw new Error(`Element type "${elementType}" not found or is not atomic`);
1062
- }
1063
- const model = {
1064
- widgetType: elementType,
1065
- elType: "widget",
1066
- settings: props
1067
- };
1068
- const createdElement = createElement({
1069
- containerId: actualContainerId,
1070
- model,
1071
- options: { useHistory: true }
1072
- });
1073
- if (styles) {
1074
- createElementStyle({
1075
- elementId: createdElement.id,
1076
- classesProp: "classes",
1077
- label: "local",
1078
- meta: { breakpoint: "desktop", state: null },
1079
- props: styles
1080
- });
1081
- }
1082
- return {
1083
- elementId: createdElement.id,
1084
- type: elementType
1085
- };
1086
- }
1087
-
1088
- // src/mcp/handlers/common-style-utils.ts
1089
- var VALID_BREAKPOINTS = [
1090
- "widescreen",
1091
- "desktop",
1092
- "laptop",
1093
- "tablet_extra",
1094
- "tablet",
1095
- "mobile_extra",
1096
- "mobile"
1097
- ];
1098
- function resolveBreakpointId(breakpoint) {
1099
- if (breakpoint === null) {
1100
- return null;
1101
- }
1102
- if (VALID_BREAKPOINTS.includes(breakpoint)) {
1103
- return breakpoint;
1104
- }
1105
- return "desktop";
1106
- }
1107
-
1108
- // src/mcp/handlers/create-style.ts
1109
- function handleCreateStyle({
1110
- elementId,
1111
- styleId,
1112
- classesProp = "classes",
1113
- label = "local",
1114
- styles,
1115
- breakpoint = "desktop",
1116
- state = null,
1117
- customCss = null
1118
- }) {
1119
- const resolvedBreakpoint = resolveBreakpointId(breakpoint);
1120
- const resolvedState = state === null || state === void 0 ? null : state;
1121
- const createdStyleId = createElementStyle({
1122
- styleId,
1123
- elementId,
1124
- classesProp,
1125
- label,
1126
- meta: { breakpoint: resolvedBreakpoint, state: resolvedState },
1127
- props: styles,
1128
- custom_css: customCss
1129
- });
1130
- return { styleId: createdStyleId };
1131
- }
1132
-
1133
- // src/mcp/handlers/delete-element.ts
1134
- function handleDeleteElement(elementId) {
1135
- const container = getContainer(elementId);
1136
- if (!container) {
1137
- throw new Error(`Element with ID "${elementId}" not found`);
1138
- }
1139
- deleteElement({
1140
- elementId,
1141
- options: { useHistory: true }
1142
- });
1143
- return { success: true };
1144
- }
1145
-
1146
- // src/mcp/handlers/delete-style.ts
1147
- function handleDeleteStyle({ elementId, styleId }) {
1148
- const elementStyles = getElementStyles(elementId);
1149
- if (!elementStyles) {
1150
- throw new Error(`Element with ID "${elementId}" has no styles.`);
1151
- }
1152
- const resolvedStyleId = styleId || Object.keys(elementStyles)[0];
1153
- if (!resolvedStyleId) {
1154
- throw new Error(`Element with ID "${elementId}" has no styles to delete.`);
1155
- }
1156
- deleteElementStyle(elementId, resolvedStyleId);
1157
- return { success: true };
1158
- }
1159
-
1160
- // src/mcp/handlers/deselect-element.ts
1161
- import { __privateRunCommand as runCommand3 } from "@elementor/editor-v1-adapters";
1162
- function handleDeselectElement(elementId) {
1163
- const container = getContainer(elementId);
1164
- if (!container) {
1165
- throw new Error(`Element with ID "${elementId}" not found`);
1166
- }
1167
- runCommand3("document/elements/deselect", { container });
1168
- return { success: true };
1169
- }
1170
- function handleDeselectAllElements() {
1171
- runCommand3("document/elements/deselect-all", {});
1172
- return { success: true };
1173
- }
1174
-
1175
- // src/mcp/handlers/duplicate-element.ts
1176
- function handleDuplicateElement(elementId) {
1177
- const container = getContainer(elementId);
1178
- if (!container) {
1179
- throw new Error(`Element with ID "${elementId}" not found`);
1180
- }
1181
- const duplicatedElement = duplicateElement({
1182
- elementId,
1183
- options: { useHistory: true }
1184
- });
1185
- const type = duplicatedElement.model.get("widgetType") || duplicatedElement.model.get("elType") || "";
1186
- return {
1187
- elementId: duplicatedElement.id,
1188
- type
1189
- };
1190
- }
1191
-
1192
- // src/mcp/handlers/get-element-props.ts
1193
- function handleGetElementProps(elementId) {
1194
- const container = getContainer(elementId);
1195
- if (!container) {
1196
- throw new Error(`Element with ID "${elementId}" not found`);
1197
- }
1198
- const type = container.model.get("widgetType") || container.model.get("elType");
1199
- if (!type) {
1200
- throw new Error(`Element with ID "${elementId}" has no type`);
1201
- }
1202
- const elementType = getElementType(type);
1203
- if (!elementType) {
1204
- throw new Error(`Element type "${type}" is not atomic`);
1205
- }
1206
- const propsSchema = elementType.propsSchema;
1207
- const propKeys = Object.keys(propsSchema);
1208
- return getElementSettings(elementId, propKeys);
1209
- }
1210
-
1211
- // src/mcp/handlers/get-element-schema.ts
1212
- import { getStylesSchema } from "@elementor/editor-styles";
1213
- function handleGetElementSchema(elementType) {
1214
- const elementTypeData = getElementType(elementType);
1215
- if (!elementTypeData) {
1216
- throw new Error(`Element type "${elementType}" not found or is not atomic`);
1217
- }
1218
- return { ...elementTypeData, stylesSchema: getStylesSchema() };
1219
- }
1220
-
1221
- // src/mcp/handlers/get-selected.ts
1222
- function handleGetSelected() {
1223
- return getSelectedElements();
1224
- }
1225
-
1226
- // src/mcp/handlers/get-styles.ts
1227
- function handleGetStyles(elementId) {
1228
- const styles = getElementStyles(elementId);
1229
- if (!styles) {
1230
- return null;
1231
- }
1232
- return Object.fromEntries(
1233
- Object.entries(styles).map(([id, style]) => [
1234
- id,
1235
- {
1236
- id: style.id,
1237
- label: style.label,
1238
- type: style.type,
1239
- variants: style.variants.map((variant) => ({
1240
- meta: variant.meta,
1241
- props: variant.props,
1242
- custom_css: variant.custom_css
1243
- }))
1244
- }
1245
- ])
1246
- );
1247
- }
1248
-
1249
- // src/mcp/handlers/list-available-types.ts
1250
- function handleListAvailableTypes() {
1251
- const widgetsCache = getWidgetsCache();
1252
- if (!widgetsCache) {
1253
- return [];
1254
- }
1255
- const availableTypes = [];
1256
- Object.entries(widgetsCache).forEach(([type, config]) => {
1257
- if (config?.atomic_controls && config?.atomic_props_schema) {
1258
- availableTypes.push({
1259
- type,
1260
- title: config.title || type
1261
- });
1262
- }
1263
- });
1264
- return availableTypes;
1265
- }
1266
-
1267
- // src/mcp/handlers/move-element.ts
1268
- function handleMoveElement({
1269
- elementId,
1270
- targetContainerId
1271
- }) {
1272
- const container = getContainer(elementId);
1273
- if (!container) {
1274
- throw new Error(`Element with ID "${elementId}" not found`);
1275
- }
1276
- const targetContainer = getContainer(targetContainerId);
1277
- if (!targetContainer) {
1278
- throw new Error(`Target container with ID "${targetContainerId}" not found`);
1279
- }
1280
- moveElement({
1281
- elementId,
1282
- targetContainerId,
1283
- options: { useHistory: true }
1284
- });
1285
- return { success: true };
1286
- }
1287
-
1288
- // src/mcp/handlers/select-element.ts
1289
- function handleSelectElement(elementId) {
1290
- const container = getContainer(elementId);
1291
- if (!container) {
1292
- throw new Error(`Element with ID "${elementId}" not found`);
1293
- }
1294
- selectElement(elementId);
1295
- return { success: true };
1296
- }
1297
- function handleSelectMultipleElements(elementIds) {
1298
- elementIds.forEach((elementId) => {
1299
- const container = getContainer(elementId);
1300
- if (container) {
1301
- selectElement(elementId);
1302
- }
1303
- });
1304
- return { success: true };
1305
- }
1306
-
1307
- // src/mcp/handlers/update-props.ts
1308
- function handleUpdateProps({ elementId, props }) {
1309
- const container = getContainer(elementId);
1310
- if (!container) {
1311
- throw new Error(`Element with ID "${elementId}" not found`);
1312
- }
1313
- updateElementSettings({
1314
- id: elementId,
1315
- props,
1316
- withHistory: true
1317
- });
1318
- return { success: true };
1319
- }
1320
-
1321
- // src/mcp/handlers/update-styles.ts
1322
- function handleUpdateStyles({
1323
- elementId,
1324
- styleId,
1325
- styles,
1326
- breakpoint = "desktop",
1327
- state = null
1328
- }) {
1329
- const resolvedBreakpoint = resolveBreakpointId(breakpoint);
1330
- const resolvedState = state === null || state === void 0 ? null : state;
1331
- const elementStyles = getElementStyles(elementId);
1332
- if (!elementStyles) {
1333
- throw new Error(`Element with ID "${elementId}" has no styles. Create a style first.`);
1334
- }
1335
- const resolvedStyleId = styleId || Object.keys(elementStyles)[0];
1336
- if (!resolvedStyleId) {
1337
- throw new Error(`Element with ID "${elementId}" has no styles. Create a style first.`);
1338
- }
1339
- updateElementStyle({
1340
- elementId,
1341
- styleId: resolvedStyleId,
1342
- meta: { breakpoint: resolvedBreakpoint, state: resolvedState },
1343
- props: styles
1344
- });
1345
- return { success: true };
1346
- }
1347
-
1348
- // src/mcp/elements-tool.ts
1349
- var actionEnum = z.enum([
1350
- "get-element-schema",
1351
- "get-element-props",
1352
- "create-element",
1353
- "update-props",
1354
- "create-style",
1355
- "get-styles",
1356
- "update-styles",
1357
- "delete-style",
1358
- "delete",
1359
- "duplicate",
1360
- "move",
1361
- "select",
1362
- "deselect",
1363
- "deselect-all",
1364
- "get-selected",
1365
- "list-available-types"
1366
- ]);
1367
- var schema = {
1368
- action: actionEnum.describe("The element operation to perform."),
1369
- elementId: z.string().optional().describe("The ID of the target element"),
1370
- elementIds: z.array(z.string()).optional().describe("Array of element IDs for multi-element operations"),
1371
- elementType: z.string().optional().describe(
1372
- "The type of element to create. Must be an atomic element type (required for create-element and get-element-schema actions)"
1373
- ),
1374
- props: z.record(z.any()).optional().describe("Props object for creating or updating an element. Must match the element type's propsSchema."),
1375
- containerId: z.string().optional().describe(
1376
- 'Parent container ID for element creation or move operations. Use "document" if parent is the document root.'
1377
- ),
1378
- targetContainerId: z.string().optional().describe("Target container ID for move operations"),
1379
- styles: z.record(z.any()).optional().describe(
1380
- "Styles object for creating or updating element styles. Must match the element type's stylesSchema."
1381
- ),
1382
- styleId: z.string().optional().describe(
1383
- "Style definition ID for style operations. If not provided, the first available style will be used (for update/delete)."
1384
- ),
1385
- breakpoint: z.string().optional().describe('Breakpoint for style operations (e.g., "desktop", "tablet", "mobile"). Defaults to "desktop".'),
1386
- state: z.string().optional().describe('State for style operations (e.g., "hover", "active", or null). Defaults to null.'),
1387
- classesProp: z.string().optional().describe('Classes property name for create-style action. Defaults to "classes".'),
1388
- label: z.string().optional().describe('Label for create-style action. Defaults to "local".'),
1389
- custom_css: z.object({ raw: z.string() }).optional().describe("Custom CSS object with raw CSS string for create-style action.")
1390
- };
1391
- function routeAction(params) {
1392
- try {
1393
- switch (params.action) {
1394
- case "get-element-schema":
1395
- if (!params.elementType) {
1396
- throw new Error("elementType is required for get-element-schema action");
1397
- }
1398
- return handleGetElementSchema(params.elementType);
1399
- case "get-element-props":
1400
- if (!params.elementId) {
1401
- throw new Error("elementId is required for get-element-props action");
1402
- }
1403
- return handleGetElementProps(params.elementId);
1404
- case "create-element":
1405
- if (!params.elementType) {
1406
- throw new Error("elementType is required for create-element action");
1407
- }
1408
- if (!params.containerId) {
1409
- throw new Error("containerId is required for create-element action");
1410
- }
1411
- return handleCreateElement({
1412
- elementType: params.elementType,
1413
- containerId: params.containerId,
1414
- props: params.props,
1415
- styles: params.styles
1416
- });
1417
- case "update-props":
1418
- if (!params.elementId) {
1419
- throw new Error("elementId is required for update-props action");
1420
- }
1421
- if (!params.props) {
1422
- throw new Error("props is required for update-props action");
1423
- }
1424
- return handleUpdateProps({
1425
- elementId: params.elementId,
1426
- props: params.props
1427
- });
1428
- case "create-style":
1429
- if (!params.elementId) {
1430
- throw new Error("elementId is required for create-style action");
1431
- }
1432
- if (!params.styles) {
1433
- throw new Error("styles is required for create-style action");
1434
- }
1435
- return handleCreateStyle({
1436
- elementId: params.elementId,
1437
- styleId: params.styleId,
1438
- classesProp: params.classesProp,
1439
- label: params.label,
1440
- styles: params.styles,
1441
- breakpoint: params.breakpoint,
1442
- state: params.state,
1443
- customCss: params.custom_css
1444
- });
1445
- case "get-styles":
1446
- if (!params.elementId) {
1447
- throw new Error("elementId is required for get-styles action");
1448
- }
1449
- return handleGetStyles(params.elementId);
1450
- case "update-styles":
1451
- if (!params.elementId) {
1452
- throw new Error("elementId is required for update-styles action");
1453
- }
1454
- if (!params.styles) {
1455
- throw new Error("styles is required for update-styles action");
1456
- }
1457
- return handleUpdateStyles({
1458
- elementId: params.elementId,
1459
- styleId: params.styleId,
1460
- styles: params.styles,
1461
- breakpoint: params.breakpoint,
1462
- state: params.state
1463
- });
1464
- case "delete-style":
1465
- if (!params.elementId) {
1466
- throw new Error("elementId is required for delete-style action");
1467
- }
1468
- return handleDeleteStyle({
1469
- elementId: params.elementId,
1470
- styleId: params.styleId
1471
- });
1472
- case "delete":
1473
- if (!params.elementId) {
1474
- throw new Error("elementId is required for delete action");
1475
- }
1476
- return handleDeleteElement(params.elementId);
1477
- case "duplicate":
1478
- if (!params.elementId) {
1479
- throw new Error("elementId is required for duplicate action");
1480
- }
1481
- return handleDuplicateElement(params.elementId);
1482
- case "move":
1483
- if (!params.elementId) {
1484
- throw new Error("elementId is required for move action");
1485
- }
1486
- if (!params.targetContainerId) {
1487
- throw new Error("targetContainerId is required for move action");
1488
- }
1489
- return handleMoveElement({
1490
- elementId: params.elementId,
1491
- targetContainerId: params.targetContainerId
1492
- });
1493
- case "select":
1494
- if (params.elementIds && params.elementIds.length > 0) {
1495
- return handleSelectMultipleElements(params.elementIds);
1496
- }
1497
- if (!params.elementId) {
1498
- throw new Error("elementId or elementIds is required for select action");
1499
- }
1500
- return handleSelectElement(params.elementId);
1501
- case "deselect":
1502
- if (!params.elementId) {
1503
- throw new Error("elementId is required for deselect action");
1504
- }
1505
- return handleDeselectElement(params.elementId);
1506
- case "deselect-all":
1507
- return handleDeselectAllElements();
1508
- case "get-selected":
1509
- return handleGetSelected();
1510
- case "list-available-types":
1511
- return handleListAvailableTypes();
1512
- default:
1513
- throw new Error(`Unknown action: ${params.action}`);
1514
- }
1515
- } catch (error) {
1516
- const errorMessage = error instanceof Error ? error.message : String(error);
1517
- throw new Error(`Failed to execute action "${params.action}": ${errorMessage}`);
1518
- }
1519
- }
1520
- function initElementsTool() {
1521
- getMCPByDomain("elements").addTool({
1522
- name: "elements",
1523
- schema,
1524
- description: `This tool manages individual Elementor atomic elements (v4).
1525
-
1526
- **When to use this tool:**
1527
-
1528
- Use this tool to create, update, delete, duplicate, move, and select individual atomic elements, as well as retrieve their schemas and current props.
1529
-
1530
- **Available actions:**
1531
-
1532
- - \`list-available-types\`: List all available atomic element types.
1533
- - \`get-element-schema\`: Get the propsSchema and controls for an element type. Required before creating elements of a new type.
1534
- - \`get-element-props\`: Get the current prop values for an existing element.
1535
- - \`create-element\`: Create a new atomic element with specified props and styles (Important to match props and styles by the schema, use get-element-schema to get the schema first).
1536
- - \`update-props\`: Update props for an existing element.
1537
- - \`create-style\`: Create a new style definition for an element.
1538
- - \`get-styles\`: Get all style definitions for an element.
1539
- - \`update-styles\`: Update styles for an existing element's style variant.
1540
- - \`delete-style\`: Delete a style definition from an element.
1541
- - \`delete\`: Delete an element.
1542
- - \`duplicate\`: Duplicate an existing element.
1543
- - \`move\`: Move an element to a different container.
1544
- - \`select\`: Select one or more elements.
1545
- - \`deselect\`: Deselect a specific element.
1546
- - \`deselect-all\`: Deselect all selected elements.
1547
- - \`get-selected\`: Get currently selected elements.
1548
-
1549
- **Constraints:**
1550
-
1551
- - Before creating an element of a certain type for the first time, you MUST call \`get-element-schema\` to retrieve its schema.
1552
- - You can only update props for existing elements.
1553
- - All props must match the element type's propsSchema keys.
1554
- - Element types must be atomic (have atomic_controls and atomic_props_schema).
1555
- - Container IDs must exist and be valid before create/move operations.
1556
-
1557
- ** Must do with every operation **
1558
- As of the user can ask in multiple ways the creation of the element, you need to first get the list of available types with "list-available-types" action.
1559
- After getting it, convert to the most relevant type that the user requested and if this is not clear, request for user input.
1560
- After finding out the proper type, get the schema for it with "get-element-schema" action.
1561
-
1562
- ** Styles and Settings propUtils **
1563
- Getting the schema is important as it introduces the propUtils for the styles and settings.
1564
- You can use the propUtils to create, update, delete, and get the values of the styles and settings.
1565
- Settings exists in the result of the get-element-schema action -> propsSchema.
1566
- Styles exists in the result of the get-element-schema action -> stylesSchema.
1567
-
1568
- **Examples:**
1569
-
1570
- Get schema for heading element:
1571
- \`\`\`json
1572
- { "action": "get-element-schema", "elementType": "e-heading" }
1573
- \`\`\`
1574
-
1575
- Create a heading element:
1576
- \`\`\`json
1577
- { "action": "create-element", "elementType": "e-heading", "containerId": "document", "props": { "title": { $$type: "string", "value": "Hello World" } } }
1578
- \`\`\`
1579
-
1580
- Update element props:
1581
- \`\`\`json
1582
- { "action": "update-props", "elementId": "abc123", "props": { "title": "Updated Title" } }
1583
- \`\`\`
1584
-
1585
- Create element style:
1586
- \`\`\`json
1587
- { "action": "create-style", "elementId": "abc123", "styles": { "padding": "20px", "margin": "10px" } }
1588
- \`\`\`
1589
-
1590
- Get element styles:
1591
- \`\`\`json
1592
- { "action": "get-styles", "elementId": "abc123" }
1593
- \`\`\`
1594
-
1595
- Update element styles:
1596
- \`\`\`json
1597
- { "action": "update-styles", "elementId": "abc123", "styles": { "padding": "20px", "margin": "10px" } }
1598
- \`\`\`
1599
-
1600
- Delete element style:
1601
- \`\`\`json
1602
- { "action": "delete-style", "elementId": "abc123", "styleId": "style-id-123" }
1603
- \`\`\``,
1604
- handler: async (params) => {
1605
- return routeAction(params);
1606
- }
1607
- });
1608
- }
1609
-
1610
- // src/mcp/index.ts
1611
- function initMcp() {
1612
- const { setMCPDescription } = getMCPByDomain2("elements");
1613
- setMCPDescription("Tools for managing atomic elements in Elementor v4 editor");
1614
- initElementsTool();
1615
- }
1616
1007
  export {
1617
1008
  ELEMENT_STYLE_CHANGE_EVENT,
1618
1009
  createElement,
@@ -1640,7 +1031,6 @@ export {
1640
1031
  getLinkInLinkRestriction,
1641
1032
  getSelectedElements,
1642
1033
  getWidgetsCache,
1643
- initMcp as initElementsMcp,
1644
1034
  isElementAnchored,
1645
1035
  moveElement,
1646
1036
  moveElements,