@elementor/editor-app-bar 0.4.0 → 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 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-app-bar@0.4.1...@elementor/editor-app-bar@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.1](https://github.com/elementor/elementor-packages/compare/@elementor/editor-app-bar@0.4.0...@elementor/editor-app-bar@0.4.1) (2023-05-30)
18
+
19
+ **Note:** Version bump only for package @elementor/editor-app-bar
20
+
21
+
22
+
23
+
24
+
6
25
  # [0.4.0](https://github.com/elementor/elementor-packages/compare/@elementor/editor-app-bar@0.3.0...@elementor/editor-app-bar@0.4.0) (2023-05-21)
7
26
 
8
27
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elementor/editor-app-bar",
3
- "version": "0.4.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 --config=../../tsup.dev.ts"
33
33
  },
34
34
  "dependencies": {
35
- "@elementor/editor": "^0.3.0",
36
- "@elementor/editor-documents": "^0.4.0",
37
- "@elementor/editor-v1-adapters": "^0.2.0",
38
- "@elementor/icons": "^0.2.1",
39
- "@elementor/locations": "^0.3.0",
35
+ "@elementor/editor": "^0.5.0",
36
+ "@elementor/editor-documents": "^0.6.0",
37
+ "@elementor/editor-v1-adapters": "^0.3.0",
38
+ "@elementor/icons": "^0.3.0",
39
+ "@elementor/locations": "^0.4.0",
40
40
  "@elementor/ui": "^1.4.50",
41
41
  "@wordpress/i18n": "^4.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": "45afd449fda346eea0f8a431ebca7d6c1d518dd1"
49
+ "gitHead": "2ee431a07ec6af6ca2b9930c0b830e78696b194a"
50
50
  }
@@ -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 MainMenuLocation from '../main-menu-location';
4
4
  import ToolsMenuLocation from '../tools-menu-location';
5
5
  import UtilitiesMenuLocation from '../utilities-menu-location';
@@ -29,7 +29,7 @@ describe( '@elementor/editor-app-bar - Menus components', () => {
29
29
  // Act.
30
30
  const { getByRole, getAllByRole } = render( <MainMenuLocation /> );
31
31
 
32
- getByRole( 'button' ).click(); // Opens the popover menu
32
+ fireEvent.click( getByRole( 'button' ) ); // Opens the popover menu
33
33
 
34
34
  // Assert.
35
35
  const menuItems = getAllByRole( 'menuitem' );
@@ -80,7 +80,7 @@ describe( '@elementor/editor-app-bar - Menus components', () => {
80
80
  expect( popoverButton ).toHaveAttribute( 'aria-label', 'More' );
81
81
 
82
82
  // Act.
83
- popoverButton.click();
83
+ fireEvent.click( popoverButton );
84
84
 
85
85
  // Assert.
86
86
  expect( getAllByRole( 'menuitem' ) ).toHaveLength( extraAfterMax );
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import SettingsButton from '../settings-button';
3
3
  import { openRoute, useRouteStatus } from '@elementor/editor-v1-adapters';
4
- import { render } from '@testing-library/react';
4
+ import { fireEvent, render } from '@testing-library/react';
5
5
 
6
6
  jest.mock( '@elementor/editor-v1-adapters', () => ( {
7
7
  openRoute: jest.fn(),
@@ -21,7 +21,7 @@ describe( '@elementor/editor-app-bar - App bar document settings button', () =>
21
21
  const { getByRole } = render( <SettingsButton /> );
22
22
 
23
23
  // Act.
24
- getByRole( 'button' ).click();
24
+ fireEvent.click( getByRole( 'button' ) );
25
25
 
26
26
  // Assert.
27
27
  expect( openRoute ).toHaveBeenCalledTimes( 1 );
@@ -1,4 +1,4 @@
1
- import { renderHook } from '@testing-library/react-hooks';
1
+ import { renderHook } from '@testing-library/react';
2
2
  import useActionProps from '../use-action-props';
3
3
  import { runCommand } from '@elementor/editor-v1-adapters';
4
4
  import { createMockDocument } from 'test-utils';
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import PrimaryAction from '../primary-action';
3
- import { render } from '@testing-library/react';
3
+ import { fireEvent, render } from '@testing-library/react';
4
4
  import { createMockDocument } from 'test-utils';
5
5
  import { useActiveDocument, useActiveDocumentActions } from '@elementor/editor-documents';
6
6
 
@@ -135,7 +135,7 @@ describe( '@elementor/editor-app-bar - Top Bar Primary Action', () => {
135
135
  // Act.
136
136
  const { getAllByRole } = render( <PrimaryAction /> );
137
137
 
138
- getAllByRole( 'button' )[ 0 ]?.click();
138
+ fireEvent.click( getAllByRole( 'button' )[ 0 ] );
139
139
 
140
140
  // Assert.
141
141
  expect( actionsMock.save ).toHaveBeenCalledTimes( 1 );
@@ -156,7 +156,7 @@ describe( '@elementor/editor-app-bar - Top Bar Primary Action', () => {
156
156
  const button = getAllByRole( 'button' )[ 0 ];
157
157
  const loader = getAllByRole( 'progressbar' )[ 0 ];
158
158
 
159
- button?.click();
159
+ fireEvent.click( button );
160
160
 
161
161
  // Assert.
162
162
  expect( actionsMock.save ).not.toHaveBeenCalled();
@@ -1,5 +1,5 @@
1
1
  import { createMockDocument } from 'test-utils';
2
- import { renderHook } from '@testing-library/react-hooks';
2
+ import { renderHook } from '@testing-library/react';
3
3
  import useDocumentSaveDraftProps from '../use-document-save-draft-props';
4
4
  import { useActiveDocument, useActiveDocumentActions } from '@elementor/editor-documents';
5
5
 
@@ -1,4 +1,4 @@
1
- import { renderHook } from '@testing-library/react-hooks';
1
+ import { renderHook } from '@testing-library/react';
2
2
  import { useActiveDocumentActions } from '@elementor/editor-documents';
3
3
  import useDocumentSaveTemplateProps from '../use-document-save-template-props';
4
4
 
@@ -1,5 +1,5 @@
1
1
  import useActionProps from '../use-action-props';
2
- import { renderHook } from '@testing-library/react-hooks';
2
+ import { renderHook } from '@testing-library/react';
3
3
  import { openRoute, useRouteStatus } from '@elementor/editor-v1-adapters';
4
4
 
5
5
  jest.mock( '@elementor/editor-v1-adapters', () => ( {
@@ -1,5 +1,5 @@
1
1
  import useActionProps from '../use-action-props';
2
- import { renderHook } from '@testing-library/react-hooks';
2
+ import { renderHook } from '@testing-library/react';
3
3
  import { runCommand, useRouteStatus } from '@elementor/editor-v1-adapters';
4
4
 
5
5
  jest.mock( '@elementor/editor-v1-adapters', () => ( {
@@ -1,5 +1,5 @@
1
1
  import useActionProps from '../use-action-props';
2
- import { renderHook } from '@testing-library/react-hooks';
2
+ import { renderHook } from '@testing-library/react';
3
3
  import { openRoute, useRouteStatus } from '@elementor/editor-v1-adapters';
4
4
 
5
5
  jest.mock( '@elementor/editor-v1-adapters', () => ( {
@@ -1,4 +1,4 @@
1
- import { renderHook } from '@testing-library/react-hooks';
1
+ import { renderHook } from '@testing-library/react';
2
2
  import useActionProps from '../use-action-props';
3
3
  import { runCommand } from '@elementor/editor-v1-adapters';
4
4
 
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { render, screen } from '@testing-library/react';
2
+ import { fireEvent, render, screen } from '@testing-library/react';
3
3
  import PrimaryAction from '../primary-action';
4
4
  import { createMockDocument } from 'test-utils';
5
5
  import { useActiveDocument, useActiveDocumentActions } from '@elementor/editor-documents';
@@ -30,7 +30,7 @@ describe( '@elementor/editor-app-bar - Primary action', () => {
30
30
  render( <PrimaryAction /> );
31
31
 
32
32
  // Act.
33
- screen.getByRole( 'button' ).click();
33
+ fireEvent.click( screen.getByRole( 'button' ) );
34
34
 
35
35
  // Assert.
36
36
  expect( saveFn ).toHaveBeenCalledTimes( 1 );
@@ -56,7 +56,7 @@ describe( '@elementor/editor-app-bar - Primary action', () => {
56
56
  render( <PrimaryAction /> );
57
57
 
58
58
  // Act.
59
- screen.getByRole( 'button' ).click();
59
+ fireEvent.click( screen.getByRole( 'button' ) );
60
60
 
61
61
  // Assert.
62
62
  expect( saveFn ).not.toHaveBeenCalled();
@@ -1,5 +1,5 @@
1
1
  import useActionProps from '../use-action-props';
2
- import { renderHook } from '@testing-library/react-hooks';
2
+ import { renderHook } from '@testing-library/react';
3
3
  import { runCommand, useRouteStatus } from '@elementor/editor-v1-adapters';
4
4
 
5
5
  jest.mock( '@elementor/editor-v1-adapters', () => ( {
@@ -1,5 +1,5 @@
1
1
  import useActionProps from '../use-action-props';
2
- import { renderHook } from '@testing-library/react-hooks';
2
+ import { renderHook } from '@testing-library/react';
3
3
  import { runCommand, useRouteStatus } from '@elementor/editor-v1-adapters';
4
4
 
5
5
  jest.mock( '@elementor/editor-v1-adapters', () => ( {
@@ -1,4 +1,4 @@
1
- import { renderHook } from '@testing-library/react-hooks';
1
+ import { renderHook } from '@testing-library/react';
2
2
  import useThemeBuilderActionProps from '../use-action-props';
3
3
  import { runCommand } from '@elementor/editor-v1-adapters';
4
4
 
@@ -1,5 +1,5 @@
1
1
  import useActionProps from '../use-action-props';
2
- import { renderHook } from '@testing-library/react-hooks';
2
+ import { renderHook } from '@testing-library/react';
3
3
  import { openRoute, useRouteStatus } from '@elementor/editor-v1-adapters';
4
4
 
5
5
  jest.mock( '@elementor/editor-v1-adapters', () => ( {
@@ -56,7 +56,7 @@ describe( '@elementor/editor-app-bar - Menus API', () => {
56
56
  expect( action ).toHaveAttribute( 'aria-label', 'Test' );
57
57
 
58
58
  // Act.
59
- action.click();
59
+ fireEvent.click( action );
60
60
 
61
61
  // Assert.
62
62
  expect( onClick ).toHaveBeenCalled();
@@ -77,13 +77,13 @@ describe( '@elementor/editor-app-bar - Menus API', () => {
77
77
  expect( toggleAction ).toHaveAttribute( 'value', 'test-value' );
78
78
 
79
79
  // Act.
80
- toggleAction.click();
80
+ fireEvent.click( toggleAction );
81
81
 
82
82
  // Assert.
83
83
  expect( toggleAction ).toHaveAttribute( 'aria-pressed', 'true' );
84
84
 
85
85
  // Act.
86
- toggleAction.click();
86
+ fireEvent.click( toggleAction );
87
87
 
88
88
  // Assert.
89
89
  expect( toggleAction ).toHaveAttribute( 'aria-pressed', 'false' );