Skip to content

Commit 5aa410c

Browse files
committed
Add deprecation
1 parent 48076c4 commit 5aa410c

File tree

6 files changed

+22
-3
lines changed

6 files changed

+22
-3
lines changed

docs/reference/deprecated.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Gutenberg's deprecation policy is intended to support backwards-compatibility fo
55
- `wp.date.getSettings` has been removed. Please use `wp.date.__experimentalGetSettings` instead.
66
- `wp.compose.remountOnPropChange` has been removed.
77
- The following editor store actions have been removed: `createNotice`, `removeNotice`, `createSuccessNotice`, `createInfoNotice`, `createErrorNotice`, `createWarningNotice`. Use the equivalent actions by the same name from the `@wordpress/notices` module.
8+
- The id prop of wp.nux.DotTip has been removed. Please use the tipId prop instead.
89

910
## 4.3.0
1011

lib/client-assets.php

+1
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,7 @@ function gutenberg_register_scripts_and_styles() {
550550
'wp-components',
551551
'wp-compose',
552552
'wp-data',
553+
'wp-deprecated',
553554
'wp-i18n',
554555
'wp-polyfill',
555556
'lodash',

package-lock.json

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/nux/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 2.0.7 (Unreleased)
2+
3+
### Deprecations
4+
5+
- The id prop of DotTip has been deprecated. Please use the tipId prop instead.
6+
17
## 2.0.6 (2018-10-22)
28

39
## 2.0.5 (2018-10-19)

packages/nux/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"@wordpress/components": "file:../components",
2525
"@wordpress/compose": "file:../compose",
2626
"@wordpress/data": "file:../data",
27+
"@wordpress/deprecated": "file:../deprecated",
2728
"@wordpress/element": "file:../element",
2829
"@wordpress/i18n": "file:../i18n",
2930
"lodash": "^4.17.10",

packages/nux/src/components/dot-tip/index.js

+12-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { compose } from '@wordpress/compose';
55
import { Popover, Button, IconButton } from '@wordpress/components';
66
import { __ } from '@wordpress/i18n';
77
import { withSelect, withDispatch } from '@wordpress/data';
8+
import { deprecated } from '@wordpress/deprecated';
89

910
function getAnchorRect( anchor ) {
1011
// The default getAnchorRect() excludes an element's top and bottom padding
@@ -58,19 +59,27 @@ export function DotTip( {
5859
}
5960

6061
export default compose(
61-
withSelect( ( select, { tipId } ) => {
62+
withSelect( ( select, { tipId, id } ) => {
63+
if ( id ) {
64+
tipId = id;
65+
deprecated( 'The id prop of wp.nux.DotTip', {
66+
plugin: 'Gutenberg',
67+
version: '4.4',
68+
alternative: 'the tipId prop',
69+
} );
70+
}
6271
const { isTipVisible, getAssociatedGuide } = select( 'core/nux' );
6372
const associatedGuide = getAssociatedGuide( tipId );
6473
return {
6574
isVisible: isTipVisible( tipId ),
6675
hasNextTip: !! ( associatedGuide && associatedGuide.nextTipId ),
6776
};
6877
} ),
69-
withDispatch( ( dispatch, { tipId } ) => {
78+
withDispatch( ( dispatch, { tipId, id } ) => {
7079
const { dismissTip, disableTips } = dispatch( 'core/nux' );
7180
return {
7281
onDismiss() {
73-
dismissTip( tipId );
82+
dismissTip( tipId || id );
7483
},
7584
onDisable() {
7685
disableTips();

0 commit comments

Comments
 (0)