| 1 |
import { ReactNode } from "react"; |
| 2 |
import { applyFilters } from "@wordpress/hooks"; |
| 3 |
|
| 4 |
import { CellKey, RibbonConfig } from "./attributes"; |
| 5 |
|
| 6 |
/** |
| 7 |
* The ribbon is a pro feature. The cell block receives it as a prop from |
| 8 |
* pro's block extension, but the read-only preview (sort / search / |
| 9 |
* responsive) renders cells from a store snapshot rather than from block |
| 10 |
* props, so it asks for the ribbon through this filter instead. |
| 11 |
*/ |
| 12 |
export function renderExtendedCellRibbon( |
| 13 |
ribbon: RibbonConfig, |
| 14 |
cellCoords: CellKey |
| 15 |
): ReactNode | null { |
| 16 |
return applyFilters( |
| 17 |
"tableberg.renderCellRibbon", |
| 18 |
null, |
| 19 |
ribbon, |
| 20 |
cellCoords |
| 21 |
) as ReactNode | null; |
| 22 |
} |
| 23 |
|