@elementor/editor-app-bar 3.35.5 → 3.35.6
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 +80 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +80 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -10
- package/src/extensions/documents-save/hooks/use-document-copy-and-share-props.ts +19 -1
- package/src/extensions/documents-save/hooks/use-document-save-draft-props.ts +19 -1
- package/src/extensions/documents-save/hooks/use-document-save-template-props.ts +19 -1
- package/src/extensions/documents-save/hooks/use-document-view-page-props.ts +23 -5
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": "3.35.
|
|
4
|
+
"version": "3.35.6",
|
|
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": "3.35.
|
|
44
|
-
"@elementor/http-client": "3.35.
|
|
45
|
-
"@elementor/editor": "3.35.
|
|
46
|
-
"@elementor/editor-documents": "3.35.
|
|
47
|
-
"@elementor/editor-responsive": "3.35.
|
|
48
|
-
"@elementor/editor-v1-adapters": "3.35.
|
|
43
|
+
"@elementor/editor-ui": "3.35.6",
|
|
44
|
+
"@elementor/http-client": "3.35.6",
|
|
45
|
+
"@elementor/editor": "3.35.6",
|
|
46
|
+
"@elementor/editor-documents": "3.35.6",
|
|
47
|
+
"@elementor/editor-responsive": "3.35.6",
|
|
48
|
+
"@elementor/editor-v1-adapters": "3.35.6",
|
|
49
49
|
"@elementor/icons": "^1.63.0",
|
|
50
|
-
"@elementor/locations": "3.35.
|
|
51
|
-
"@elementor/menus": "3.35.
|
|
52
|
-
"@elementor/events": "3.35.
|
|
50
|
+
"@elementor/locations": "3.35.6",
|
|
51
|
+
"@elementor/menus": "3.35.6",
|
|
52
|
+
"@elementor/events": "3.35.6",
|
|
53
53
|
"@elementor/ui": "1.36.17",
|
|
54
54
|
"@wordpress/i18n": "^5.13.0"
|
|
55
55
|
},
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
__useActiveDocument as useActiveDocument,
|
|
3
3
|
__useActiveDocumentActions as useActiveDocumentActions,
|
|
4
4
|
} from '@elementor/editor-documents';
|
|
5
|
+
import { useMixpanel } from '@elementor/events';
|
|
5
6
|
import { LinkIcon } from '@elementor/icons';
|
|
6
7
|
import { __ } from '@wordpress/i18n';
|
|
7
8
|
|
|
@@ -10,11 +11,28 @@ import { type ActionProps } from '../../../types';
|
|
|
10
11
|
export default function useDocumentCopyAndShareProps(): ActionProps {
|
|
11
12
|
const document = useActiveDocument();
|
|
12
13
|
const { copyAndShare } = useActiveDocumentActions();
|
|
14
|
+
const { dispatchEvent, config } = useMixpanel();
|
|
13
15
|
|
|
14
16
|
return {
|
|
15
17
|
icon: LinkIcon,
|
|
16
18
|
title: __( 'Copy and Share', 'elementor' ),
|
|
17
|
-
onClick:
|
|
19
|
+
onClick: () => {
|
|
20
|
+
const eventName = config?.names?.editorOne?.topBarPublishDropdown;
|
|
21
|
+
if ( eventName ) {
|
|
22
|
+
dispatchEvent?.( eventName, {
|
|
23
|
+
app_type: config?.appTypes?.editor,
|
|
24
|
+
window_name: config?.appTypes?.editor,
|
|
25
|
+
interaction_type: config?.triggers?.click?.toLowerCase(),
|
|
26
|
+
target_type: config?.targetTypes?.dropdownItem,
|
|
27
|
+
target_name: config?.targetNames?.publishDropdown?.copyAndShare,
|
|
28
|
+
interaction_result: config?.interactionResults?.actionSelected,
|
|
29
|
+
target_location: config?.locations?.topBar?.replace( /\s+/g, '_' ).toLowerCase(),
|
|
30
|
+
location_l1: config?.secondaryLocations?.publishDropdown?.replace( /\s+/g, '_' ).toLowerCase(),
|
|
31
|
+
location_l2: config?.targetTypes?.dropdownItem,
|
|
32
|
+
} );
|
|
33
|
+
}
|
|
34
|
+
copyAndShare();
|
|
35
|
+
},
|
|
18
36
|
disabled:
|
|
19
37
|
! document || document.isSaving || document.isSavingDraft || ! ( 'publish' === document.status.value ),
|
|
20
38
|
visible: document?.permissions?.showCopyAndShare,
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
__useActiveDocument as useActiveDocument,
|
|
3
3
|
__useActiveDocumentActions as useActiveDocumentActions,
|
|
4
4
|
} from '@elementor/editor-documents';
|
|
5
|
+
import { useMixpanel } from '@elementor/events';
|
|
5
6
|
import { FileReportIcon } from '@elementor/icons';
|
|
6
7
|
import { __ } from '@wordpress/i18n';
|
|
7
8
|
|
|
@@ -10,11 +11,28 @@ import { type ActionProps } from '../../../types';
|
|
|
10
11
|
export default function useDocumentSaveDraftProps(): ActionProps {
|
|
11
12
|
const document = useActiveDocument();
|
|
12
13
|
const { saveDraft } = useActiveDocumentActions();
|
|
14
|
+
const { dispatchEvent, config } = useMixpanel();
|
|
13
15
|
|
|
14
16
|
return {
|
|
15
17
|
icon: FileReportIcon,
|
|
16
18
|
title: __( 'Save Draft', 'elementor' ),
|
|
17
|
-
onClick:
|
|
19
|
+
onClick: () => {
|
|
20
|
+
const eventName = config?.names?.editorOne?.topBarPublishDropdown;
|
|
21
|
+
if ( eventName ) {
|
|
22
|
+
dispatchEvent?.( eventName, {
|
|
23
|
+
app_type: config?.appTypes?.editor,
|
|
24
|
+
window_name: config?.appTypes?.editor,
|
|
25
|
+
interaction_type: config?.triggers?.click?.toLowerCase(),
|
|
26
|
+
target_type: config?.targetTypes?.dropdownItem,
|
|
27
|
+
target_name: config?.targetNames?.publishDropdown?.saveDraft,
|
|
28
|
+
interaction_result: config?.interactionResults?.actionSelected,
|
|
29
|
+
target_location: config?.locations?.topBar?.replace( /\s+/g, '_' ).toLowerCase(),
|
|
30
|
+
location_l1: config?.secondaryLocations?.publishDropdown?.replace( /\s+/g, '_' ).toLowerCase(),
|
|
31
|
+
location_l2: config?.targetTypes?.dropdownItem,
|
|
32
|
+
} );
|
|
33
|
+
}
|
|
34
|
+
saveDraft();
|
|
35
|
+
},
|
|
18
36
|
disabled: ! document || document.isSaving || document.isSavingDraft || ! document.isDirty,
|
|
19
37
|
};
|
|
20
38
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { __useActiveDocumentActions as useActiveDocumentActions } from '@elementor/editor-documents';
|
|
2
|
+
import { useMixpanel } from '@elementor/events';
|
|
2
3
|
import { FolderIcon } from '@elementor/icons';
|
|
3
4
|
import { __ } from '@wordpress/i18n';
|
|
4
5
|
|
|
@@ -6,10 +7,27 @@ import { type ActionProps } from '../../../types';
|
|
|
6
7
|
|
|
7
8
|
export default function useDocumentSaveTemplateProps(): ActionProps {
|
|
8
9
|
const { saveTemplate } = useActiveDocumentActions();
|
|
10
|
+
const { dispatchEvent, config } = useMixpanel();
|
|
9
11
|
|
|
10
12
|
return {
|
|
11
13
|
icon: FolderIcon,
|
|
12
14
|
title: __( 'Save as Template', 'elementor' ),
|
|
13
|
-
onClick:
|
|
15
|
+
onClick: () => {
|
|
16
|
+
const eventName = config?.names?.editorOne?.topBarPublishDropdown;
|
|
17
|
+
if ( eventName ) {
|
|
18
|
+
dispatchEvent?.( eventName, {
|
|
19
|
+
app_type: config?.appTypes?.editor,
|
|
20
|
+
window_name: config?.appTypes?.editor,
|
|
21
|
+
interaction_type: config?.triggers?.click?.toLowerCase(),
|
|
22
|
+
target_type: config?.targetTypes?.dropdownItem,
|
|
23
|
+
target_name: config?.targetNames?.publishDropdown?.saveAsTemplate,
|
|
24
|
+
interaction_result: config?.interactionResults?.actionSelected,
|
|
25
|
+
target_location: config?.locations?.topBar?.replace( /\s+/g, '_' ).toLowerCase(),
|
|
26
|
+
location_l1: config?.secondaryLocations?.publishDropdown?.replace( /\s+/g, '_' ).toLowerCase(),
|
|
27
|
+
location_l2: config?.targetTypes?.dropdownItem,
|
|
28
|
+
} );
|
|
29
|
+
}
|
|
30
|
+
saveTemplate();
|
|
31
|
+
},
|
|
14
32
|
};
|
|
15
33
|
}
|
|
@@ -1,18 +1,36 @@
|
|
|
1
1
|
import { __useActiveDocument as useActiveDocument } from '@elementor/editor-documents';
|
|
2
2
|
import { __privateRunCommand as runCommand } from '@elementor/editor-v1-adapters';
|
|
3
|
+
import { useMixpanel } from '@elementor/events';
|
|
3
4
|
import { EyeIcon } from '@elementor/icons';
|
|
4
5
|
import { __ } from '@wordpress/i18n';
|
|
5
6
|
|
|
6
7
|
export default function useDocumentViewPageProps() {
|
|
7
8
|
const document = useActiveDocument();
|
|
9
|
+
const { dispatchEvent, config } = useMixpanel();
|
|
8
10
|
|
|
9
11
|
return {
|
|
10
12
|
icon: EyeIcon,
|
|
11
13
|
title: __( 'View Page', 'elementor' ),
|
|
12
|
-
onClick: () =>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
onClick: () => {
|
|
15
|
+
const eventName = config?.names?.editorOne?.topBarPublishDropdown;
|
|
16
|
+
if ( eventName ) {
|
|
17
|
+
dispatchEvent?.( eventName, {
|
|
18
|
+
app_type: config?.appTypes?.editor,
|
|
19
|
+
window_name: config?.appTypes?.editor,
|
|
20
|
+
interaction_type: config?.triggers?.click?.toLowerCase(),
|
|
21
|
+
target_type: config?.targetTypes?.dropdownItem,
|
|
22
|
+
target_name: config?.targetNames?.publishDropdown?.viewPage,
|
|
23
|
+
interaction_result: config?.interactionResults?.actionSelected,
|
|
24
|
+
target_location: config?.locations?.topBar?.replace( /\s+/g, '_' ).toLowerCase(),
|
|
25
|
+
location_l1: config?.secondaryLocations?.publishDropdown?.replace( /\s+/g, '_' ).toLowerCase(),
|
|
26
|
+
location_l2: config?.targetTypes?.dropdownItem,
|
|
27
|
+
} );
|
|
28
|
+
}
|
|
29
|
+
if ( document?.id ) {
|
|
30
|
+
runCommand( 'editor/documents/view', {
|
|
31
|
+
id: document.id,
|
|
32
|
+
} );
|
|
33
|
+
}
|
|
34
|
+
},
|
|
17
35
|
};
|
|
18
36
|
}
|