@elementor/editor-app-bar 0.32.1 → 3.32.0-21
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/CHANGELOG.md +0 -7
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +196 -154
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +154 -112
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -10
- package/src/components/actions/link.tsx +3 -2
- package/src/components/locations/main-menu-location.tsx +2 -2
- package/src/components/ui/popover-menu-item.tsx +3 -1
- package/src/extensions/connect/hooks/use-connect-link-config.tsx +23 -0
- package/src/extensions/connect/index.ts +11 -0
- package/src/extensions/documents-indicator/components/settings-button.tsx +10 -7
- package/src/extensions/documents-preview/hooks/use-action-props.ts +2 -2
- package/src/extensions/documents-save/components/primary-action.tsx +10 -7
- package/src/extensions/elements/hooks/use-action-props.ts +2 -2
- package/src/extensions/finder/hooks/use-action-props.ts +2 -2
- package/src/extensions/help/index.ts +3 -2
- package/src/extensions/history/hooks/use-action-props.ts +2 -2
- package/src/extensions/index.ts +2 -0
- package/src/extensions/keyboard-shortcuts/hooks/use-action-props.ts +2 -2
- package/src/extensions/responsive/components/breakpoints-switcher.tsx +2 -2
- package/src/extensions/site-settings/hooks/use-action-props.ts +2 -2
- package/src/extensions/structure/hooks/use-action-props.ts +2 -2
- package/src/extensions/theme-builder/hooks/use-action-props.ts +2 -2
- package/src/extensions/user-preferences/hooks/use-action-props.ts +2 -2
- package/src/extensions/wordpress/index.ts +11 -7
- package/src/types.ts +13 -2
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { mainMenu } from '../../locations';
|
|
2
|
+
import useConnectLinkConfig from './hooks/use-connect-link-config';
|
|
3
|
+
|
|
4
|
+
export function init() {
|
|
5
|
+
mainMenu.registerLink( {
|
|
6
|
+
id: 'app-bar-connect',
|
|
7
|
+
group: 'exits',
|
|
8
|
+
priority: 10,
|
|
9
|
+
useProps: useConnectLinkConfig,
|
|
10
|
+
} );
|
|
11
|
+
}
|
|
@@ -38,15 +38,18 @@ export default function SettingsButton() {
|
|
|
38
38
|
disabled={ isBlocked }
|
|
39
39
|
onChange={ () => {
|
|
40
40
|
const extendedWindow = window as unknown as ExtendedWindow;
|
|
41
|
-
const config = extendedWindow?.
|
|
41
|
+
const config = extendedWindow?.elementorCommon?.eventsManager?.config;
|
|
42
42
|
|
|
43
43
|
if ( config ) {
|
|
44
|
-
extendedWindow.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
extendedWindow.elementorCommon.eventsManager.dispatchEvent(
|
|
45
|
+
config.names.topBar.documentSettings,
|
|
46
|
+
{
|
|
47
|
+
location: config.locations.topBar,
|
|
48
|
+
secondaryLocation: config.secondaryLocations[ 'document-settings' ],
|
|
49
|
+
trigger: config.triggers.click,
|
|
50
|
+
element: config.elements.buttonIcon,
|
|
51
|
+
}
|
|
52
|
+
);
|
|
50
53
|
}
|
|
51
54
|
|
|
52
55
|
openRoute( 'panel/page-settings/settings' );
|
|
@@ -13,10 +13,10 @@ export default function useActionProps() {
|
|
|
13
13
|
title: __( 'Preview Changes', 'elementor' ),
|
|
14
14
|
onClick: () => {
|
|
15
15
|
const extendedWindow = window as unknown as ExtendedWindow;
|
|
16
|
-
const config = extendedWindow?.
|
|
16
|
+
const config = extendedWindow?.elementorCommon?.eventsManager?.config;
|
|
17
17
|
|
|
18
18
|
if ( config ) {
|
|
19
|
-
extendedWindow.
|
|
19
|
+
extendedWindow.elementorCommon.eventsManager.dispatchEvent( config.names.topBar.previewPage, {
|
|
20
20
|
location: config.locations.topBar,
|
|
21
21
|
secondaryLocation: config.secondaryLocations[ 'preview-page' ],
|
|
22
22
|
trigger: config.triggers.click,
|
|
@@ -50,15 +50,18 @@ export default function PrimaryAction() {
|
|
|
50
50
|
<Button
|
|
51
51
|
onClick={ () => {
|
|
52
52
|
const extendedWindow = window as unknown as ExtendedWindow;
|
|
53
|
-
const config = extendedWindow?.
|
|
53
|
+
const config = extendedWindow?.elementorCommon?.eventsManager?.config;
|
|
54
54
|
|
|
55
55
|
if ( config ) {
|
|
56
|
-
extendedWindow.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
extendedWindow.elementorCommon.eventsManager.dispatchEvent(
|
|
57
|
+
config.names.topBar.publishButton,
|
|
58
|
+
{
|
|
59
|
+
location: config.locations.topBar,
|
|
60
|
+
secondaryLocation: config.secondaryLocations[ 'publish-button' ],
|
|
61
|
+
trigger: config.triggers.click,
|
|
62
|
+
element: config.elements.mainCta,
|
|
63
|
+
}
|
|
64
|
+
);
|
|
62
65
|
}
|
|
63
66
|
|
|
64
67
|
if ( ! document.isSaving ) {
|
|
@@ -15,10 +15,10 @@ export default function useActionProps() {
|
|
|
15
15
|
icon: PlusIcon,
|
|
16
16
|
onClick: () => {
|
|
17
17
|
const extendedWindow = window as unknown as ExtendedWindow;
|
|
18
|
-
const config = extendedWindow?.
|
|
18
|
+
const config = extendedWindow?.elementorCommon?.eventsManager?.config;
|
|
19
19
|
|
|
20
20
|
if ( config ) {
|
|
21
|
-
extendedWindow.
|
|
21
|
+
extendedWindow.elementorCommon.eventsManager.dispatchEvent( config.names.topBar.widgetPanel, {
|
|
22
22
|
location: config.locations.topBar,
|
|
23
23
|
secondaryLocation: config.secondaryLocations[ 'widget-panel' ],
|
|
24
24
|
trigger: config.triggers.toggleClick,
|
|
@@ -10,10 +10,10 @@ export default function useActionProps() {
|
|
|
10
10
|
icon: SearchIcon,
|
|
11
11
|
onClick: () => {
|
|
12
12
|
const extendedWindow = window as unknown as ExtendedWindow;
|
|
13
|
-
const config = extendedWindow?.
|
|
13
|
+
const config = extendedWindow?.elementorCommon?.eventsManager?.config;
|
|
14
14
|
|
|
15
15
|
if ( config ) {
|
|
16
|
-
extendedWindow.
|
|
16
|
+
extendedWindow.elementorCommon.eventsManager.dispatchEvent( config.names.topBar.finder, {
|
|
17
17
|
location: config.locations.topBar,
|
|
18
18
|
secondaryLocation: config.secondaryLocations.finder,
|
|
19
19
|
trigger: config.triggers.toggleClick,
|
|
@@ -14,12 +14,13 @@ export function init() {
|
|
|
14
14
|
href: 'https://go.elementor.com/editor-top-bar-learn/',
|
|
15
15
|
icon: HelpIcon,
|
|
16
16
|
target: '_blank',
|
|
17
|
+
showExternalLinkIcon: true,
|
|
17
18
|
onClick: () => {
|
|
18
19
|
const extendedWindow = window as unknown as ExtendedWindow;
|
|
19
|
-
const config = extendedWindow?.
|
|
20
|
+
const config = extendedWindow?.elementorCommon?.eventsManager?.config;
|
|
20
21
|
|
|
21
22
|
if ( config ) {
|
|
22
|
-
extendedWindow.
|
|
23
|
+
extendedWindow.elementorCommon.eventsManager.dispatchEvent( config.names.topBar.help, {
|
|
23
24
|
location: config.locations.topBar,
|
|
24
25
|
secondaryLocation: config.secondaryLocations.help,
|
|
25
26
|
trigger: config.triggers.click,
|
|
@@ -15,10 +15,10 @@ export default function useActionProps() {
|
|
|
15
15
|
icon: HistoryIcon,
|
|
16
16
|
onClick: () => {
|
|
17
17
|
const extendedWindow = window as unknown as ExtendedWindow;
|
|
18
|
-
const config = extendedWindow?.
|
|
18
|
+
const config = extendedWindow?.elementorCommon?.eventsManager?.config;
|
|
19
19
|
|
|
20
20
|
if ( config ) {
|
|
21
|
-
extendedWindow.
|
|
21
|
+
extendedWindow.elementorCommon.eventsManager.dispatchEvent( config.names.topBar.history, {
|
|
22
22
|
location: config.locations.topBar,
|
|
23
23
|
secondaryLocation: config.secondaryLocations.elementorLogo,
|
|
24
24
|
trigger: config.triggers.click,
|
package/src/extensions/index.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* The code should be moved to the appropriate packages.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import { init as initConnect } from './connect';
|
|
6
7
|
import { init as initDocumentsIndicator } from './documents-indicator';
|
|
7
8
|
import { init as initDocumentsPreview } from './documents-preview';
|
|
8
9
|
import { init as initDocumentsSave } from './documents-save';
|
|
@@ -33,4 +34,5 @@ export function init() {
|
|
|
33
34
|
initThemeBuilder();
|
|
34
35
|
initUserPreferences();
|
|
35
36
|
initWordpress();
|
|
37
|
+
initConnect();
|
|
36
38
|
}
|
|
@@ -10,10 +10,10 @@ export default function useActionProps(): ActionProps {
|
|
|
10
10
|
title: __( 'Keyboard Shortcuts', 'elementor' ),
|
|
11
11
|
onClick: () => {
|
|
12
12
|
const extendedWindow = window as unknown as ExtendedWindow;
|
|
13
|
-
const config = extendedWindow?.
|
|
13
|
+
const config = extendedWindow?.elementorCommon?.eventsManager?.config;
|
|
14
14
|
|
|
15
15
|
if ( config ) {
|
|
16
|
-
extendedWindow.
|
|
16
|
+
extendedWindow.elementorCommon.eventsManager.dispatchEvent( config.names.topBar.keyboardShortcuts, {
|
|
17
17
|
location: config.locations.topBar,
|
|
18
18
|
secondaryLocation: config.secondaryLocations.elementorLogo,
|
|
19
19
|
trigger: config.triggers.click,
|
|
@@ -30,10 +30,10 @@ export default function BreakpointsSwitcher() {
|
|
|
30
30
|
|
|
31
31
|
const onChange = ( _: unknown, value: BreakpointId ) => {
|
|
32
32
|
const extendedWindow = window as unknown as ExtendedWindow;
|
|
33
|
-
const config = extendedWindow?.
|
|
33
|
+
const config = extendedWindow?.elementorCommon?.eventsManager?.config;
|
|
34
34
|
|
|
35
35
|
if ( config ) {
|
|
36
|
-
extendedWindow.
|
|
36
|
+
extendedWindow.elementorCommon.eventsManager.dispatchEvent( config.names.topBar.responsiveControls, {
|
|
37
37
|
location: config.locations.topBar,
|
|
38
38
|
secondaryLocation: config.secondaryLocations.responsiveControls,
|
|
39
39
|
trigger: config.triggers.click,
|
|
@@ -17,10 +17,10 @@ export default function useActionProps(): ToggleActionProps {
|
|
|
17
17
|
icon: AdjustmentsHorizontalIcon,
|
|
18
18
|
onClick: () => {
|
|
19
19
|
const extendedWindow = window as unknown as ExtendedWindow;
|
|
20
|
-
const config = extendedWindow?.
|
|
20
|
+
const config = extendedWindow?.elementorCommon?.eventsManager?.config;
|
|
21
21
|
|
|
22
22
|
if ( config ) {
|
|
23
|
-
extendedWindow.
|
|
23
|
+
extendedWindow.elementorCommon.eventsManager.dispatchEvent( config.names.topBar.siteSettings, {
|
|
24
24
|
location: config.locations.topBar,
|
|
25
25
|
secondaryLocation: config.secondaryLocations.siteSettings,
|
|
26
26
|
trigger: config.triggers.toggleClick,
|
|
@@ -15,10 +15,10 @@ export default function useActionProps(): ToggleActionProps {
|
|
|
15
15
|
icon: StructureIcon,
|
|
16
16
|
onClick: () => {
|
|
17
17
|
const extendedWindow = window as unknown as ExtendedWindow;
|
|
18
|
-
const config = extendedWindow?.
|
|
18
|
+
const config = extendedWindow?.elementorCommon?.eventsManager?.config;
|
|
19
19
|
|
|
20
20
|
if ( config ) {
|
|
21
|
-
extendedWindow.
|
|
21
|
+
extendedWindow.elementorCommon.eventsManager.dispatchEvent( config.names.topBar.structure, {
|
|
22
22
|
location: config.locations.topBar,
|
|
23
23
|
secondaryLocation: config.secondaryLocations.structure,
|
|
24
24
|
trigger: config.triggers.toggleClick,
|
|
@@ -10,10 +10,10 @@ export default function useActionProps(): ActionProps {
|
|
|
10
10
|
title: __( 'Theme Builder', 'elementor' ),
|
|
11
11
|
onClick: () => {
|
|
12
12
|
const extendedWindow = window as unknown as ExtendedWindow;
|
|
13
|
-
const config = extendedWindow?.
|
|
13
|
+
const config = extendedWindow?.elementorCommon?.eventsManager?.config;
|
|
14
14
|
|
|
15
15
|
if ( config ) {
|
|
16
|
-
extendedWindow.
|
|
16
|
+
extendedWindow.elementorCommon.eventsManager.dispatchEvent( config.names.topBar.themeBuilder, {
|
|
17
17
|
location: config.locations.topBar,
|
|
18
18
|
secondaryLocation: config.secondaryLocations.elementorLogo,
|
|
19
19
|
trigger: config.triggers.click,
|
|
@@ -15,10 +15,10 @@ export default function useActionProps(): ToggleActionProps {
|
|
|
15
15
|
title: __( 'User Preferences', 'elementor' ),
|
|
16
16
|
onClick: () => {
|
|
17
17
|
const extendedWindow = window as unknown as ExtendedWindow;
|
|
18
|
-
const config = extendedWindow?.
|
|
18
|
+
const config = extendedWindow?.elementorCommon?.eventsManager?.config;
|
|
19
19
|
|
|
20
20
|
if ( config ) {
|
|
21
|
-
extendedWindow.
|
|
21
|
+
extendedWindow.elementorCommon.eventsManager.dispatchEvent( config.names.topBar.userPreferences, {
|
|
22
22
|
location: config.locations.topBar,
|
|
23
23
|
secondaryLocation: config.secondaryLocations.elementorLogo,
|
|
24
24
|
trigger: config.triggers.click,
|
|
@@ -9,6 +9,7 @@ export function init() {
|
|
|
9
9
|
mainMenu.registerLink( {
|
|
10
10
|
id: 'exit-to-wordpress',
|
|
11
11
|
group: 'exits',
|
|
12
|
+
priority: 20,
|
|
12
13
|
useProps: () => {
|
|
13
14
|
const document = useActiveDocument();
|
|
14
15
|
return {
|
|
@@ -17,15 +18,18 @@ export function init() {
|
|
|
17
18
|
icon: WordpressIcon,
|
|
18
19
|
onClick: () => {
|
|
19
20
|
const extendedWindow = window as unknown as ExtendedWindow;
|
|
20
|
-
const config = extendedWindow?.
|
|
21
|
+
const config = extendedWindow?.elementorCommon?.eventsManager?.config;
|
|
21
22
|
|
|
22
23
|
if ( config ) {
|
|
23
|
-
extendedWindow.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
extendedWindow.elementorCommon.eventsManager.dispatchEvent(
|
|
25
|
+
config.names.topBar.exitToWordpress,
|
|
26
|
+
{
|
|
27
|
+
location: config.locations.topBar,
|
|
28
|
+
secondaryLocation: config.secondaryLocations.elementorLogo,
|
|
29
|
+
trigger: config.triggers.click,
|
|
30
|
+
element: config.elements.link,
|
|
31
|
+
}
|
|
32
|
+
);
|
|
29
33
|
}
|
|
30
34
|
},
|
|
31
35
|
};
|
package/src/types.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type ExtendedWindow = Window & {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
elementorCommon: {
|
|
3
|
+
eventsManager: {
|
|
4
4
|
dispatchEvent: ( name: string, data: Record< string, string > ) => void;
|
|
5
5
|
config: {
|
|
6
6
|
locations: Record< string, string >;
|
|
@@ -12,6 +12,17 @@ export type ExtendedWindow = Window & {
|
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
|
+
config: {
|
|
16
|
+
library_connect: {
|
|
17
|
+
is_connected: boolean;
|
|
18
|
+
};
|
|
19
|
+
user: {
|
|
20
|
+
top_bar: {
|
|
21
|
+
my_elementor_url: string;
|
|
22
|
+
connect_url: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
15
26
|
};
|
|
16
27
|
};
|
|
17
28
|
|