@elementor/editor-canvas 4.3.0-1007 → 4.3.0-1008
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 +12 -4
- package/dist/index.mjs +12 -4
- package/package.json +20 -20
- package/src/mcp/tools/get-page-structure/tool.ts +21 -4
package/dist/index.js
CHANGED
|
@@ -5149,16 +5149,22 @@ var initGetPageStructureTool = (reg) => {
|
|
|
5149
5149
|
const { addTool } = reg;
|
|
5150
5150
|
addTool({
|
|
5151
5151
|
name: "get-page-structure",
|
|
5152
|
-
description: "Returns
|
|
5152
|
+
description: "Returns a lean Elementor element tree skeleton (id, elType, widgetType, nested elements) for a post or page. If no postId is provided, uses the currently open document. Optionally scope to a subtree with elementId. Set includeContent=true (requires elementId) to also return each node's settings and styles.",
|
|
5153
5153
|
schema: {
|
|
5154
5154
|
postId: import_schema4.z.number().optional().describe(
|
|
5155
5155
|
"WordPress post ID of the Elementor document. If omitted, uses the currently open document."
|
|
5156
|
+
),
|
|
5157
|
+
elementId: import_schema4.z.string().optional().describe("If provided, returns only the subtree rooted at that element id."),
|
|
5158
|
+
includeContent: import_schema4.z.boolean().optional().describe(
|
|
5159
|
+
"If true, includes each node's settings and styles (same shape build-composition accepts as input). Requires elementId."
|
|
5156
5160
|
)
|
|
5157
5161
|
},
|
|
5158
5162
|
outputSchema: {
|
|
5159
|
-
elements: import_schema4.z.array(import_schema4.z.any()).describe(
|
|
5163
|
+
elements: import_schema4.z.array(import_schema4.z.any()).describe(
|
|
5164
|
+
"Skeleton of Elementor elements (id, elType, widgetType, nested elements). When includeContent is true, each node also includes settings and styles."
|
|
5165
|
+
)
|
|
5160
5166
|
},
|
|
5161
|
-
handler: async ({ postId }) => {
|
|
5167
|
+
handler: async ({ postId, elementId, includeContent }) => {
|
|
5162
5168
|
const resolvedPostId = postId ?? (0, import_editor_documents3.getCurrentDocument)()?.id;
|
|
5163
5169
|
if (!resolvedPostId) {
|
|
5164
5170
|
throw new Error("No post ID provided and no active document found.");
|
|
@@ -5167,7 +5173,9 @@ var initGetPageStructureTool = (reg) => {
|
|
|
5167
5173
|
const { data } = await (0, import_http_client8.httpService)().post(MCP_PROXY_URL6, {
|
|
5168
5174
|
tool: "get-page-structure",
|
|
5169
5175
|
input: {
|
|
5170
|
-
post_id: resolvedPostId
|
|
5176
|
+
post_id: resolvedPostId,
|
|
5177
|
+
...elementId ? { element_id: elementId } : {},
|
|
5178
|
+
...includeContent ? { include_content: true } : {}
|
|
5171
5179
|
}
|
|
5172
5180
|
});
|
|
5173
5181
|
return {
|
package/dist/index.mjs
CHANGED
|
@@ -5121,16 +5121,22 @@ var initGetPageStructureTool = (reg) => {
|
|
|
5121
5121
|
const { addTool } = reg;
|
|
5122
5122
|
addTool({
|
|
5123
5123
|
name: "get-page-structure",
|
|
5124
|
-
description: "Returns
|
|
5124
|
+
description: "Returns a lean Elementor element tree skeleton (id, elType, widgetType, nested elements) for a post or page. If no postId is provided, uses the currently open document. Optionally scope to a subtree with elementId. Set includeContent=true (requires elementId) to also return each node's settings and styles.",
|
|
5125
5125
|
schema: {
|
|
5126
5126
|
postId: z3.number().optional().describe(
|
|
5127
5127
|
"WordPress post ID of the Elementor document. If omitted, uses the currently open document."
|
|
5128
|
+
),
|
|
5129
|
+
elementId: z3.string().optional().describe("If provided, returns only the subtree rooted at that element id."),
|
|
5130
|
+
includeContent: z3.boolean().optional().describe(
|
|
5131
|
+
"If true, includes each node's settings and styles (same shape build-composition accepts as input). Requires elementId."
|
|
5128
5132
|
)
|
|
5129
5133
|
},
|
|
5130
5134
|
outputSchema: {
|
|
5131
|
-
elements: z3.array(z3.any()).describe(
|
|
5135
|
+
elements: z3.array(z3.any()).describe(
|
|
5136
|
+
"Skeleton of Elementor elements (id, elType, widgetType, nested elements). When includeContent is true, each node also includes settings and styles."
|
|
5137
|
+
)
|
|
5132
5138
|
},
|
|
5133
|
-
handler: async ({ postId }) => {
|
|
5139
|
+
handler: async ({ postId, elementId, includeContent }) => {
|
|
5134
5140
|
const resolvedPostId = postId ?? getCurrentDocument2()?.id;
|
|
5135
5141
|
if (!resolvedPostId) {
|
|
5136
5142
|
throw new Error("No post ID provided and no active document found.");
|
|
@@ -5139,7 +5145,9 @@ var initGetPageStructureTool = (reg) => {
|
|
|
5139
5145
|
const { data } = await httpService7().post(MCP_PROXY_URL6, {
|
|
5140
5146
|
tool: "get-page-structure",
|
|
5141
5147
|
input: {
|
|
5142
|
-
post_id: resolvedPostId
|
|
5148
|
+
post_id: resolvedPostId,
|
|
5149
|
+
...elementId ? { element_id: elementId } : {},
|
|
5150
|
+
...includeContent ? { include_content: true } : {}
|
|
5143
5151
|
}
|
|
5144
5152
|
});
|
|
5145
5153
|
return {
|
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-
|
|
4
|
+
"version": "4.3.0-1008",
|
|
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-
|
|
41
|
-
"@elementor/editor-controls": "4.3.0-
|
|
42
|
-
"@elementor/editor-documents": "4.3.0-
|
|
43
|
-
"@elementor/editor-elements": "4.3.0-
|
|
44
|
-
"@elementor/editor-interactions": "4.3.0-
|
|
45
|
-
"@elementor/editor-mcp": "4.3.0-
|
|
46
|
-
"@elementor/editor-notifications": "4.3.0-
|
|
47
|
-
"@elementor/editor-props": "4.3.0-
|
|
48
|
-
"@elementor/editor-responsive": "4.3.0-
|
|
49
|
-
"@elementor/editor-styles": "4.3.0-
|
|
50
|
-
"@elementor/editor-styles-repository": "4.3.0-
|
|
51
|
-
"@elementor/editor-ui": "4.3.0-
|
|
52
|
-
"@elementor/editor-v1-adapters": "4.3.0-
|
|
53
|
-
"@elementor/events": "4.3.0-
|
|
54
|
-
"@elementor/http-client": "4.3.0-
|
|
55
|
-
"@elementor/schema": "4.3.0-
|
|
56
|
-
"@elementor/twing": "4.3.0-
|
|
40
|
+
"@elementor/editor": "4.3.0-1008",
|
|
41
|
+
"@elementor/editor-controls": "4.3.0-1008",
|
|
42
|
+
"@elementor/editor-documents": "4.3.0-1008",
|
|
43
|
+
"@elementor/editor-elements": "4.3.0-1008",
|
|
44
|
+
"@elementor/editor-interactions": "4.3.0-1008",
|
|
45
|
+
"@elementor/editor-mcp": "4.3.0-1008",
|
|
46
|
+
"@elementor/editor-notifications": "4.3.0-1008",
|
|
47
|
+
"@elementor/editor-props": "4.3.0-1008",
|
|
48
|
+
"@elementor/editor-responsive": "4.3.0-1008",
|
|
49
|
+
"@elementor/editor-styles": "4.3.0-1008",
|
|
50
|
+
"@elementor/editor-styles-repository": "4.3.0-1008",
|
|
51
|
+
"@elementor/editor-ui": "4.3.0-1008",
|
|
52
|
+
"@elementor/editor-v1-adapters": "4.3.0-1008",
|
|
53
|
+
"@elementor/events": "4.3.0-1008",
|
|
54
|
+
"@elementor/http-client": "4.3.0-1008",
|
|
55
|
+
"@elementor/schema": "4.3.0-1008",
|
|
56
|
+
"@elementor/twing": "4.3.0-1008",
|
|
57
57
|
"@elementor/ui": "1.37.5",
|
|
58
|
-
"@elementor/utils": "4.3.0-
|
|
59
|
-
"@elementor/wp-media": "4.3.0-
|
|
58
|
+
"@elementor/utils": "4.3.0-1008",
|
|
59
|
+
"@elementor/wp-media": "4.3.0-1008",
|
|
60
60
|
"@floating-ui/react": "^0.27.5",
|
|
61
61
|
"@wordpress/i18n": "^5.13.0",
|
|
62
62
|
"dompurify": "^3.2.6"
|
|
@@ -17,8 +17,9 @@ export const initGetPageStructureTool = ( reg: MCPRegistryEntry ) => {
|
|
|
17
17
|
addTool( {
|
|
18
18
|
name: 'get-page-structure',
|
|
19
19
|
description:
|
|
20
|
-
'Returns
|
|
21
|
-
'If no postId is provided, uses the currently open document.
|
|
20
|
+
'Returns a lean Elementor element tree skeleton (id, elType, widgetType, nested elements) for a post or page. ' +
|
|
21
|
+
'If no postId is provided, uses the currently open document. Optionally scope to a subtree with elementId. ' +
|
|
22
|
+
"Set includeContent=true (requires elementId) to also return each node's settings and styles.",
|
|
22
23
|
schema: {
|
|
23
24
|
postId: z
|
|
24
25
|
.number()
|
|
@@ -26,11 +27,25 @@ export const initGetPageStructureTool = ( reg: MCPRegistryEntry ) => {
|
|
|
26
27
|
.describe(
|
|
27
28
|
'WordPress post ID of the Elementor document. If omitted, uses the currently open document.'
|
|
28
29
|
),
|
|
30
|
+
elementId: z
|
|
31
|
+
.string()
|
|
32
|
+
.optional()
|
|
33
|
+
.describe( 'If provided, returns only the subtree rooted at that element id.' ),
|
|
34
|
+
includeContent: z
|
|
35
|
+
.boolean()
|
|
36
|
+
.optional()
|
|
37
|
+
.describe(
|
|
38
|
+
"If true, includes each node's settings and styles (same shape build-composition accepts as input). Requires elementId."
|
|
39
|
+
),
|
|
29
40
|
},
|
|
30
41
|
outputSchema: {
|
|
31
|
-
elements: z
|
|
42
|
+
elements: z
|
|
43
|
+
.array( z.any() )
|
|
44
|
+
.describe(
|
|
45
|
+
'Skeleton of Elementor elements (id, elType, widgetType, nested elements). When includeContent is true, each node also includes settings and styles.'
|
|
46
|
+
),
|
|
32
47
|
},
|
|
33
|
-
handler: async ( { postId } ) => {
|
|
48
|
+
handler: async ( { postId, elementId, includeContent } ) => {
|
|
34
49
|
const resolvedPostId = postId ?? getCurrentDocument()?.id;
|
|
35
50
|
|
|
36
51
|
if ( ! resolvedPostId ) {
|
|
@@ -42,6 +57,8 @@ export const initGetPageStructureTool = ( reg: MCPRegistryEntry ) => {
|
|
|
42
57
|
tool: 'get-page-structure',
|
|
43
58
|
input: {
|
|
44
59
|
post_id: resolvedPostId,
|
|
60
|
+
...( elementId ? { element_id: elementId } : {} ),
|
|
61
|
+
...( includeContent ? { include_content: true } : {} ),
|
|
45
62
|
},
|
|
46
63
|
} );
|
|
47
64
|
|