@elementor/editor-components 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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@elementor/editor-components",
3
3
  "description": "Elementor editor components",
4
- "version": "4.3.0-948",
4
+ "version": "4.3.0-949",
5
5
  "private": false,
6
6
  "author": "Elementor Team",
7
7
  "homepage": "https://elementor.com/",
@@ -40,31 +40,31 @@
40
40
  "dev": "tsup --config=../../tsup.dev.ts"
41
41
  },
42
42
  "dependencies": {
43
- "@elementor/editor": "4.3.0-948",
44
- "@elementor/editor-canvas": "4.3.0-948",
45
- "@elementor/editor-controls": "4.3.0-948",
46
- "@elementor/editor-documents": "4.3.0-948",
47
- "@elementor/editor-editing-panel": "4.3.0-948",
48
- "@elementor/editor-elements": "4.3.0-948",
49
- "@elementor/editor-elements-panel": "4.3.0-948",
50
- "@elementor/editor-mcp": "4.3.0-948",
51
- "@elementor/editor-templates": "4.3.0-948",
52
- "@elementor/editor-panels": "4.3.0-948",
53
- "@elementor/editor-props": "4.3.0-948",
54
- "@elementor/editor-ui": "4.3.0-948",
55
- "@elementor/editor-v1-adapters": "4.3.0-948",
56
- "@elementor/http-client": "4.3.0-948",
43
+ "@elementor/editor": "4.3.0-949",
44
+ "@elementor/editor-canvas": "4.3.0-949",
45
+ "@elementor/editor-controls": "4.3.0-949",
46
+ "@elementor/editor-documents": "4.3.0-949",
47
+ "@elementor/editor-editing-panel": "4.3.0-949",
48
+ "@elementor/editor-elements": "4.3.0-949",
49
+ "@elementor/editor-elements-panel": "4.3.0-949",
50
+ "@elementor/editor-mcp": "4.3.0-949",
51
+ "@elementor/editor-templates": "4.3.0-949",
52
+ "@elementor/editor-panels": "4.3.0-949",
53
+ "@elementor/editor-props": "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/events": "4.3.0-948",
59
- "@elementor/query": "4.3.0-948",
60
- "@elementor/schema": "4.3.0-948",
61
- "@elementor/store": "4.3.0-948",
58
+ "@elementor/events": "4.3.0-949",
59
+ "@elementor/query": "4.3.0-949",
60
+ "@elementor/schema": "4.3.0-949",
61
+ "@elementor/store": "4.3.0-949",
62
62
  "@elementor/ui": "1.37.5",
63
- "@elementor/utils": "4.3.0-948",
63
+ "@elementor/utils": "4.3.0-949",
64
64
  "@wordpress/i18n": "^5.13.0",
65
- "@elementor/editor-notifications": "4.3.0-948",
66
- "@elementor/editor-current-user": "4.3.0-948",
67
- "@elementor/editor-embedded-documents-manager": "4.3.0-948"
65
+ "@elementor/editor-notifications": "4.3.0-949",
66
+ "@elementor/editor-current-user": "4.3.0-949",
67
+ "@elementor/editor-embedded-documents-manager": "4.3.0-949"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "react": "^18.3.1",
@@ -341,7 +341,7 @@ function createComponentView( options: ComponentTypeOptions ): typeof TemplatedE
341
341
 
342
342
  trackComponentEvent( {
343
343
  action: 'edited',
344
- source: 'user',
344
+ executedBy: 'user',
345
345
  component_uid: editorSettings?.component_uid,
346
346
  component_name: editorSettings?.title,
347
347
  location,
package/src/index.ts CHANGED
@@ -54,6 +54,8 @@ export {
54
54
  createComponentsAction,
55
55
  registerComponentsReducer,
56
56
  selectOverridableProps,
57
+ selectCreatedThisSession,
58
+ selectComponentByUid,
57
59
  selectPath,
58
60
  slice,
59
61
  useCurrentComponent,
@@ -89,5 +91,5 @@ export { isComponentInstance } from './utils/is-component-instance';
89
91
  export { resolveOverridePropValue } from './utils/resolve-override-prop-value';
90
92
  export { switchToComponent } from './utils/switch-to-component';
91
93
  export { onElementDrop, trackComponentEvent } from './utils/tracking';
92
- export type { Source } from './utils/tracking';
94
+ export type { ExecutedBy } from './utils/tracking';
93
95
  export { getComponentDocumentData } from './utils/component-document-data';
@@ -111,7 +111,7 @@ export async function detachComponentInstance( {
111
111
  const componentUid = selectComponent( getState(), componentId )?.uid;
112
112
  trackComponentEvent( {
113
113
  action: 'detached',
114
- source: 'user',
114
+ executedBy: 'user',
115
115
  component_uid: componentUid,
116
116
  instance_id: instanceId,
117
117
  location: trackingInfo.location,
@@ -5,7 +5,7 @@ import { __getState as getState } from '@elementor/store';
5
5
  import { selectCreatedThisSession } from '../store/store';
6
6
  import { type ExtendedWindow } from '../types';
7
7
 
8
- export type Source = 'user' | 'mcp_tool' | 'system';
8
+ export type ExecutedBy = 'user' | 'mcp_tool' | 'system';
9
9
 
10
10
  type ComponentEventData = Record< string, unknown > & {
11
11
  action:
@@ -19,13 +19,16 @@ type ComponentEventData = Record< string, unknown > & {
19
19
  | 'propertiesPanelOpened'
20
20
  | 'propertiesGroupCreated'
21
21
  | 'detached';
22
- source: Source;
22
+ // TODO: Remove `source` parameter in version 4.4.0 - it's replaced by `executedBy`, but pro's older versions will still send `source`
23
+ // so we keep both for backward compatibility
24
+ source?: ExecutedBy;
25
+ executedBy: ExecutedBy;
23
26
  };
24
27
 
25
28
  const FEATURE_NAME = 'Components';
26
29
 
27
- export const trackComponentEvent = ( { action, source, ...data }: ComponentEventData ) => {
28
- if ( source === 'system' ) {
30
+ export const trackComponentEvent = ( { action, source, executedBy, ...data }: ComponentEventData ) => {
31
+ if ( source === 'system' || executedBy === 'system' ) {
29
32
  return;
30
33
  }
31
34
 
@@ -35,9 +38,10 @@ export const trackComponentEvent = ( { action, source, ...data }: ComponentEvent
35
38
  }
36
39
 
37
40
  const name = config.names.components[ action ];
38
- dispatchEvent?.( name, { ...data, source, 'Feature name': FEATURE_NAME } );
41
+ dispatchEvent?.( name, { ...data, executed_by: executedBy ?? source, 'Feature name': FEATURE_NAME } );
39
42
  };
40
43
 
44
+ // TODO: Remove this function in version 4.4.0 - moved to pro
41
45
  export const onElementDrop = ( _args: unknown, element: V1Element ) => {
42
46
  if ( ! ( element?.model?.get( 'widgetType' ) === 'e-component' ) ) {
43
47
  return;
@@ -56,7 +60,7 @@ export const onElementDrop = ( _args: unknown, element: V1Element ) => {
56
60
 
57
61
  trackComponentEvent( {
58
62
  action: 'instanceAdded',
59
- source: 'user',
63
+ executedBy: 'user',
60
64
  instance_id: instanceId,
61
65
  component_uid: componentUID,
62
66
  component_name: componentName,