@elementor/editor-variables 4.2.0-840 → 4.2.0-842

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elementor/editor-variables",
3
- "version": "4.2.0-840",
3
+ "version": "4.2.0-842",
4
4
  "private": false,
5
5
  "author": "Elementor Team",
6
6
  "homepage": "https://elementor.com/",
@@ -39,22 +39,22 @@
39
39
  "dev": "tsup --config=../../tsup.dev.ts"
40
40
  },
41
41
  "dependencies": {
42
- "@elementor/editor": "4.2.0-840",
43
- "@elementor/editor-canvas": "4.2.0-840",
44
- "@elementor/editor-controls": "4.2.0-840",
45
- "@elementor/editor-current-user": "4.2.0-840",
46
- "@elementor/editor-mcp": "4.2.0-840",
47
- "@elementor/editor-panels": "4.2.0-840",
48
- "@elementor/editor-props": "4.2.0-840",
49
- "@elementor/editor-ui": "4.2.0-840",
50
- "@elementor/editor-v1-adapters": "4.2.0-840",
51
- "@elementor/menus": "4.2.0-840",
52
- "@elementor/http-client": "4.2.0-840",
42
+ "@elementor/editor": "4.2.0-842",
43
+ "@elementor/editor-canvas": "4.2.0-842",
44
+ "@elementor/editor-controls": "4.2.0-842",
45
+ "@elementor/editor-current-user": "4.2.0-842",
46
+ "@elementor/editor-mcp": "4.2.0-842",
47
+ "@elementor/editor-panels": "4.2.0-842",
48
+ "@elementor/editor-props": "4.2.0-842",
49
+ "@elementor/editor-ui": "4.2.0-842",
50
+ "@elementor/editor-v1-adapters": "4.2.0-842",
51
+ "@elementor/menus": "4.2.0-842",
52
+ "@elementor/http-client": "4.2.0-842",
53
53
  "@elementor/icons": "~1.75.1",
54
- "@elementor/events": "4.2.0-840",
55
- "@elementor/schema": "4.2.0-840",
54
+ "@elementor/events": "4.2.0-842",
55
+ "@elementor/schema": "4.2.0-842",
56
56
  "@elementor/ui": "1.37.5",
57
- "@elementor/utils": "4.2.0-840",
57
+ "@elementor/utils": "4.2.0-842",
58
58
  "@wordpress/i18n": "^5.13.0"
59
59
  },
60
60
  "peerDependencies": {
package/src/init.ts CHANGED
@@ -47,7 +47,15 @@ export function init() {
47
47
  } );
48
48
 
49
49
  variablesService.init().then( () => {
50
- initMcp( getMCPByDomain( 'variables' ), getMCPByDomain( 'canvas' ) );
50
+ const variablesMcpRegistry = getMCPByDomain( 'variables', {
51
+ instructions: `Everything related to V4 ( Atomic ) variables.
52
+ # Global variables
53
+ - Create/update/delete global variables
54
+ - Get list of global variables
55
+ - Get details of a global variable
56
+ `,
57
+ } );
58
+ initMcp( variablesMcpRegistry, getMCPByDomain( 'canvas' ) );
51
59
  } );
52
60
 
53
61
  injectIntoTop( {
package/src/mcp/index.ts CHANGED
@@ -4,15 +4,6 @@ import { initManageVariableTool } from './manage-variable-tool';
4
4
  import { initVariablesResource } from './variables-resource';
5
5
 
6
6
  export function initMcp( reg: MCPRegistryEntry, canvasMcpEntry: MCPRegistryEntry ) {
7
- const { setMCPDescription } = reg;
8
- setMCPDescription(
9
- `Everything related to V4 ( Atomic ) variables.
10
- # Global variables
11
- - Create/update/delete global variables
12
- - Get list of global variables
13
- - Get details of a global variable
14
- `
15
- );
16
7
  initManageVariableTool( reg );
17
8
  initVariablesResource( reg, canvasMcpEntry );
18
9
  }
@@ -20,7 +20,12 @@ export const initManageVariableTool = ( reg: MCPRegistryEntry ) => {
20
20
  .optional()
21
21
  .describe( 'Variable type: "global-color-variable" or "global-font-variable" (required for create)' ),
22
22
  label: z.string().optional().describe( 'Variable label (required for create/update)' ),
23
- value: z.string().optional().describe( 'Variable value (required for create/update)' ),
23
+ value: z
24
+ .string()
25
+ .optional()
26
+ .describe(
27
+ 'The variable value (required for create/update). Provide a plain CSS value matching the variable type (font: family name; color: CSS color; size: value with unit). Never JSON.'
28
+ ),
24
29
  },
25
30
  outputSchema: {
26
31
  status: z.enum( [ 'ok' ] ).describe( 'Operation status' ),
@@ -36,14 +41,11 @@ export const initManageVariableTool = ( reg: MCPRegistryEntry ) => {
36
41
  description: 'Global variables',
37
42
  },
38
43
  ],
39
- description: `Manages global variables (create/update/delete). Existing variables available in resources.
40
- CREATE: requires type, label, value. Ensure label is unique.
41
- UPDATE: requires id, label, value. When renaming: keep existing value. When updating value: keep exact label.
42
- DELETE: requires id. DESTRUCTIVE - confirm with user first.
43
-
44
- # NAMING - IMPORTANT
45
- the variables names should ALWAYS be lowercased and dashed spaced. example: "Headline Primary" should be "headline-primary"
46
- `,
44
+ description: `Create, update, or delete V4 global variables (distinct from legacy "globals").
45
+ - Values: any valid CSS value, inserted as-is (1:1 with \`--css-var: VALUE\`). Do NOT pass JSON or legacy-globals object structures.
46
+ - Names: lowercase, dash-separated (e.g. "Headline Primary" "headline-primary").
47
+ - Update: when renaming, keep the existing value; when updating value, keep the exact label.
48
+ - Delete: destructive — confirm with user first.`,
47
49
  handler: async ( params ) => {
48
50
  const operations = getServiceActions( service );
49
51
  const op = operations[ params.action ];