diff --git a/src/transliteration/ui/line-tokens.tsx b/src/transliteration/ui/line-tokens.tsx index eee3439cf..9ac7ce567 100644 --- a/src/transliteration/ui/line-tokens.tsx +++ b/src/transliteration/ui/line-tokens.tsx @@ -7,13 +7,15 @@ import { LemmaMap, LineLemmasContext, } from './LineLemmasContext' -import { LineAccumulator, MarkableColumnData } from './LineAccumulator' +import { LineAccumulator } from './LineAccumulator' import { annotationLineAccFromColumns, lineAccFromColumns, TextLineColumn, } from 'transliteration/domain/columns' import { PhoneticProps } from 'akkadian/application/phonetics/segments' +import { TextLine } from 'transliteration/domain/text-line' +import { LineNumber } from './line-number' export function LineTokens({ content, @@ -82,39 +84,67 @@ export function LineColumns({ } export function AnnotationLineColumns({ + line, lineIndex, columns, maxColumns, }: { + line: TextLine lineIndex: number columns: readonly TextLineColumn[] maxColumns: number }): JSX.Element { const lineAccumulator = annotationLineAccFromColumns(columns) - return ( - <> - {lineAccumulator.columns.map( - (column: MarkableColumnData, index: number) => ( - - {column.content.map((markableToken, index) => { - return ( - - console.log( - `clicked on token ${markableToken.token.cleanValue} at line=${lineIndex}, index=${index}`, - markableToken.token - ) - } - > - {markableToken.display()} - - ) - })} + const sourceTextLine = ( + + + + + {lineAccumulator.flatResult.map((token, index) => { + return ( + + + console.log( + `clicked on token ${token.token.cleanValue} at line=${lineIndex}, index=${index}`, + token.token + ) + } + > + {token.display()} + + + ) + })} + + ) + const lemmaAnnotationLayer = ( + + + {lineAccumulator.flatResult.map((token, index) => { + return ( + + + console.log( + `clicked on lemma of token ${token.token.cleanValue} at line=${lineIndex}, index=${index}`, + token.token + ) + } + > + {token.token.uniqueLemma} + ) - )} + })} + + ) + + return ( + <> + {sourceTextLine} + {lemmaAnnotationLayer} ) }