1- import * as React from 'react' ;
2-
3- type EmptyProps = Record < string , never > ;
4-
51type FormattingEvent =
62 | {
7- readonly type : ' color' ;
3+ readonly type : " color" ;
84 readonly value : string ;
95 }
106 | {
11- readonly type : ' cancel' ;
7+ readonly type : " cancel" ;
128 }
139 | {
14- readonly type : ' uncancel' ;
10+ readonly type : " uncancel" ;
1511 } ;
1612
1713// TODO: determine the color based on the current selection
18- const FormattingPalette : React . FC < EmptyProps > = ( props ) => {
14+ const FormattingPalette = ( ) => {
1915 return (
2016 < div >
2117 < input
@@ -24,9 +20,9 @@ const FormattingPalette: React.FC<EmptyProps> = (props) => {
2420 const color = e . target . value ;
2521
2622 if ( document . activeElement ) {
27- const event = new CustomEvent < FormattingEvent > ( ' formatting' , {
23+ const event = new CustomEvent < FormattingEvent > ( " formatting" , {
2824 detail : {
29- type : ' color' ,
25+ type : " color" ,
3026 value : color ,
3127 } ,
3228 bubbles : true ,
@@ -40,9 +36,9 @@ const FormattingPalette: React.FC<EmptyProps> = (props) => {
4036 < button
4137 onClick = { ( ) => {
4238 if ( document . activeElement ) {
43- const event = new CustomEvent < FormattingEvent > ( ' formatting' , {
39+ const event = new CustomEvent < FormattingEvent > ( " formatting" , {
4440 detail : {
45- type : ' cancel' ,
41+ type : " cancel" ,
4642 } ,
4743 bubbles : true ,
4844 cancelable : true ,
@@ -57,9 +53,9 @@ const FormattingPalette: React.FC<EmptyProps> = (props) => {
5753 < button
5854 onClick = { ( ) => {
5955 if ( document . activeElement ) {
60- const event = new CustomEvent < FormattingEvent > ( ' formatting' , {
56+ const event = new CustomEvent < FormattingEvent > ( " formatting" , {
6157 detail : {
62- type : ' uncancel' ,
58+ type : " uncancel" ,
6359 } ,
6460 bubbles : true ,
6561 cancelable : true ,
0 commit comments