Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ import { convertLexicalToHTMLAsync } from '../index.js'

type Args = {
converters?: HTMLConvertersAsync | HTMLConvertersFunctionAsync
/**
* Whether the lexicalHTML field should appear in the list view filter options.
*
* @default true
*/
disableListColumn?: boolean
/**
* Whether the lexicalHTML field should be hidden in the admin panel
*
Expand Down Expand Up @@ -36,11 +42,19 @@ type Args = {
* @todo will be renamed to lexicalHTML in 4.0, replacing the deprecated `lexicalHTML` converter
*/
export const lexicalHTMLField: (args: Args) => Field = (args) => {
const { converters, hidden = true, htmlFieldName, lexicalFieldName, storeInDB = false } = args
const {
converters,
disableListColumn = true,
hidden = true,
htmlFieldName,
lexicalFieldName,
storeInDB = false,
} = args
const field: Field = {
name: htmlFieldName,
type: 'code',
admin: {
disableListColumn,
editorOptions: {
language: 'html',
},
Expand Down