| 1 |
import { __ } from "@wordpress/i18n"; |
| 2 |
import { buttonBindableAttributes } from "../blocks/button/element"; |
| 3 |
import { textBindableAttributes } from "../blocks/text/element"; |
| 4 |
import { imageBindableAttributes } from "../blocks/image/element"; |
| 5 |
import { listBindableAttributes } from "../blocks/list/element"; |
| 6 |
import { BindableAttribute } from "../dynamic-data"; |
| 7 |
import { getExtendedElementDefinition } from "../extensions"; |
| 8 |
|
| 9 |
export function getElementBindableAttributes( |
| 10 |
elementType: string |
| 11 |
): BindableAttribute[] { |
| 12 |
switch (elementType) { |
| 13 |
case "text": |
| 14 |
return textBindableAttributes; |
| 15 |
case "button": |
| 16 |
return buttonBindableAttributes; |
| 17 |
case "image": |
| 18 |
return imageBindableAttributes; |
| 19 |
case "list": |
| 20 |
return listBindableAttributes; |
| 21 |
default: |
| 22 |
return ( |
| 23 |
getExtendedElementDefinition(elementType)?.bindableAttributes || |
| 24 |
[] |
| 25 |
); |
| 26 |
} |
| 27 |
} |
| 28 |
|