@elementor/editor-app-bar 4.2.0-844 → 4.2.0-845

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-app-bar",
3
3
  "description": "App Bar extension for @elementor/editor",
4
- "version": "4.2.0-844",
4
+ "version": "4.2.0-845",
5
5
  "private": false,
6
6
  "author": "Elementor Team",
7
7
  "homepage": "https://elementor.com/",
@@ -40,17 +40,17 @@
40
40
  "dev": "tsup --config=../../tsup.dev.ts"
41
41
  },
42
42
  "dependencies": {
43
- "@elementor/editor-ui": "4.2.0-844",
44
- "@elementor/http-client": "4.2.0-844",
45
- "@elementor/editor": "4.2.0-844",
46
- "@elementor/editor-documents": "4.2.0-844",
47
- "@elementor/editor-mcp": "4.2.0-844",
48
- "@elementor/editor-responsive": "4.2.0-844",
49
- "@elementor/editor-v1-adapters": "4.2.0-844",
43
+ "@elementor/editor-ui": "4.2.0-845",
44
+ "@elementor/http-client": "4.2.0-845",
45
+ "@elementor/editor": "4.2.0-845",
46
+ "@elementor/editor-documents": "4.2.0-845",
47
+ "@elementor/editor-mcp": "4.2.0-845",
48
+ "@elementor/editor-responsive": "4.2.0-845",
49
+ "@elementor/editor-v1-adapters": "4.2.0-845",
50
50
  "@elementor/icons": "~1.75.1",
51
- "@elementor/locations": "4.2.0-844",
52
- "@elementor/menus": "4.2.0-844",
53
- "@elementor/events": "4.2.0-844",
51
+ "@elementor/locations": "4.2.0-845",
52
+ "@elementor/menus": "4.2.0-845",
53
+ "@elementor/events": "4.2.0-845",
54
54
  "@elementor/ui": "1.37.5",
55
55
  "@wordpress/i18n": "^5.13.0"
56
56
  },
@@ -1,8 +1,11 @@
1
+ import { useEffect } from 'react';
1
2
  import { isAngieAvailable } from '@elementor/editor-mcp';
3
+ import { trackEvent } from '@elementor/events';
2
4
  import { AngieIcon } from '@elementor/icons';
3
5
  import { __ } from '@wordpress/i18n';
4
6
 
5
7
  const CREATE_WIDGET_EVENT = 'elementor/editor/create-widget';
8
+ const AI_WIDGET_CTA_VIEWED_EVENT = 'ai_widget_cta_viewed' as const;
6
9
 
7
10
  const CREATE_WIDGET_PROMPT = `Create a widget for me.
8
11
  Goal: [What should this widget help me accomplish?]
@@ -10,6 +13,21 @@ Placement: [Where will I see it in the editor/UI?]
10
13
  How it should work: `;
11
14
 
12
15
  export default function useActionProps() {
16
+ const hasAngieInstalled = isAngieAvailable();
17
+ const visible = ! hasAngieInstalled;
18
+
19
+ useEffect( () => {
20
+ if ( ! visible ) {
21
+ return;
22
+ }
23
+
24
+ trackEvent( {
25
+ eventName: AI_WIDGET_CTA_VIEWED_EVENT,
26
+ entry_point: 'top_bar_icon',
27
+ has_angie_installed: false,
28
+ } );
29
+ }, [ visible ] );
30
+
13
31
  return {
14
32
  title: __( 'Angie', 'elementor' ),
15
33
  icon: AngieIcon,
@@ -18,12 +36,12 @@ export default function useActionProps() {
18
36
  new CustomEvent( CREATE_WIDGET_EVENT, {
19
37
  detail: {
20
38
  prompt: CREATE_WIDGET_PROMPT,
21
- entry_point: 'top_bar',
39
+ entry_point: 'top_bar_icon',
22
40
  },
23
41
  } )
24
42
  );
25
43
  },
26
44
  selected: false,
27
- visible: ! isAngieAvailable(),
45
+ visible,
28
46
  };
29
47
  }