@elementor/editor-app-bar 4.1.0-779 → 4.1.0-780

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.1.0-779",
4
+ "version": "4.1.0-780",
5
5
  "private": false,
6
6
  "author": "Elementor Team",
7
7
  "homepage": "https://elementor.com/",
@@ -40,16 +40,16 @@
40
40
  "dev": "tsup --config=../../tsup.dev.ts"
41
41
  },
42
42
  "dependencies": {
43
- "@elementor/editor-ui": "4.1.0-779",
44
- "@elementor/http-client": "4.1.0-779",
45
- "@elementor/editor": "4.1.0-779",
46
- "@elementor/editor-documents": "4.1.0-779",
47
- "@elementor/editor-responsive": "4.1.0-779",
48
- "@elementor/editor-v1-adapters": "4.1.0-779",
43
+ "@elementor/editor-ui": "4.1.0-780",
44
+ "@elementor/http-client": "4.1.0-780",
45
+ "@elementor/editor": "4.1.0-780",
46
+ "@elementor/editor-documents": "4.1.0-780",
47
+ "@elementor/editor-responsive": "4.1.0-780",
48
+ "@elementor/editor-v1-adapters": "4.1.0-780",
49
49
  "@elementor/icons": "^1.68.0",
50
- "@elementor/locations": "4.1.0-779",
51
- "@elementor/menus": "4.1.0-779",
52
- "@elementor/events": "4.1.0-779",
50
+ "@elementor/locations": "4.1.0-780",
51
+ "@elementor/menus": "4.1.0-780",
52
+ "@elementor/events": "4.1.0-780",
53
53
  "@elementor/ui": "1.37.5",
54
54
  "@wordpress/i18n": "^5.13.0"
55
55
  },
@@ -2,17 +2,17 @@ import {
2
2
  __privateRunCommand as runCommand,
3
3
  __privateUseRouteStatus as useRouteStatus,
4
4
  } from '@elementor/editor-v1-adapters';
5
+ import { StructureIcon } from '@elementor/icons';
5
6
  import { __ } from '@wordpress/i18n';
6
7
 
7
8
  import { type ExtendedWindow, type ToggleActionProps } from '../../../types';
8
- import { StructureIconWithPopup } from './structure-icon-with-popup';
9
9
 
10
10
  export default function useActionProps(): ToggleActionProps {
11
11
  const { isActive, isBlocked } = useRouteStatus( 'navigator' );
12
12
 
13
13
  return {
14
14
  title: __( 'Structure', 'elementor' ),
15
- icon: StructureIconWithPopup,
15
+ icon: StructureIcon,
16
16
  onClick: () => {
17
17
  const extendedWindow = window as unknown as ExtendedWindow;
18
18
  const config = extendedWindow?.elementorCommon?.eventsManager?.config;
package/src/types.ts CHANGED
@@ -13,10 +13,6 @@ export type ExtendedWindow = Window & {
13
13
  };
14
14
  };
15
15
 
16
- ajax?: {
17
- addRequest: ( action: string, options?: Record< string, unknown > ) => Promise< unknown >;
18
- };
19
-
20
16
  config: {
21
17
  library_connect: {
22
18
  is_connected: boolean;
@@ -24,10 +20,6 @@ export type ExtendedWindow = Window & {
24
20
  };
25
21
  };
26
22
 
27
- elementorShowInfotip?: {
28
- shouldShow: string;
29
- };
30
-
31
23
  elementor: {
32
24
  helpers: {
33
25
  hasPro: () => boolean;
@@ -1,84 +0,0 @@
1
- import * as React from 'react';
2
- import { useEffect, useState } from 'react';
3
- import { StructureIcon } from '@elementor/icons';
4
- import { Button, Card, CardActions, CardContent, Infotip, Typography } from '@elementor/ui';
5
- import { __ } from '@wordpress/i18n';
6
-
7
- import { type ExtendedWindow } from '../../../types';
8
-
9
- const extendedWindow = window as unknown as ExtendedWindow;
10
-
11
- const StructurePopupContent = ( { onClose }: { onClose: () => void } ) => {
12
- const handleDismiss = async () => {
13
- onClose();
14
-
15
- extendedWindow.elementorCommon?.ajax?.addRequest?.( 'structure_popup_dismiss' ).catch( () => {} );
16
- };
17
-
18
- const stopEventPropagation = ( event: React.MouseEvent ) => {
19
- event.stopPropagation();
20
- };
21
-
22
- return (
23
- <Card elevation={ 0 } sx={ { maxWidth: 300 } } onClick={ stopEventPropagation }>
24
- <CardContent>
25
- <Typography variant="subtitle2" sx={ { mb: 2 } }>
26
- { __( 'Refreshed Top Bar layout!', 'elementor' ) }
27
- </Typography>
28
- <Typography variant="body2">
29
- { __( 'We’ve fine-tuned the Top Bar to make navigation faster and smoother.', 'elementor' ) }
30
- </Typography>
31
- </CardContent>
32
- <CardActions sx={ { pt: 0 } }>
33
- <Button
34
- size="small"
35
- color="secondary"
36
- href="https://go.elementor.com/editor-top-bar-learn/"
37
- target="_blank"
38
- >
39
- { __( 'Learn More', 'elementor' ) }
40
- </Button>
41
- <Button size="small" variant="contained" onClick={ handleDismiss }>
42
- { __( 'Got it', 'elementor' ) }
43
- </Button>
44
- </CardActions>
45
- </Card>
46
- );
47
- };
48
-
49
- export const StructureIconWithPopup = () => {
50
- const [ showPopup, setShowPopup ] = useState( false );
51
-
52
- useEffect( () => {
53
- if ( extendedWindow.elementorShowInfotip?.shouldShow === '1' ) {
54
- setShowPopup( true );
55
- }
56
- }, [] );
57
-
58
- const handleClosePopup = () => {
59
- setShowPopup( false );
60
- };
61
-
62
- if ( extendedWindow.elementorShowInfotip?.shouldShow !== '1' ) {
63
- return <StructureIcon />;
64
- }
65
-
66
- return (
67
- <Infotip
68
- placement="bottom"
69
- arrow={ false }
70
- content={ <StructurePopupContent onClose={ handleClosePopup } /> }
71
- open={ showPopup }
72
- PopperProps={ {
73
- modifiers: [
74
- {
75
- name: 'offset',
76
- options: { offset: [ -16, 12 ] },
77
- },
78
- ],
79
- } }
80
- >
81
- <StructureIcon />
82
- </Infotip>
83
- );
84
- };