@elementor/editor-variables 4.1.0-721 → 4.1.0-723
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 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -20
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/init.ts +2 -1
- package/src/mcp/index.ts +13 -7
- package/src/mcp/manage-variable-tool.ts +4 -3
- package/src/mcp/variables-resource.ts +5 -8
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// src/init.ts
|
|
2
2
|
import { injectIntoLogic, injectIntoTop } from "@elementor/editor";
|
|
3
3
|
import { registerControlReplacement } from "@elementor/editor-controls";
|
|
4
|
+
import { getMCPByDomain } from "@elementor/editor-mcp";
|
|
4
5
|
import { __registerPanel as registerPanel } from "@elementor/editor-panels";
|
|
5
6
|
import { isTransformable as isTransformable2 } from "@elementor/editor-props";
|
|
6
7
|
import { controlActionsMenu } from "@elementor/menus";
|
|
@@ -3753,22 +3754,15 @@ var trackOpenVariablePopover = (path, variableType) => {
|
|
|
3753
3754
|
});
|
|
3754
3755
|
};
|
|
3755
3756
|
|
|
3756
|
-
// src/mcp/index.ts
|
|
3757
|
-
import { isAngieAvailable } from "@elementor/editor-mcp";
|
|
3758
|
-
|
|
3759
3757
|
// src/mcp/manage-variable-tool.ts
|
|
3760
|
-
import { getMCPByDomain as getMCPByDomain2 } from "@elementor/editor-mcp";
|
|
3761
3758
|
import { z as z3 } from "@elementor/schema";
|
|
3762
3759
|
|
|
3763
3760
|
// src/mcp/variables-resource.ts
|
|
3764
|
-
import { getMCPByDomain } from "@elementor/editor-mcp";
|
|
3765
3761
|
var GLOBAL_VARIABLES_URI = "elementor://global-variables";
|
|
3766
|
-
var initVariablesResource = () => {
|
|
3767
|
-
const canvasMcpEntry = getMCPByDomain("canvas");
|
|
3768
|
-
const variablesMcpEntry = getMCPByDomain("variables");
|
|
3762
|
+
var initVariablesResource = (variablesMcpEntry, canvasMcpEntry) => {
|
|
3769
3763
|
[canvasMcpEntry, variablesMcpEntry].forEach((entry) => {
|
|
3770
|
-
const {
|
|
3771
|
-
|
|
3764
|
+
const { resource, sendResourceUpdated } = entry;
|
|
3765
|
+
resource(
|
|
3772
3766
|
"global-variables",
|
|
3773
3767
|
GLOBAL_VARIABLES_URI,
|
|
3774
3768
|
{
|
|
@@ -3787,7 +3781,7 @@ var initVariablesResource = () => {
|
|
|
3787
3781
|
}
|
|
3788
3782
|
);
|
|
3789
3783
|
window.addEventListener("variables:updated", () => {
|
|
3790
|
-
|
|
3784
|
+
sendResourceUpdated({
|
|
3791
3785
|
uri: GLOBAL_VARIABLES_URI
|
|
3792
3786
|
});
|
|
3793
3787
|
});
|
|
@@ -3795,8 +3789,9 @@ var initVariablesResource = () => {
|
|
|
3795
3789
|
};
|
|
3796
3790
|
|
|
3797
3791
|
// src/mcp/manage-variable-tool.ts
|
|
3798
|
-
var initManageVariableTool = () => {
|
|
3799
|
-
|
|
3792
|
+
var initManageVariableTool = (reg) => {
|
|
3793
|
+
const { addTool } = reg;
|
|
3794
|
+
addTool({
|
|
3800
3795
|
name: "manage-global-variable",
|
|
3801
3796
|
schema: {
|
|
3802
3797
|
action: z3.enum(["create", "update", "delete"]).describe("Operation to perform"),
|
|
@@ -3866,12 +3861,18 @@ function getServiceActions(svc) {
|
|
|
3866
3861
|
}
|
|
3867
3862
|
|
|
3868
3863
|
// src/mcp/index.ts
|
|
3869
|
-
function initMcp() {
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3864
|
+
function initMcp(reg, canvasMcpEntry) {
|
|
3865
|
+
const { setMCPDescription } = reg;
|
|
3866
|
+
setMCPDescription(
|
|
3867
|
+
`Everything related to V4 ( Atomic ) variables.
|
|
3868
|
+
# Global variables
|
|
3869
|
+
- Create/update/delete global variables
|
|
3870
|
+
- Get list of global variables
|
|
3871
|
+
- Get details of a global variable
|
|
3872
|
+
`
|
|
3873
|
+
);
|
|
3874
|
+
initManageVariableTool(reg);
|
|
3875
|
+
initVariablesResource(reg, canvasMcpEntry);
|
|
3875
3876
|
}
|
|
3876
3877
|
|
|
3877
3878
|
// src/register-variable-types.tsx
|
|
@@ -4193,7 +4194,7 @@ function init() {
|
|
|
4193
4194
|
useProps: usePropVariableAction
|
|
4194
4195
|
});
|
|
4195
4196
|
service.init().then(() => {
|
|
4196
|
-
initMcp();
|
|
4197
|
+
initMcp(getMCPByDomain("variables"), getMCPByDomain("canvas"));
|
|
4197
4198
|
});
|
|
4198
4199
|
injectIntoTop({
|
|
4199
4200
|
id: "canvas-style-variables-render",
|