@wordpress/nux 5.20.0 → 6.0.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
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 6.0.0 (2022-12-14)
6
+
7
+ ### Breaking Changes
8
+
9
+ - Updated dependencies to require React 18 ([45235](https://github.com/WordPress/gutenberg/pull/45235))
10
+
5
11
  ## 5.20.0 (2022-11-16)
6
12
 
7
13
  ## 5.19.0 (2022-11-02)
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Converts a hex value into the rgb equivalent.
3
+ *
4
+ * @param {string} hex - the hexadecimal value to convert
5
+ * @return {string} comma separated rgb values
6
+ */
1
7
  /**
2
8
  * Colors
3
9
  */
@@ -11,6 +17,12 @@
11
17
  * Don't add to this sheet unless you're pretty sure the value will be reused in many places.
12
18
  * For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
13
19
  */
20
+ /**
21
+ * Converts a hex value into the rgb equivalent.
22
+ *
23
+ * @param {string} hex - the hexadecimal value to convert
24
+ * @return {string} comma separated rgb values
25
+ */
14
26
  /**
15
27
  * Colors
16
28
  */
@@ -82,6 +94,8 @@
82
94
  --wp-admin-theme-color-darker-20: #005a87;
83
95
  --wp-admin-theme-color-darker-20--rgb: 0, 90, 135;
84
96
  --wp-admin-border-width-focus: 2px;
97
+ --wp-block-synced-color: #7a00df;
98
+ --wp-block-synced-color--rgb: 122, 0, 223;
85
99
  }
86
100
  @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
87
101
  :root {
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Converts a hex value into the rgb equivalent.
3
+ *
4
+ * @param {string} hex - the hexadecimal value to convert
5
+ * @return {string} comma separated rgb values
6
+ */
1
7
  /**
2
8
  * Colors
3
9
  */
@@ -11,6 +17,12 @@
11
17
  * Don't add to this sheet unless you're pretty sure the value will be reused in many places.
12
18
  * For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
13
19
  */
20
+ /**
21
+ * Converts a hex value into the rgb equivalent.
22
+ *
23
+ * @param {string} hex - the hexadecimal value to convert
24
+ * @return {string} comma separated rgb values
25
+ */
14
26
  /**
15
27
  * Colors
16
28
  */
@@ -82,6 +94,8 @@
82
94
  --wp-admin-theme-color-darker-20: #005a87;
83
95
  --wp-admin-theme-color-darker-20--rgb: 0, 90, 135;
84
96
  --wp-admin-border-width-focus: 2px;
97
+ --wp-block-synced-color: #7a00df;
98
+ --wp-block-synced-color--rgb: 122, 0, 223;
85
99
  }
86
100
  @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
87
101
  :root {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/nux",
3
- "version": "5.20.0",
3
+ "version": "6.0.0",
4
4
  "description": "NUX (New User eXperience) module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -31,21 +31,21 @@
31
31
  ],
32
32
  "dependencies": {
33
33
  "@babel/runtime": "^7.16.0",
34
- "@wordpress/components": "^22.1.0",
35
- "@wordpress/compose": "^5.20.0",
36
- "@wordpress/data": "^7.6.0",
37
- "@wordpress/deprecated": "^3.22.0",
38
- "@wordpress/element": "^4.20.0",
39
- "@wordpress/i18n": "^4.22.0",
40
- "@wordpress/icons": "^9.13.0",
34
+ "@wordpress/components": "^23.0.0",
35
+ "@wordpress/compose": "^6.0.0",
36
+ "@wordpress/data": "^8.0.0",
37
+ "@wordpress/deprecated": "^3.23.0",
38
+ "@wordpress/element": "^5.0.0",
39
+ "@wordpress/i18n": "^4.23.0",
40
+ "@wordpress/icons": "^9.14.0",
41
41
  "rememo": "^4.0.0"
42
42
  },
43
43
  "peerDependencies": {
44
- "react": "^17.0.0",
45
- "react-dom": "^17.0.0"
44
+ "react": "^18.0.0",
45
+ "react-dom": "^18.0.0"
46
46
  },
47
47
  "publishConfig": {
48
48
  "access": "public"
49
49
  },
50
- "gitHead": "7ac04f446242452d3cb24372f9ca58f0cae97715"
50
+ "gitHead": "1eb65aabe6738097f4c062e78f69ae8f05879848"
51
51
  }
@@ -3,13 +3,14 @@
3
3
  exports[`DotTip should render correctly 1`] = `
4
4
  <div
5
5
  aria-label="Editor tips"
6
- class="components-popover nux-dot-tip"
6
+ class="components-popover nux-dot-tip is-positioned"
7
7
  role="dialog"
8
- style="position: absolute; opacity: 0; transform: translateX(-2em) scale(0) translateZ(0); transform-origin: 0% 50% 0;"
8
+ style="position: absolute; top: 0px; left: 0px; opacity: 0; transform: translateX(-2em) scale(0) translateZ(0); transform-origin: 0% 50% 0;"
9
9
  tabindex="-1"
10
10
  >
11
11
  <div
12
12
  class="components-popover__content"
13
+ style="max-height: 0px; overflow: auto;"
13
14
  >
14
15
  <p>
15
16
  It looks like you’re writing a letter. Would you like help?
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { render, screen } from '@testing-library/react';
4
+ import { act, render, screen } from '@testing-library/react';
5
5
  import userEvent from '@testing-library/user-event';
6
6
 
7
7
  /**
@@ -12,23 +12,27 @@ import { DotTip } from '..';
12
12
  const noop = () => {};
13
13
 
14
14
  describe( 'DotTip', () => {
15
- it( 'should not render anything if invisible', () => {
15
+ it( 'should not render anything if invisible', async () => {
16
16
  render(
17
17
  <DotTip>
18
18
  It looks like you’re writing a letter. Would you like help?
19
19
  </DotTip>
20
20
  );
21
21
 
22
+ await act( () => Promise.resolve() );
23
+
22
24
  expect( screen.queryByRole( 'dialog' ) ).not.toBeInTheDocument();
23
25
  } );
24
26
 
25
- it( 'should render correctly', () => {
27
+ it( 'should render correctly', async () => {
26
28
  render(
27
29
  <DotTip isVisible setTimeout={ noop }>
28
30
  It looks like you’re writing a letter. Would you like help?
29
31
  </DotTip>
30
32
  );
31
33
 
34
+ await act( () => Promise.resolve() );
35
+
32
36
  expect( screen.getByRole( 'dialog' ) ).toMatchSnapshot();
33
37
  } );
34
38
 
@@ -44,6 +48,8 @@ describe( 'DotTip', () => {
44
48
  </DotTip>
45
49
  );
46
50
 
51
+ await act( () => Promise.resolve() );
52
+
47
53
  await user.click( screen.getByRole( 'button', { name: 'Got it' } ) );
48
54
 
49
55
  expect( onDismiss ).toHaveBeenCalled();
@@ -61,6 +67,8 @@ describe( 'DotTip', () => {
61
67
  </DotTip>
62
68
  );
63
69
 
70
+ await act( () => Promise.resolve() );
71
+
64
72
  await user.click(
65
73
  screen.getByRole( 'button', { name: 'Disable tips' } )
66
74
  );