@elementor/editor-global-classes 4.3.0-948 → 4.3.0-949
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.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +16 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +21 -21
- package/src/mcp-integration/mcp-apply-unapply-global-classes.ts +8 -0
- package/src/mcp-integration/mcp-manage-global-classes.ts +8 -0
- package/src/utils/tracking.ts +2 -0
package/dist/index.d.mts
CHANGED
|
@@ -30,6 +30,7 @@ type EventMap = {
|
|
|
30
30
|
source?: 'created' | 'converted' | 'duplicated';
|
|
31
31
|
classId: StyleDefinitionID;
|
|
32
32
|
classTitle?: string;
|
|
33
|
+
executedBy?: 'mcp_tool' | 'user';
|
|
33
34
|
};
|
|
34
35
|
classDeleted: {
|
|
35
36
|
classId: StyleDefinitionID;
|
|
@@ -45,6 +46,7 @@ type EventMap = {
|
|
|
45
46
|
classId: StyleDefinitionID;
|
|
46
47
|
classTitle: string;
|
|
47
48
|
totalInstancesAfterApply: number;
|
|
49
|
+
executedBy?: 'mcp_tool' | 'user';
|
|
48
50
|
};
|
|
49
51
|
classRemoved: {
|
|
50
52
|
classId: StyleDefinitionID;
|
package/dist/index.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ type EventMap = {
|
|
|
30
30
|
source?: 'created' | 'converted' | 'duplicated';
|
|
31
31
|
classId: StyleDefinitionID;
|
|
32
32
|
classTitle?: string;
|
|
33
|
+
executedBy?: 'mcp_tool' | 'user';
|
|
33
34
|
};
|
|
34
35
|
classDeleted: {
|
|
35
36
|
classId: StyleDefinitionID;
|
|
@@ -45,6 +46,7 @@ type EventMap = {
|
|
|
45
46
|
classId: StyleDefinitionID;
|
|
46
47
|
classTitle: string;
|
|
47
48
|
totalInstancesAfterApply: number;
|
|
49
|
+
executedBy?: 'mcp_tool' | 'user';
|
|
48
50
|
};
|
|
49
51
|
classRemoved: {
|
|
50
52
|
classId: StyleDefinitionID;
|
package/dist/index.js
CHANGED
|
@@ -2648,7 +2648,7 @@ var initClassesResource = (classesMcpEntry, canvasMcpEntry) => {
|
|
|
2648
2648
|
var import_editor = require("@elementor/editor");
|
|
2649
2649
|
var import_editor_editing_panel2 = require("@elementor/editor-editing-panel");
|
|
2650
2650
|
var import_editor_embedded_documents_manager = require("@elementor/editor-embedded-documents-manager");
|
|
2651
|
-
var
|
|
2651
|
+
var import_editor_mcp3 = require("@elementor/editor-mcp");
|
|
2652
2652
|
var import_editor_styles_repository5 = require("@elementor/editor-styles-repository");
|
|
2653
2653
|
var import_store32 = require("@elementor/store");
|
|
2654
2654
|
|
|
@@ -2864,6 +2864,11 @@ function initMcpApplyUnapplyGlobalClasses(server) {
|
|
|
2864
2864
|
const { classId, elementId } = params;
|
|
2865
2865
|
const appliedClasses = (0, import_editor_editing_panel.doGetAppliedClasses)(elementId);
|
|
2866
2866
|
(0, import_editor_editing_panel.doApplyClasses)(elementId, [...appliedClasses, classId]);
|
|
2867
|
+
globalClassesStylesProvider.actions.tracking?.({
|
|
2868
|
+
event: "classApplied",
|
|
2869
|
+
executedBy: "mcp_tool",
|
|
2870
|
+
classId
|
|
2871
|
+
});
|
|
2867
2872
|
return {
|
|
2868
2873
|
llm_instructions: "Please check the element configuration, find inline styles duplicated by the applied global class, and remove them",
|
|
2869
2874
|
result: `Class ${classId} applied to element ${elementId} successfully.`
|
|
@@ -2959,6 +2964,7 @@ function initMcpApplyGetGlobalClassUsages(reg) {
|
|
|
2959
2964
|
|
|
2960
2965
|
// src/mcp-integration/mcp-manage-global-classes.ts
|
|
2961
2966
|
var import_editor_canvas2 = require("@elementor/editor-canvas");
|
|
2967
|
+
var import_editor_mcp2 = require("@elementor/editor-mcp");
|
|
2962
2968
|
var import_schema3 = require("@elementor/schema");
|
|
2963
2969
|
var schema = {
|
|
2964
2970
|
action: import_schema3.z.enum(["create", "modify", "delete"]).describe("Operation to perform"),
|
|
@@ -3059,6 +3065,12 @@ var handler = async (input) => {
|
|
|
3059
3065
|
status: "ok",
|
|
3060
3066
|
message: `created global class with ID ${newClassId}`
|
|
3061
3067
|
};
|
|
3068
|
+
globalClassesStylesProvider.actions.tracking?.({
|
|
3069
|
+
event: "classCreated",
|
|
3070
|
+
executedBy: "mcp_tool",
|
|
3071
|
+
classId: newClassId
|
|
3072
|
+
});
|
|
3073
|
+
(0, import_editor_mcp2.dispatchMcpStylesAppliedEvent)({ styleValue: props });
|
|
3062
3074
|
} else {
|
|
3063
3075
|
throw new Error("error creating class");
|
|
3064
3076
|
}
|
|
@@ -3074,6 +3086,7 @@ var handler = async (input) => {
|
|
|
3074
3086
|
});
|
|
3075
3087
|
if (updated) {
|
|
3076
3088
|
result = { status: "ok", classId };
|
|
3089
|
+
(0, import_editor_mcp2.dispatchMcpStylesAppliedEvent)({ styleValue: props });
|
|
3077
3090
|
} else {
|
|
3078
3091
|
throw new Error("error modifying class");
|
|
3079
3092
|
}
|
|
@@ -3329,7 +3342,7 @@ function init() {
|
|
|
3329
3342
|
getThemeColor: (theme) => theme.palette.global.dark
|
|
3330
3343
|
});
|
|
3331
3344
|
initMcpIntegration(
|
|
3332
|
-
(0,
|
|
3345
|
+
(0, import_editor_mcp3.getMCPByDomain)("classes", {
|
|
3333
3346
|
instructions: "MCP server for management of Elementor global classes",
|
|
3334
3347
|
docs: `Everything related to V4 ( Atomic ) global classes.
|
|
3335
3348
|
# Global classes
|
|
@@ -3338,7 +3351,7 @@ function init() {
|
|
|
3338
3351
|
- Get details of a global class
|
|
3339
3352
|
`
|
|
3340
3353
|
}),
|
|
3341
|
-
(0,
|
|
3354
|
+
(0, import_editor_mcp3.getMCPByDomain)("canvas")
|
|
3342
3355
|
);
|
|
3343
3356
|
}
|
|
3344
3357
|
// Annotate the CommonJS export names for ESM import in node:
|