| 1 |
import { registerBlockType } from "@wordpress/blocks"; |
| 2 |
import generateBlockCSS from "../shared/generateBlockCSS"; |
| 3 |
import { isBlockEnabled } from "../../utils"; |
| 4 |
import SaveComponent from "../shared/SaveComponent"; |
| 5 |
import ColumnEdit from "./edit"; |
| 6 |
import { ColumnIconBlocks } from "./icons"; |
| 7 |
|
| 8 |
const options = { |
| 9 |
apiVersion: 3, |
| 10 |
icon: ColumnIconBlocks, |
| 11 |
category: "sp-smart-post-show", |
| 12 |
name: "sp-smart-post-show/column", |
| 13 |
parent: ["sp-smart-post-show/container"], |
| 14 |
title: "Column", |
| 15 |
description: "Display a single column flex box container column.", |
| 16 |
example: { |
| 17 |
attributes: { |
| 18 |
isPreview: true, |
| 19 |
}, |
| 20 |
}, |
| 21 |
edit: ColumnEdit, |
| 22 |
save: SaveComponent, |
| 23 |
generateCSS: (attributes) => generateBlockCSS(attributes, "sp-smart-post-show/column", "frontend"), |
| 24 |
}; |
| 25 |
|
| 26 |
const registerBlockTypeFn = () => { |
| 27 |
if (isBlockEnabled("container")) { |
| 28 |
registerBlockType(options.name, options); |
| 29 |
} |
| 30 |
}; |
| 31 |
|
| 32 |
registerBlockTypeFn(); |
| 33 |
|