@elementor/editor-app-bar 4.1.0-manual → 4.2.0-839
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 +264 -196
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +190 -122
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -11
- package/src/components/locations/send-feedback-popup-location.tsx +2 -2
- package/src/extensions/angie/hooks/use-action-props.ts +29 -0
- package/src/extensions/angie/index.ts +10 -0
- package/src/extensions/documents-save/hooks/use-document-view-as-markdown-props.ts +29 -0
- package/src/extensions/documents-save/index.ts +7 -0
- package/src/extensions/documents-settings/index.ts +1 -1
- package/src/extensions/index.ts +2 -0
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
|
+
"version": "4.2.0-839",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "Elementor Team",
|
|
7
7
|
"homepage": "https://elementor.com/",
|
|
@@ -40,16 +40,17 @@
|
|
|
40
40
|
"dev": "tsup --config=../../tsup.dev.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@elementor/editor-ui": "4.
|
|
44
|
-
"@elementor/http-client": "4.
|
|
45
|
-
"@elementor/editor": "4.
|
|
46
|
-
"@elementor/editor-documents": "4.
|
|
47
|
-
"@elementor/editor-
|
|
48
|
-
"@elementor/editor-
|
|
49
|
-
"@elementor/
|
|
50
|
-
"@elementor/
|
|
51
|
-
"@elementor/
|
|
52
|
-
"@elementor/
|
|
43
|
+
"@elementor/editor-ui": "4.2.0-839",
|
|
44
|
+
"@elementor/http-client": "4.2.0-839",
|
|
45
|
+
"@elementor/editor": "4.2.0-839",
|
|
46
|
+
"@elementor/editor-documents": "4.2.0-839",
|
|
47
|
+
"@elementor/editor-mcp": "4.2.0-839",
|
|
48
|
+
"@elementor/editor-responsive": "4.2.0-839",
|
|
49
|
+
"@elementor/editor-v1-adapters": "4.2.0-839",
|
|
50
|
+
"@elementor/icons": "~1.75.1",
|
|
51
|
+
"@elementor/locations": "4.2.0-839",
|
|
52
|
+
"@elementor/menus": "4.2.0-839",
|
|
53
|
+
"@elementor/events": "4.2.0-839",
|
|
53
54
|
"@elementor/ui": "1.37.5",
|
|
54
55
|
"@wordpress/i18n": "^5.13.0"
|
|
55
56
|
},
|
|
@@ -77,7 +77,7 @@ export default function SendFeedbackPopupLocation() {
|
|
|
77
77
|
feedback_text: feedbackContent,
|
|
78
78
|
} );
|
|
79
79
|
};
|
|
80
|
-
const
|
|
80
|
+
const handleStartAnother = () => {
|
|
81
81
|
setFeedbackContent( '' );
|
|
82
82
|
setFeedbackResult( null );
|
|
83
83
|
};
|
|
@@ -164,7 +164,7 @@ export default function SendFeedbackPopupLocation() {
|
|
|
164
164
|
</>
|
|
165
165
|
) }
|
|
166
166
|
{ feedbackResult?.success ? (
|
|
167
|
-
<Button variant="text" onClick={ () =>
|
|
167
|
+
<Button variant="text" onClick={ () => handleStartAnother() }>
|
|
168
168
|
{ __( 'Submit Another Feedback', 'elementor' ) }
|
|
169
169
|
</Button>
|
|
170
170
|
) : (
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { isAngieAvailable } from '@elementor/editor-mcp';
|
|
2
|
+
import { AngieIcon } from '@elementor/icons';
|
|
3
|
+
import { __ } from '@wordpress/i18n';
|
|
4
|
+
|
|
5
|
+
const CREATE_WIDGET_EVENT = 'elementor/editor/create-widget';
|
|
6
|
+
|
|
7
|
+
const CREATE_WIDGET_PROMPT = `Create a widget for me.
|
|
8
|
+
Goal: [What should this widget help me accomplish?]
|
|
9
|
+
Placement: [Where will I see it in the editor/UI?]
|
|
10
|
+
How it should work: `;
|
|
11
|
+
|
|
12
|
+
export default function useActionProps() {
|
|
13
|
+
return {
|
|
14
|
+
title: __( 'Angie', 'elementor' ),
|
|
15
|
+
icon: AngieIcon,
|
|
16
|
+
onClick: () => {
|
|
17
|
+
window.dispatchEvent(
|
|
18
|
+
new CustomEvent( CREATE_WIDGET_EVENT, {
|
|
19
|
+
detail: {
|
|
20
|
+
prompt: CREATE_WIDGET_PROMPT,
|
|
21
|
+
entry_point: 'top_bar',
|
|
22
|
+
},
|
|
23
|
+
} )
|
|
24
|
+
);
|
|
25
|
+
},
|
|
26
|
+
selected: false,
|
|
27
|
+
visible: ! isAngieAvailable(),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { __useActiveDocument as useActiveDocument } from '@elementor/editor-documents';
|
|
2
|
+
import { __privateRunCommand as runCommand } from '@elementor/editor-v1-adapters';
|
|
3
|
+
import { EyeIcon } from '@elementor/icons';
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
|
|
6
|
+
export default function useDocumentViewAsMarkdownProps() {
|
|
7
|
+
const document = useActiveDocument();
|
|
8
|
+
|
|
9
|
+
return {
|
|
10
|
+
icon: EyeIcon,
|
|
11
|
+
title: __( 'View as Markdown', 'elementor' ),
|
|
12
|
+
onClick: async () => {
|
|
13
|
+
const baseUrl = document?.links?.wpPreview || document?.links?.permalink;
|
|
14
|
+
|
|
15
|
+
if ( ! baseUrl ) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if ( document?.isDirty ) {
|
|
20
|
+
await runCommand( 'document/save/auto', { force: true } );
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const separator = baseUrl.includes( '?' ) ? '&' : '?';
|
|
24
|
+
const url = baseUrl + separator + 'format=markdown';
|
|
25
|
+
|
|
26
|
+
window.open( url, '_blank' );
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -3,6 +3,7 @@ import PrimaryAction from './components/primary-action';
|
|
|
3
3
|
import useDocumentCopyAndShareProps from './hooks/use-document-copy-and-share-props';
|
|
4
4
|
import useDocumentSaveDraftProps from './hooks/use-document-save-draft-props';
|
|
5
5
|
import useDocumentSaveTemplateProps from './hooks/use-document-save-template-props';
|
|
6
|
+
import useDocumentViewAsMarkdownProps from './hooks/use-document-view-as-markdown-props';
|
|
6
7
|
import useDocumentViewPageProps from './hooks/use-document-view-page-props';
|
|
7
8
|
import { documentOptionsMenu } from './locations';
|
|
8
9
|
|
|
@@ -37,4 +38,10 @@ export function init() {
|
|
|
37
38
|
priority: 50,
|
|
38
39
|
useProps: useDocumentViewPageProps,
|
|
39
40
|
} );
|
|
41
|
+
|
|
42
|
+
documentOptionsMenu.registerAction( {
|
|
43
|
+
id: 'document-view-as-markdown',
|
|
44
|
+
priority: 60,
|
|
45
|
+
useProps: useDocumentViewAsMarkdownProps,
|
|
46
|
+
} );
|
|
40
47
|
}
|
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 initAngie } from './angie';
|
|
6
7
|
import { init as initConnect } from './connect';
|
|
7
8
|
import { init as initDocumentsPreview } from './documents-preview';
|
|
8
9
|
import { init as initDocumentsSave } from './documents-save';
|
|
@@ -21,6 +22,7 @@ import { init as initUserPreferences } from './user-preferences';
|
|
|
21
22
|
import { init as initWordpress } from './wordpress';
|
|
22
23
|
|
|
23
24
|
export function init() {
|
|
25
|
+
initAngie();
|
|
24
26
|
initDocumentsPreview();
|
|
25
27
|
initDocumentsSave();
|
|
26
28
|
initDocumentsSettings();
|