| 1 |
import { __ } from '@wordpress/i18n'; |
| 2 |
import { InspectorControls } from '@wordpress/block-editor'; |
| 3 |
import { |
| 4 |
PanelBody, |
| 5 |
TextControl, |
| 6 |
Button, |
| 7 |
ButtonGroup, |
| 8 |
BaseControl, |
| 9 |
ToggleControl, |
| 10 |
SelectControl, |
| 11 |
TabPanel, |
| 12 |
Notice, |
| 13 |
} from '@wordpress/components'; |
| 14 |
|
| 15 |
import objAttributes from "./attributes"; |
| 16 |
import { ARCHIVE_DOC_ORDERBY, ARCHIVE_DOC_ORDER, ARCHIVE_ICON_WIDTH, ARCHIVE_ICON_HEIGHT, LIST_TWO_ICON_WIDTH, LIST_TWO_ICON_HEIGHT, LAYOUT_OPTIONS, LIST_THREE_ICON_WIDTH, LIST_THREE_ICON_HEIGHT, LAST_UPDATED_BACKGROUND_LAYOUT_THREE, LIST_ICON_BACKGROUND_LAYOUT_THREE, PAGINATION_BACKGROUND_COLOR_LAYOUT_1, PAGINATION_BACKGROUND_COLOR_LAYOUT_3, PAGINATION_HEIGHT_LAYOUT_1_3, PAGINATION_WIDTH_LAYOUT_1_3, PAGINATION_PADDING_1_3, PAGINATION_MARGIN_1_3, ALIGNMENT_VALUES, ARCHIVE_LIST_WRAPPER_BACKGROUND, ARCHIVE_LIST_WRAPPER_BACKGROUND_LAYOUT_2, ARCHIVE_LIST_WRAPPER_BACKGROUND_LAYOUT_3, LAYOUT_2_WRAPPER_PADDING, LAYOUT_2_WRAPPER_MARGIN, CONTAINER_PADDING, CONTAINER_MARGIN, LIST_ITEM_SPACING, LIST_AREA_PADDING, TITLE_MARGIN, TITLE_PADDING, EXCERPT_MARGIN, EXCERPT_PADDING, DATE_MARGIN, DATE_PADDING } from './constants'; |
| 17 |
import TypographyDropdown from '../../../util/typography-control-v2'; |
| 18 |
import { TYPO_ARCHIVE_LIST, TYPO_DESCRIPTION, TYPO_ARCHIVE_TITLE, TYPO_ARCHIVE_LIST_TITLE_TWO, TYPO_DESCRIPTION_TWO, TYPO_ARCHIVE_LIST_TITLE_THREE, TYPO_EXCEPRT_LAYOUT_THREE, LAST_UPDATED_TIME_TYPO, TYPO_PAGINATION } from './typographyPrefixConstants'; |
| 19 |
import ColorControl from "../../../util/color-control"; |
| 20 |
import ResponsiveRangeController from "../../../util/responsive-range-control"; |
| 21 |
import FontIconPicker from "@fonticonpicker/react-fonticonpicker"; |
| 22 |
import faIcons from '../../../util/faIcons'; |
| 23 |
import { applyFilters } from '@wordpress/hooks'; |
| 24 |
import cross from '../../../util/cross'; |
| 25 |
import upload from '../../../util/upload'; |
| 26 |
import BackgroundControl from "../../../util/background-control"; |
| 27 |
import ResponsiveDimensionsControl from "../../../util/dimensions-control-v2"; |
| 28 |
|
| 29 |
import { MediaPlaceholder } from '@wordpress/block-editor'; |
| 30 |
|
| 31 |
|
| 32 |
const Inspector = ( { attributes, setAttributes }) => { |
| 33 |
let { orderby, order, pagination_color, pagination_active_color, pagination_active_border_color, nested_subcategory, pagination, postsPerPageLayoutTwo, last_updated_time_color, resOption, list_color, layout, list_hover_color, list_icon_color, list_icon_hover_color, list_description_color, list_title_color, list_color_layout_two, list_exceprt_color_layout_three, list_title_color_layout_three, list_title_hover_color_layout_three, list_icon_color_layout_three, list_icon_hover_color_layout_three, list_hover_color_layout_two, list_icon_color_layout_two, list_icon_hover_color_two, list_description_color_layout_two, list_icon, listIconImageUrl, pagination_alignment_layout_1, pagination_alignment_layout_3, listTitleTag, listEntryHeadingTag } = attributes; |
| 34 |
|
| 35 |
let layoutOptions = [...LAYOUT_OPTIONS]; |
| 36 |
|
| 37 |
if( betterDocsBlocksHelper?.is_pro_active !='1' ) { |
| 38 |
layoutOptions = layoutOptions?.filter((value) => { |
| 39 |
return value?.value != 'layout-2'; |
| 40 |
}); |
| 41 |
} |
| 42 |
|
| 43 |
const resRequiredProps = { |
| 44 |
setAttributes, |
| 45 |
resOption, |
| 46 |
attributes, |
| 47 |
objAttributes, |
| 48 |
}; |
| 49 |
|
| 50 |
return ( |
| 51 |
<InspectorControls key="controls"> |
| 52 |
<div className="eb-panel-control"> |
| 53 |
<TabPanel |
| 54 |
className="eb-parent-tab-panel" |
| 55 |
activeClass="active-tab" |
| 56 |
tabs={[ |
| 57 |
{ |
| 58 |
name: "general", |
| 59 |
title: __("General", "betterdocs"), |
| 60 |
className: "eb-tab general", |
| 61 |
}, |
| 62 |
{ |
| 63 |
name: "styles", |
| 64 |
title: __("Style", "betterdocs"), |
| 65 |
className: "eb-tab styles", |
| 66 |
} |
| 67 |
]} |
| 68 |
> |
| 69 |
{(tab) => { |
| 70 |
return ( |
| 71 |
<div className={"eb-tab-controls " + tab.name}> |
| 72 |
{tab.name === "general" && ( |
| 73 |
<> |
| 74 |
{layout === 'layout-1' && ( |
| 75 |
<PanelBody title={__("Entry Heading", "betterdocs")}> |
| 76 |
<SelectControl |
| 77 |
label={__("Entry Heading Tag", "betterdocs")} |
| 78 |
value={listEntryHeadingTag} |
| 79 |
options={[ |
| 80 |
{ label: 'H1', value: 'h1' }, |
| 81 |
{ label: 'H2', value: 'h2' }, |
| 82 |
{ label: 'H3', value: 'h3' }, |
| 83 |
{ label: 'H4', value: 'h4' }, |
| 84 |
{ label: 'H5', value: 'h5' }, |
| 85 |
{ label: 'H6', value: 'h6' }, |
| 86 |
{ label: 'P', value: 'p' } |
| 87 |
]} |
| 88 |
onChange={(value) => { |
| 89 |
setAttributes({ |
| 90 |
listEntryHeadingTag: value, |
| 91 |
}); |
| 92 |
}} |
| 93 |
/> |
| 94 |
</PanelBody> |
| 95 |
)} |
| 96 |
<PanelBody title={__("Query", "betterdocs")}> |
| 97 |
<> |
| 98 |
<SelectControl |
| 99 |
label={__("Order By", "betterdocs")} |
| 100 |
value={orderby} |
| 101 |
options={ARCHIVE_DOC_ORDERBY} |
| 102 |
onChange={(newOrderby) => |
| 103 |
setAttributes({ |
| 104 |
orderby: newOrderby, |
| 105 |
}) |
| 106 |
} |
| 107 |
/> |
| 108 |
{orderby != 'betterdocs_order' && <SelectControl |
| 109 |
label={__("Order", "betterdocs")} |
| 110 |
value={order} |
| 111 |
options={ARCHIVE_DOC_ORDER} |
| 112 |
onChange={(newOrder) => |
| 113 |
setAttributes({ |
| 114 |
order: newOrder, |
| 115 |
}) |
| 116 |
} |
| 117 |
/>} |
| 118 |
<SelectControl |
| 119 |
label={__("Select Layout", "betterdocs")} |
| 120 |
value={layout} |
| 121 |
options={layoutOptions} |
| 122 |
onChange={(newLayout) => |
| 123 |
setAttributes({ |
| 124 |
layout: newLayout, |
| 125 |
}) |
| 126 |
} |
| 127 |
/> |
| 128 |
{(layout == 'layout-2' || layout == 'layout-3' || layout == 'layout-4') && <SelectControl |
| 129 |
label={__("Title Tag", "betterdocs")} |
| 130 |
value={listTitleTag} |
| 131 |
options={[ |
| 132 |
{ label: 'H1', value: 'h1' }, |
| 133 |
{ label: 'H2', value: 'h2' }, |
| 134 |
{ label: 'H3', value: 'h3' }, |
| 135 |
{ label: 'H4', value: 'h4' }, |
| 136 |
{ label: 'H5', value: 'h5' }, |
| 137 |
{ label: 'H6', value: 'h6' }, |
| 138 |
{ label: 'P', value: 'p' } |
| 139 |
]} |
| 140 |
onChange={(value) => { |
| 141 |
setAttributes({ |
| 142 |
listTitleTag: value, |
| 143 |
}); |
| 144 |
}} |
| 145 |
/>} |
| 146 |
{ |
| 147 |
//applyFilters('archiveLayoutMode', '', [setAttributes, attributes]) |
| 148 |
} |
| 149 |
{layout == 'layout-1' && <ToggleControl |
| 150 |
label={__("Nested Subcategory", "betterdocs")} |
| 151 |
checked={nested_subcategory} |
| 152 |
onChange={() => { |
| 153 |
setAttributes({ |
| 154 |
nested_subcategory: !nested_subcategory, |
| 155 |
}); |
| 156 |
}} |
| 157 |
/>} |
| 158 |
<ToggleControl |
| 159 |
label={__("Enable Pagination", "betterdocs")} |
| 160 |
checked={pagination} |
| 161 |
onChange={() => { |
| 162 |
setAttributes({ |
| 163 |
pagination: !pagination, |
| 164 |
}); |
| 165 |
}} |
| 166 |
/> |
| 167 |
{pagination && |
| 168 |
<TextControl |
| 169 |
label={__("Posts Per Page", "betterdocs")} |
| 170 |
type="number" |
| 171 |
value={postsPerPageLayoutTwo} |
| 172 |
onChange={(value) => { |
| 173 |
setAttributes({ |
| 174 |
postsPerPageLayoutTwo: parseInt(value), |
| 175 |
}); |
| 176 |
}} |
| 177 |
/>} |
| 178 |
</> |
| 179 |
</PanelBody> |
| 180 |
</> |
| 181 |
)} |
| 182 |
{ |
| 183 |
tab.name == 'styles' && ( |
| 184 |
<> |
| 185 |
{/* Container Section */} |
| 186 |
<PanelBody title={__("Container Section", "betterdocs")}> |
| 187 |
<ResponsiveDimensionsControl |
| 188 |
baseLabel={__("Padding", "betterdocs")} |
| 189 |
controlName={CONTAINER_PADDING} |
| 190 |
resRequiredProps={resRequiredProps} |
| 191 |
/> |
| 192 |
<ResponsiveDimensionsControl |
| 193 |
baseLabel={__("Margin", "betterdocs")} |
| 194 |
controlName={CONTAINER_MARGIN} |
| 195 |
resRequiredProps={resRequiredProps} |
| 196 |
/> |
| 197 |
</PanelBody> |
| 198 |
|
| 199 |
<PanelBody title={__("List Style", "betterdocs")}> |
| 200 |
{layout != 'layout-2' && layout != 'layout-3' && layout != 'layout-4' && <MediaPlaceholder |
| 201 |
onSelect={(image) => { |
| 202 |
setAttributes({ |
| 203 |
listIconImageUrl:image?.url |
| 204 |
}) |
| 205 |
}} |
| 206 |
value={listIconImageUrl} |
| 207 |
accept="image/*" |
| 208 |
allowedTypes={["image"]} |
| 209 |
mediaLibraryButton={({ open }) => { |
| 210 |
return ( |
| 211 |
<> |
| 212 |
<Button |
| 213 |
icon={upload} |
| 214 |
variant="primary" |
| 215 |
label={__('Add image from media')} |
| 216 |
showTooltip |
| 217 |
tooltipPosition="top center" |
| 218 |
onClick={() => { |
| 219 |
open(); |
| 220 |
}} |
| 221 |
/> |
| 222 |
{listIconImageUrl?.length > 0 && <div className="preview-wrapper-controller" style={{position:'relative'}}> |
| 223 |
<img src={listIconImageUrl} /> |
| 224 |
<div className="preview-wrapper" style={{position:'absolute', top:'0px', right:'0px', height:'30px', width:'30px', backgroundColor:'#1e1e1e', borderRadius:'5px', cursor:'pointer'}} onClick={(e) => { |
| 225 |
setAttributes({ |
| 226 |
listIconImageUrl:'' |
| 227 |
}) |
| 228 |
}}> |
| 229 |
{cross()} |
| 230 |
</div> |
| 231 |
</div>} |
| 232 |
</> |
| 233 |
); |
| 234 |
}} |
| 235 |
/>} |
| 236 |
{listIconImageUrl?.length == 0 && layout != 'layout-2' && layout != 'layout-3' && layout != 'layout-4' && <><BaseControl> |
| 237 |
<h3 className="eb-control-title"> |
| 238 |
{__("Icon", "betterdocs")} |
| 239 |
</h3> |
| 240 |
</BaseControl> |
| 241 |
<FontIconPicker |
| 242 |
icons={faIcons} |
| 243 |
value={list_icon} |
| 244 |
onChange={(list_icon) => setAttributes({ list_icon })} |
| 245 |
appendTo="body" |
| 246 |
closeOnSelect |
| 247 |
/></>} |
| 248 |
<TypographyDropdown |
| 249 |
baseLabel={__("Typography", "betterdocs")} |
| 250 |
typographyPrefixConstant={layout == 'layout-1' ? TYPO_ARCHIVE_LIST : ( layout == 'layout-2' ? TYPO_ARCHIVE_LIST_TITLE_TWO : TYPO_ARCHIVE_LIST_TITLE_THREE )} |
| 251 |
resRequiredProps={resRequiredProps} |
| 252 |
/> |
| 253 |
{layout == 'layout-2' && <> |
| 254 |
<ResponsiveDimensionsControl |
| 255 |
baseLabel={__("Padding", "betterdocs")} |
| 256 |
resRequiredProps={resRequiredProps} |
| 257 |
controlName={LAYOUT_2_WRAPPER_PADDING} |
| 258 |
/> |
| 259 |
<ResponsiveDimensionsControl |
| 260 |
baseLabel={__("Margin", "betterdocs")} |
| 261 |
resRequiredProps={resRequiredProps} |
| 262 |
controlName={LAYOUT_2_WRAPPER_MARGIN} |
| 263 |
/> |
| 264 |
</>} |
| 265 |
{(layout == 'layout-3' || layout == 'layout-4') && <> |
| 266 |
<ResponsiveDimensionsControl |
| 267 |
baseLabel={__("Title Margin", "betterdocs")} |
| 268 |
controlName={TITLE_MARGIN} |
| 269 |
resRequiredProps={resRequiredProps} |
| 270 |
/> |
| 271 |
<ResponsiveDimensionsControl |
| 272 |
baseLabel={__("Title Padding", "betterdocs")} |
| 273 |
controlName={TITLE_PADDING} |
| 274 |
resRequiredProps={resRequiredProps} |
| 275 |
/> |
| 276 |
</>} |
| 277 |
|
| 278 |
{layout == 'layout-1' && <ColorControl |
| 279 |
label={__("Color", "betterdocs")} |
| 280 |
color={list_color} |
| 281 |
onChange={(color) => { |
| 282 |
setAttributes({list_color:color}) |
| 283 |
}} |
| 284 |
/>} |
| 285 |
|
| 286 |
{layout == 'layout-2' && <ColorControl |
| 287 |
label={__("Color", "betterdocs")} |
| 288 |
color={list_color_layout_two} |
| 289 |
onChange={(color) => { |
| 290 |
setAttributes({list_color_layout_two:color}) |
| 291 |
}} |
| 292 |
/>} |
| 293 |
{layout == 'layout-3' || layout == 'layout-4' && <ColorControl |
| 294 |
label={__("Color", "betterdocs")} |
| 295 |
color={list_title_color_layout_three} |
| 296 |
onChange={(color) => { |
| 297 |
setAttributes({list_title_color_layout_three:color}) |
| 298 |
}} |
| 299 |
/>} |
| 300 |
<BackgroundControl |
| 301 |
controlName={ |
| 302 |
layout == 'layout-1' ? ARCHIVE_LIST_WRAPPER_BACKGROUND : ( layout == 'layout-2' ? ARCHIVE_LIST_WRAPPER_BACKGROUND_LAYOUT_2 : ARCHIVE_LIST_WRAPPER_BACKGROUND_LAYOUT_3 ) |
| 303 |
} |
| 304 |
resRequiredProps={resRequiredProps} |
| 305 |
noOverlay={true} |
| 306 |
/> |
| 307 |
<ColorControl |
| 308 |
label={__("Hover Color", "betterdocs")} |
| 309 |
color={layout == 'layout-1' ? list_hover_color : (layout == 'layout-2' ? list_hover_color_layout_two : list_title_hover_color_layout_three)} |
| 310 |
onChange={(color) => { |
| 311 |
if( layout == 'layout-1' ) { |
| 312 |
setAttributes({list_hover_color:color}) |
| 313 |
} else if( layout == 'layout-2' ){ |
| 314 |
setAttributes({list_hover_color_layout_two:color}) |
| 315 |
} else { |
| 316 |
setAttributes({list_title_hover_color_layout_three:color}) |
| 317 |
} |
| 318 |
}} |
| 319 |
/> |
| 320 |
<ColorControl |
| 321 |
label={__("Icon Color", "betterdocs")} |
| 322 |
color={layout == 'layout-1' ? list_icon_color : ( layout == 'layout-2' ? list_icon_color_layout_two : list_icon_color_layout_three)} |
| 323 |
onChange={(color) => { |
| 324 |
if( layout == 'layout-1' ) { |
| 325 |
setAttributes({list_icon_color:color}); |
| 326 |
} else if( layout == 'layout-2'){ |
| 327 |
setAttributes({list_icon_color_layout_two:color}); |
| 328 |
} else { |
| 329 |
setAttributes({list_icon_color_layout_three: color}); |
| 330 |
} |
| 331 |
}} |
| 332 |
/> |
| 333 |
<ColorControl |
| 334 |
label={__("Icon Hover Color", "betterdocs")} |
| 335 |
color={layout == 'layout-1' ? list_icon_hover_color : ( layout == 'layout-2' ? list_icon_hover_color_two : list_icon_hover_color_layout_three)} |
| 336 |
onChange={(color) => { |
| 337 |
if( layout == 'layout-1' ) { |
| 338 |
setAttributes({list_icon_hover_color:color}) |
| 339 |
} else if( layout == 'layout-2' ) { |
| 340 |
setAttributes({list_icon_hover_color_two:color}) |
| 341 |
} else { |
| 342 |
setAttributes({list_icon_hover_color_layout_three:color}) |
| 343 |
} |
| 344 |
}} |
| 345 |
/> |
| 346 |
<ResponsiveRangeController |
| 347 |
baseLabel={__("Icon Width", "betterdocs")} |
| 348 |
controlName={layout == 'layout-1' ? ARCHIVE_ICON_WIDTH : (layout == 'layout-2' ? LIST_TWO_ICON_WIDTH : LIST_THREE_ICON_WIDTH)} |
| 349 |
resRequiredProps={resRequiredProps} |
| 350 |
min={1} |
| 351 |
max={100} |
| 352 |
step={1} |
| 353 |
/> |
| 354 |
<ResponsiveRangeController |
| 355 |
baseLabel={__("Icon Height", "betterdocs")} |
| 356 |
controlName={layout == 'layout-1' ? ARCHIVE_ICON_HEIGHT : ( layout == 'layout-2' ? LIST_TWO_ICON_HEIGHT : LIST_THREE_ICON_HEIGHT )} |
| 357 |
resRequiredProps={resRequiredProps} |
| 358 |
min={1} |
| 359 |
max={100} |
| 360 |
step={1} |
| 361 |
/> |
| 362 |
{layout == 'layout-3' && <BackgroundControl |
| 363 |
controlName={LIST_ICON_BACKGROUND_LAYOUT_THREE} |
| 364 |
resRequiredProps={resRequiredProps} |
| 365 |
noOverlay={true} |
| 366 |
/>} |
| 367 |
{layout == 'layout-4' && <ResponsiveRangeController |
| 368 |
baseLabel={__("Icon Width", "betterdocs")} |
| 369 |
controlName={LIST_THREE_ICON_WIDTH} |
| 370 |
resRequiredProps={resRequiredProps} |
| 371 |
min={1} |
| 372 |
max={100} |
| 373 |
step={1} |
| 374 |
/>} |
| 375 |
{layout == 'layout-4' && <ResponsiveRangeController |
| 376 |
baseLabel={__("Icon Height", "betterdocs")} |
| 377 |
controlName={LIST_THREE_ICON_HEIGHT} |
| 378 |
resRequiredProps={resRequiredProps} |
| 379 |
min={1} |
| 380 |
max={100} |
| 381 |
step={1} |
| 382 |
/>} |
| 383 |
{layout == 'layout-4' && <BackgroundControl |
| 384 |
controlName={LIST_ICON_BACKGROUND_LAYOUT_THREE} |
| 385 |
resRequiredProps={resRequiredProps} |
| 386 |
noOverlay={true} |
| 387 |
/>} |
| 388 |
|
| 389 |
<BaseControl> |
| 390 |
<h3 className="eb-control-title"> |
| 391 |
{ layout == 'layout-1' || layout == 'layout-2' ?__("Description", "betterdocs") : __('Excerpt', 'betterdocs')} |
| 392 |
</h3> |
| 393 |
</BaseControl> |
| 394 |
<ColorControl |
| 395 |
label={layout == 'layout-1' || layout == 'layout-2' ? __("Description Color", "betterdocs") : __('Excerpt Color', "betterdocs")} |
| 396 |
color={layout == 'layout-1' ? list_description_color : (layout == 'layout-2' ? list_description_color_layout_two : list_exceprt_color_layout_three )} |
| 397 |
onChange={(color) => { |
| 398 |
if( layout == 'layout-1' ){ |
| 399 |
setAttributes({list_description_color:color}) |
| 400 |
} else if( layout == 'layout-2' ) { |
| 401 |
setAttributes({list_description_color_layout_two:color}) |
| 402 |
} else { |
| 403 |
setAttributes({list_exceprt_color_layout_three:color}) |
| 404 |
} |
| 405 |
}} |
| 406 |
/> |
| 407 |
<TypographyDropdown |
| 408 |
baseLabel={layout == 'layout-1' || layout == 'layout-2' ? __("Description Typography", "betterdocs") : __("Excerpt Typography", "betterdocs")} |
| 409 |
typographyPrefixConstant={layout == 'layout-1' ? TYPO_DESCRIPTION : ( layout == 'layout-2' ? TYPO_DESCRIPTION_TWO : TYPO_EXCEPRT_LAYOUT_THREE )} |
| 410 |
resRequiredProps={resRequiredProps} |
| 411 |
/> |
| 412 |
|
| 413 |
{/* Excerpt Spacing Controls for Layout 3 & 4 */} |
| 414 |
{(layout == 'layout-3' || layout == 'layout-4') && <> |
| 415 |
<ResponsiveDimensionsControl |
| 416 |
baseLabel={__("Excerpt Margin", "betterdocs")} |
| 417 |
controlName={EXCERPT_MARGIN} |
| 418 |
resRequiredProps={resRequiredProps} |
| 419 |
/> |
| 420 |
<ResponsiveDimensionsControl |
| 421 |
baseLabel={__("Excerpt Padding", "betterdocs")} |
| 422 |
controlName={EXCERPT_PADDING} |
| 423 |
resRequiredProps={resRequiredProps} |
| 424 |
/> |
| 425 |
</>} |
| 426 |
|
| 427 |
{/* List Spacing Controls for Layout 3 & 4 */} |
| 428 |
{(layout == 'layout-3' || layout == 'layout-4') && <> |
| 429 |
<ResponsiveDimensionsControl |
| 430 |
baseLabel={__("List Item Spacing", "betterdocs")} |
| 431 |
controlName={LIST_ITEM_SPACING} |
| 432 |
resRequiredProps={resRequiredProps} |
| 433 |
/> |
| 434 |
<ResponsiveDimensionsControl |
| 435 |
baseLabel={__("List Area Padding", "betterdocs")} |
| 436 |
controlName={LIST_AREA_PADDING} |
| 437 |
resRequiredProps={resRequiredProps} |
| 438 |
/> |
| 439 |
</>} |
| 440 |
</PanelBody> |
| 441 |
{layout == 'layout-1' && <PanelBody title={__("List Title", "betterdocs")}> |
| 442 |
<TypographyDropdown |
| 443 |
baseLabel={__("Typography", "betterdocs")} |
| 444 |
typographyPrefixConstant={TYPO_ARCHIVE_TITLE} |
| 445 |
resRequiredProps={resRequiredProps} |
| 446 |
/> |
| 447 |
<ColorControl |
| 448 |
label={__("Color", "betterdocs")} |
| 449 |
color={list_title_color} |
| 450 |
onChange={(color) => { |
| 451 |
setAttributes({list_title_color:color}) |
| 452 |
}} |
| 453 |
/> |
| 454 |
</PanelBody>} |
| 455 |
{(layout == 'layout-3' || layout == 'layout-4') && <PanelBody title={__("Last Updated Time", "betterdocs")}> |
| 456 |
<TypographyDropdown |
| 457 |
baseLabel={__("Typography", "betterdocs")} |
| 458 |
typographyPrefixConstant={LAST_UPDATED_TIME_TYPO} |
| 459 |
resRequiredProps={resRequiredProps} |
| 460 |
/> |
| 461 |
<ColorControl |
| 462 |
label={__("Color", "betterdocs")} |
| 463 |
color={last_updated_time_color} |
| 464 |
onChange={(color) => { |
| 465 |
setAttributes({last_updated_time_color:color}) |
| 466 |
}} |
| 467 |
/> |
| 468 |
{(layout == 'layout-3' || layout == 'layout-4') && <BackgroundControl |
| 469 |
controlName={LAST_UPDATED_BACKGROUND_LAYOUT_THREE} |
| 470 |
resRequiredProps={resRequiredProps} |
| 471 |
noOverlay={true} |
| 472 |
/>} |
| 473 |
<ResponsiveDimensionsControl |
| 474 |
baseLabel={__("Date Margin", "betterdocs")} |
| 475 |
controlName={DATE_MARGIN} |
| 476 |
resRequiredProps={resRequiredProps} |
| 477 |
/> |
| 478 |
<ResponsiveDimensionsControl |
| 479 |
baseLabel={__("Date Padding", "betterdocs")} |
| 480 |
controlName={DATE_PADDING} |
| 481 |
resRequiredProps={resRequiredProps} |
| 482 |
/> |
| 483 |
</PanelBody>} |
| 484 |
{(( pagination && layout == 'layout-1' ) || ( pagination && layout == 'layout-3' ) || ( pagination && layout == 'layout-4' )) && <PanelBody title={__("Pagination", "betterdocs")}> |
| 485 |
<ResponsiveDimensionsControl |
| 486 |
baseLabel={__("Padding", "betterdocs")} |
| 487 |
resRequiredProps={resRequiredProps} |
| 488 |
controlName={PAGINATION_PADDING_1_3} |
| 489 |
/> |
| 490 |
<ResponsiveDimensionsControl |
| 491 |
baseLabel={__("Margin", "betterdocs")} |
| 492 |
resRequiredProps={resRequiredProps} |
| 493 |
controlName={PAGINATION_MARGIN_1_3} |
| 494 |
/> |
| 495 |
<BaseControl |
| 496 |
label={__("Alignment")} |
| 497 |
id="eb-button-group-alignment" |
| 498 |
> |
| 499 |
{layout == 'layout-1' && <ButtonGroup id="eb-button-group-alignment"> |
| 500 |
{ALIGNMENT_VALUES.map((item) => ( |
| 501 |
<Button |
| 502 |
key={item.value} |
| 503 |
isLarge |
| 504 |
isPrimary={pagination_alignment_layout_1 === item.value} |
| 505 |
isSecondary={pagination_alignment_layout_1 !== item.value} |
| 506 |
onClick={() => |
| 507 |
setAttributes({ |
| 508 |
pagination_alignment_layout_1: item.value, |
| 509 |
}) |
| 510 |
} |
| 511 |
> |
| 512 |
{item.label} |
| 513 |
</Button> |
| 514 |
))} |
| 515 |
</ButtonGroup>} |
| 516 |
{layout == 'layout-3' && <ButtonGroup id="eb-button-group-alignment"> |
| 517 |
{ALIGNMENT_VALUES.map((item) => ( |
| 518 |
<Button |
| 519 |
key={item.value} |
| 520 |
isLarge |
| 521 |
isPrimary={pagination_alignment_layout_3 === item.value} |
| 522 |
isSecondary={pagination_alignment_layout_3 !== item.value} |
| 523 |
onClick={() => |
| 524 |
setAttributes({ |
| 525 |
pagination_alignment_layout_3: item.value, |
| 526 |
}) |
| 527 |
} |
| 528 |
> |
| 529 |
{item.label} |
| 530 |
</Button> |
| 531 |
))} |
| 532 |
</ButtonGroup>} |
| 533 |
</BaseControl> |
| 534 |
<ColorControl |
| 535 |
label={__("Color", "betterdocs")} |
| 536 |
color={pagination_color} |
| 537 |
onChange={(color) => { |
| 538 |
setAttributes({pagination_color:color}) |
| 539 |
}} |
| 540 |
/> |
| 541 |
<ColorControl |
| 542 |
label={__("Active Color", "betterdocs")} |
| 543 |
color={pagination_active_color} |
| 544 |
onChange={(color) => { |
| 545 |
setAttributes({pagination_active_color:color}) |
| 546 |
}} |
| 547 |
/> |
| 548 |
<BackgroundControl |
| 549 |
controlName={layout == 'layout-1' ? PAGINATION_BACKGROUND_COLOR_LAYOUT_1 : PAGINATION_BACKGROUND_COLOR_LAYOUT_3} |
| 550 |
resRequiredProps={resRequiredProps} |
| 551 |
noOverlay={true} |
| 552 |
/> |
| 553 |
<ResponsiveRangeController |
| 554 |
baseLabel={__("Height", "betterdocs")} |
| 555 |
controlName={PAGINATION_HEIGHT_LAYOUT_1_3} |
| 556 |
resRequiredProps={resRequiredProps} |
| 557 |
min={1} |
| 558 |
max={100} |
| 559 |
step={1} |
| 560 |
/> |
| 561 |
<ResponsiveRangeController |
| 562 |
baseLabel={__("Width", "betterdocs")} |
| 563 |
controlName={PAGINATION_WIDTH_LAYOUT_1_3} |
| 564 |
resRequiredProps={resRequiredProps} |
| 565 |
min={1} |
| 566 |
max={100} |
| 567 |
step={1} |
| 568 |
/> |
| 569 |
<ColorControl |
| 570 |
label={__("Active Border Color", "betterdocs")} |
| 571 |
color={pagination_active_border_color} |
| 572 |
onChange={(color) => { |
| 573 |
setAttributes({pagination_active_border_color:color}) |
| 574 |
}} |
| 575 |
/> |
| 576 |
<TypographyDropdown |
| 577 |
baseLabel={__("Typography", "betterdocs")} |
| 578 |
typographyPrefixConstant={TYPO_PAGINATION} |
| 579 |
resRequiredProps={resRequiredProps} |
| 580 |
/> |
| 581 |
</PanelBody>} |
| 582 |
</> |
| 583 |
|
| 584 |
)} |
| 585 |
</div> |
| 586 |
) |
| 587 |
} |
| 588 |
} |
| 589 |
</TabPanel> |
| 590 |
</div> |
| 591 |
</InspectorControls> |
| 592 |
) |
| 593 |
} |
| 594 |
|
| 595 |
export default Inspector; |
| 596 |
|