@elementor/editor-site-navigation 0.4.1 → 0.5.0
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 +19 -0
- package/package.json +6 -6
- package/src/components/top-bar/__tests__/add-new-page.test.tsx +4 -4
- package/src/components/top-bar/__tests__/recently-edited.test.tsx +6 -6
- package/src/hooks/__tests__/use-create-page.test.ts +1 -2
- package/src/hooks/__tests__/use-recent-posts.test.ts +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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.5.0](https://github.com/elementor/elementor-packages/compare/@elementor/editor-site-navigation@0.4.2...@elementor/editor-site-navigation@0.5.0) (2023-06-01)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* add support for React 18 [ED-10905] ([#46](https://github.com/elementor/elementor-packages/issues/46)) ([c8915c6](https://github.com/elementor/elementor-packages/commit/c8915c6ea62550bcdeb5c8a576f311bedc35bcad))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [0.4.2](https://github.com/elementor/elementor-packages/compare/@elementor/editor-site-navigation@0.4.1...@elementor/editor-site-navigation@0.4.2) (2023-05-30)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @elementor/editor-site-navigation
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [0.4.1](https://github.com/elementor/elementor-packages/compare/@elementor/editor-site-navigation@0.4.0...@elementor/editor-site-navigation@0.4.1) (2023-05-23)
|
|
7
26
|
|
|
8
27
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-site-navigation",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Elementor Team",
|
|
6
6
|
"homepage": "https://elementor.com/",
|
|
@@ -32,19 +32,19 @@
|
|
|
32
32
|
"dev": "tsup src/index.ts --format esm --clean"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@elementor/editor-app-bar": "^0.
|
|
36
|
-
"@elementor/editor-documents": "^0.
|
|
37
|
-
"@elementor/icons": "^0.
|
|
35
|
+
"@elementor/editor-app-bar": "^0.5.0",
|
|
36
|
+
"@elementor/editor-documents": "^0.6.0",
|
|
37
|
+
"@elementor/icons": "^0.3.0",
|
|
38
38
|
"@elementor/ui": "^1.4.50",
|
|
39
39
|
"@wordpress/api-fetch": "^6.27.0",
|
|
40
40
|
"@wordpress/i18n": "^4.31.0",
|
|
41
41
|
"@wordpress/url": "^3.31.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"react": "17.x"
|
|
44
|
+
"react": "17.x || 18.x"
|
|
45
45
|
},
|
|
46
46
|
"elementor": {
|
|
47
47
|
"type": "extension"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "2ee431a07ec6af6ca2b9930c0b830e78696b194a"
|
|
50
50
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { render, waitFor } from '@testing-library/react';
|
|
2
|
+
import { fireEvent, render, waitFor } from '@testing-library/react';
|
|
3
3
|
import { useHostDocument, useActiveDocument, useNavigateToDocument } from '@elementor/editor-documents';
|
|
4
4
|
import RecentlyEdited from '../recently-edited';
|
|
5
5
|
import { createMockDocument } from 'test-utils';
|
|
@@ -49,7 +49,7 @@ describe( '@elementor/recently-edited - Top bar add new page', () => {
|
|
|
49
49
|
|
|
50
50
|
// Act.
|
|
51
51
|
const buttons = getAllByRole( 'button' );
|
|
52
|
-
buttons[ 0 ]
|
|
52
|
+
fireEvent.click( buttons[ 0 ] ); // Opens the recently edited menu
|
|
53
53
|
|
|
54
54
|
// Assert.
|
|
55
55
|
const label = getByText( 'Add new page', { exact: false } );
|
|
@@ -73,10 +73,10 @@ describe( '@elementor/recently-edited - Top bar add new page', () => {
|
|
|
73
73
|
|
|
74
74
|
// Act.
|
|
75
75
|
const buttons = getAllByRole( 'button' );
|
|
76
|
-
buttons[ 0 ]
|
|
76
|
+
fireEvent.click( buttons[ 0 ] ); // Opens the recently edited menu
|
|
77
77
|
|
|
78
78
|
const addNewPage = getByText( 'Add new page', { exact: false } );
|
|
79
|
-
|
|
79
|
+
fireEvent.click( addNewPage );
|
|
80
80
|
|
|
81
81
|
// Assert.
|
|
82
82
|
await waitFor( () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
2
|
+
import { fireEvent, render } from '@testing-library/react';
|
|
3
3
|
import { useHostDocument, useActiveDocument, useNavigateToDocument } from '@elementor/editor-documents';
|
|
4
4
|
import RecentlyEdited from '../recently-edited';
|
|
5
5
|
import { createMockDocument } from 'test-utils';
|
|
@@ -126,7 +126,7 @@ describe( '@elementor/recently-edited - Top bar Recently Edited', () => {
|
|
|
126
126
|
|
|
127
127
|
// Act.
|
|
128
128
|
const buttons = getAllByRole( 'button' );
|
|
129
|
-
buttons[ 0 ]
|
|
129
|
+
fireEvent.click( buttons[ 0 ] ); // Opens the recently edited menu
|
|
130
130
|
|
|
131
131
|
// Assert.
|
|
132
132
|
const label = getByText( 'There are no other pages or templates on this site yet', { exact: false } );
|
|
@@ -165,7 +165,7 @@ describe( '@elementor/recently-edited - Top bar Recently Edited', () => {
|
|
|
165
165
|
|
|
166
166
|
// Act.
|
|
167
167
|
const buttons = getAllByRole( 'button' );
|
|
168
|
-
buttons[ 0 ]
|
|
168
|
+
fireEvent.click( buttons[ 0 ] ); // Opens the recently edited menu
|
|
169
169
|
|
|
170
170
|
// Assert.
|
|
171
171
|
const menu = getByRole( 'menu' );
|
|
@@ -225,7 +225,7 @@ describe( '@elementor/recently-edited - Top bar Recently Edited', () => {
|
|
|
225
225
|
expect( getByText( 'Header title with special char ¥' ) ).toBeInTheDocument();
|
|
226
226
|
|
|
227
227
|
// Open the posts list.
|
|
228
|
-
getByRole( 'button' )
|
|
228
|
+
fireEvent.click( getByRole( 'button' ) );
|
|
229
229
|
|
|
230
230
|
// Assert - the post title should be rendered with the HTML entity.
|
|
231
231
|
expect( getByText( 'Post title with <h1>HTML</h1>' ) ).toBeInTheDocument();
|
|
@@ -256,10 +256,10 @@ describe( '@elementor/recently-edited - Top bar Recently Edited', () => {
|
|
|
256
256
|
const { getByText, getByRole } = render( <RecentlyEdited /> );
|
|
257
257
|
|
|
258
258
|
// Open the posts list.
|
|
259
|
-
getByRole( 'button' )
|
|
259
|
+
fireEvent.click( getByRole( 'button' ) );
|
|
260
260
|
|
|
261
261
|
// Act.
|
|
262
|
-
getByText( 'Test post' )
|
|
262
|
+
fireEvent.click( getByText( 'Test post' ) );
|
|
263
263
|
|
|
264
264
|
// Assert.
|
|
265
265
|
expect( navigateToDocument ).toHaveBeenCalledTimes( 1 );
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { renderHook } from '@testing-library/react
|
|
2
|
-
import { waitFor } from '@testing-library/react';
|
|
1
|
+
import { waitFor, renderHook } from '@testing-library/react';
|
|
3
2
|
import apiFetch from '@wordpress/api-fetch';
|
|
4
3
|
import useCreatePage, { endpointPath } from '../use-create-page';
|
|
5
4
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { waitFor } from '@testing-library/react';
|
|
2
|
-
import { renderHook } from '@testing-library/react-hooks';
|
|
1
|
+
import { waitFor, renderHook } from '@testing-library/react';
|
|
3
2
|
import apiFetch from '@wordpress/api-fetch';
|
|
4
3
|
import useRecentPosts, { endpointPath } from '../use-recent-posts';
|
|
5
4
|
|