@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/dist/index.js CHANGED
@@ -3971,7 +3971,9 @@ var initManageVariableTool = (reg) => {
3971
3971
  id: import_schema3.z.string().optional().describe("Variable id (required for update/delete). Get from list-global-variables."),
3972
3972
  type: import_schema3.z.string().optional().describe('Variable type: "global-color-variable" or "global-font-variable" (required for create)'),
3973
3973
  label: import_schema3.z.string().optional().describe("Variable label (required for create/update)"),
3974
- value: import_schema3.z.string().optional().describe("Variable value (required for create/update)")
3974
+ value: import_schema3.z.string().optional().describe(
3975
+ "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."
3976
+ )
3975
3977
  },
3976
3978
  outputSchema: {
3977
3979
  status: import_schema3.z.enum(["ok"]).describe("Operation status"),
@@ -3987,14 +3989,11 @@ var initManageVariableTool = (reg) => {
3987
3989
  description: "Global variables"
3988
3990
  }
3989
3991
  ],
3990
- description: `Manages global variables (create/update/delete). Existing variables available in resources.
3991
- CREATE: requires type, label, value. Ensure label is unique.
3992
- UPDATE: requires id, label, value. When renaming: keep existing value. When updating value: keep exact label.
3993
- DELETE: requires id. DESTRUCTIVE - confirm with user first.
3994
-
3995
- # NAMING - IMPORTANT
3996
- the variables names should ALWAYS be lowercased and dashed spaced. example: "Headline Primary" should be "headline-primary"
3997
- `,
3992
+ description: `Create, update, or delete V4 global variables (distinct from legacy "globals").
3993
+ - Values: any valid CSS value, inserted as-is (1:1 with \`--css-var: VALUE\`). Do NOT pass JSON or legacy-globals object structures.
3994
+ - Names: lowercase, dash-separated (e.g. "Headline Primary" \u2192 "headline-primary").
3995
+ - Update: when renaming, keep the existing value; when updating value, keep the exact label.
3996
+ - Delete: destructive \u2014 confirm with user first.`,
3998
3997
  handler: async (params) => {
3999
3998
  const operations = getServiceActions(service);
4000
3999
  const op = operations[params.action];
@@ -4043,15 +4042,6 @@ function getServiceActions(svc) {
4043
4042
 
4044
4043
  // src/mcp/index.ts
4045
4044
  function initMcp(reg, canvasMcpEntry) {
4046
- const { setMCPDescription } = reg;
4047
- setMCPDescription(
4048
- `Everything related to V4 ( Atomic ) variables.
4049
- # Global variables
4050
- - Create/update/delete global variables
4051
- - Get list of global variables
4052
- - Get details of a global variable
4053
- `
4054
- );
4055
4045
  initManageVariableTool(reg);
4056
4046
  initVariablesResource(reg, canvasMcpEntry);
4057
4047
  }
@@ -4563,7 +4553,15 @@ function init() {
4563
4553
  useProps: usePropVariableAction
4564
4554
  });
4565
4555
  service.init().then(() => {
4566
- initMcp((0, import_editor_mcp.getMCPByDomain)("variables"), (0, import_editor_mcp.getMCPByDomain)("canvas"));
4556
+ const variablesMcpRegistry = (0, import_editor_mcp.getMCPByDomain)("variables", {
4557
+ instructions: `Everything related to V4 ( Atomic ) variables.
4558
+ # Global variables
4559
+ - Create/update/delete global variables
4560
+ - Get list of global variables
4561
+ - Get details of a global variable
4562
+ `
4563
+ });
4564
+ initMcp(variablesMcpRegistry, (0, import_editor_mcp.getMCPByDomain)("canvas"));
4567
4565
  });
4568
4566
  (0, import_editor.injectIntoTop)({
4569
4567
  id: "canvas-style-variables-render",