@elementor/editor-variables 4.2.0-841 → 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 +17 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -19
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/init.ts +9 -1
- package/src/mcp/index.ts +0 -9
- package/src/mcp/manage-variable-tool.ts +11 -9
package/dist/index.mjs
CHANGED
|
@@ -3974,7 +3974,9 @@ var initManageVariableTool = (reg) => {
|
|
|
3974
3974
|
id: z3.string().optional().describe("Variable id (required for update/delete). Get from list-global-variables."),
|
|
3975
3975
|
type: z3.string().optional().describe('Variable type: "global-color-variable" or "global-font-variable" (required for create)'),
|
|
3976
3976
|
label: z3.string().optional().describe("Variable label (required for create/update)"),
|
|
3977
|
-
value: z3.string().optional().describe(
|
|
3977
|
+
value: z3.string().optional().describe(
|
|
3978
|
+
"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."
|
|
3979
|
+
)
|
|
3978
3980
|
},
|
|
3979
3981
|
outputSchema: {
|
|
3980
3982
|
status: z3.enum(["ok"]).describe("Operation status"),
|
|
@@ -3990,14 +3992,11 @@ var initManageVariableTool = (reg) => {
|
|
|
3990
3992
|
description: "Global variables"
|
|
3991
3993
|
}
|
|
3992
3994
|
],
|
|
3993
|
-
description: `
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
# NAMING - IMPORTANT
|
|
3999
|
-
the variables names should ALWAYS be lowercased and dashed spaced. example: "Headline Primary" should be "headline-primary"
|
|
4000
|
-
`,
|
|
3995
|
+
description: `Create, update, or delete V4 global variables (distinct from legacy "globals").
|
|
3996
|
+
- Values: any valid CSS value, inserted as-is (1:1 with \`--css-var: VALUE\`). Do NOT pass JSON or legacy-globals object structures.
|
|
3997
|
+
- Names: lowercase, dash-separated (e.g. "Headline Primary" \u2192 "headline-primary").
|
|
3998
|
+
- Update: when renaming, keep the existing value; when updating value, keep the exact label.
|
|
3999
|
+
- Delete: destructive \u2014 confirm with user first.`,
|
|
4001
4000
|
handler: async (params) => {
|
|
4002
4001
|
const operations = getServiceActions(service);
|
|
4003
4002
|
const op = operations[params.action];
|
|
@@ -4046,15 +4045,6 @@ function getServiceActions(svc) {
|
|
|
4046
4045
|
|
|
4047
4046
|
// src/mcp/index.ts
|
|
4048
4047
|
function initMcp(reg, canvasMcpEntry) {
|
|
4049
|
-
const { setMCPDescription } = reg;
|
|
4050
|
-
setMCPDescription(
|
|
4051
|
-
`Everything related to V4 ( Atomic ) variables.
|
|
4052
|
-
# Global variables
|
|
4053
|
-
- Create/update/delete global variables
|
|
4054
|
-
- Get list of global variables
|
|
4055
|
-
- Get details of a global variable
|
|
4056
|
-
`
|
|
4057
|
-
);
|
|
4058
4048
|
initManageVariableTool(reg);
|
|
4059
4049
|
initVariablesResource(reg, canvasMcpEntry);
|
|
4060
4050
|
}
|
|
@@ -4583,7 +4573,15 @@ function init() {
|
|
|
4583
4573
|
useProps: usePropVariableAction
|
|
4584
4574
|
});
|
|
4585
4575
|
service.init().then(() => {
|
|
4586
|
-
|
|
4576
|
+
const variablesMcpRegistry = getMCPByDomain("variables", {
|
|
4577
|
+
instructions: `Everything related to V4 ( Atomic ) variables.
|
|
4578
|
+
# Global variables
|
|
4579
|
+
- Create/update/delete global variables
|
|
4580
|
+
- Get list of global variables
|
|
4581
|
+
- Get details of a global variable
|
|
4582
|
+
`
|
|
4583
|
+
});
|
|
4584
|
+
initMcp(variablesMcpRegistry, getMCPByDomain("canvas"));
|
|
4587
4585
|
});
|
|
4588
4586
|
injectIntoTop({
|
|
4589
4587
|
id: "canvas-style-variables-render",
|