Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit e78b3ac

Browse files
author
Tarun Vijwani
committed
Merge remote-tracking branch 'origin/trunk' into trunk
2 parents 74540aa + 0a89436 commit e78b3ac

File tree

2 files changed

+10
-24
lines changed

2 files changed

+10
-24
lines changed
Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/**
22
* External dependencies
33
*/
4-
import PropTypes from 'prop-types';
54
import { PlainText } from '@wordpress/block-editor';
65
import { withInstanceId } from '@wordpress/compose';
76
import { __ } from '@wordpress/i18n';
@@ -10,15 +9,21 @@ import { __ } from '@wordpress/i18n';
109
* Internal dependencies
1110
*/
1211
import './editor.scss';
13-
12+
interface BlockTitleProps {
13+
className: string;
14+
headingLevel: number;
15+
onChange: ( value: string ) => void;
16+
heading: string;
17+
instanceId: number;
18+
}
1419
const BlockTitle = ( {
1520
className,
1621
headingLevel,
1722
onChange,
1823
heading,
1924
instanceId,
20-
} ) => {
21-
const TagName = `h${ headingLevel }`;
25+
}: BlockTitleProps ) => {
26+
const TagName = `h${ headingLevel }` as keyof JSX.IntrinsicElements;
2227
return (
2328
<TagName className={ className }>
2429
<label
@@ -38,23 +43,4 @@ const BlockTitle = ( {
3843
);
3944
};
4045

41-
BlockTitle.propTypes = {
42-
/**
43-
* Classname to add to title in addition to the defaults.
44-
*/
45-
className: PropTypes.string,
46-
/**
47-
* The value of the heading.
48-
*/
49-
value: PropTypes.string,
50-
/**
51-
* Callback to update the attribute when text is changed.
52-
*/
53-
onChange: PropTypes.func,
54-
/**
55-
* Level of the heading tag (1, 2, 3... will render <h1>, <h2>, <h3>... elements).
56-
*/
57-
headingLevel: PropTypes.number,
58-
};
59-
6046
export default withInstanceId( BlockTitle );

checkstyle.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1982,7 +1982,7 @@
19821982
<error line="174" column="35" severity="error" message="Argument of type &apos;unknown&apos; is not assignable to parameter of type &apos;StoreAttributes[]&apos;." source="TS2345" />
19831983
<error line="182" column="35" severity="error" message="Parameter &apos;attribute&apos; implicitly has an &apos;any&apos; type." source="TS7006" />
19841984
</file>
1985-
<file name="assets/js/editor-components/block-title/index.js">
1985+
<file name="assets/js/editor-components/block-title/index.tsx">
19861986
<error line="15" column="2" severity="error" message="Binding element &apos;className&apos; implicitly has an &apos;any&apos; type." source="TS7031" />
19871987
<error line="16" column="2" severity="error" message="Binding element &apos;headingLevel&apos; implicitly has an &apos;any&apos; type." source="TS7031" />
19881988
<error line="17" column="2" severity="error" message="Binding element &apos;onChange&apos; implicitly has an &apos;any&apos; type." source="TS7031" />

0 commit comments

Comments
 (0)