@elementor/editor-app-bar 4.4.0-1066 → 4.4.0-1069
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.js +29 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +29 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -12
- package/src/extensions/help/hooks/use-action-props.ts +34 -12
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.4.0-
|
|
4
|
+
"version": "4.4.0-1069",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "Elementor Team",
|
|
7
7
|
"homepage": "https://elementor.com/",
|
|
@@ -40,18 +40,18 @@
|
|
|
40
40
|
"dev": "tsup --config=../../tsup.dev.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@elementor/editor-current-user": "4.4.0-
|
|
44
|
-
"@elementor/editor-ui": "4.4.0-
|
|
45
|
-
"@elementor/http-client": "4.4.0-
|
|
46
|
-
"@elementor/editor": "4.4.0-
|
|
47
|
-
"@elementor/editor-documents": "4.4.0-
|
|
48
|
-
"@elementor/editor-mcp": "4.4.0-
|
|
49
|
-
"@elementor/editor-responsive": "4.4.0-
|
|
50
|
-
"@elementor/editor-v1-adapters": "4.4.0-
|
|
43
|
+
"@elementor/editor-current-user": "4.4.0-1069",
|
|
44
|
+
"@elementor/editor-ui": "4.4.0-1069",
|
|
45
|
+
"@elementor/http-client": "4.4.0-1069",
|
|
46
|
+
"@elementor/editor": "4.4.0-1069",
|
|
47
|
+
"@elementor/editor-documents": "4.4.0-1069",
|
|
48
|
+
"@elementor/editor-mcp": "4.4.0-1069",
|
|
49
|
+
"@elementor/editor-responsive": "4.4.0-1069",
|
|
50
|
+
"@elementor/editor-v1-adapters": "4.4.0-1069",
|
|
51
51
|
"@elementor/icons": "~1.75.1",
|
|
52
|
-
"@elementor/locations": "4.4.0-
|
|
53
|
-
"@elementor/menus": "4.4.0-
|
|
54
|
-
"@elementor/events": "4.4.0-
|
|
52
|
+
"@elementor/locations": "4.4.0-1069",
|
|
53
|
+
"@elementor/menus": "4.4.0-1069",
|
|
54
|
+
"@elementor/events": "4.4.0-1069",
|
|
55
55
|
"@elementor/ui": "1.37.5",
|
|
56
56
|
"@wordpress/i18n": "^5.13.0"
|
|
57
57
|
},
|
|
@@ -1,26 +1,48 @@
|
|
|
1
|
+
import { isAngieAvailable, openAngieInAskMode } from '@elementor/editor-mcp';
|
|
1
2
|
import { HelpIcon } from '@elementor/icons';
|
|
2
3
|
import { __ } from '@wordpress/i18n';
|
|
3
4
|
|
|
4
5
|
import { type ExtendedWindow } from '../../../types';
|
|
5
6
|
|
|
7
|
+
const HELP_CENTER_URL = 'https://go.elementor.com/editor-top-bar-learn/';
|
|
8
|
+
const HELP_CENTER_ANGIE_PROMPT = `${ __( 'Help me with', 'elementor' ) } `;
|
|
9
|
+
|
|
10
|
+
const dispatchHelpClickEvent = () => {
|
|
11
|
+
const extendedWindow = window as unknown as ExtendedWindow;
|
|
12
|
+
const config = extendedWindow?.elementorCommon?.eventsManager?.config;
|
|
13
|
+
|
|
14
|
+
if ( config ) {
|
|
15
|
+
extendedWindow.elementorCommon.eventsManager.dispatchEvent( config.names.topBar.help, {
|
|
16
|
+
location: config.locations.topBar,
|
|
17
|
+
secondaryLocation: config.secondaryLocations.help,
|
|
18
|
+
trigger: config.triggers.click,
|
|
19
|
+
element: config.elements.buttonIcon,
|
|
20
|
+
} );
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
6
24
|
export default function useActionProps() {
|
|
25
|
+
const hasAngieActive = isAngieAvailable();
|
|
26
|
+
|
|
27
|
+
if ( hasAngieActive ) {
|
|
28
|
+
return {
|
|
29
|
+
title: __( 'Help Center', 'elementor' ),
|
|
30
|
+
icon: HelpIcon,
|
|
31
|
+
onClick: ( event: React.MouseEvent ) => {
|
|
32
|
+
event.preventDefault();
|
|
33
|
+
dispatchHelpClickEvent();
|
|
34
|
+
openAngieInAskMode( HELP_CENTER_ANGIE_PROMPT );
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
7
39
|
return {
|
|
8
40
|
title: __( 'Help Center', 'elementor' ),
|
|
9
|
-
href:
|
|
41
|
+
href: HELP_CENTER_URL,
|
|
10
42
|
icon: HelpIcon,
|
|
11
43
|
target: '_blank',
|
|
12
44
|
onClick: () => {
|
|
13
|
-
|
|
14
|
-
const config = extendedWindow?.elementorCommon?.eventsManager?.config;
|
|
15
|
-
|
|
16
|
-
if ( config ) {
|
|
17
|
-
extendedWindow.elementorCommon.eventsManager.dispatchEvent( config.names.topBar.help, {
|
|
18
|
-
location: config.locations.topBar,
|
|
19
|
-
secondaryLocation: config.secondaryLocations.help,
|
|
20
|
-
trigger: config.triggers.click,
|
|
21
|
-
element: config.elements.buttonIcon,
|
|
22
|
-
} );
|
|
23
|
-
}
|
|
45
|
+
dispatchHelpClickEvent();
|
|
24
46
|
},
|
|
25
47
|
};
|
|
26
48
|
}
|