import { __ } from "@wordpress/i18n";
import { Fragment, useState } from "@wordpress/element";
import {
SPRangeControl,
SelectField,
Background,
Toggle,
BoxShadow,
Spacing,
Border,
SelectDropdown,
SpColorPicker,
TypographyNew,
Divider,
Popup,
} from "../../components";
import { BgIcon, GradientIcon, TransparentIcon } from "../../components/background/svgIcon";
import SPToggleGroupControl from "../../components/toggleGroupControl/toggleGroupControl";
import { inArray } from "../../controls/controls";
import useDefaultValue from "../../hooks/useDefaultValue";
import {
HorizontalCenterIcon,
HorizontalLeftIcon,
HorizontalRightIcon,
VerticalBottomIcon,
VerticalCenterIcon,
VerticalTopIcon,
} from "../../icons/icons";
export const ImageStyleTab = ({ attributes, setAttributes }) => {
const {
imageHoverEffect,
imageBorder,
imageBorderWidth,
imageRadius,
imageSpace,
imageOpacityEffect,
imagePosition,
blockName,
imageGalleryNavArrowColor,
imageGalleryNavArrowBgColor,
imageGrayscaleLevel,
imageBlurEffect,
imageBrightness,
imageGrayscaleLevelHover,
imageBlurEffectHover,
imageBrightnessHover,
showImageGallery,
} = attributes;
const defaultValues = useDefaultValue(blockName);
const [imageNormaOrlHover, setImageNormaOrlHover] = useState("normal");
const [navArrowNormalOrHover, setNavArrowNormaOrlHover] = useState("color");
return (
<>
{imageHoverEffect === "opacity" && (
)}
setImageNormaOrlHover(newValue)}
items={[
{ label: "Normal", value: "normal" },
{ label: "Hover", value: "hover" },
]}
/>
{imageNormaOrlHover === "normal" && (
<>
>
)}
{imageNormaOrlHover === "hover" && (
<>
>
)}
{(["post-thumbnail-slider", "post-thumbnail-slider-two", "post-slider", "post-slider-two"].includes(
blockName
) ||
"background" !== imagePosition) && (
<>
>
)}
{imagePosition !== "background" && blockName !== "thumbnail-slider-two" && (
)}
{showImageGallery && (
<>
setNavArrowNormaOrlHover(newValue)}
items={[
{ label: "Normal", value: "color" },
{ label: "Hover", value: "hoverColor" },
]}
/>
setAttributes({
imageGalleryNavArrowColor: {
...imageGalleryNavArrowColor,
[navArrowNormalOrHover]: newColor,
},
})
}
defaultColor=""
/>
setAttributes({
imageGalleryNavArrowBgColor: {
...imageGalleryNavArrowBgColor,
[navArrowNormalOrHover]: newColor,
},
})
}
defaultColor=""
/>
>
)}
>
);
};
export const ContentAreaStyleTab = ({ attributes, setAttributes }) => {
const {
contentAreaHeight,
contentAreaBg,
contentAreaBorderRadius,
contentAreaBoxShadow,
contentAreaPadding,
contentAreaBorder,
contentAreaBorderWidth,
contentAreaEnableBoxShadow,
postSliderLayout,
contentVerticalPosition,
contentHorizontalPosition,
blockName,
imagePosition,
postCardBg,
postCardBorder,
postCardBorderWidth,
postCardBorderRadius,
postCardBoxShadowEnable,
postCardBoxShadow,
postCardPadding,
postCardHoverBorderWidth,
postCardHoverBorderRadius,
postCardHoverBoxShadowEnable,
postCardHoverBoxShadow,
contentOrientation,
imageOverlayType,
contentAreaWidth,
contentAreaMargin,
contentAreaHoverBorderRadius,
contentAreaHoverBorderWidth,
blockLayoutName,
contentAreaInnerWidth,
largeContentAreaPadding,
layoutSixPostCardBg,
largeItemPadding,
postListLayout,
thumbnailThumbBGColor,
contentAreaThumbsBorder,
contentAreaThumbsBorderWidth,
contentAreaThumbsBorderRadius,
thumbnailTwoPosition,
} = attributes;
const [contentAreaBgStyleType, setContentAreaBgStyleType] = useState("color");
return (
<>
{["post-slider", "post-thumbnail-slider", "thumbnail-slider-two"].includes(blockName) &&
![
// 'post-slider-layout-three',
// 'post-slider-layout-five',
"post-slider-two-layout-two",
"post-slider-two-layout-three",
"thumbnail-slider-layout-six",
].includes(blockLayoutName) && (
)}
{("post-slider-two" === blockName ||
(imagePosition !== "top" &&
[
"sp-smart-post-list-two-layout-one",
"sp-smart-post-list-two-layout-two",
"sp-smart-post-list-two-layout-five",
"sp-smart-post-list-two-layout-six",
].includes(blockLayoutName)) ||
("thumbnail-slider-two" === blockName && ["left", "right"].includes(thumbnailTwoPosition))) && (
, value: "top" },
{ label: , value: "center" },
{ label: , value: "bottom" },
]}
/>
)}
{("post-slider-two" === blockName ||
["post-slider-layout-five", "thumbnail-slider-layout-six"].includes(blockLayoutName) ||
("background" === imagePosition && imageOverlayType === "box") ||
("thumbnail-slider-two" !== blockName && thumbnailTwoPosition === "bottom")) && (
,
value: "left",
},
{
label: ,
value: "right",
},
]
: [
{
label: ,
value: "left",
},
{
label: ,
value: "center",
},
{
label: ,
value: "right",
},
]
}
/>
)}
{"post-slider-two" === blockName && (imageOverlayType === "box" || "background" === imagePosition) && (
<>
>
)}
{![
// 'thumbnail-slider-two',
"post-slider",
// 'post-slider-two',
// 'thumbnail-slider',
].includes(blockName) &&
![
"thumbnail-slider-two-layout-two",
"thumbnail-slider-two-layout-three",
"thumbnail-slider-two-layout-four",
].includes(blockLayoutName) && (
setContentAreaBgStyleType(val)}
/>
)}
{((![
"post-grid-three",
"post-grid-four",
"post-grid-five",
"post-slider",
"post-slider-two",
"post-thumbnail-slider",
"thumbnail-slider-two",
].includes(blockName) &&
imagePosition !== "background") ||
[
// 'post-slider-layout-five',
// 'thumbnail-slider-layout-three',
// 'thumbnail-slider-layout-four',
// 'thumbnail-slider-layout-six',
].includes(blockLayoutName)) && (
,
value: "transparent",
tooltip: "Transparent",
},
{
label: ,
value: "bgColor",
tooltip: "Solid",
},
{
label: ,
value: "gradient",
tooltip: "Gradient",
},
]}
/>
)}
{/** For only Thumbnail Slider Layout Six so default color will not conflict */}
{/* { layoutSixPostCardBg &&
[ "thumbnail-slider-layout-six" ].includes(
blockLayoutName
) && (
,
// value: 'transparent',
// tooltip: 'Transparent',
// },
{
label: ,
value: "bgColor",
tooltip: "Solid",
},
{
label: ,
value: "gradient",
tooltip: "Gradient",
},
] }
/>
) } */}
{/** For only Thumbnail Slider Two Thumbnails BG Color so default color will not conflict */}
{thumbnailThumbBGColor &&
["thumbnail-slider-two", "post-thumbnail-slider"].includes(blockName) &&
![
"thumbnail-slider-two-layout-two",
"thumbnail-slider-two-layout-three",
"thumbnail-slider-two-layout-four",
"thumbnail-slider-layout-one",
"thumbnail-slider-layout-two",
"thumbnail-slider-layout-five",
"thumbnail-slider-layout-six",
].includes(blockLayoutName) && (
,
value: "transparent",
tooltip: "Transparent",
},
{
label: ,
value: "bgColor",
tooltip: "Solid",
},
{
label: ,
value: "gradient",
tooltip: "Gradient",
},
]}
/>
)}
{([
"orientation_six",
"orientation_seven",
"orientation_eight",
"list-one-layout-five",
"list-one-layout-six",
"list-one-layout-seven",
"list-one-layout-eight",
].includes(contentOrientation) ||
["post-grid-three", "post-grid-four", "post-grid-five", "post-slider", "post-slider-two"].includes(
blockName
) ||
(imagePosition === "background" && imageOverlayType === "box")) &&
!["post-thumbnail-slider", "post-slider"].includes(blockName) && (
,
value: "transparent",
tooltip: "Transparent",
},
{
label: ,
value: "bgColor",
tooltip: "Solid",
},
{
label: ,
value: "gradient",
tooltip: "Gradient",
},
]}
/>
)}
{contentAreaBgStyleType === "color" && (
<>
{!["thumbnail-slider-two", "post-slider", "post-slider-two", "post-thumbnail-slider"].includes(
blockName
) && (
<>
>
)}
{(blockName === "post-slider-two" ||
[
"orientation_six",
"orientation_seven",
"orientation_eight",
"list-one-layout-three",
"list-one-layout-four",
].includes(contentOrientation) ||
(blockLayoutName &&
[
// 'post-slider-layout-three',
"thumbnail-slider-layout-six",
].includes(blockLayoutName))) && (
<>
>
)}
{!["post-slider", "post-slider-two", "post-thumbnail-slider", "thumbnail-slider-two"].includes(
blockName
) && (
<>
{postCardBoxShadowEnable && (
)}
>
)}
{[
"orientation_six",
"orientation_seven",
"orientation_eight",
"list-one-layout-five",
"list-one-layout-six",
"list-one-layout-seven",
"list-one-layout-eight",
].includes(contentOrientation) && (
<>
{contentAreaEnableBoxShadow && (
)}
>
)}
>
)}
{contentAreaBgStyleType === "hover" && (
<>
{!["thumbnail-slider-two", "post-slider", "post-slider-two", "post-thumbnail-slider"].includes(
blockName
) && (
<>
>
)}
{(blockName === "post-slider-two" ||
[
"orientation_six",
"orientation_seven",
"orientation_eight",
"list-one-layout-five",
"list-one-layout-six",
"list-one-layout-seven",
"list-one-layout-eight",
].includes(contentOrientation) ||
["thumbnail-slider-layout-six"].includes(blockLayoutName)) && (
<>
>
)}
{!["post-slider", "post-slider-two", "post-thumbnail-slider", "thumbnail-slider-two"].includes(
blockName
) && (
<>
{postCardHoverBoxShadowEnable && (
)}
>
)}
>
)}
{![
// 'thumbnail-slider-two',
"post-slider",
// 'post-slider-two',
// 'thumbnail-slider',
].includes(blockName) && }
{[
"thumbnail-slider-two-layout-three",
"thumbnail-slider-two-layout-four",
"thumbnail-slider-two-layout-five",
].includes(blockLayoutName) && (
<>
>
)}
{![
"post-slider",
"post-slider-two",
// 'post-thumbnail-slider',
// 'thumbnail-slider-two',
"post-grid-five",
].includes(blockName) &&
imagePosition !== "background" &&
imageOverlayType !== "box" && (
)}
{[
"sp-smart-post-list-two-layout-one",
"sp-smart-post-list-two-layout-two",
"sp-smart-post-list-two-layout-five",
"sp-smart-post-list-two-layout-six",
"sp-smart-post-list-three-layout-three",
"sp-smart-post-list-three-layout-four",
].includes(postListLayout) && (
)}
{"thumbnail-slider-two" !== blockName && (
)}
{["post-grid-six"].includes(blockName) && (
)}
{![
"post-slider",
"post-slider-two",
"post-grid-four",
// 'thumbnail-slider-two',
].includes(blockName) && (
<>
>
)}
>
);
};
export const TitleStyleTab = ({ attributes, setAttributes }) => {
const [colorState, setColorState] = useState("normal");
const {
blockName,
titleColor,
titleMargin,
titleTypography,
titleFontSize,
titleLatterSpacing,
titleLineHeight,
largeItemTitleColor,
largeItemTitleLineHeight,
largeItemTitleLatterSpacing,
largeItemTitleFontSize,
largeItemTitleTypography,
blockLayoutName,
thumbnailItemsTitleColor,
titleWordSpacing,
largeItemTitleWordSpacing,
titleGlobalTypography,
largeItemTitleGlobalTypography,
postBadgesTypography,
postBadgesFontSize,
postBadgesLineHeight,
postBadgesLetterSpacing,
postBadgesWordSpacing,
postBadgesGlobalTypography,
badgesLabelColor,
badgesBgColor,
badgesBorder,
badgesBorderWidth,
badgesBorderRadius,
badgesPadding,
titleUnderlineEffect,
titleEffect,
titleEffectColor,
postBadgesShow,
} = attributes;
const defaultValues = useDefaultValue(blockName);
const underLineDirections = [
{ label: "Left to Right", value: "leftToRight" },
{ label: "Right to Left", value: "rightToLeft" },
{ label: "Start Centered", value: "startCentered" },
];
const topBottomDirections = [
{ label: "Left to Right", value: "leftToRight" },
{ label: "Right to Left", value: "rightToLeft" },
{ label: "Start Centered", value: "startCentered" },
{ label: "Opposite Start", value: "oppositeStart" },
{ label: "Opposite Start Reversed", value: "oppositeStartReversed" },
];
return (
<>
{/* */}
{[
"post-grid-one",
"post-grid-six",
"post-grid-three",
"post-grid-four",
"post-grid-five",
"post-list-two",
"post-list-three",
"thumbnail-slider-two",
].includes(blockName) &&
!["grid-one-layout-one", "grid-one-layout-five"].includes(blockLayoutName) && (
)}
setColorState(newColor)}
/>
{"normal" === colorState ? (
<>
setAttributes({
titleColor: { ...titleColor, color: newColor },
})
}
defaultColor=""
/>
{["post-grid-six", "post-list-two", "post-list-three", "thumbnail-slider-two"].includes(
blockName
) && (
setAttributes({
largeItemTitleColor: {
...largeItemTitleColor,
color: newColor,
},
})
}
defaultColor={defaultValues?.metaColor}
/>
)}
{blockLayoutName &&
inArray(["thumbnail-slider-layout-three", "thumbnail-slider-layout-four"], blockLayoutName) && (
setAttributes({
thumbnailItemsTitleColor: {
...thumbnailItemsTitleColor,
color: newColor,
},
})
}
defaultColor="#FFFFFF"
/>
)}
>
) : (
<>
setAttributes({
titleColor: {
...titleColor,
hoverColor: newColor,
},
})
}
/>
{["post-grid-six", "post-list-two", "post-list-three", "thumbnail-slider-two"].includes(
blockName
) && (
setAttributes({
largeItemTitleColor: {
...largeItemTitleColor,
hoverColor: newColor,
},
})
}
/>
)}
{blockLayoutName &&
inArray(["thumbnail-slider-layout-three", "thumbnail-slider-layout-four"], blockLayoutName) && (
setAttributes({
thumbnailItemsTitleColor: {
...thumbnailItemsTitleColor,
hoverColor: newColor,
},
})
}
defaultColor="#FFFFFF"
/>
)}
>
)}
{[
"post-carousel-two",
"post-grid-two",
"post-grid-three",
"post-grid-four",
"post-grid-five",
"post-grid-six",
"post-slider",
"post-slider-two",
"post-thumbnail-slider",
"thumbnail-slider-two",
"post-timeline-two",
].includes(blockName) && (
<>
{(titleEffect === "underline" || titleEffect === "topBottomLine") && (
)}
setAttributes({
titleEffectColor: newColor,
})
}
defaultColor="#FFFFFF"
/>
>
)}
{postBadgesShow && (
)}
>
);
};
export const TitleBadgesStyleTab = ({ attributes, setAttributes }) => {
const { badgesLabelColor, badgesBgColor, badgesBorder, badgesBorderWidth, badgesBorderRadius, badgesPadding } =
attributes;
return (
<>
{
setAttributes({ badgesLabelColor: newColor });
}}
/>
{
setAttributes({ badgesBgColor: newColor });
}}
/>
>
);
};
export const MetaDataStyleTab = ({ attributes, setAttributes }) => {
const [metadataColorState, setMetadataColorState] = useState("normal");
const {
metaTypography,
metaFontSize,
metaFontSpacing,
metaLineHeight,
metaColors,
metaSeparator,
metaSeparatorColor,
metaSpaceBetween,
metadataMargin,
metaLargeTypography,
metaLargeFontSize,
metaLargeFontSpacing,
metaLargeLineHeight,
largeMetaColors,
blockName,
metaRowGap,
metaWordSpacing,
metaLargeWordSpacing,
metaGlobalTypography,
} = attributes;
const defaultValues = useDefaultValue(blockName);
return (
<>
{["post-grid-six", "post-grid-four", "post-grid-five"].includes(blockName) && (
)}
setMetadataColorState(newColor)}
/>
{"normal" === metadataColorState ? (
<>
setAttributes({
metaColors: { ...metaColors, color: newColor },
})
}
defaultColor="#333333"
/>
{["post-grid-six", "post-list-two", "post-list-three"].includes(blockName) && (
setAttributes({
largeMetaColors: {
...largeMetaColors,
color: newColor,
},
})
}
defaultColor={defaultValues?.metaColor}
/>
)}
>
) : (
<>
setAttributes({
metaColors: {
...metaColors,
hoverColor: newColor,
},
})
}
/>
{["post-grid-six", "post-list-two", "post-list-three"].includes(blockName) && (
setAttributes({
largeMetaColors: {
...largeMetaColors,
hoverColor: newColor,
},
})
}
defaultColor={defaultValues?.metaColor}
/>
)}
>
)}
{metaSeparator !== "normal-space" && (
setAttributes({ metaSeparatorColor: newColor })}
defaultColor="#333333"
/>
)}
>
);
};
export const ExcerptStyleTab = ({ attributes, setAttributes }) => {
const {
excerptTypography,
excerptFontSize,
excerptFontSpacing,
excerptLineHeight,
excerptColor,
excerptMargin,
blockName,
largeExcerptColor,
excerptWordSpacing,
excerptGlobalTypography,
} = attributes;
return (
<>
setAttributes({
excerptColor: {
...excerptColor,
color: newColor,
},
})
}
defaultColor="#4E4F52"
/>
{["post-list-two", "post-list-three"].includes(blockName) && (
setAttributes({
largeExcerptColor: {
...largeExcerptColor,
color: newColor,
},
})
}
defaultColor=""
/>
)}
>
);
};
export const ReadMoreStyleTab = ({ attributes, setAttributes }) => {
const {
blockName,
readMoreButtonTypography,
readMoreButtonFontSize,
readMoreButtonFontSpacing,
readMoreButtonLineHeight,
readMoreIconStyle,
readMoreColor,
readMoreBg,
readMoreButtonBorderRadius,
readMoreButtonPadding,
readMoreButtonMargin,
readMoreButtonBorder,
readMoreButtonBorderWidth,
largeItemReadMoreColor,
largeItemReadMoreBg,
largeItemReadMoreButtonBorder,
largeItemReadMoreButtonBorderWidth,
readMoreIconGap,
readMoreTextColor,
readMoreButtonType,
readMoreButtonWordSpacing,
readMoreButtonBorderWidthHover,
largeItemReadMoreBtnBorderWidthHover,
readMoreButtonBorderRadiusHover,
readMoreIocVisibility,
readMoreButtonGlobalTypography,
} = attributes;
const [readMoreButtonStyleType, setReadMoreButtonStyleType] = useState("color");
return (
<>
{/*
*/}
{["always", "hover"].includes(readMoreIocVisibility) && (
<>
,
},
{
label: "Arrow Solid",
value: "right-one",
icon: ,
},
{
label: "Chevron Outline",
value: "right-open-outline",
icon: ,
},
{
label: "Arrow Minimal",
value: "arrow-right-solid",
icon: ,
},
{
label: "Double Chevron",
value: "angles-right-solid",
icon: ,
},
]}
/>
>
)}
setReadMoreButtonStyleType(val)}
/>
{"color" === readMoreButtonStyleType ? (
<>
setAttributes({
readMoreColor: {
...readMoreColor,
color: newColor,
},
})
}
defaultColor="#4E4F52"
/>
{["post-list-two"].includes(blockName) && (
setAttributes({
readMoreTextColor: {
...readMoreTextColor,
color: newColor,
},
})
}
defaultColor="#4E4F52"
/>
)}
{/* { [ 'post-grid-six' ].includes( blockName ) && (
<>
setAttributes( {
largeItemReadMoreColor: {
...largeItemReadMoreColor,
color: newColor,
},
} )
}
defaultColor="#4E4F52"
/>
>
) } */}
>
) : (
<>
setAttributes({
readMoreColor: {
...readMoreColor,
hoverColor: newColor,
},
})
}
defaultColor="#FFFFFF"
/>
{["post-list-two"].includes(blockName) && (
setAttributes({
readMoreTextColor: {
...readMoreTextColor,
hover: newColor,
},
})
}
defaultColor="#4E4F52"
/>
)}
{/* { [ 'post-grid-six' ].includes( blockName ) && (
<>
setAttributes( {
largeItemReadMoreColor: {
...largeItemReadMoreColor,
hoverColor: newColor,
},
} )
}
defaultColor="#FFFFFF"
/>
>
) } */}
>
)}
{readMoreButtonType !== "link" && (
<>
,
value: "transparent",
tooltip: "Transparent",
},
{
label: ,
value: "bgColor",
tooltip: "Solid",
},
{
label: ,
value: "gradient",
tooltip: "Gradient",
},
]}
/>
{/* { [ 'post-grid-six' ].includes( blockName ) && (
,
value: 'transparent',
tooltip: 'Transparent',
},
{
label: ,
value: 'bgColor',
tooltip: 'Solid',
},
{
label: ,
value: 'gradient',
tooltip: 'Gradient',
},
] }
/>
) } */}
{"color" === readMoreButtonStyleType ? (
<>
{/* { [ 'post-grid-six' ].includes( blockName ) && (
) } */}
>
) : (
<>
{/* { [ 'post-grid-six' ].includes( blockName ) && (
) } */}
>
)}
>
)}
>
);
};
export const SocialShareStyleTab = ({ attributes, setAttributes }) => {
const {
socialShareIconSize,
socialShareIconType,
socialShareCustomColor,
socialShareCustomBgColor,
socialShareBorderRadius,
socialShareSpaceBetween,
// socialShareHeight,
// socialShareWidth,
socialShareMargin,
// socialIconOnly,
socialShareBorder,
socialShareBorderWidth,
socialSharePadding,
socialIconDisplayType,
socialPopupShareColor,
socialPopupShareBGColor,
socialPopupCountColor,
socialPopupContainerBGColor,
socialSharePopupBorder,
socialSharePopupBorderWidth,
socialSharePopupBorderRadius,
socialShareBoxShadow,
socialShareBoxShadowValue,
socialPopupBoxShadow,
socialPopupBoxShadowValue,
socialPopupPadding,
socialShareIconPosition,
} = attributes;
const [socialColorState, setSocialColorState] = useState("color");
const [popupColorState, setPopupColorState] = useState("color");
return (
<>
{/* { 'original' === socialShareIconType && (
<>
>
) } */}
{/* { ( ! socialIconOnly || 'custom' === socialShareIconType ) && (
<>
>
) } */}
{socialShareIconType && ("custom" === socialShareIconType || "popup-share" === socialIconDisplayType) && (
<>
setSocialColorState(val)}
/>
>
)}
{socialColorState === "color" ? (
<>
{"custom" === socialShareIconType && (
<>
setAttributes({
socialShareCustomColor: {
...socialShareCustomColor,
color: newColor,
},
})
}
defaultColor="#FFFFFF"
/>
setAttributes({
socialShareCustomBgColor: {
...socialShareCustomBgColor,
color: newColor,
},
})
}
defaultColor="#4e4f52"
/>
>
)}
{"popup-share" === socialIconDisplayType && (
<>
setAttributes({
socialPopupShareColor: {
...socialPopupShareColor,
color: newColor,
},
})
}
/>
{/*
setAttributes({
socialPopupShareBGColor: {
...socialPopupShareBGColor,
color: newColor,
},
})
}
/> */}
setAttributes({
socialPopupContainerBGColor: {
...socialPopupContainerBGColor,
color: newColor,
},
})
}
/>
>
)}
>
) : (
<>
{"custom" === socialShareIconType && (
<>
setAttributes({
socialShareCustomColor: {
...socialShareCustomColor,
hoverColor: newColor,
},
})
}
/>
setAttributes({
socialShareCustomBgColor: {
...socialShareCustomBgColor,
hoverColor: newColor,
},
})
}
/>
>
)}
{"popup-share" === socialIconDisplayType && (
<>
setAttributes({
socialPopupShareColor: {
...socialPopupShareColor,
hoverColor: newColor,
},
})
}
/>
{/*
setAttributes({
socialPopupShareBGColor: {
...socialPopupShareBGColor,
hoverColor: newColor,
},
})
}
/> */}
{/*
setAttributes( {
socialPopupContainerBGColor: {
...socialPopupContainerBGColor,
hoverColor: newColor,
},
} )
}
/> */}
>
)}
>
)}
{"popup-share" === socialIconDisplayType && (
)}
{"popup-share" === socialIconDisplayType && (
)}
{"popup-share" !== socialIconDisplayType && (
)}
{"popup-share" === socialIconDisplayType && (
<>
{socialShareBoxShadow && (
)}
{socialPopupBoxShadow && (
)}
>
)}
{"popup-share" === socialIconDisplayType && (
)}
{("over-thumbnail" === socialShareIconPosition || "inline-icon" === socialIconDisplayType) && (
)}
>
);
};
export const AdvancedStyleTab = ({ attributes, setAttributes }) => {
const {
advancedBg,
advancedBorderStyle,
advancedBorderStyleWidth,
advancedBorderRadius,
advancedPadding,
advancedMargin,
advancedBoxShadow,
advancedBoxShadowEnable,
advancedBorderStyleWidthHover,
advancedBorderRadiusHover,
blockName,
} = attributes;
const [advancedButtonStyleType, setAdvancedButtonStyleType] = useState("color");
return (
<>
setAdvancedButtonStyleType(val)}
/>
,
value: "transparent",
tooltip: "Transparent",
},
{ label: , value: "bgColor", tooltip: "Solid" },
{
label: ,
value: "gradient",
tooltip: "Gradient",
},
]}
/>
{!["post-slider", "post-slider-two", "post-thumbnail-slider", "thumbnail-slider-two"].includes(
blockName
) && (
<>
{"color" === advancedButtonStyleType ? (
) : (
)}
>
)}
{advancedBoxShadowEnable && (
)}
>
);
};
export const CategoryStyleTab = ({ attributes, setAttributes }) => {
const {
catTabCategoryTypography,
catTabCategoryFontSize,
catTabCategoryLetterSpacing,
catTabCategoryLineHeight,
catTabCategoryColor,
catTabCategoryBg,
catTabCategoryBorder,
catTabCategoryBorderWidth,
catTabCategoryBorderRadius,
catTabCategorySpaceBetween,
catTabCategoryPadding,
catTabCategoryMargin,
blockLayoutName,
thumbnailItemsCateColor,
catTabCategoryBarColor,
catTabCategoryWordSpacing,
catTabCategoryBorderWidthHover,
catTabCategoryBorderRadiusHover,
catTabCategoryGlobalTypography,
} = attributes;
const [catTabBtnState, setCatTabBtnState] = useState("color");
return (
<>
{[
"thumbnail-slider-two-layout-three",
"thumbnail-slider-two-layout-four",
"thumbnail-slider-two-layout-five",
].includes(blockLayoutName) && (
setAttributes({ catTabCategoryBarColor: newColor })}
defaultColor="#FFFFFF"
/>
)}
setCatTabBtnState(newState)}
/>
{"color" === catTabBtnState ? (
<>
setAttributes({
catTabCategoryColor: {
...catTabCategoryColor,
color: newColor,
},
})
}
defaultColor="#FFFFFF"
/>
{blockLayoutName &&
inArray(["thumbnail-slider-layout-three", "thumbnail-slider-layout-four"], blockLayoutName) && (
setAttributes({
thumbnailItemsCateColor: {
...thumbnailItemsCateColor,
color: newColor,
},
})
}
defaultColor="#FFFFFF"
/>
)}
>
) : (
<>
setAttributes({
catTabCategoryColor: {
...catTabCategoryColor,
hoverColor: newColor,
},
})
}
defaultColor="#000000"
/>
{blockLayoutName &&
inArray(["thumbnail-slider-layout-three", "thumbnail-slider-layout-four"], blockLayoutName) && (
setAttributes({
thumbnailItemsCateColor: {
...thumbnailItemsCateColor,
hoverColor: newColor,
},
})
}
defaultColor="#000000"
/>
)}
>
)}
{![
"thumbnail-slider-two-layout-three",
"thumbnail-slider-two-layout-four",
"thumbnail-slider-two-layout-five",
].includes(blockLayoutName) && (
,
value: "transparent",
tooltip: "Transparent",
},
{
label: ,
value: "bgColor",
tooltip: "Solid",
},
{
label: ,
value: "gradient",
tooltip: "Gradient",
},
]}
/>
)}
{"color" === catTabBtnState ? (
) : (
{" "}
)}
>
);
};
export const PopupDetailsStyleTab = ({ attributes, setAttributes }) => {
const {
popupTitleColor,
popupMetaFieldsColor,
popupExcerptColor,
popupBgColor,
popupOverlayColor,
popupNavArrowBgColor,
popupNavArrowColor,
popupCloseBtnColor,
generalLinkOpen,
popupCloseBtnEnable,
} = attributes;
const [popupDetailsColorType, setPopupDetailsColorType] = useState("normal");
return (
<>
setAttributes({
popupTitleColor: newColor,
})
}
/>
setAttributes({
popupMetaFieldsColor: newColor,
})
}
/>
setAttributes({
popupExcerptColor: newColor,
})
}
/>
setAttributes({
popupBgColor: newColor,
})
}
/>
setAttributes({
popupOverlayColor: newColor,
})
}
/>
{popupCloseBtnEnable && (
setPopupDetailsColorType(val)}
/>
)}
{popupCloseBtnEnable && (
<>
{"normal" === popupDetailsColorType ? (
<>
setAttributes({
popupCloseBtnColor: {
...popupCloseBtnColor,
color: newColor,
},
})
}
/>
{generalLinkOpen === "multi-popup" && (
<>
setAttributes({
popupNavArrowColor: {
...popupNavArrowColor,
color: newColor,
},
})
}
/>
setAttributes({
popupNavArrowBgColor: {
...popupNavArrowBgColor,
color: newColor,
},
})
}
/>
>
)}
>
) : (
<>
setAttributes({
popupCloseBtnColor: {
...popupCloseBtnColor,
hover: newColor,
},
})
}
/>
{generalLinkOpen === "multi-popup" && (
<>
setAttributes({
popupNavArrowColor: {
...popupNavArrowColor,
hover: newColor,
},
})
}
/>
setAttributes({
popupNavArrowBgColor: {
...popupNavArrowBgColor,
hover: newColor,
},
})
}
/>
>
)}
>
)}
>
)}
>
);
};
export const PaginationStyleTab = ({ attributes, setAttributes }) => {
const {
paginationColor,
paginationBGColor,
paginationBorder,
paginationBorderRadius,
paginationPadding,
paginationMargin,
paginationBorderWidth,
paginationType,
paginationTypography,
paginationFontSize,
paginationLetterSpacing,
paginationLineHeight,
paginationWordSpacing,
paginationGlobalTypography,
} = attributes;
const [paginationColorStyle, setPaginationColorStyle] = useState("normal");
return (
<>
{["load-more", "pagination"].includes(paginationType) && (
<>
>
)}
setPaginationColorStyle(newValue)}
/>
{"normal" === paginationColorStyle ? (
<>
{
setAttributes({
paginationColor: {
...paginationColor,
color: newColor,
defaultColor: "",
},
});
}}
defaultColor={"#FFFFFF"}
/>
setAttributes({
paginationBGColor: {
...paginationBGColor,
color: newColor,
defaultColor: "",
},
})
}
defaultColor={"#333333"}
/>
>
) : (
<>
setAttributes({
paginationColor: {
...paginationColor,
hoverColor: newColor,
},
})
}
defaultColor={"#333333"}
/>
{/* {paginationType === "pagination" && (
setAttributes({
paginationColor: {
...paginationColor,
activeColor: newColor,
},
})
}
defaultColor={"#000000"}
/>
)} */}
setAttributes({
paginationBGColor: {
...paginationBGColor,
hoverColor: newColor,
},
})
}
defaultColor={"#FFFFFF00"}
/>
{/* {paginationType === "pagination" && (
setAttributes({
paginationBGColor: {
...paginationBGColor,
activeColor: newColor,
},
})
}
defaultColor={"#FFFFFF00"}
/>
)} */}
>
)}
{["load-more", "pagination"].includes(paginationType) && (
)}
>
);
};
export const CarouselNavArrowStyleTab = ({ attributes, setAttributes }) => {
const {
carouselArrowColor,
carouselArrowBgColor,
carouselArrowBorder,
carouselArrowBorderWidth,
carouselArrowBorderRadius,
carouselBoxShadowEnable,
carouselBoxShadow,
carouselArrowBorderWidthHover,
} = attributes;
const [colorState, setColorState] = useState("normal");
return (
<>
setColorState(val)}
/>
{"normal" === colorState ? (
<>
setAttributes({
carouselArrowColor: {
...carouselArrowColor,
color: newColor,
},
})
}
defaultColor={"#ffffff"}
/>
setAttributes({
carouselArrowBgColor: {
...carouselArrowBgColor,
color: newBGColor,
},
})
}
defaultColor={"#1A1B1C"}
/>
>
) : (
<>
setAttributes({
carouselArrowColor: {
...carouselArrowColor,
hoverColor: newColor,
},
})
}
defaultColor={"#1A1B1C"}
/>
setAttributes({
carouselArrowBgColor: {
...carouselArrowBgColor,
hoverColor: newBGColor,
},
})
}
defaultColor={"#ffffff"}
/>
>
)}
{carouselBoxShadowEnable && (
)}
>
);
};
export const CarouselPaginationStyleTab = ({ attributes, setAttributes }) => {
const {
carouselPaginationStyle,
carouselPaginationTextColor,
carouselPaginationColor,
carouselPaginationBorder,
carouselPaginationBorderWidth,
carouselPaginationBorderWidthHover,
} = attributes;
const [colorState, setColorState] = useState("normal");
return (
<>
setColorState(newValue)}
/>
{"normal" === colorState ? (
<>
{(carouselPaginationStyle === "fraction" || carouselPaginationStyle === "numbers") && (
<>
setAttributes({
carouselPaginationTextColor: {
...carouselPaginationTextColor,
color: newColor,
},
})
}
defaultColor={"#4e4f52"}
/>
>
)}
setAttributes({
carouselPaginationColor: {
...carouselPaginationColor,
color: newColor,
},
})
}
defaultColor={"#cacbcf"}
/>
{carouselPaginationStyle !== "scrollbar" && (
)}
>
) : (
<>
{(carouselPaginationStyle === "fraction" || carouselPaginationStyle === "numbers") && (
<>
setAttributes({
carouselPaginationTextColor: {
...carouselPaginationTextColor,
activeColor: newColor,
},
})
}
defaultColor="#4e4f52"
/>
>
)}
setAttributes({
carouselPaginationColor: {
...carouselPaginationColor,
hoverColor: newColor,
},
})
}
defaultColor="#4e4f52"
/>
{carouselPaginationStyle !== "scrollbar" && (
)}
>
)}
>
);
};
export const PriceStyleTab = ({ attributes, setAttributes }) => {
const {
priceColor,
discountColor,
priceTypography,
priceFontSize,
priceLatterSpacing,
priceLineHeight,
priceWordSpacing,
} = attributes;
return (
<>
setAttributes({
priceColor: {
...priceColor,
color: newColor,
},
})
}
/>
setAttributes({
discountColor: {
...discountColor,
color: newColor,
},
})
}
/>
>
);
};
export const RatingStyleTab = ({ attributes, setAttributes }) => {
const { starColor, emptyStarColor, reviewCounterColor } = attributes;
return (
<>
setAttributes({
starColor: {
...starColor,
color: newColor,
},
})
}
/>
setAttributes({
emptyStarColor: {
...emptyStarColor,
color: newColor,
},
})
}
/>
setAttributes({
reviewCounterColor: {
...reviewCounterColor,
color: newColor,
},
})
}
/>
>
);
};
export const AddToCartStyleTab = ({ attributes, setAttributes }) => {
const {
addToCartBg,
addToCartColor,
addToCartBorder,
addToCartBorderWidth,
addToCartTypography,
addToCartFontSize,
addToCartLatterSpacing,
addToCartLineHeight,
addToCartWordSpacing,
} = attributes;
const [addToCartButtonStyleType, setAddToCartButtonStyleType] = useState("color");
return (
<>
setAddToCartButtonStyleType(val)}
/>
{"color" === addToCartButtonStyleType ? (
<>
setAttributes({
addToCartColor: {
...addToCartColor,
color: newColor,
},
})
}
/>
>
) : (
<>
setAttributes({
addToCartColor: {
...addToCartColor,
hoverColor: newColor,
},
})
}
/>
>
)}
,
value: "transparent",
tooltip: "Transparent",
},
{ label: , value: "bgColor", tooltip: "Solid" },
{
label: ,
value: "gradient",
tooltip: "Gradient",
},
]}
/>
>
);
};
export const PostTimelineConnectorStyleTab = ({ attributes, setAttributes }) => {
const {
blockName,
timelineConnectorColor,
timelineIndicatorColor,
timelineCircleBgColor,
timelineConnectorBorder,
timelineConnectorBorderWidth,
timelineConnectorBorderRadius,
} = attributes;
const [colorButton, setColorButton] = useState("normal");
return (
<>
{["post-timeline-one", "post-timeline-two"].includes(blockName) ? (
<>
setColorButton(value)}
items={[
{ label: "Normal", value: "normal" },
{ label: "Active", value: "active" },
]}
/>
{"normal" === colorButton ? (
<>
setAttributes({
timelineConnectorColor: {
...timelineConnectorColor,
color: newColor,
},
})
}
defaultColor={"#E0E0E0"}
/>
setAttributes({
timelineIndicatorColor: {
...timelineIndicatorColor,
color: newColor,
},
})
}
defaultColor={"#E0E0E0"}
/>
setAttributes({
timelineCircleBgColor: {
...timelineCircleBgColor,
color: newColor,
},
})
}
defaultColor={"#FFFFFF"}
/>
>
) : (
<>
setAttributes({
timelineConnectorColor: {
...timelineConnectorColor,
active: newColor,
},
})
}
defaultColor={"var(--sp-smart-primary-2-600)"}
/>
setAttributes({
timelineIndicatorColor: {
...timelineIndicatorColor,
active: newColor,
},
})
}
defaultColor={"var(--sp-smart-primary-2-600)"}
/>
setAttributes({
timelineCircleBgColor: {
...timelineCircleBgColor,
active: newColor,
},
})
}
defaultColor={"#E0E0E0"}
/>
>
)}
>
) : (
<>
setAttributes({
timelineConnectorColor: {
...timelineConnectorColor,
active: newColor,
},
})
}
defaultColor={"var(--sp-smart-primary-2-600)"}
/>
setAttributes({
timelineIndicatorColor: {
...timelineIndicatorColor,
color: newColor,
},
})
}
defaultColor={"var(--sp-smart-primary-2-600)"}
/>
setAttributes({
timelineCircleBgColor: {
...timelineCircleBgColor,
color: newColor,
},
})
}
defaultColor={"#FFFFFF"}
/>
>
)}
>
);
};
export const DividerStyleTab = ({ attributes, setAttributes }) => {
const { dividerBg, dividerWidth, dividerHeight } = attributes;
return (
<>
,
value: "transparent",
tooltip: "Transparent",
},
{
label: ,
value: "bgColor",
tooltip: "Solid",
},
{
label: ,
value: "gradient",
tooltip: "Gradient",
},
]}
/>
>
);
};