@elementor/editor-global-classes 4.3.0-947 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elementor/editor-global-classes",
3
- "version": "4.3.0-947",
3
+ "version": "4.3.0-949",
4
4
  "private": false,
5
5
  "author": "Elementor Team",
6
6
  "homepage": "https://elementor.com/",
@@ -39,30 +39,30 @@
39
39
  "dev": "tsup --config=../../tsup.dev.ts"
40
40
  },
41
41
  "dependencies": {
42
- "@elementor/editor": "4.3.0-947",
43
- "@elementor/editor-current-user": "4.3.0-947",
44
- "@elementor/editor-documents": "4.3.0-947",
45
- "@elementor/editor-embedded-documents-manager": "4.3.0-947",
46
- "@elementor/editor-editing-panel": "4.3.0-947",
47
- "@elementor/editor-mcp": "4.3.0-947",
48
- "@elementor/editor-panels": "4.3.0-947",
49
- "@elementor/editor-props": "4.3.0-947",
50
- "@elementor/editor-variables": "4.3.0-947",
51
- "@elementor/editor-styles": "4.3.0-947",
52
- "@elementor/editor-canvas": "4.3.0-947",
53
- "@elementor/editor-styles-repository": "4.3.0-947",
54
- "@elementor/editor-ui": "4.3.0-947",
55
- "@elementor/editor-v1-adapters": "4.3.0-947",
56
- "@elementor/http-client": "4.3.0-947",
42
+ "@elementor/editor": "4.3.0-949",
43
+ "@elementor/editor-current-user": "4.3.0-949",
44
+ "@elementor/editor-documents": "4.3.0-949",
45
+ "@elementor/editor-embedded-documents-manager": "4.3.0-949",
46
+ "@elementor/editor-editing-panel": "4.3.0-949",
47
+ "@elementor/editor-mcp": "4.3.0-949",
48
+ "@elementor/editor-panels": "4.3.0-949",
49
+ "@elementor/editor-props": "4.3.0-949",
50
+ "@elementor/editor-variables": "4.3.0-949",
51
+ "@elementor/editor-styles": "4.3.0-949",
52
+ "@elementor/editor-canvas": "4.3.0-949",
53
+ "@elementor/editor-styles-repository": "4.3.0-949",
54
+ "@elementor/editor-ui": "4.3.0-949",
55
+ "@elementor/editor-v1-adapters": "4.3.0-949",
56
+ "@elementor/http-client": "4.3.0-949",
57
57
  "@elementor/icons": "~1.75.1",
58
- "@elementor/query": "4.3.0-947",
59
- "@elementor/schema": "4.3.0-947",
60
- "@elementor/store": "4.3.0-947",
58
+ "@elementor/query": "4.3.0-949",
59
+ "@elementor/schema": "4.3.0-949",
60
+ "@elementor/store": "4.3.0-949",
61
61
  "@elementor/ui": "1.37.5",
62
- "@elementor/utils": "4.3.0-947",
62
+ "@elementor/utils": "4.3.0-949",
63
63
  "@tanstack/react-virtual": "^3.13.24",
64
64
  "@wordpress/i18n": "^5.13.0",
65
- "@elementor/events": "4.3.0-947"
65
+ "@elementor/events": "4.3.0-949"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "react": "^18.3.1",
@@ -2,6 +2,7 @@ import { doApplyClasses, doGetAppliedClasses, doUnapplyClass } from '@elementor/
2
2
  import { type MCPRegistryEntry } from '@elementor/editor-mcp';
3
3
  import { z } from '@elementor/schema';
4
4
 
5
+ import { globalClassesStylesProvider } from '../global-classes-styles-provider';
5
6
  import { APPLY_GLOBAL_CLASS_GUIDE_URI, generateApplyGlobalClassGuidePrompt } from './apply-global-class-guide-prompt';
6
7
  import { GLOBAL_CLASSES_URI } from './classes-resource';
7
8
 
@@ -43,6 +44,13 @@ export default function initMcpApplyUnapplyGlobalClasses( server: MCPRegistryEnt
43
44
  const { classId, elementId } = params;
44
45
  const appliedClasses = doGetAppliedClasses( elementId );
45
46
  doApplyClasses( elementId, [ ...appliedClasses, classId ] );
47
+
48
+ globalClassesStylesProvider.actions.tracking?.( {
49
+ event: 'classApplied',
50
+ executedBy: 'mcp_tool',
51
+ classId,
52
+ } );
53
+
46
54
  return {
47
55
  llm_instructions:
48
56
  'Please check the element configuration, find inline styles duplicated by the applied global class, and remove them',
@@ -1,4 +1,5 @@
1
1
  import { BREAKPOINTS_SCHEMA_FULL_URI, convertStyleBlocksToAtomic, type StyleBlock } from '@elementor/editor-canvas';
2
+ import { dispatchMcpStylesAppliedEvent } from '@elementor/editor-mcp';
2
3
  import { type MCPRegistryEntry } from '@elementor/editor-mcp';
3
4
  import { type Props } from '@elementor/editor-props';
4
5
  import { type BreakpointId } from '@elementor/editor-responsive';
@@ -139,6 +140,12 @@ const handler = async ( input: InputSchema ): Promise< OutputSchema > => {
139
140
  status: 'ok',
140
141
  message: `created global class with ID ${ newClassId }`,
141
142
  };
143
+ globalClassesStylesProvider.actions.tracking?.( {
144
+ event: 'classCreated',
145
+ executedBy: 'mcp_tool',
146
+ classId: newClassId,
147
+ } );
148
+ dispatchMcpStylesAppliedEvent( { styleValue: props } );
142
149
  } else {
143
150
  throw new Error( 'error creating class' );
144
151
  }
@@ -154,6 +161,7 @@ const handler = async ( input: InputSchema ): Promise< OutputSchema > => {
154
161
  } );
155
162
  if ( updated ) {
156
163
  result = { status: 'ok', classId };
164
+ dispatchMcpStylesAppliedEvent( { styleValue: props } );
157
165
  } else {
158
166
  throw new Error( 'error modifying class' );
159
167
  }
@@ -12,6 +12,7 @@ type EventMap = {
12
12
  source?: 'created' | 'converted' | 'duplicated';
13
13
  classId: StyleDefinitionID;
14
14
  classTitle?: string;
15
+ executedBy?: 'mcp_tool' | 'user';
15
16
  };
16
17
  classDeleted: {
17
18
  classId: StyleDefinitionID;
@@ -27,6 +28,7 @@ type EventMap = {
27
28
  classId: StyleDefinitionID;
28
29
  classTitle: string;
29
30
  totalInstancesAfterApply: number;
31
+ executedBy?: 'mcp_tool' | 'user';
30
32
  };
31
33
  classRemoved: {
32
34
  classId: StyleDefinitionID;