| 1 |
import { Fragment } from "@wordpress/element"; |
| 2 |
import Card from "../template-parts/card"; |
| 3 |
|
| 4 |
import { SectionHeadingBlockIcon } from "../../blocks/section-heading/icons"; |
| 5 |
import { PostCarouselBlockIcon } from "../../blocks/post-carousel/icon"; |
| 6 |
import { PostSliderBlockIcon } from "../../blocks/post-slider/icon"; |
| 7 |
import { PostSliderTwoBlockIcon } from "../../blocks/post-slider-two/icon"; |
| 8 |
import { PostThumbnailSlider } from "../../blocks/thumbnail-slider/icon"; |
| 9 |
import { PostThumbnailSliderTwoBlockIcon } from "../../blocks/thumbnail-slider-two/icon"; |
| 10 |
import { NewsTicker } from "../../blocks/news-ticker/icon"; |
| 11 |
import { GridOneBlockIcon } from "../../blocks/post-grid-one/icon"; |
| 12 |
import { GridTwoBlockIcon } from "../../blocks/post-grid-two/icon"; |
| 13 |
import { GridThreeBlockIcon } from "../../blocks/post-grid-three/icon"; |
| 14 |
import { GridFourBlockIcon } from "../../blocks/post-grid-four/icon"; |
| 15 |
import { GridFiveBlockIcon } from "../../blocks/post-grid-five/icon"; |
| 16 |
import { GridSixBlockIcon } from "../../blocks/post-grid-six/icon"; |
| 17 |
import { ListOneBlockIcon } from "../../blocks/post-list-one/icon"; |
| 18 |
import { ListTwoBlockIcon } from "../../blocks/post-list-two/icon"; |
| 19 |
import { ListThreeBlockIcon } from "../../blocks/post-list-three/icon"; |
| 20 |
import { TimelineOneBlockIcon } from "../../blocks/post-timeline-one/icon"; |
| 21 |
import { TimelineTwoBlockIcon } from "../../blocks/post-timeline-two/icon"; |
| 22 |
import { TimelineThreeBlockIcon } from "../../blocks/post-timeline-three/icon"; |
| 23 |
import { ContainerBlockIcon } from "../../blocks/container/icons"; |
| 24 |
import { ButtonsBlockIcon } from "../../blocks/buttons/icon"; |
| 25 |
import { TaxonomyBlockIcon } from "../../blocks/taxonomy/icon"; |
| 26 |
import { SocialProfilesBlockIcon } from "../../blocks/social-profiles/icons"; |
| 27 |
import { SearchBlockIcon } from "../../blocks/smart-search/icons"; |
| 28 |
import { PostCarouselTwoBlockIcon } from "../../blocks/post-carousel-two/icons"; |
| 29 |
import { TableOfContentIcon } from "../../blocks/table-of-content/icons"; |
| 30 |
import { SmartImageBlockIcon } from "../../blocks/smart-image/icons"; |
| 31 |
import { InfoBoxBlockIcon } from "../../blocks/smart-info-box/icons"; |
| 32 |
import { SmartListBlockIcon } from "../../blocks/smart-lists/icons"; |
| 33 |
import { ArchiveTitleIcon, PostAuthorBoxIcon, PostAuthorMetaIcon, PostBreadcrumbsBlockIcon, PostCategoryBlockIcon, PostCommentCountIcon, PostCommentIcon, PostContentIcon, PostDateMetaBlockIcon, PostExcerptIcon, PostFeatureImageIcon, PostLikeCountIcon, PostMetaBlockIcon, PostNextPreviousIcon, PostReadingTimeIcon, PostSocialShareIcon, PostTagBlockIcon, PostTitleIcon, PostViewCountIcon } from "../../icons/builderBlockIcon"; |
| 34 |
|
| 35 |
// Blocks settings page block on/off cards data. |
| 36 |
export const cardData = { |
| 37 |
"post-carousel": { |
| 38 |
Icon: PostCarouselBlockIcon, |
| 39 |
title: "Post Carousel 01", |
| 40 |
docLink: "https://wpsmartpost.com/docs/post-carousel-slider-blocks/post-carousel-01/", |
| 41 |
demoLink: "https://wpsmartpost.com/blocks/#demoId3514", |
| 42 |
}, |
| 43 |
"post-carousel-two": { |
| 44 |
Icon: PostCarouselTwoBlockIcon, |
| 45 |
title: "Post Carousel 02", |
| 46 |
docLink: "https://wpsmartpost.com/docs/post-carousel-slider-blocks/post-carousel-02/", |
| 47 |
demoLink: "https://wpsmartpost.com/blocks/#demoId3516", |
| 48 |
}, |
| 49 |
"post-slider": { |
| 50 |
Icon: PostSliderBlockIcon, |
| 51 |
title: "Post Slider 01", |
| 52 |
docLink: "https://wpsmartpost.com/docs/post-carousel-slider-blocks/post-slider-01/", |
| 53 |
demoLink: "https://wpsmartpost.com/blocks/#demoId3490", |
| 54 |
}, |
| 55 |
"post-slider-two": { |
| 56 |
Icon: PostSliderTwoBlockIcon, |
| 57 |
title: "Post Slider 02", |
| 58 |
docLink: "https://wpsmartpost.com/docs/post-carousel-slider-blocks/post-slider-02/", |
| 59 |
demoLink: "https://wpsmartpost.com/blocks/#demoId3493", |
| 60 |
pro: true, |
| 61 |
}, |
| 62 |
"thumbnail-slider": { |
| 63 |
Icon: PostThumbnailSlider, |
| 64 |
title: "Thumbnails Slider 01", |
| 65 |
docLink: "https://wpsmartpost.com/docs/post-carousel-slider-blocks/thumbnails-slider-01/", |
| 66 |
demoLink: "https://wpsmartpost.com/blocks/#demoId3570", |
| 67 |
}, |
| 68 |
"thumbnail-slider-two": { |
| 69 |
Icon: PostThumbnailSliderTwoBlockIcon, |
| 70 |
title: "Thumbnails Slider 02", |
| 71 |
docLink: "https://wpsmartpost.com/docs/post-carousel-slider-blocks/thumbnails-slider-02/", |
| 72 |
demoLink: "https://wpsmartpost.com/blocks/#demoId3572", |
| 73 |
pro: true, |
| 74 |
}, |
| 75 |
"news-ticker": { |
| 76 |
Icon: NewsTicker, |
| 77 |
title: "News Ticker", |
| 78 |
docLink: "https://wpsmartpost.com/docs/post-carousel-slider-blocks/news-ticker/", |
| 79 |
demoLink: "https://wpsmartpost.com/blocks/#demoId3568", |
| 80 |
}, |
| 81 |
"post-grid-one": { |
| 82 |
Icon: GridOneBlockIcon, |
| 83 |
title: "Post Grid 01", |
| 84 |
docLink: "https://wpsmartpost.com/docs/post-grid-blocks/post-grid-01/", |
| 85 |
demoLink: "https://wpsmartpost.com/blocks/#demoId3497", |
| 86 |
}, |
| 87 |
"post-grid-two": { |
| 88 |
Icon: GridTwoBlockIcon, |
| 89 |
title: "Post Grid 02", |
| 90 |
docLink: "https://wpsmartpost.com/docs/post-grid-blocks/post-grid-02/", |
| 91 |
demoLink: "https://wpsmartpost.com/blocks/#demoId3504", |
| 92 |
}, |
| 93 |
"post-grid-three": { |
| 94 |
Icon: GridThreeBlockIcon, |
| 95 |
title: "Post Grid 03", |
| 96 |
docLink: "https://wpsmartpost.com/docs/post-grid-blocks/post-grid-03/", |
| 97 |
demoLink: "https://wpsmartpost.com/blocks/#demoId3505", |
| 98 |
}, |
| 99 |
"post-grid-four": { |
| 100 |
Icon: GridFourBlockIcon, |
| 101 |
title: "Post Grid 04", |
| 102 |
docLink: "https://wpsmartpost.com/docs/post-grid-blocks/post-grid-04/", |
| 103 |
demoLink: "https://wpsmartpost.com/blocks/#demoId3506", |
| 104 |
pro: true, |
| 105 |
}, |
| 106 |
"post-grid-five": { |
| 107 |
Icon: GridFiveBlockIcon, |
| 108 |
title: "Post Grid 05", |
| 109 |
docLink: "https://wpsmartpost.com/docs/post-grid-blocks/post-grid-05/", |
| 110 |
demoLink: "https://wpsmartpost.com/blocks/#demoId3507", |
| 111 |
}, |
| 112 |
"post-grid-six": { |
| 113 |
Icon: GridSixBlockIcon, |
| 114 |
title: "Post Grid 06", |
| 115 |
docLink: "https://wpsmartpost.com/docs/post-grid-blocks/post-grid-06/", |
| 116 |
demoLink: "https://wpsmartpost.com/blocks/#demoId3508", |
| 117 |
}, |
| 118 |
"post-list-one": { |
| 119 |
Icon: ListOneBlockIcon, |
| 120 |
title: "Post List 01", |
| 121 |
docLink: "https://wpsmartpost.com/docs/post-list-blocks/post-list-01/", |
| 122 |
demoLink: "https://wpsmartpost.com/blocks/#demoId3509", |
| 123 |
}, |
| 124 |
"post-list-two": { |
| 125 |
Icon: ListTwoBlockIcon, |
| 126 |
title: "Post List 02", |
| 127 |
docLink: "https://wpsmartpost.com/docs/post-list-blocks/post-list-02/", |
| 128 |
demoLink: "https://wpsmartpost.com/blocks/#demoId3511", |
| 129 |
pro: true |
| 130 |
}, |
| 131 |
"post-list-three": { |
| 132 |
Icon: ListThreeBlockIcon, |
| 133 |
title: "Post List 03", |
| 134 |
docLink: "https://wpsmartpost.com/docs/post-list-blocks/post-list-03/", |
| 135 |
demoLink: "https://wpsmartpost.com/blocks/#demoId3520", |
| 136 |
}, |
| 137 |
"post-timeline-one": { |
| 138 |
Icon: TimelineOneBlockIcon, |
| 139 |
title: "Post Timeline 01", |
| 140 |
docLink: "https://wpsmartpost.com/docs/post-timeline-blocks/post-timeline-01/", |
| 141 |
demoLink: "https://wpsmartpost.com/blocks/#demoId3522", |
| 142 |
}, |
| 143 |
"post-timeline-two": { |
| 144 |
Icon: TimelineTwoBlockIcon, |
| 145 |
title: "Post Timeline 02", |
| 146 |
docLink: "https://wpsmartpost.com/docs/post-timeline-blocks/post-timeline-02/", |
| 147 |
demoLink: "https://wpsmartpost.com/blocks/#demoId3524", |
| 148 |
}, |
| 149 |
"post-timeline-three": { |
| 150 |
Icon: TimelineThreeBlockIcon, |
| 151 |
title: "Post Timeline 03", |
| 152 |
docLink: "https://wpsmartpost.com/docs/post-timeline-blocks/post-timeline-03/", |
| 153 |
demoLink: "https://wpsmartpost.com/blocks/#demoId3526", |
| 154 |
}, |
| 155 |
"section-heading": { |
| 156 |
Icon: SectionHeadingBlockIcon, |
| 157 |
title: "Section Heading", |
| 158 |
docLink: "https://wpsmartpost.com/docs/section-heading/", |
| 159 |
demoLink: "https://wpsmartpost.com/blocks/#demoId3586", |
| 160 |
}, |
| 161 |
container: { |
| 162 |
Icon: ContainerBlockIcon, |
| 163 |
title: "Container", |
| 164 |
docLink: "https://wpsmartpost.com/docs/container/", |
| 165 |
demoLink: "https://wpsmartpost.com/blocks/#demoId3580", |
| 166 |
}, |
| 167 |
|
| 168 |
buttons: { |
| 169 |
Icon: ButtonsBlockIcon, |
| 170 |
title: "Smart Button", |
| 171 |
docLink: "https://wpsmartpost.com/docs/smart-button/", |
| 172 |
demoLink: "https://wpsmartpost.com/blocks/#demoId3588", |
| 173 |
}, |
| 174 |
taxonomy: { |
| 175 |
Icon: TaxonomyBlockIcon, |
| 176 |
title: "Taxonomy", |
| 177 |
docLink: "https://wpsmartpost.com/docs/taxonomy/", |
| 178 |
demoLink: "https://wpsmartpost.com/blocks/#demoId3604", |
| 179 |
}, |
| 180 |
"social-profiles": { |
| 181 |
Icon: SocialProfilesBlockIcon, |
| 182 |
title: "Social Profiles", |
| 183 |
docLink: "https://wpsmartpost.com/docs/social-profiles/", |
| 184 |
demoLink: "https://wpsmartpost.com/blocks/#demoId3528", |
| 185 |
}, |
| 186 |
"table-of-content": { |
| 187 |
Icon: TableOfContentIcon, |
| 188 |
title: "Table Of Contents", |
| 189 |
docLink: "https://wpsmartpost.com/docs/table-of-content/", |
| 190 |
demoLink: "https://wpsmartpost.com/blocks/#demoId3602", |
| 191 |
}, |
| 192 |
"smart-image": { |
| 193 |
Icon: SmartImageBlockIcon, |
| 194 |
title: "Smart Image", |
| 195 |
docLink: "https://wpsmartpost.com/docs/smart-image/", |
| 196 |
demoLink: "https://wpsmartpost.com/blocks/#demoId3584", |
| 197 |
}, |
| 198 |
"smart-search": { |
| 199 |
Icon: SearchBlockIcon, |
| 200 |
title: "Smart Search", |
| 201 |
docLink: "https://wpsmartpost.com/docs/smart-search/", |
| 202 |
demoLink: "https://wpsmartpost.com/blocks/#demoId3596", |
| 203 |
pro: true, |
| 204 |
}, |
| 205 |
"smart-info-box": { |
| 206 |
Icon: InfoBoxBlockIcon, |
| 207 |
title: "Smart Info Box", |
| 208 |
docLink: "https://wpsmartpost.com/docs/smart-info-box/", |
| 209 |
demoLink: "https://wpsmartpost.com/blocks/#demoId3590", |
| 210 |
}, |
| 211 |
"smart-lists": { |
| 212 |
Icon: SmartListBlockIcon, |
| 213 |
title: "Smart List", |
| 214 |
docLink: "https://wpsmartpost.com/docs/smart-list/", |
| 215 |
demoLink: "https://wpsmartpost.com/blocks/#demoId3592", |
| 216 |
}, |
| 217 |
|
| 218 |
// Website builder blocks. |
| 219 |
"archive-title": { |
| 220 |
Icon: ArchiveTitleIcon, |
| 221 |
title: "Archive Title", |
| 222 |
docLink: "https://wpsmartpost.com/docs/archive-title/", |
| 223 |
pro: true, |
| 224 |
}, |
| 225 |
"post-title": { |
| 226 |
Icon: PostTitleIcon, |
| 227 |
title: "Post Title", |
| 228 |
docLink: "https://wpsmartpost.com/docs/post-title/", |
| 229 |
pro: true, |
| 230 |
}, |
| 231 |
"post-featured-image": { |
| 232 |
Icon: PostFeatureImageIcon, |
| 233 |
title: "Post Featured Image", |
| 234 |
docLink: "https://wpsmartpost.com/docs/post-featured-image/", |
| 235 |
pro: true, |
| 236 |
}, |
| 237 |
"post-content": { |
| 238 |
Icon: PostContentIcon, |
| 239 |
title: "Post Content", |
| 240 |
docLink: "https://wpsmartpost.com/docs/post-content/", |
| 241 |
pro: true, |
| 242 |
}, |
| 243 |
"post-excerpt": { |
| 244 |
Icon: PostExcerptIcon, |
| 245 |
title: "Post Excerpt", |
| 246 |
docLink: "https://wpsmartpost.com/docs/post-excerpt/", |
| 247 |
pro: true, |
| 248 |
}, |
| 249 |
"post-meta": { |
| 250 |
Icon: PostMetaBlockIcon, |
| 251 |
title: "Post Meta", |
| 252 |
docLink: "https://wpsmartpost.com/docs/post-meta/", |
| 253 |
pro: true, |
| 254 |
}, |
| 255 |
"post-category": { |
| 256 |
Icon: PostCategoryBlockIcon, |
| 257 |
title: "Post Category", |
| 258 |
docLink: "https://wpsmartpost.com/docs/post-category/", |
| 259 |
pro: true, |
| 260 |
}, |
| 261 |
"smart-post-tag": { |
| 262 |
Icon: PostTagBlockIcon, |
| 263 |
title: "Smart Post Tag", |
| 264 |
docLink: "https://wpsmartpost.com/docs/smart-post-tag/", |
| 265 |
pro: true, |
| 266 |
}, |
| 267 |
"post-author-meta": { |
| 268 |
Icon: PostAuthorMetaIcon, |
| 269 |
title: "Post Author Meta", |
| 270 |
docLink: "https://wpsmartpost.com/docs/post-author-meta/", |
| 271 |
pro: true, |
| 272 |
}, |
| 273 |
"post-next-previous": { |
| 274 |
Icon: PostNextPreviousIcon, |
| 275 |
title: "Post Next Previous", |
| 276 |
docLink: "https://wpsmartpost.com/docs/post-next-previous/", |
| 277 |
pro: true, |
| 278 |
}, |
| 279 |
"post-comment-count": { |
| 280 |
Icon: PostCommentCountIcon, |
| 281 |
title: "Post Comment Count", |
| 282 |
docLink: "https://wpsmartpost.com/docs/post-comment-count/", |
| 283 |
pro: true, |
| 284 |
}, |
| 285 |
"post-reading-time": { |
| 286 |
Icon: PostReadingTimeIcon, |
| 287 |
title: "Post Reading Time", |
| 288 |
docLink: "https://wpsmartpost.com/docs/post-reading-time/", |
| 289 |
pro: true, |
| 290 |
}, |
| 291 |
"post-like-count": { |
| 292 |
Icon: PostLikeCountIcon, |
| 293 |
title: "Post Like Count", |
| 294 |
docLink: "https://wpsmartpost.com/docs/post-like-count/", |
| 295 |
pro: true, |
| 296 |
}, |
| 297 |
"post-view-count": { |
| 298 |
Icon: PostViewCountIcon, |
| 299 |
title: "Post View Count", |
| 300 |
docLink: "https://wpsmartpost.com/docs/post-view-count-2/", |
| 301 |
pro: true, |
| 302 |
}, |
| 303 |
"post-author-box": { |
| 304 |
Icon: PostAuthorBoxIcon, |
| 305 |
title: "Post Author Box", |
| 306 |
docLink: "https://wpsmartpost.com/docs/post-author-box/", |
| 307 |
pro: true, |
| 308 |
}, |
| 309 |
"post-date-meta": { |
| 310 |
Icon: PostDateMetaBlockIcon, |
| 311 |
title: "Post Date Meta", |
| 312 |
docLink: "https://wpsmartpost.com/docs/post-date-meta/", |
| 313 |
pro: true, |
| 314 |
}, |
| 315 |
"post-breadcrumbs": { |
| 316 |
Icon: PostBreadcrumbsBlockIcon, |
| 317 |
title: "Post Breadcrumbs", |
| 318 |
docLink: "https://wpsmartpost.com/docs/post-breadcrumbs/", |
| 319 |
pro: true, |
| 320 |
}, |
| 321 |
"post-social-share": { |
| 322 |
Icon: PostSocialShareIcon, |
| 323 |
title: "Post Social Share", |
| 324 |
docLink: "https://wpsmartpost.com/docs/post-social-share/", |
| 325 |
pro: true, |
| 326 |
}, |
| 327 |
"post-comment": { |
| 328 |
Icon: PostCommentIcon, |
| 329 |
title: "Post Comment", |
| 330 |
docLink: "https://wpsmartpost.com/docs/post-comment/", |
| 331 |
pro: true, |
| 332 |
}, |
| 333 |
}; |
| 334 |
|
| 335 |
export const BlockPage = ({ blocksSettings, blockShowHideHandler, type = "" }) => { |
| 336 |
return ( |
| 337 |
<div className="sp-pcp-blocks-setting-blocks-page"> |
| 338 |
|
| 339 |
{"setup-wizard" !== type && |
| 340 |
<> |
| 341 |
<div className="sp-pcp-page-section-title"> |
| 342 |
<h3 className="sp-pcp-blocks-setting-title">Control Blocks</h3> |
| 343 |
<span>Turn blocks on or off as needed to improve performance.</span> |
| 344 |
</div> |
| 345 |
<h3 className="sp-pcp-blocks-setting-title sp-smart-carousel-title">Post Carousel & Slider Blocks</h3> |
| 346 |
</> |
| 347 |
} |
| 348 |
{Object.entries(cardData)?.map(([blockName, card]) => ( |
| 349 |
<Fragment key={blockName}> |
| 350 |
<Card |
| 351 |
attributes={card} |
| 352 |
blockName={blockName} |
| 353 |
blocksSettings={blocksSettings} |
| 354 |
blockShowHideHandler={blockShowHideHandler} |
| 355 |
type={type} |
| 356 |
/> |
| 357 |
{("setup-wizard" !== type && "post-list-three" === blockName) && ( |
| 358 |
<h3 className="sp-pcp-blocks-setting-title">Post Timeline Blocks</h3> |
| 359 |
)} |
| 360 |
{( "setup-wizard" !== type && "post-grid-six" === blockName ) && <h3 className="sp-pcp-blocks-setting-title">Post List Blocks</h3>} |
| 361 |
{("setup-wizard" !== type && "news-ticker" === blockName) && <h3 className="sp-pcp-blocks-setting-title">Post Grid Blocks</h3>} |
| 362 |
{"post-timeline-three" === blockName && ( |
| 363 |
<h3 className="sp-pcp-blocks-setting-title">Smart Blocks</h3> |
| 364 |
)} |
| 365 |
{"smart-lists" === blockName && ( |
| 366 |
<h3 className="sp-pcp-blocks-setting-title">Website Builder Blocks</h3> |
| 367 |
)} |
| 368 |
</Fragment> |
| 369 |
))} |
| 370 |
</div> |
| 371 |
); |
| 372 |
}; |
| 373 |
|
| 374 |
export default BlockPage; |
| 375 |
|