11import {
22 EditorFormDefinition ,
3- EditorFormFieldDefinition ,
3+ EditorFormFieldDefinition , EditorFormFields ,
44 EditorFormTabs ,
55 EditorSelectFormFieldDefinition
66} from "../../framework/forms" ;
@@ -17,6 +17,7 @@ import {
1717import { formatSizeValue } from "../../../utils/dom" ;
1818import { TableCellNode , TableNode , TableRowNode } from "@lexical/table" ;
1919import { CommonBlockAlignment } from "lexical/nodes/common" ;
20+ import { colorFieldBuilder } from "../../framework/blocks/color-field" ;
2021
2122const borderStyleInput : EditorSelectFormFieldDefinition = {
2223 label : 'Border style' ,
@@ -145,15 +146,15 @@ export const cellProperties: EditorFormDefinition = {
145146 } as EditorSelectFormFieldDefinition ,
146147 ] ;
147148
148- const advancedFields : EditorFormFieldDefinition [ ] = [
149+ const advancedFields : EditorFormFields = [
149150 {
150151 label : 'Border width' , // inline-style: border-width
151152 name : 'border_width' ,
152153 type : 'text' ,
153154 } ,
154155 borderStyleInput , // inline-style: border-style
155- borderColorInput , // inline-style: border-color
156- backgroundColorInput , // inline-style: background-color
156+ colorFieldBuilder ( borderColorInput ) ,
157+ colorFieldBuilder ( backgroundColorInput ) ,
157158 ] ;
158159
159160 return new EditorFormTabs ( [
@@ -210,8 +211,8 @@ export const rowProperties: EditorFormDefinition = {
210211 type : 'text' ,
211212 } ,
212213 borderStyleInput , // style on tr: height
213- borderColorInput , // style on tr: height
214- backgroundColorInput , // style on tr: height
214+ colorFieldBuilder ( borderColorInput ) ,
215+ colorFieldBuilder ( backgroundColorInput ) ,
215216 ] ,
216217} ;
217218
@@ -305,10 +306,10 @@ export const tableProperties: EditorFormDefinition = {
305306 alignmentInput , // alignment class
306307 ] ;
307308
308- const advancedFields : EditorFormFieldDefinition [ ] = [
309- borderStyleInput , // Style - border-style
310- borderColorInput , // Style - border-color
311- backgroundColorInput , // Style - background-color
309+ const advancedFields : EditorFormFields = [
310+ borderStyleInput ,
311+ colorFieldBuilder ( borderColorInput ) ,
312+ colorFieldBuilder ( backgroundColorInput ) ,
312313 ] ;
313314
314315 return new EditorFormTabs ( [
0 commit comments