@elementor/editor-canvas 4.3.0-1003 → 4.3.0-1004

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.js CHANGED
@@ -4522,6 +4522,9 @@ var initBuildCompositionTool = (reg) => {
4522
4522
  "Map configuration-id \u2192 raw CSS declarations (property \u2192 value strings; no selectors). Server converts to native styles; unconvertible declarations become the element custom CSS."
4523
4523
  ),
4524
4524
  parentId: import_schema.z.string().optional().describe("ID of the parent container. Omit or pass 'document' to insert at document root."),
4525
+ mode: import_schema.z.enum(["append", "replace_children"]).optional().describe(
4526
+ "'append' (default) inserts under parentId; 'replace_children' removes existing direct children of parentId first, then inserts."
4527
+ ),
4525
4528
  dryRun: import_schema.z.boolean().optional().describe("If true, validate and return the resolved tree without persisting.")
4526
4529
  },
4527
4530
  outputSchema: {
@@ -4530,9 +4533,10 @@ var initBuildCompositionTool = (reg) => {
4530
4533
  version: import_schema.z.string(),
4531
4534
  resolvedXml: import_schema.z.string(),
4532
4535
  llmInstructions: import_schema.z.string(),
4533
- warnings: import_schema.z.array(import_schema.z.string()).optional()
4536
+ warnings: import_schema.z.array(import_schema.z.string()).optional(),
4537
+ removedElementIds: import_schema.z.array(import_schema.z.string()).optional()
4534
4538
  },
4535
- handler: async ({ xmlStructure, elementConfig, style, parentId, dryRun }) => {
4539
+ handler: async ({ xmlStructure, elementConfig, style, parentId, mode, dryRun }) => {
4536
4540
  const document2 = (0, import_editor_documents2.getCurrentDocument)();
4537
4541
  if (!document2?.id) {
4538
4542
  throw new Error("No active document found.");
@@ -4546,6 +4550,7 @@ var initBuildCompositionTool = (reg) => {
4546
4550
  element_config: elementConfig ?? {},
4547
4551
  style: style ?? {},
4548
4552
  parent_id: parentId ?? "document",
4553
+ mode: mode ?? "append",
4549
4554
  dry_run: dryRun ?? false
4550
4555
  }
4551
4556
  });
@@ -4566,7 +4571,8 @@ var initBuildCompositionTool = (reg) => {
4566
4571
  version: data.data.version,
4567
4572
  resolvedXml: data.data.resolved_xml,
4568
4573
  llmInstructions: data.data.llm_instructions,
4569
- warnings: data.data.warnings
4574
+ warnings: data.data.warnings,
4575
+ removedElementIds: data.data.removed_element_ids
4570
4576
  };
4571
4577
  } catch (error) {
4572
4578
  throw new Error(getMcpErrorMessage(error, "build-composition"));
package/dist/index.mjs CHANGED
@@ -4488,6 +4488,9 @@ var initBuildCompositionTool = (reg) => {
4488
4488
  "Map configuration-id \u2192 raw CSS declarations (property \u2192 value strings; no selectors). Server converts to native styles; unconvertible declarations become the element custom CSS."
4489
4489
  ),
4490
4490
  parentId: z.string().optional().describe("ID of the parent container. Omit or pass 'document' to insert at document root."),
4491
+ mode: z.enum(["append", "replace_children"]).optional().describe(
4492
+ "'append' (default) inserts under parentId; 'replace_children' removes existing direct children of parentId first, then inserts."
4493
+ ),
4491
4494
  dryRun: z.boolean().optional().describe("If true, validate and return the resolved tree without persisting.")
4492
4495
  },
4493
4496
  outputSchema: {
@@ -4496,9 +4499,10 @@ var initBuildCompositionTool = (reg) => {
4496
4499
  version: z.string(),
4497
4500
  resolvedXml: z.string(),
4498
4501
  llmInstructions: z.string(),
4499
- warnings: z.array(z.string()).optional()
4502
+ warnings: z.array(z.string()).optional(),
4503
+ removedElementIds: z.array(z.string()).optional()
4500
4504
  },
4501
- handler: async ({ xmlStructure, elementConfig, style, parentId, dryRun }) => {
4505
+ handler: async ({ xmlStructure, elementConfig, style, parentId, mode, dryRun }) => {
4502
4506
  const document2 = getCurrentDocument();
4503
4507
  if (!document2?.id) {
4504
4508
  throw new Error("No active document found.");
@@ -4512,6 +4516,7 @@ var initBuildCompositionTool = (reg) => {
4512
4516
  element_config: elementConfig ?? {},
4513
4517
  style: style ?? {},
4514
4518
  parent_id: parentId ?? "document",
4519
+ mode: mode ?? "append",
4515
4520
  dry_run: dryRun ?? false
4516
4521
  }
4517
4522
  });
@@ -4532,7 +4537,8 @@ var initBuildCompositionTool = (reg) => {
4532
4537
  version: data.data.version,
4533
4538
  resolvedXml: data.data.resolved_xml,
4534
4539
  llmInstructions: data.data.llm_instructions,
4535
- warnings: data.data.warnings
4540
+ warnings: data.data.warnings,
4541
+ removedElementIds: data.data.removed_element_ids
4536
4542
  };
4537
4543
  } catch (error) {
4538
4544
  throw new Error(getMcpErrorMessage(error, "build-composition"));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@elementor/editor-canvas",
3
3
  "description": "Elementor Editor Canvas",
4
- "version": "4.3.0-1003",
4
+ "version": "4.3.0-1004",
5
5
  "private": false,
6
6
  "author": "Elementor Team",
7
7
  "homepage": "https://elementor.com/",
@@ -37,26 +37,26 @@
37
37
  "react-dom": "^18.3.1"
38
38
  },
39
39
  "dependencies": {
40
- "@elementor/editor": "4.3.0-1003",
41
- "@elementor/editor-controls": "4.3.0-1003",
42
- "@elementor/editor-documents": "4.3.0-1003",
43
- "@elementor/editor-elements": "4.3.0-1003",
44
- "@elementor/editor-interactions": "4.3.0-1003",
45
- "@elementor/editor-mcp": "4.3.0-1003",
46
- "@elementor/editor-notifications": "4.3.0-1003",
47
- "@elementor/editor-props": "4.3.0-1003",
48
- "@elementor/editor-responsive": "4.3.0-1003",
49
- "@elementor/editor-styles": "4.3.0-1003",
50
- "@elementor/editor-styles-repository": "4.3.0-1003",
51
- "@elementor/editor-ui": "4.3.0-1003",
52
- "@elementor/editor-v1-adapters": "4.3.0-1003",
53
- "@elementor/events": "4.3.0-1003",
54
- "@elementor/http-client": "4.3.0-1003",
55
- "@elementor/schema": "4.3.0-1003",
56
- "@elementor/twing": "4.3.0-1003",
40
+ "@elementor/editor": "4.3.0-1004",
41
+ "@elementor/editor-controls": "4.3.0-1004",
42
+ "@elementor/editor-documents": "4.3.0-1004",
43
+ "@elementor/editor-elements": "4.3.0-1004",
44
+ "@elementor/editor-interactions": "4.3.0-1004",
45
+ "@elementor/editor-mcp": "4.3.0-1004",
46
+ "@elementor/editor-notifications": "4.3.0-1004",
47
+ "@elementor/editor-props": "4.3.0-1004",
48
+ "@elementor/editor-responsive": "4.3.0-1004",
49
+ "@elementor/editor-styles": "4.3.0-1004",
50
+ "@elementor/editor-styles-repository": "4.3.0-1004",
51
+ "@elementor/editor-ui": "4.3.0-1004",
52
+ "@elementor/editor-v1-adapters": "4.3.0-1004",
53
+ "@elementor/events": "4.3.0-1004",
54
+ "@elementor/http-client": "4.3.0-1004",
55
+ "@elementor/schema": "4.3.0-1004",
56
+ "@elementor/twing": "4.3.0-1004",
57
57
  "@elementor/ui": "1.37.5",
58
- "@elementor/utils": "4.3.0-1003",
59
- "@elementor/wp-media": "4.3.0-1003",
58
+ "@elementor/utils": "4.3.0-1004",
59
+ "@elementor/wp-media": "4.3.0-1004",
60
60
  "@floating-ui/react": "^0.27.5",
61
61
  "@wordpress/i18n": "^5.13.0",
62
62
  "dompurify": "^3.2.6"
@@ -17,6 +17,7 @@ type BuildCompositionResponse = {
17
17
  resolved_xml: string;
18
18
  llm_instructions: string;
19
19
  warnings?: string[];
20
+ removed_element_ids?: string[];
20
21
  };
21
22
 
22
23
  export const initBuildCompositionTool = ( reg: MCPRegistryEntry ) => {
@@ -58,6 +59,12 @@ export const initBuildCompositionTool = ( reg: MCPRegistryEntry ) => {
58
59
  .string()
59
60
  .optional()
60
61
  .describe( "ID of the parent container. Omit or pass 'document' to insert at document root." ),
62
+ mode: z
63
+ .enum( [ 'append', 'replace_children' ] )
64
+ .optional()
65
+ .describe(
66
+ "'append' (default) inserts under parentId; 'replace_children' removes existing direct children of parentId first, then inserts."
67
+ ),
61
68
  dryRun: z
62
69
  .boolean()
63
70
  .optional()
@@ -70,8 +77,9 @@ export const initBuildCompositionTool = ( reg: MCPRegistryEntry ) => {
70
77
  resolvedXml: z.string(),
71
78
  llmInstructions: z.string(),
72
79
  warnings: z.array( z.string() ).optional(),
80
+ removedElementIds: z.array( z.string() ).optional(),
73
81
  },
74
- handler: async ( { xmlStructure, elementConfig, style, parentId, dryRun } ) => {
82
+ handler: async ( { xmlStructure, elementConfig, style, parentId, mode, dryRun } ) => {
75
83
  const document = getCurrentDocument();
76
84
 
77
85
  if ( ! document?.id ) {
@@ -87,6 +95,7 @@ export const initBuildCompositionTool = ( reg: MCPRegistryEntry ) => {
87
95
  element_config: elementConfig ?? {},
88
96
  style: style ?? {},
89
97
  parent_id: parentId ?? 'document',
98
+ mode: mode ?? 'append',
90
99
  dry_run: dryRun ?? false,
91
100
  },
92
101
  } );
@@ -111,6 +120,7 @@ export const initBuildCompositionTool = ( reg: MCPRegistryEntry ) => {
111
120
  resolvedXml: data.data.resolved_xml,
112
121
  llmInstructions: data.data.llm_instructions,
113
122
  warnings: data.data.warnings,
123
+ removedElementIds: data.data.removed_element_ids,
114
124
  };
115
125
  } catch ( error ) {
116
126
  throw new Error( getMcpErrorMessage( error, 'build-composition' ) );