@elementor/editor-site-navigation 0.19.8 → 0.19.9
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
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.19.9](https://github.com/elementor/elementor-packages/compare/@elementor/editor-site-navigation@0.19.8...@elementor/editor-site-navigation@0.19.9) (2023-11-19)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **editor-site-navigation:** wrong state handling in edit mode [ED-12814] ([#146](https://github.com/elementor/elementor-packages/issues/146)) ([5bee3ee](https://github.com/elementor/elementor-packages/commit/5bee3eed17d8f6589c5cddd87ace012dcc9549ce))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [0.19.8](https://github.com/elementor/elementor-packages/compare/@elementor/editor-site-navigation@0.19.7...@elementor/editor-site-navigation@0.19.8) (2023-11-07)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @elementor/editor-site-navigation
|
package/dist/index.js
CHANGED
|
@@ -507,7 +507,7 @@ var import_ui7 = require("@elementor/ui");
|
|
|
507
507
|
var import_icons6 = require("@elementor/icons");
|
|
508
508
|
var import_i18n4 = require("@wordpress/i18n");
|
|
509
509
|
function EditModeTemplate({ postTitle, isLoading, callback }) {
|
|
510
|
-
const
|
|
510
|
+
const [title, setTitle] = (0, import_react6.useState)(postTitle);
|
|
511
511
|
const [inputError, setInputError] = (0, import_react6.useState)("");
|
|
512
512
|
const closeButton = (0, import_react6.useRef)();
|
|
513
513
|
const onBlur = (e) => {
|
|
@@ -522,7 +522,7 @@ function EditModeTemplate({ postTitle, isLoading, callback }) {
|
|
|
522
522
|
};
|
|
523
523
|
const validateInput = () => {
|
|
524
524
|
let isValid = true;
|
|
525
|
-
if (
|
|
525
|
+
if (title.trim() === "") {
|
|
526
526
|
isValid = false;
|
|
527
527
|
setInputError((0, import_i18n4.__)("Name is required", "elementor"));
|
|
528
528
|
}
|
|
@@ -532,7 +532,7 @@ function EditModeTemplate({ postTitle, isLoading, callback }) {
|
|
|
532
532
|
if (!validateInput()) {
|
|
533
533
|
return;
|
|
534
534
|
}
|
|
535
|
-
callback(
|
|
535
|
+
callback(title);
|
|
536
536
|
};
|
|
537
537
|
return /* @__PURE__ */ React8.createElement(
|
|
538
538
|
import_ui7.ListItem,
|
|
@@ -545,8 +545,8 @@ function EditModeTemplate({ postTitle, isLoading, callback }) {
|
|
|
545
545
|
{
|
|
546
546
|
autoFocus: true,
|
|
547
547
|
fullWidth: true,
|
|
548
|
-
|
|
549
|
-
|
|
548
|
+
value: title,
|
|
549
|
+
onChange: (e) => setTitle(e.target.value),
|
|
550
550
|
disabled: isLoading,
|
|
551
551
|
error: !!inputError,
|
|
552
552
|
onBlur,
|
package/dist/index.mjs
CHANGED
|
@@ -495,7 +495,7 @@ import {
|
|
|
495
495
|
import { XIcon } from "@elementor/icons";
|
|
496
496
|
import { __ as __4 } from "@wordpress/i18n";
|
|
497
497
|
function EditModeTemplate({ postTitle, isLoading, callback }) {
|
|
498
|
-
const
|
|
498
|
+
const [title, setTitle] = useState5(postTitle);
|
|
499
499
|
const [inputError, setInputError] = useState5("");
|
|
500
500
|
const closeButton = useRef();
|
|
501
501
|
const onBlur = (e) => {
|
|
@@ -510,7 +510,7 @@ function EditModeTemplate({ postTitle, isLoading, callback }) {
|
|
|
510
510
|
};
|
|
511
511
|
const validateInput = () => {
|
|
512
512
|
let isValid = true;
|
|
513
|
-
if (
|
|
513
|
+
if (title.trim() === "") {
|
|
514
514
|
isValid = false;
|
|
515
515
|
setInputError(__4("Name is required", "elementor"));
|
|
516
516
|
}
|
|
@@ -520,7 +520,7 @@ function EditModeTemplate({ postTitle, isLoading, callback }) {
|
|
|
520
520
|
if (!validateInput()) {
|
|
521
521
|
return;
|
|
522
522
|
}
|
|
523
|
-
callback(
|
|
523
|
+
callback(title);
|
|
524
524
|
};
|
|
525
525
|
return /* @__PURE__ */ React8.createElement(
|
|
526
526
|
ListItem2,
|
|
@@ -533,8 +533,8 @@ function EditModeTemplate({ postTitle, isLoading, callback }) {
|
|
|
533
533
|
{
|
|
534
534
|
autoFocus: true,
|
|
535
535
|
fullWidth: true,
|
|
536
|
-
|
|
537
|
-
|
|
536
|
+
value: title,
|
|
537
|
+
onChange: (e) => setTitle(e.target.value),
|
|
538
538
|
disabled: isLoading,
|
|
539
539
|
error: !!inputError,
|
|
540
540
|
onBlur,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-site-navigation",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.9",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Elementor Team",
|
|
6
6
|
"homepage": "https://elementor.com/",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"elementor": {
|
|
50
50
|
"type": "extension"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "bf6f15fca29b0ed3fc9e5f0a7a801ab31264553a"
|
|
53
53
|
}
|
|
@@ -18,7 +18,7 @@ type Props = {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export default function EditModeTemplate( { postTitle, isLoading, callback }: Props ) {
|
|
21
|
-
const
|
|
21
|
+
const [ title, setTitle ] = useState( postTitle );
|
|
22
22
|
const [ inputError, setInputError ] = useState( '' );
|
|
23
23
|
const closeButton = useRef<HTMLButtonElement>();
|
|
24
24
|
|
|
@@ -38,7 +38,7 @@ export default function EditModeTemplate( { postTitle, isLoading, callback }: Pr
|
|
|
38
38
|
const validateInput = () => {
|
|
39
39
|
let isValid = true;
|
|
40
40
|
|
|
41
|
-
if (
|
|
41
|
+
if ( title.trim() === '' ) {
|
|
42
42
|
isValid = false;
|
|
43
43
|
setInputError( __( 'Name is required', 'elementor' ) );
|
|
44
44
|
}
|
|
@@ -51,7 +51,7 @@ export default function EditModeTemplate( { postTitle, isLoading, callback }: Pr
|
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
callback(
|
|
54
|
+
callback( title );
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
return (
|
|
@@ -63,8 +63,8 @@ export default function EditModeTemplate( { postTitle, isLoading, callback }: Pr
|
|
|
63
63
|
<TextField
|
|
64
64
|
autoFocus // eslint-disable-line jsx-a11y/no-autofocus
|
|
65
65
|
fullWidth
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
value={ title }
|
|
67
|
+
onChange={ ( e: React.ChangeEvent<{value: string}> ) => setTitle( e.target.value ) }
|
|
68
68
|
disabled={ isLoading }
|
|
69
69
|
error={ !! inputError }
|
|
70
70
|
onBlur={ onBlur }
|