@elementor/editor-global-classes 4.3.0-1023 → 4.3.0-1031
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 +21 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +21 -21
- package/src/mcp-integration/manage-classes-tool.ts +25 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-global-classes",
|
|
3
|
-
"version": "4.3.0-
|
|
3
|
+
"version": "4.3.0-1031",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Elementor Team",
|
|
6
6
|
"homepage": "https://elementor.com/",
|
|
@@ -39,30 +39,30 @@
|
|
|
39
39
|
"dev": "tsup --config=../../tsup.dev.ts"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@elementor/editor": "4.3.0-
|
|
43
|
-
"@elementor/editor-current-user": "4.3.0-
|
|
44
|
-
"@elementor/editor-documents": "4.3.0-
|
|
45
|
-
"@elementor/editor-embedded-documents-manager": "4.3.0-
|
|
46
|
-
"@elementor/editor-editing-panel": "4.3.0-
|
|
47
|
-
"@elementor/editor-mcp": "4.3.0-
|
|
48
|
-
"@elementor/editor-panels": "4.3.0-
|
|
49
|
-
"@elementor/editor-props": "4.3.0-
|
|
50
|
-
"@elementor/editor-variables": "4.3.0-
|
|
51
|
-
"@elementor/editor-styles": "4.3.0-
|
|
52
|
-
"@elementor/editor-canvas": "4.3.0-
|
|
53
|
-
"@elementor/editor-styles-repository": "4.3.0-
|
|
54
|
-
"@elementor/editor-ui": "4.3.0-
|
|
55
|
-
"@elementor/editor-v1-adapters": "4.3.0-
|
|
56
|
-
"@elementor/http-client": "4.3.0-
|
|
42
|
+
"@elementor/editor": "4.3.0-1031",
|
|
43
|
+
"@elementor/editor-current-user": "4.3.0-1031",
|
|
44
|
+
"@elementor/editor-documents": "4.3.0-1031",
|
|
45
|
+
"@elementor/editor-embedded-documents-manager": "4.3.0-1031",
|
|
46
|
+
"@elementor/editor-editing-panel": "4.3.0-1031",
|
|
47
|
+
"@elementor/editor-mcp": "4.3.0-1031",
|
|
48
|
+
"@elementor/editor-panels": "4.3.0-1031",
|
|
49
|
+
"@elementor/editor-props": "4.3.0-1031",
|
|
50
|
+
"@elementor/editor-variables": "4.3.0-1031",
|
|
51
|
+
"@elementor/editor-styles": "4.3.0-1031",
|
|
52
|
+
"@elementor/editor-canvas": "4.3.0-1031",
|
|
53
|
+
"@elementor/editor-styles-repository": "4.3.0-1031",
|
|
54
|
+
"@elementor/editor-ui": "4.3.0-1031",
|
|
55
|
+
"@elementor/editor-v1-adapters": "4.3.0-1031",
|
|
56
|
+
"@elementor/http-client": "4.3.0-1031",
|
|
57
57
|
"@elementor/icons": "~1.75.1",
|
|
58
|
-
"@elementor/query": "4.3.0-
|
|
59
|
-
"@elementor/schema": "4.3.0-
|
|
60
|
-
"@elementor/store": "4.3.0-
|
|
58
|
+
"@elementor/query": "4.3.0-1031",
|
|
59
|
+
"@elementor/schema": "4.3.0-1031",
|
|
60
|
+
"@elementor/store": "4.3.0-1031",
|
|
61
61
|
"@elementor/ui": "1.37.5",
|
|
62
|
-
"@elementor/utils": "4.3.0-
|
|
62
|
+
"@elementor/utils": "4.3.0-1031",
|
|
63
63
|
"@tanstack/react-virtual": "^3.13.24",
|
|
64
64
|
"@wordpress/i18n": "^5.13.0",
|
|
65
|
-
"@elementor/events": "4.3.0-
|
|
65
|
+
"@elementor/events": "4.3.0-1031"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"react": "^18.3.1",
|
|
@@ -13,7 +13,7 @@ const TOOL_NAME = 'manage-classes';
|
|
|
13
13
|
|
|
14
14
|
type ManageClassesResponse = {
|
|
15
15
|
status: string;
|
|
16
|
-
|
|
16
|
+
results?: StyleDefinition[];
|
|
17
17
|
order?: string[];
|
|
18
18
|
};
|
|
19
19
|
|
|
@@ -23,7 +23,7 @@ export const initManageClassesTool = ( reg: MCPRegistryEntry ) => {
|
|
|
23
23
|
addTool( {
|
|
24
24
|
name: TOOL_NAME,
|
|
25
25
|
description:
|
|
26
|
-
'Manage V4 global CSS classes on the active kit.
|
|
26
|
+
'Manage V4 global CSS classes on the active kit. Bulk create, update, or delete using raw CSS declarations (up to 50 operations). Duplicate labels are auto-renamed with a DUP_ prefix.',
|
|
27
27
|
schema: {
|
|
28
28
|
action: z.enum( [ 'create', 'update', 'delete' ] ),
|
|
29
29
|
id: z
|
|
@@ -35,12 +35,22 @@ export const initManageClassesTool = ( reg: MCPRegistryEntry ) => {
|
|
|
35
35
|
.optional()
|
|
36
36
|
.describe( 'Class label (lowercase, dash-separated) — required for create/update.' ),
|
|
37
37
|
css: z
|
|
38
|
-
.
|
|
38
|
+
.string()
|
|
39
|
+
.optional()
|
|
40
|
+
.describe(
|
|
41
|
+
'Plain CSS string. Supports &:hover/&:focus/&:active nesting and @media(--breakpoint) blocks. In patch mode: "prop: null" removes that prop; "all: null" wipes the variant.'
|
|
42
|
+
),
|
|
43
|
+
mode: z
|
|
44
|
+
.enum( [ 'patch', 'replace' ] )
|
|
39
45
|
.optional()
|
|
40
|
-
.describe(
|
|
46
|
+
.describe(
|
|
47
|
+
'Merge strategy for update — patch (default): merge incoming props with existing; replace: discard all existing variants for the affected breakpoints.'
|
|
48
|
+
),
|
|
41
49
|
},
|
|
42
50
|
outputSchema: {
|
|
43
51
|
status: z.enum( [ 'ok' ] ).describe( 'Operation status' ),
|
|
52
|
+
id: z.string().optional().describe( 'ID of the affected class — use for subsequent update/delete calls.' ),
|
|
53
|
+
label: z.string().optional().describe( 'Final label of the class after any auto-rename.' ),
|
|
44
54
|
},
|
|
45
55
|
requiredResources: [
|
|
46
56
|
{
|
|
@@ -52,21 +62,21 @@ export const initManageClassesTool = ( reg: MCPRegistryEntry ) => {
|
|
|
52
62
|
handler: async ( params ) => {
|
|
53
63
|
const { data } = await httpService().post< HttpResponse< ManageClassesResponse > >( MCP_PROXY_URL, {
|
|
54
64
|
tool: TOOL_NAME,
|
|
55
|
-
input: params,
|
|
65
|
+
input: { operations: [ params ] },
|
|
56
66
|
} );
|
|
57
67
|
|
|
58
|
-
const
|
|
68
|
+
const result = data.data.results?.[ 0 ];
|
|
59
69
|
const { create, update, delete: del } = globalClassesStylesProvider.actions;
|
|
60
70
|
|
|
61
71
|
switch ( params.action ) {
|
|
62
72
|
case 'create':
|
|
63
|
-
if (
|
|
64
|
-
create(
|
|
73
|
+
if ( result && create ) {
|
|
74
|
+
create( result.label, result.variants, result.id );
|
|
65
75
|
}
|
|
66
76
|
break;
|
|
67
77
|
case 'update':
|
|
68
|
-
if (
|
|
69
|
-
update(
|
|
78
|
+
if ( result && update ) {
|
|
79
|
+
update( result );
|
|
70
80
|
}
|
|
71
81
|
break;
|
|
72
82
|
case 'delete':
|
|
@@ -79,7 +89,11 @@ export const initManageClassesTool = ( reg: MCPRegistryEntry ) => {
|
|
|
79
89
|
dispatch( slice.actions.reset( { context: 'frontend' } ) );
|
|
80
90
|
window.dispatchEvent( new CustomEvent( 'classes:updated', { detail: { context: 'frontend' } } ) );
|
|
81
91
|
|
|
82
|
-
return {
|
|
92
|
+
return {
|
|
93
|
+
status: 'ok' as const,
|
|
94
|
+
id: result?.id,
|
|
95
|
+
label: result?.label,
|
|
96
|
+
};
|
|
83
97
|
},
|
|
84
98
|
} );
|
|
85
99
|
};
|