PluginProbe
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News / 4.0.7
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News v4.0.7
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 2.3.5 2.3.6 2.4.0 2.4.1 2.4.10 2.4.11 2.4.12 2.4.13 2.4.14 2.4.15 2.4.16 2.4.17 2.4.18 2.4.19 2.4.2 2.4.20 2.4.21 All 88 releases
post-carousel / src / blocks / smart-search / block.js

block.js in Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News 4.0.7, at src/blocks/smart-search/block.js

34 lines 1021 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { registerBlockType } from "@wordpress/blocks";
2 import SmartSearchEdit from "./edit";
3 import generateBlockCSS from "../shared/generateBlockCSS";
4 import { SearchBlockIcon, SmartSearchPreviewImage } from "./icons";
5 import { isBlockEnabled } from "../../utils";
6
7 const options = {
8 apiVersion: 3,
9 icon: SearchBlockIcon,
10 category: "sp-smart-post-show-pro-blocks",
11 name: "sp-smart-post-show/smart-search",
12 title: "Smart Search",
13 description: "Enable visitors to instantly find content with a stylish, powerful live search.",
14 supports: {
15 align: ["wide", "full"],
16 },
17 example: {
18 attributes: {
19 isPreview: true,
20 },
21 },
22 edit: (props) => (props.attributes.isPreview ? <SmartSearchPreviewImage /> : <SmartSearchEdit {...props} />),
23 save: () => null,
24 generateCSS: (attributes) => generateBlockCSS(attributes, "sp-smart-post-show/smart-search", "frontend"),
25 };
26
27 const registerBlockTypeFn = () => {
28 if (isBlockEnabled(options.name)) {
29 registerBlockType(options.name, options);
30 }
31 };
32
33 registerBlockTypeFn();
34