@elementor/editor-global-classes 4.3.0-948 → 4.3.0-950
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.mjs
CHANGED
|
@@ -2897,6 +2897,11 @@ function initMcpApplyUnapplyGlobalClasses(server) {
|
|
|
2897
2897
|
const { classId, elementId } = params;
|
|
2898
2898
|
const appliedClasses = doGetAppliedClasses(elementId);
|
|
2899
2899
|
doApplyClasses(elementId, [...appliedClasses, classId]);
|
|
2900
|
+
globalClassesStylesProvider.actions.tracking?.({
|
|
2901
|
+
event: "classApplied",
|
|
2902
|
+
executedBy: "mcp_tool",
|
|
2903
|
+
classId
|
|
2904
|
+
});
|
|
2900
2905
|
return {
|
|
2901
2906
|
llm_instructions: "Please check the element configuration, find inline styles duplicated by the applied global class, and remove them",
|
|
2902
2907
|
result: `Class ${classId} applied to element ${elementId} successfully.`
|
|
@@ -2992,6 +2997,7 @@ function initMcpApplyGetGlobalClassUsages(reg) {
|
|
|
2992
2997
|
|
|
2993
2998
|
// src/mcp-integration/mcp-manage-global-classes.ts
|
|
2994
2999
|
import { BREAKPOINTS_SCHEMA_FULL_URI, convertStyleBlocksToAtomic } from "@elementor/editor-canvas";
|
|
3000
|
+
import { dispatchMcpStylesAppliedEvent } from "@elementor/editor-mcp";
|
|
2995
3001
|
import { z as z3 } from "@elementor/schema";
|
|
2996
3002
|
var schema = {
|
|
2997
3003
|
action: z3.enum(["create", "modify", "delete"]).describe("Operation to perform"),
|
|
@@ -3092,6 +3098,12 @@ var handler = async (input) => {
|
|
|
3092
3098
|
status: "ok",
|
|
3093
3099
|
message: `created global class with ID ${newClassId}`
|
|
3094
3100
|
};
|
|
3101
|
+
globalClassesStylesProvider.actions.tracking?.({
|
|
3102
|
+
event: "classCreated",
|
|
3103
|
+
executedBy: "mcp_tool",
|
|
3104
|
+
classId: newClassId
|
|
3105
|
+
});
|
|
3106
|
+
dispatchMcpStylesAppliedEvent({ styleValue: props });
|
|
3095
3107
|
} else {
|
|
3096
3108
|
throw new Error("error creating class");
|
|
3097
3109
|
}
|
|
@@ -3107,6 +3119,7 @@ var handler = async (input) => {
|
|
|
3107
3119
|
});
|
|
3108
3120
|
if (updated) {
|
|
3109
3121
|
result = { status: "ok", classId };
|
|
3122
|
+
dispatchMcpStylesAppliedEvent({ styleValue: props });
|
|
3110
3123
|
} else {
|
|
3111
3124
|
throw new Error("error modifying class");
|
|
3112
3125
|
}
|