@elementor/editor-site-navigation 0.12.0 → 0.13.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 +11 -0
- package/dist/index.js +3 -3
- package/dist/index.mjs +3 -3
- package/package.json +2 -2
- package/src/components/panel/actions-menu/actions/__tests__/view.test.tsx +36 -0
- package/src/components/panel/actions-menu/actions/view.tsx +1 -2
- package/src/init.ts +1 -1
- package/src/types.ts +1 -1
- /package/src/hooks/{useToggleButtonProps.ts → use-toggle-button-props.ts} +0 -0
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.13.0](https://github.com/elementor/elementor-packages/compare/@elementor/editor-site-navigation@0.12.0...@elementor/editor-site-navigation@0.13.0) (2023-07-26)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* added view page action to pages panel [ED-10869] ([#66](https://github.com/elementor/elementor-packages/issues/66)) ([dfefd2f](https://github.com/elementor/elementor-packages/commit/dfefd2f90435c8ecf45c897c4329bd9c5a262a6c))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [0.12.0](https://github.com/elementor/elementor-packages/compare/@elementor/editor-site-navigation@0.11.0...@elementor/editor-site-navigation@0.12.0) (2023-07-24)
|
|
7
18
|
|
|
8
19
|
|
package/dist/index.js
CHANGED
|
@@ -249,7 +249,7 @@ function RecentlyEdited() {
|
|
|
249
249
|
// src/init.ts
|
|
250
250
|
var import_editor_app_bar = require("@elementor/editor-app-bar");
|
|
251
251
|
|
|
252
|
-
// src/hooks/
|
|
252
|
+
// src/hooks/use-toggle-button-props.ts
|
|
253
253
|
var import_i18n14 = require("@wordpress/i18n");
|
|
254
254
|
var import_icons15 = require("@elementor/icons");
|
|
255
255
|
|
|
@@ -724,7 +724,7 @@ function View({ post }) {
|
|
|
724
724
|
title,
|
|
725
725
|
icon: import_icons10.EyeIcon,
|
|
726
726
|
onClick: () => {
|
|
727
|
-
|
|
727
|
+
window.open(post.link, "_blank");
|
|
728
728
|
}
|
|
729
729
|
}
|
|
730
730
|
);
|
|
@@ -891,7 +891,7 @@ var {
|
|
|
891
891
|
component: shell_default
|
|
892
892
|
});
|
|
893
893
|
|
|
894
|
-
// src/hooks/
|
|
894
|
+
// src/hooks/use-toggle-button-props.ts
|
|
895
895
|
function useToggleButtonProps() {
|
|
896
896
|
const { isOpen, isBlocked } = usePanelStatus();
|
|
897
897
|
const { open, close } = usePanelActions();
|
package/dist/index.mjs
CHANGED
|
@@ -231,7 +231,7 @@ function RecentlyEdited() {
|
|
|
231
231
|
// src/init.ts
|
|
232
232
|
import { injectIntoPageIndication, toolsMenu } from "@elementor/editor-app-bar";
|
|
233
233
|
|
|
234
|
-
// src/hooks/
|
|
234
|
+
// src/hooks/use-toggle-button-props.ts
|
|
235
235
|
import { __ as __14 } from "@wordpress/i18n";
|
|
236
236
|
import { PagesIcon } from "@elementor/icons";
|
|
237
237
|
|
|
@@ -724,7 +724,7 @@ function View({ post }) {
|
|
|
724
724
|
title,
|
|
725
725
|
icon: EyeIcon,
|
|
726
726
|
onClick: () => {
|
|
727
|
-
|
|
727
|
+
window.open(post.link, "_blank");
|
|
728
728
|
}
|
|
729
729
|
}
|
|
730
730
|
);
|
|
@@ -891,7 +891,7 @@ var {
|
|
|
891
891
|
component: shell_default
|
|
892
892
|
});
|
|
893
893
|
|
|
894
|
-
// src/hooks/
|
|
894
|
+
// src/hooks/use-toggle-button-props.ts
|
|
895
895
|
function useToggleButtonProps() {
|
|
896
896
|
const { isOpen, isBlocked } = usePanelStatus();
|
|
897
897
|
const { open, close } = usePanelActions();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-site-navigation",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
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": "eb0ac23904894e5643c30e5b66b91541032bb8a0"
|
|
53
53
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { act, render, screen } from '@testing-library/react';
|
|
3
|
+
import View from '../view';
|
|
4
|
+
import { Post } from '../../../../../types';
|
|
5
|
+
|
|
6
|
+
describe( '@elementor/editor-site-navigation - View', () => {
|
|
7
|
+
afterAll( () => {
|
|
8
|
+
jest.clearAllMocks();
|
|
9
|
+
} );
|
|
10
|
+
|
|
11
|
+
it( 'should open page in a different tab', () => {
|
|
12
|
+
// Arrange.
|
|
13
|
+
const spy = jest.spyOn( window, 'open' );
|
|
14
|
+
spy.mockImplementation( () => null );
|
|
15
|
+
const page: Post = {
|
|
16
|
+
id: 1,
|
|
17
|
+
title: { rendered: 'Page Title' },
|
|
18
|
+
link: 'mocklink',
|
|
19
|
+
status: 'publish',
|
|
20
|
+
type: 'page',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// Act.
|
|
24
|
+
render( <View post={ page } /> );
|
|
25
|
+
const button = screen.getByRole( 'button' );
|
|
26
|
+
|
|
27
|
+
act( () => {
|
|
28
|
+
// Open menu
|
|
29
|
+
button.click();
|
|
30
|
+
} );
|
|
31
|
+
|
|
32
|
+
// Assert.
|
|
33
|
+
expect( spy ).toHaveBeenCalledTimes( 1 );
|
|
34
|
+
expect( spy ).toHaveBeenCalledWith( 'mocklink', '_blank' );
|
|
35
|
+
} );
|
|
36
|
+
} );
|
package/src/init.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import RecentlyEdited from './components/top-bar/recently-edited';
|
|
2
2
|
import { injectIntoPageIndication, toolsMenu } from '@elementor/editor-app-bar';
|
|
3
|
-
import { useToggleButtonProps } from './hooks/
|
|
3
|
+
import { useToggleButtonProps } from './hooks/use-toggle-button-props';
|
|
4
4
|
import { registerPanel } from '@elementor/editor-panels';
|
|
5
5
|
import { panel } from './components/panel/panel';
|
|
6
6
|
import { env } from './env';
|
package/src/types.ts
CHANGED
|
File without changes
|