import type { PatternsFieldType } from '@wix/bex-core'; import type { CellTypeConfigMap } from './types'; /** * Maps a source field's neutral type to the EditableTable cell type used to * render and edit it. Reference / multi-reference / address need extra * typeConfig the projection can't supply yet, so the projection downgrades * those to a read-only display (see NEEDS_TYPE_CONFIG in * buildEditableFieldColumns); the ideal mapping is kept here for when that * lands. ARRAY / OBJECT / UNKNOWN have no dedicated editable cell, so they * display as 'object'. */ export const FIELD_TYPE_TO_CELL_TYPE: Record< PatternsFieldType, keyof CellTypeConfigMap > = { SHORT_TEXT: 'text', LONG_TEXT: 'text', NUMBER: 'number', BOOLEAN: 'boolean', DATE: 'date', DATETIME: 'datetime', TIME: 'time', URL: 'url', EMAIL: 'email', COLOR: 'color', IMAGE: 'image', VIDEO: 'video', AUDIO: 'audio', MEDIA_GALLERY: 'mediaGallery', DOCUMENT: 'document', MULTI_DOCUMENT: 'multiDocument', RICH_TEXT: 'richText', RICH_CONTENT: 'richContent', ADDRESS: 'address', REFERENCE: 'reference', MULTI_REFERENCE: 'multiReference', ARRAY: 'object', OBJECT: 'object', UNKNOWN: 'object', };