feat(richtext-lexical): inline blocks (#7102)
This commit is contained in:
@@ -79,6 +79,8 @@ export const BlockRow: React.FC<BlockFieldProps> = ({
|
||||
.filter(Boolean)
|
||||
.join(' ')
|
||||
|
||||
const LabelComponent = block?.LabelComponent
|
||||
|
||||
return (
|
||||
<div
|
||||
id={`${parentPath.split('.').join('-')}-row-${rowIndex}`}
|
||||
@@ -119,19 +121,23 @@ export const BlockRow: React.FC<BlockFieldProps> = ({
|
||||
: undefined
|
||||
}
|
||||
header={
|
||||
<div className={`${baseClass}__block-header`}>
|
||||
<span className={`${baseClass}__block-number`}>
|
||||
{String(rowIndex + 1).padStart(2, '0')}
|
||||
</span>
|
||||
<Pill
|
||||
className={`${baseClass}__block-pill ${baseClass}__block-pill-${row.blockType}`}
|
||||
pillStyle="white"
|
||||
>
|
||||
{getTranslation(block.labels.singular, i18n)}
|
||||
</Pill>
|
||||
<SectionTitle path={`${path}.blockName`} readOnly={readOnly} />
|
||||
{fieldHasErrors && <ErrorPill count={errorCount} i18n={i18n} withMessage />}
|
||||
</div>
|
||||
LabelComponent ? (
|
||||
<LabelComponent blockKind={'block'} formData={row} />
|
||||
) : (
|
||||
<div className={`${baseClass}__block-header`}>
|
||||
<span className={`${baseClass}__block-number`}>
|
||||
{String(rowIndex + 1).padStart(2, '0')}
|
||||
</span>
|
||||
<Pill
|
||||
className={`${baseClass}__block-pill ${baseClass}__block-pill-${row.blockType}`}
|
||||
pillStyle="white"
|
||||
>
|
||||
{getTranslation(block.labels.singular, i18n)}
|
||||
</Pill>
|
||||
<SectionTitle path={`${path}.blockName`} readOnly={readOnly} />
|
||||
{fieldHasErrors && <ErrorPill count={errorCount} i18n={i18n} withMessage />}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
isCollapsed={row.collapsed}
|
||||
key={row.id}
|
||||
|
||||
Reference in New Issue
Block a user