@elementor/editor-controls 3.35.0-403 → 3.35.0-404
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 +13 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/components/inline-editor.tsx +14 -0
- package/src/components/url-popover.tsx +16 -11
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-controls",
|
|
3
3
|
"description": "This package contains the controls model and utils for the Elementor editor",
|
|
4
|
-
"version": "3.35.0-
|
|
4
|
+
"version": "3.35.0-404",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "Elementor Team",
|
|
7
7
|
"homepage": "https://elementor.com/",
|
|
@@ -40,22 +40,22 @@
|
|
|
40
40
|
"dev": "tsup --config=../../tsup.dev.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@elementor/editor-current-user": "3.35.0-
|
|
44
|
-
"@elementor/editor-elements": "3.35.0-
|
|
45
|
-
"@elementor/editor-props": "3.35.0-
|
|
46
|
-
"@elementor/editor-responsive": "3.35.0-
|
|
47
|
-
"@elementor/editor-ui": "3.35.0-
|
|
48
|
-
"@elementor/editor-v1-adapters": "3.35.0-
|
|
49
|
-
"@elementor/env": "3.35.0-
|
|
50
|
-
"@elementor/http-client": "3.35.0-
|
|
43
|
+
"@elementor/editor-current-user": "3.35.0-404",
|
|
44
|
+
"@elementor/editor-elements": "3.35.0-404",
|
|
45
|
+
"@elementor/editor-props": "3.35.0-404",
|
|
46
|
+
"@elementor/editor-responsive": "3.35.0-404",
|
|
47
|
+
"@elementor/editor-ui": "3.35.0-404",
|
|
48
|
+
"@elementor/editor-v1-adapters": "3.35.0-404",
|
|
49
|
+
"@elementor/env": "3.35.0-404",
|
|
50
|
+
"@elementor/http-client": "3.35.0-404",
|
|
51
51
|
"@elementor/icons": "^1.63.0",
|
|
52
|
-
"@elementor/locations": "3.35.0-
|
|
53
|
-
"@elementor/mixpanel": "3.35.0-
|
|
54
|
-
"@elementor/query": "3.35.0-
|
|
55
|
-
"@elementor/session": "3.35.0-
|
|
52
|
+
"@elementor/locations": "3.35.0-404",
|
|
53
|
+
"@elementor/mixpanel": "3.35.0-404",
|
|
54
|
+
"@elementor/query": "3.35.0-404",
|
|
55
|
+
"@elementor/session": "3.35.0-404",
|
|
56
56
|
"@elementor/ui": "1.36.17",
|
|
57
|
-
"@elementor/utils": "3.35.0-
|
|
58
|
-
"@elementor/wp-media": "3.35.0-
|
|
57
|
+
"@elementor/utils": "3.35.0-404",
|
|
58
|
+
"@elementor/wp-media": "3.35.0-404",
|
|
59
59
|
"@wordpress/i18n": "^5.13.0",
|
|
60
60
|
"@monaco-editor/react": "^4.7.0",
|
|
61
61
|
"dayjs": "^1.11.18",
|
|
@@ -27,6 +27,10 @@ import { type Editor, EditorContent, useEditor } from '@tiptap/react';
|
|
|
27
27
|
import { isEmpty } from '../utils/inline-editing';
|
|
28
28
|
import { InlineEditorToolbar } from './inline-editor-toolbar';
|
|
29
29
|
|
|
30
|
+
const ITALIC_KEYBOARD_SHORTCUT = 'i';
|
|
31
|
+
const BOLD_KEYBOARD_SHORTCUT = 'b';
|
|
32
|
+
const UNDERLINE_KEYBOARD_SHORTCUT = 'u';
|
|
33
|
+
|
|
30
34
|
type InlineEditorProps = {
|
|
31
35
|
value: string | null;
|
|
32
36
|
setValue: ( value: string | null ) => void;
|
|
@@ -147,6 +151,16 @@ export const InlineEditor = forwardRef(
|
|
|
147
151
|
if ( event.key === 'Escape' ) {
|
|
148
152
|
onBlur?.( event );
|
|
149
153
|
}
|
|
154
|
+
|
|
155
|
+
if ( ( ! event.metaKey && ! event.ctrlKey ) || event.altKey ) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (
|
|
160
|
+
[ ITALIC_KEYBOARD_SHORTCUT, BOLD_KEYBOARD_SHORTCUT, UNDERLINE_KEYBOARD_SHORTCUT ].includes( event.key )
|
|
161
|
+
) {
|
|
162
|
+
event.stopPropagation();
|
|
163
|
+
}
|
|
150
164
|
};
|
|
151
165
|
|
|
152
166
|
const toolbarRelatedListeners = showToolbar
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type RefObject, useEffect, useRef } from 'react';
|
|
3
3
|
import { ExternalLinkIcon } from '@elementor/icons';
|
|
4
|
-
import { bindPopover, Popover, type PopupState, Stack, TextField, ToggleButton } from '@elementor/ui';
|
|
4
|
+
import { bindPopover, Popover, type PopupState, Stack, TextField, ToggleButton, Tooltip } from '@elementor/ui';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
6
|
|
|
7
7
|
type Props = {
|
|
@@ -56,17 +56,22 @@ export const UrlPopover = ( {
|
|
|
56
56
|
inputProps={ { ref: inputRef } }
|
|
57
57
|
color="secondary"
|
|
58
58
|
InputProps={ { sx: { borderRadius: '8px' } } }
|
|
59
|
+
onKeyUp={ ( event: React.KeyboardEvent< HTMLInputElement > ) =>
|
|
60
|
+
event.key === 'Enter' && handleClose()
|
|
61
|
+
}
|
|
59
62
|
/>
|
|
60
|
-
<
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
<Tooltip title={ __( 'Open in a new tab', 'elementor' ) }>
|
|
64
|
+
<ToggleButton
|
|
65
|
+
size="tiny"
|
|
66
|
+
value="newTab"
|
|
67
|
+
selected={ openInNewTab }
|
|
68
|
+
onClick={ onToggleNewTab }
|
|
69
|
+
aria-label={ __( 'Open in a new tab', 'elementor' ) }
|
|
70
|
+
sx={ { borderRadius: '8px' } }
|
|
71
|
+
>
|
|
72
|
+
<ExternalLinkIcon fontSize="tiny" />
|
|
73
|
+
</ToggleButton>
|
|
74
|
+
</Tooltip>
|
|
70
75
|
</Stack>
|
|
71
76
|
</Popover>
|
|
72
77
|
);
|