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 / news-ticker / generalTab.js

generalTab.js in Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News 4.0.7, at src/blocks/news-ticker/generalTab.js

1,532 lines 36.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { __ } from "@wordpress/i18n";
2 import {
3 NewsTickerOne,
4 NewsTickerSix,
5 NewsTickerFour,
6 NewsTickerFive,
7 NewsTickerThree,
8 NewsTickerTwo,
9 NewsTickerSeven,
10 AlignLeft,
11 AlignCenter,
12 AlignRight,
13 ListStyle1,
14 ListStyle2,
15 ListStyle3,
16 ListStyle4,
17 ListStyle5,
18 ListStyle6,
19 ListStyle7,
20 NewsIcon,
21 NewsIcon2,
22 NewsIcon3,
23 NewsIcon4,
24 NewsIcon5,
25 } from "../../icons/icons";
26 import { openLinksOptions } from "../../controls/constants";
27 import Border from "../../components/border/border";
28 import {
29 Background,
30 InputControl,
31 SelectField,
32 SpColorPicker,
33 SPRangeControl,
34 SPToggleGroupControl,
35 TypographyNew,
36 Toggle,
37 Layouts,
38 Spacing,
39 BoxShadow,
40 SelectDropdown,
41 } from "../../components";
42 import { useState } from "@wordpress/element";
43 import { BgIcon, GradientIcon } from "../../components/background/svgIcon";
44 import {
45 ArrowMinimal,
46 ArrowOutline,
47 ArrowSolid,
48 ChevronBold,
49 ChevronBorderLine,
50 ChevronOutline,
51 ChevronSolid,
52 DoubleChevron,
53 DoubleChevronOutline,
54 TriangleOutline,
55 } from "../../icons/arrowIcons";
56 import { priceLink } from "../shared/helpFn";
57 //carousel general tab panel
58 export const NewsTickerGeneralPanel = ({ attributes, setAttributes }) => {
59 const {
60 displayStyle,
61 carouselAutoPlay,
62 carouselAutoPlayDelay,
63 carouselDirection,
64 carouselPauseOnHover,
65 carouselAnimationEffect,
66 tickerHeight,
67 carouselTickerSpeed,
68 headingStyle,
69 tickerOpenNewTab,
70 tickerDisplaySticky,
71 tickerStickyTopPosition,
72 tickerHeadingBg,
73 headingColor,
74 newsTickerItemToDisplay,
75 postLimit,
76 } = attributes;
77
78 const carouselAnimationItems = [
79 { label: "Slide", value: "slide" },
80 { label: "Fade", value: "fade" },
81 ];
82 const sliderDirection =
83 "ticker" === displayStyle
84 ? [
85 { label: "Right to Left", value: "right_to_left" },
86 { label: "Left to Right", value: "left_to_right" },
87 ]
88 : [
89 { label: "Right to Left", value: "right_to_left" },
90 { label: "Left to Right", value: "left_to_right" },
91 { label: "Top to Bottom", value: "top_to_bottom" },
92 { label: "Bottom to Top", value: "bottom_to_top" },
93 ];
94
95 const layoutChange = (newValue) => {
96 if (newValue === headingStyle) return; // no change, skip
97
98 if (newValue === "seven") {
99 setAttributes({
100 headingStyle: newValue,
101 tickerHeadingBg: {
102 ...tickerHeadingBg,
103 color: {
104 ...tickerHeadingBg.color,
105 solidColor: "#ffffff", // white bg
106 },
107 },
108 headingColor: {
109 ...headingColor,
110 color: "#023047", // blue text
111 },
112 tickerIconColor: "#023047",
113 });
114 } else {
115 setAttributes({
116 headingStyle: newValue,
117 tickerHeadingBg: {
118 ...tickerHeadingBg,
119 color: {
120 ...tickerHeadingBg.color,
121 solidColor: "#023047", // dark blue bg
122 },
123 },
124 headingColor: {
125 ...headingColor,
126 color: "#ffffff", // white text
127 },
128 tickerIconColor: "#ffffff",
129 });
130 }
131 };
132
133 return (
134 <>
135 <SPToggleGroupControl
136 label={__("Display Style", "post-carousel")}
137 attributes={displayStyle}
138 attributesKey={"displayStyle"}
139 setAttributes={setAttributes}
140 items={[
141 { label: "Ticker", value: "ticker" },
142 { label: "Slider (Pro)", value: "slide", disabled: "disabled" },
143 { label: "Typewriter", value: "typewriter", disabled: "disabled" },
144 ]}
145 />
146 {"slide" === displayStyle && (
147 <SelectField
148 label={__("Slider Type", "post-carousel")}
149 flexStyle={true}
150 attributes={carouselAnimationEffect}
151 attributesKey={"carouselAnimationEffect"}
152 setAttributes={setAttributes}
153 items={carouselAnimationItems}
154 />
155 )}
156
157 {(displayStyle === "ticker" || (displayStyle === "slide" && carouselAnimationEffect !== "fade")) && (
158 <SelectField
159 label={__("Slider Direction", "post-carousel")}
160 flexStyle={true}
161 attributes={carouselDirection}
162 attributesKey="carouselDirection"
163 setAttributes={setAttributes}
164 items={sliderDirection}
165 />
166 )}
167
168 <Layouts
169 attributes={headingStyle}
170 tickerAttr={{ tickerHeadingBg, headingColor }}
171 setAttributes={setAttributes}
172 attributesKey={"headingStyle"}
173 displayActive={true}
174 showDemoTitle={true}
175 proBtnClass="sp-smart-small-size"
176 ticker={true}
177 grid={3}
178 onChange={layoutChange}
179 label={__("Heading Style", "post-carousel")}
180 items={[
181 {
182 icon: <NewsTickerOne />,
183 value: "one",
184 },
185 {
186 icon: <NewsTickerTwo />,
187 value: "two",
188 type: "pro",
189 demoLink: priceLink
190 },
191 {
192 icon: <NewsTickerThree />,
193 value: "three",
194 type: "pro",
195 demoLink: priceLink
196 },
197 {
198 icon: <NewsTickerFour />,
199 value: "four",
200 type: "pro",
201 demoLink: priceLink
202 },
203 {
204 icon: <NewsTickerFive />,
205 value: "five",
206 type: "pro",
207 demoLink: priceLink
208 },
209 {
210 icon: <NewsTickerSix />,
211 value: "six",
212 type: "pro",
213 demoLink: priceLink
214 },
215 {
216 icon: <NewsTickerSeven />,
217 value: "seven",
218 type: "pro",
219 demoLink: priceLink
220 },
221 ]}
222 />
223
224 <InputControl
225 label={__("Number of Slides", "post-carousel")}
226 className="sp-smart-limit-field"
227 ajax={true}
228 attributes={postLimit}
229 min={1}
230 attributesKey={"postLimit"}
231 setAttributes={setAttributes}
232 />
233
234 <>
235 <SPRangeControl
236 label={__("Height", "post-carousel")}
237 setAttributes={setAttributes}
238 attributes={tickerHeight}
239 units={["px", "%", "em"]}
240 max={200}
241 attributesKey={"tickerHeight"}
242 defaultValue={{ unit: "px", value: 48 }}
243 />
244 </>
245
246 {"slide" === displayStyle && (
247 <>
248 <SPRangeControl
249 label={__("Item to Display", "post-carousel")}
250 attributes={newsTickerItemToDisplay}
251 attributesKey={"newsTickerItemToDisplay"}
252 setAttributes={setAttributes}
253 max={6}
254 defaultValue={{ value: 3 }}
255 />
256 <Toggle
257 label={__("AutoPlay", "post-carousel")}
258 attributes={carouselAutoPlay}
259 setAttributes={setAttributes}
260 attributesKey={"carouselAutoPlay"}
261 />
262 </>
263 )}
264 {carouselAutoPlay && "slide" === displayStyle && (
265 <SPRangeControl
266 label={__("AutoPlay Delay", "post-carousel")}
267 attributes={carouselAutoPlayDelay}
268 attributesKey={"carouselAutoPlayDelay"}
269 setAttributes={setAttributes}
270 units={["ms"]}
271 max={5000}
272 ajax={true}
273 defaultValue={{ unit: "ms", value: 2000 }}
274 step={50}
275 />
276 )}
277
278 {["ticker", "slide"].includes(displayStyle) && (
279 <SPRangeControl
280 label={__("Speed", "post-carousel")}
281 setAttributes={setAttributes}
282 attributes={carouselTickerSpeed}
283 units={["ms"]}
284 max={5000}
285 attributesKey={"carouselTickerSpeed"}
286 defaultValue={{ unit: "ms", value: 3000 }}
287 step={50}
288 />
289 )}
290
291 {((carouselAutoPlay && "slide" === displayStyle) || "ticker" === displayStyle) && (
292 <Toggle
293 label={__("Pause on Hover", "post-carousel")}
294 attributes={carouselPauseOnHover}
295 setAttributes={setAttributes}
296 attributesKey={"carouselPauseOnHover"}
297 />
298 )}
299
300 <Toggle
301 label={__("Open in new tab", "post-carousel")}
302 attributes={tickerOpenNewTab}
303 setAttributes={setAttributes}
304 attributesKey={"tickerOpenNewTab"}
305 />
306
307 <Toggle
308 label={__("Position Sticky", "post-carousel")}
309 attributes={tickerDisplaySticky}
310 setAttributes={setAttributes}
311 attributesKey={"tickerDisplaySticky"}
312 pro={true}
313 />
314
315 {tickerDisplaySticky && (
316 <SPRangeControl
317 label={__("Sticky Top Position", "post-carousel")}
318 setAttributes={setAttributes}
319 attributes={tickerStickyTopPosition}
320 units={["px"]}
321 max={200}
322 attributesKey={"tickerStickyTopPosition"}
323 defaultValue={{ unit: "px", value: 48 }}
324 />
325 )}
326 </>
327 );
328 };
329
330 //post carousel general tab panel
331 export const PostCarouselGeneralTab = ({ attributes, setAttributes }) => {
332 const { contentAlignment, generalLinkOpen, preloaderEnable, equalHeightEnable } = attributes;
333 return (
334 <>
335 <SPToggleGroupControl
336 label={__("Content Alignment", "post-carousel")}
337 items={[
338 { label: <AlignLeft />, value: "left" },
339 { label: <AlignCenter />, value: "center" },
340 { label: <AlignRight />, value: "right" },
341 ]}
342 attributes={contentAlignment}
343 attributesKey={"contentAlignment"}
344 setAttributes={setAttributes}
345 />
346 <SelectField
347 label={__("Link Open In", "post-carousel")}
348 attributes={generalLinkOpen}
349 attributesKey={"generalLinkOpen"}
350 setAttributes={setAttributes}
351 items={openLinksOptions}
352 />
353 <Toggle
354 label={__("Preloader", "post-carousel")}
355 attributes={preloaderEnable}
356 attributesKey={"preloaderEnable"}
357 setAttributes={setAttributes}
358 />
359 <Toggle
360 label={__("Enable Equal Height", "post-carousel")}
361 attributes={equalHeightEnable}
362 attributesKey={"equalHeightEnable"}
363 setAttributes={setAttributes}
364 pro={true}
365 />
366 </>
367 );
368 };
369
370 export const NewsTickerContentArea = ({ attributes, setAttributes }) => {
371 const {
372 contentBg,
373 ContentBorderWidth,
374 ContentBorder,
375 ContentBorderRadius,
376 gapBetweenHeadingContent,
377 newsTickerShadowEnable,
378 newsTickerBoxShadow,
379 } = attributes;
380
381 return (
382 <>
383 <Background
384 label={__("Background Type", "post-carousel")}
385 colorLabel="Solid Color"
386 defaultColor={"#FFFFFF"}
387 attributes={contentBg}
388 attributesKey={"contentBg"}
389 setAttributes={setAttributes}
390 colorType={"color"}
391 items={[
392 {
393 label: <BgIcon />,
394 value: "bgColor",
395 tooltip: "Solid",
396 },
397 {
398 label: <GradientIcon />,
399 value: "gradient",
400 tooltip: "Gradient",
401 },
402 ]}
403 />
404
405 <Border
406 attributes={{
407 border: ContentBorder,
408 borderWidth: ContentBorderWidth,
409 }}
410 setAttributes={setAttributes}
411 attributesKey={{
412 border: "ContentBorder",
413 borderWidth: "ContentBorderWidth",
414 }}
415 defaultColor={{
416 color: "#333333",
417 hover: "#333333",
418 }}
419 />
420
421 <Spacing
422 label={__("Border Radius", "post-carousel")}
423 attributes={ContentBorderRadius}
424 attributesKey={"ContentBorderRadius"}
425 setAttributes={setAttributes}
426 units={["px", "%", "em"]}
427 defaultValue={{
428 unit: "px",
429 value: {
430 top: 0,
431 right: 0,
432 bottom: 0,
433 left: 0,
434 },
435 }}
436 indicator={"radius"}
437 />
438
439 <SPRangeControl
440 label={__("Heading to Title Gap", "post-carousel")}
441 attributes={gapBetweenHeadingContent}
442 attributesKey={"gapBetweenHeadingContent"}
443 setAttributes={setAttributes}
444 units={["px", "%", "Em"]}
445 max={200}
446 defaultValue={{ unit: "px", value: 20 }}
447 />
448
449 <Toggle
450 label={__("Box Shadow", "post-carousel")}
451 attributes={newsTickerShadowEnable}
452 attributesKey={"newsTickerShadowEnable"}
453 setAttributes={setAttributes}
454 />
455 {newsTickerShadowEnable && (
456 <BoxShadow
457 label={__("Box Shadow", "post-carousel")}
458 attributes={newsTickerBoxShadow}
459 attributesKey={"newsTickerBoxShadow"}
460 setAttributes={setAttributes}
461 defaultColor="#A19D9D"
462 />
463 )}
464 </>
465 );
466 };
467
468 export const NewsTickerHeadingTab = ({ attributes, setAttributes }) => {
469 const {
470 HeadingLabel,
471 HeadingPosition,
472 blockName,
473 headingTypography,
474 headingFontSize,
475 headingLatterSpacing,
476 headingLineHeight,
477 headingColor,
478 tickerHeadingBg,
479 tickerIconEnabled,
480 tickerIconSource,
481 tickerIconColor,
482 tickerIconPosition,
483 headingWordSpacing,
484 newsTickerIconSize,
485 newsTickerHeadingPadding,
486 headingGlobalTypography,
487 } = attributes;
488
489 return (
490 <>
491 <InputControl
492 attributes={HeadingLabel}
493 attributesKey={"HeadingLabel"}
494 setAttributes={setAttributes}
495 label={__("Heading Label", "post-carousel")}
496 flex={false}
497 inputType="string"
498 />
499 <SPToggleGroupControl
500 attributes={HeadingPosition}
501 attributesKey={"HeadingPosition"}
502 setAttributes={setAttributes}
503 items={[
504 { label: "Left", value: "left" },
505 { label: "Right", value: "right" },
506 ]}
507 label="Heading Position"
508 />
509 <TypographyNew
510 attributes={{
511 family: headingTypography,
512 familyKey: "headingTypography",
513 fontSize: headingFontSize,
514 fontSizeKey: "headingFontSize",
515 fontSpacing: headingLatterSpacing,
516 fontSpacingKey: "headingLatterSpacing",
517 lineHeight: headingLineHeight,
518 lineHeightKey: "headingLineHeight",
519 wordSpacing: headingWordSpacing,
520 wordSpacingKey: "headingWordSpacing",
521 globalTypo: headingGlobalTypography,
522 globalTypoKey: "headingGlobalTypography",
523 }}
524 setAttributes={setAttributes}
525 spacingDefaultValue={{ unit: "px", value: 0 }}
526 fontSizeDefault={{
527 unit: "px",
528 value: 14,
529 }}
530 lineDefaultValue={1.2}
531 typographyLabel={
532 blockName === "thumbnail-slider-two"
533 ? __("Thumb Typography", "post-carousel")
534 : __("Typography", "post-carousel")
535 }
536 />
537
538 <SpColorPicker
539 label={__("Color", "post-carousel")}
540 value={headingColor.color}
541 onChange={(newColor) =>
542 setAttributes({
543 headingColor: {
544 ...headingColor,
545 color: newColor,
546 },
547 })
548 }
549 defaultColor="#000000"
550 />
551
552 <Background
553 label={__("Background Type", "post-carousel")}
554 colorLabel="Solid Color"
555 defaultColor={"#023047"}
556 attributes={tickerHeadingBg}
557 attributesKey={"tickerHeadingBg"}
558 setAttributes={setAttributes}
559 colorType={"color"}
560 items={[
561 {
562 label: <BgIcon />,
563 value: "bgColor",
564 tooltip: "Solid",
565 },
566 {
567 label: <GradientIcon />,
568 value: "gradient",
569 tooltip: "Gradient",
570 },
571 ]}
572 />
573
574 <Toggle
575 label={__("Icon", "post-carousel")}
576 attributes={tickerIconEnabled}
577 setAttributes={setAttributes}
578 attributesKey={"tickerIconEnabled"}
579 />
580
581 {tickerIconEnabled && (
582 <>
583 <SPToggleGroupControl
584 attributes={tickerIconSource}
585 attributesKey={"tickerIconSource"}
586 setAttributes={setAttributes}
587 items={[
588 {
589 label: <NewsIcon />,
590 value: "newsIcon",
591 },
592 {
593 label: <NewsIcon2 />,
594 value: "newsIcon2",
595 disabled: "disabled"
596 },
597 {
598 label: <NewsIcon3 />,
599 value: "newsIcon3",
600 disabled: "disabled"
601 },
602 {
603 label: <NewsIcon4 />,
604 value: "newsIcon4",
605 disabled: "disabled"
606 },
607 {
608 label: <NewsIcon5 />,
609 value: "newsIcon5",
610 disabled: "disabled"
611 },
612 ]}
613 label="Icon Set"
614 />
615 <SPRangeControl
616 label={__("Icon Size", "post-carousel")}
617 attributes={newsTickerIconSize}
618 attributesKey={"newsTickerIconSize"}
619 setAttributes={setAttributes}
620 units={["px", "%", "em"]}
621 defaultValue={{ unit: "px", value: 24 }}
622 />
623 <SpColorPicker
624 label={__("Icon Color", "post-carousel")}
625 value={tickerIconColor}
626 onChange={(newColor) =>
627 setAttributes({
628 tickerIconColor: newColor,
629 })
630 }
631 defaultColor="#000000"
632 />
633
634 <SPToggleGroupControl
635 attributes={tickerIconPosition}
636 attributesKey={"tickerIconPosition"}
637 setAttributes={setAttributes}
638 items={[
639 { label: "Left", value: "left" },
640 { label: "Right", value: "right" },
641 ]}
642 label="Icon Position"
643 />
644 </>
645 )}
646 <Spacing
647 label={__("Padding", "post-carousel")}
648 attributes={newsTickerHeadingPadding}
649 attributesKey={"newsTickerHeadingPadding"}
650 setAttributes={setAttributes}
651 units={["px", "%", "em"]}
652 defaultValue={{
653 unit: "px",
654 value: {
655 top: 15,
656 right: 24,
657 bottom: 15,
658 left: 24,
659 },
660 }}
661 />
662 </>
663 );
664 };
665
666 export const NewsTickerTitleTab = ({ attributes, setAttributes }) => {
667 const {
668 blockName,
669 tickerTitleGap,
670 tickerTitleTypography,
671 tickerTitleFontSize,
672 tickerTitleLatterSpacing,
673 tickerTitleLineHeight,
674 tickertitleColor,
675 tickerSeparatorEnable,
676 tickerTitleListStyleEnble,
677 tickerListStyle,
678 tickerListStyleColor,
679 displayStyle,
680 titleLength,
681 tickerTitleWordSpacing,
682 titleListStyleIconSize,
683 titleListStyleIconGap,
684 tickerTitleGlobalTypography,
685 } = attributes;
686 const [colorState, setColorState] = useState("normal");
687
688 return (
689 <>
690 <TypographyNew
691 attributes={{
692 family: tickerTitleTypography,
693 familyKey: "tickerTitleTypography",
694 fontSize: tickerTitleFontSize,
695 fontSizeKey: "tickerTitleFontSize",
696 fontSpacing: tickerTitleLatterSpacing,
697 fontSpacingKey: "tickerTitleLatterSpacing",
698 lineHeight: tickerTitleLineHeight,
699 lineHeightKey: "tickerTitleLineHeight",
700 wordSpacing: tickerTitleWordSpacing,
701 wordSpacingKey: "tickerTitleWordSpacing",
702 globalTypo: tickerTitleGlobalTypography,
703 globalTypoKey: "tickerTitleGlobalTypography",
704 }}
705 setAttributes={setAttributes}
706 spacingDefaultValue={{ unit: "px", value: 0 }}
707 fontSizeDefault={{
708 unit: "px",
709 value: 14,
710 }}
711 typographyLabel={
712 blockName === "thumbnail-slider-two"
713 ? __("Thumb Typography", "post-carousel")
714 : __("Typography", "post-carousel")
715 }
716 />
717 <SPRangeControl
718 label={__("Title Length", "post-carousel")}
719 className="sp-smart-post-ranger-length"
720 attributes={titleLength}
721 attributesKey={"titleLength"}
722 setAttributes={setAttributes}
723 units={["Chars", "Words"]}
724 defaultValue={{ unit: "Words", value: 7 }}
725 min={1}
726 />
727 {displayStyle === "ticker" && (
728 <SPRangeControl
729 label={__("Space Between Title", "post-carousel")}
730 setAttributes={setAttributes}
731 attributes={tickerTitleGap}
732 units={["px", "%", "em"]}
733 max={100}
734 attributesKey={"tickerTitleGap"}
735 defaultValue={{ unit: "px", value: 24 }}
736 />
737 )}
738
739 <SPToggleGroupControl
740 attributes={colorState}
741 items={[
742 { label: "Normal", value: "normal" },
743 { label: "Hover", value: "hover" },
744 ]}
745 onClick={(val) => setColorState(val)}
746 />
747 {"normal" === colorState ? (
748 <>
749 <SpColorPicker
750 label={__("Color", "post-carousel")}
751 value={tickertitleColor.color}
752 onChange={(newColor) =>
753 setAttributes({
754 tickertitleColor: {
755 ...tickertitleColor,
756 color: newColor,
757 },
758 })
759 }
760 defaultColor={"#ffffff"}
761 />
762 </>
763 ) : (
764 <>
765 <SpColorPicker
766 label={__("Hover Color", "post-carousel")}
767 value={tickertitleColor.hoverColor}
768 onChange={(newColor) =>
769 setAttributes({
770 tickertitleColor: {
771 ...tickertitleColor,
772 hoverColor: newColor,
773 },
774 })
775 }
776 defaultColor={"#1A1B1C"}
777 />
778 </>
779 )}
780
781 {displayStyle === "ticker" && (
782 <Toggle
783 label={__("Titles Separator", "post-carousel")}
784 attributes={tickerSeparatorEnable}
785 setAttributes={setAttributes}
786 attributesKey={"tickerSeparatorEnable"}
787 />
788 )}
789 {displayStyle !== "typewriter" && (
790 <>
791 <Toggle
792 label={__("Titles List Style", "post-carousel")}
793 attributes={tickerTitleListStyleEnble}
794 setAttributes={setAttributes}
795 attributesKey={"tickerTitleListStyleEnble"}
796 />
797 {tickerTitleListStyleEnble && (
798 <>
799 <SPRangeControl
800 label={__("Icon Size", "post-carousel")}
801 attributes={titleListStyleIconSize}
802 attributesKey={"titleListStyleIconSize"}
803 setAttributes={setAttributes}
804 units={["px", "%", "em"]}
805 defaultValue={{ unit: "px", value: "" }}
806 />
807 <SPRangeControl
808 label={__("Gap", "post-carousel")}
809 attributes={titleListStyleIconGap}
810 attributesKey={"titleListStyleIconGap"}
811 setAttributes={setAttributes}
812 units={["px", "%", "em"]}
813 defaultValue={{ unit: "px", value: "" }}
814 />
815 <SPToggleGroupControl
816 attributes={tickerListStyle}
817 attributesKey={"tickerListStyle"}
818 setAttributes={setAttributes}
819 items={[
820 {
821 label: <ListStyle1 />,
822 value: "list1",
823 },
824 {
825 label: <ListStyle2 />,
826 value: "list2",
827 },
828 {
829 label: <ListStyle3 />,
830 value: "list3",
831 },
832 {
833 label: <ListStyle4 />,
834 value: "list4",
835 },
836 {
837 label: <ListStyle5 />,
838 value: "list5",
839 },
840 {
841 label: <ListStyle6 />,
842 value: "list6",
843 },
844 {
845 label: <ListStyle7 />,
846 value: "list7",
847 },
848 ]}
849 label="List Style Type"
850 />
851 <SpColorPicker
852 label={__("List Style Color", "post-carousel")}
853 value={tickerListStyleColor}
854 onChange={(newColor) =>
855 setAttributes({
856 tickerListStyleColor: newColor,
857 })
858 }
859 defaultColor="#023047"
860 />
861 </>
862 )}
863 </>
864 )}
865 </>
866 );
867 };
868
869 export const NewsTickerDateTab = ({ attributes, setAttributes }) => {
870 const {
871 blockName,
872 tickerDate,
873 tickerDateType,
874 tickerDateStyle,
875 tickerDateColor,
876 tickerDateTypography,
877 tickerDateLineHeight,
878 tickerDateLatterSpacing,
879 tickerDateFontSize,
880 tickerDateBgColor,
881 metaDateFormat,
882 metaDateCustomDateFormat,
883 tickerDateWordSpacing,
884 tickerDateGlobalTypography,
885 } = attributes;
886
887 return (
888 <>
889 <Toggle
890 label={__("Date", "post-carousel")}
891 attributes={tickerDate}
892 setAttributes={setAttributes}
893 attributesKey={"tickerDate"}
894 />
895 {tickerDate && (
896 <>
897 <SPToggleGroupControl
898 attributes={tickerDateType}
899 items={[
900 { label: "Days Ago", value: "daysAgo" },
901 { label: "Date", value: "date" },
902 ]}
903 onClick={(val) => setAttributes({ tickerDateType: val })}
904 label="Date Type"
905 />
906
907 {tickerDateType === "date" && (
908 <>
909 <SelectField
910 label={__("Date Format", "post-carousel")}
911 attributes={metaDateFormat}
912 attributesKey={"metaDateFormat"}
913 setAttributes={setAttributes}
914 items={[
915 {
916 label: "Select Date Format",
917 value: "",
918 disabled: "disabled",
919 },
920 {
921 label: "Default",
922 value: "default",
923 },
924 {
925 label: "Oct 7, 2025",
926 value: "M j, Y",
927 },
928 {
929 label: "October 7, 2025",
930 value: "F j, Y",
931 },
932 {
933 label: "Time Ago (Human Time)",
934 value: "time_ago",
935 disabled: "disabled"
936 },
937 {
938 label: "Custom (Pro)",
939 value: "custom",
940 disabled: "disabled"
941 },
942 ]}
943 />
944 {metaDateFormat === "custom" && (
945 <>
946 <InputControl
947 help={
948 <>
949 <span>{__("To define format, check", "post-carousel")}</span>
950 <a
951 href="https://wordpress.org/support/article/formatting-date-and-time/"
952 target="_blank"
953 >
954 {" "}
955 this doc.
956 </a>
957 </>
958 }
959 attributes={metaDateCustomDateFormat}
960 attributesKey={"metaDateCustomDateFormat"}
961 setAttributes={setAttributes}
962 inputType={"string"}
963 flex={false}
964 placeholder={"F j, Y"}
965 />
966 </>
967 )}
968 </>
969 )}
970
971 <SelectField
972 label={__("Date Display Style", "post-carousel")}
973 flexStyle={true}
974 attributes={tickerDateStyle}
975 attributesKey={"tickerDateStyle"}
976 setAttributes={setAttributes}
977 items={[
978 {
979 label: "Text",
980 value: "text",
981 },
982 {
983 label: "Button",
984 value: "button",
985 },
986 ]}
987 />
988
989 <TypographyNew
990 attributes={{
991 family: tickerDateTypography,
992 familyKey: "tickerDateTypography",
993 fontSize: tickerDateFontSize,
994 fontSizeKey: "tickerDateFontSize",
995 fontSpacing: tickerDateLatterSpacing,
996 fontSpacingKey: "tickerDateLatterSpacing",
997 lineHeight: tickerDateLineHeight,
998 lineHeightKey: "tickerDateLineHeight",
999 wordSpacing: tickerDateWordSpacing,
1000 wordSpacingKey: "tickerDateWordSpacing",
1001 globalTypo: tickerDateGlobalTypography,
1002 globalTypoKey: "tickerDateGlobalTypography",
1003 }}
1004 setAttributes={setAttributes}
1005 spacingDefaultValue={{
1006 unit: "px",
1007 value: 0,
1008 }}
1009 fontSizeDefault={{
1010 unit: "px",
1011 value: 10,
1012 }}
1013 typographyLabel={
1014 blockName === "thumbnail-slider-two"
1015 ? __("Thumb Typography", "post-carousel")
1016 : __("Date Typography", "post-carousel")
1017 }
1018 />
1019 <SpColorPicker
1020 label={__("Text Color", "post-carousel")}
1021 value={tickerDateColor}
1022 onChange={(newColor) =>
1023 setAttributes({
1024 tickerDateColor: newColor,
1025 })
1026 }
1027 defaultColor="#989595"
1028 />
1029
1030 {tickerDateStyle === "button" && (
1031 <SpColorPicker
1032 label={__("Background", "post-carousel")}
1033 value={tickerDateBgColor}
1034 onChange={(newColor) =>
1035 setAttributes({
1036 tickerDateBgColor: newColor,
1037 })
1038 }
1039 defaultColor="#E1E1E1"
1040 />
1041 )}
1042 </>
1043 )}
1044 </>
1045 );
1046 };
1047
1048 export const NewsTickerImageTab = ({ attributes, setAttributes }) => {
1049 const {
1050 tickerImagePosition,
1051 tickerImageWidth,
1052 tickerImageHeight,
1053 tickerImg,
1054 tickerImgShape,
1055 newsTickerImageRadius,
1056 } = attributes;
1057
1058 return (
1059 <>
1060 <Toggle
1061 label={__("Show Featured Image", "post-carousel")}
1062 attributes={tickerImg}
1063 attributesKey="tickerImg"
1064 setAttributes={setAttributes}
1065 pro={true}
1066 />
1067
1068 {tickerImg && (
1069 <>
1070 <SelectField
1071 label={__("Image Shape", "post-carousel")}
1072 flexStyle={true}
1073 attributes={tickerImgShape}
1074 attributesKey={"tickerImgShape"}
1075 setAttributes={setAttributes}
1076 items={[
1077 {
1078 label: "Circle",
1079 value: "circle",
1080 },
1081 {
1082 label: "Square",
1083 value: "square",
1084 },
1085 ]}
1086 />
1087 <SPRangeControl
1088 label={__("Width", "post-carousel")}
1089 attributes={tickerImageWidth}
1090 attributesKey="tickerImageWidth"
1091 setAttributes={setAttributes}
1092 units={["px", "%", "Em"]}
1093 defaultValue={{
1094 unit: "px",
1095 value: 20,
1096 }}
1097 max={100}
1098 />
1099
1100 <SPRangeControl
1101 label={__("Height", "post-carousel")}
1102 attributes={tickerImageHeight}
1103 attributesKey="tickerImageHeight"
1104 setAttributes={setAttributes}
1105 units={["px", "%", "Em"]}
1106 defaultValue={{
1107 unit: "px",
1108 value: 20,
1109 }}
1110 max={100}
1111 />
1112 {/* </>
1113 ) } */}
1114 {"square" === tickerImgShape && (
1115 <Spacing
1116 label={__("Radius", "post-carousel")}
1117 attributes={newsTickerImageRadius}
1118 attributesKey={"newsTickerImageRadius"}
1119 setAttributes={setAttributes}
1120 units={["px", "%", "em"]}
1121 defaultValue={{
1122 unit: "px",
1123 value: {
1124 top: 0,
1125 right: 0,
1126 bottom: 0,
1127 left: 0,
1128 },
1129 }}
1130 />
1131 )}
1132
1133 <SPToggleGroupControl
1134 label={__("Position", "post-carousel")}
1135 attributes={tickerImagePosition}
1136 attributesKey={"tickerImagePosition"}
1137 setAttributes={setAttributes}
1138 items={[
1139 {
1140 label: "Left",
1141 value: "left",
1142 },
1143 {
1144 label: "Right",
1145 value: "right",
1146 },
1147 ]}
1148 />
1149 </>
1150 )}
1151 </>
1152 );
1153 };
1154
1155 export const NewsTickerNavigationGeneralTab = ({ attributes, setAttributes }) => {
1156 const {
1157 carouselArrowStyle,
1158 carouselArrowSize,
1159 carouselArrowHeight,
1160 tickerNavigation,
1161 tickerPause,
1162 tickerDivider,
1163 newsTickerCarouselArrowWidth,
1164 newsCarouselArrowSpaceBetween,
1165 } = attributes;
1166
1167 return (
1168 <>
1169 <Toggle
1170 label={__("Navigation", "post-carousel")}
1171 attributes={tickerNavigation}
1172 attributesKey={"tickerNavigation"}
1173 setAttributes={setAttributes}
1174 />
1175 {tickerNavigation && (
1176 <>
1177 {/* <SelectDropdown
1178 label={ __( 'Arrow Style', 'post-carousel' ) }
1179 attributes={ carouselArrowStyle }
1180 attributesKey={ 'carouselArrowStyle' }
1181 setAttributes={ setAttributes }
1182 options={ [
1183 {
1184 label: 'Style One',
1185 value: 'open',
1186 icon: (
1187 <span className="sp-smart-post-select-nav-icon">
1188 <i
1189 className={ `sp-icon-left-open` }
1190 ></i>
1191 <i
1192 className={ `sp-icon-right-open` }
1193 ></i>
1194 </span>
1195 ),
1196 },
1197 {
1198 label: 'Style Two',
1199 value: 'open-mini',
1200 icon: (
1201 <span className="sp-smart-post-select-nav-icon">
1202 <i
1203 className={ `sp-icon-left-open-mini` }
1204 ></i>
1205 <i
1206 className={ `sp-icon-right-open-mini` }
1207 ></i>
1208 </span>
1209 ),
1210 },
1211 {
1212 label: 'Style Three',
1213 value: 'open-big',
1214 icon: (
1215 <span className="sp-smart-post-select-nav-icon">
1216 <i
1217 className={ `sp-icon-left-open-big` }
1218 ></i>
1219 <i
1220 className={ `sp-icon-right-open-big` }
1221 ></i>
1222 </span>
1223 ),
1224 },
1225 {
1226 label: 'Style Four',
1227 value: 'open-one',
1228 icon: (
1229 <span className="sp-smart-post-select-nav-icon">
1230 <i
1231 className={ `sp-icon-left-open-one` }
1232 ></i>
1233 <i
1234 className={ `sp-icon-right-open-one` }
1235 ></i>
1236 </span>
1237 ),
1238 },
1239 {
1240 label: 'Style Five',
1241 value: 'open-outline',
1242 icon: (
1243 <span className="sp-smart-post-select-nav-icon">
1244 <i
1245 className={ `sp-icon-left-open-outline` }
1246 ></i>
1247 <i
1248 className={ `sp-icon-right-open-outline` }
1249 ></i>
1250 </span>
1251 ),
1252 },
1253 {
1254 label: 'Style Six',
1255 value: 'dir',
1256 icon: (
1257 <span className="sp-smart-post-select-nav-icon">
1258 <i className={ `sp-icon-left-dir` }></i>
1259 <i
1260 className={ `sp-icon-right-dir` }
1261 ></i>
1262 </span>
1263 ),
1264 },
1265 {
1266 label: 'Style Seven',
1267 value: 'one',
1268 icon: (
1269 <span className="sp-smart-post-select-nav-icon">
1270 <i className={ `sp-icon-left-one` }></i>
1271 <i
1272 className={ `sp-icon-right-one` }
1273 ></i>
1274 </span>
1275 ),
1276 },
1277 {
1278 label: 'Style Eight',
1279 value: 'circled2',
1280 icon: (
1281 <span className="sp-smart-post-select-nav-icon">
1282 <i
1283 className={ `sp-icon-left-circled2` }
1284 ></i>
1285 <i
1286 className={ `sp-icon-right-circled2` }
1287 ></i>
1288 </span>
1289 ),
1290 },
1291 ] }
1292 /> */}
1293
1294 <SelectDropdown
1295 label={__("Arrow Icon Style", "post-carousel")}
1296 attributes={carouselArrowStyle}
1297 attributesKey={"carouselArrowStyle"}
1298 setAttributes={setAttributes}
1299 options={[
1300 {
1301 label: __("Chevron Solid", "post-carousel"),
1302 value: "chevron-solid",
1303 icon: <ChevronSolid />,
1304 },
1305 {
1306 label: __("Chevron Outline", "post-carousel"),
1307 value: "chevron-outline",
1308 icon: <ChevronOutline />,
1309 },
1310 {
1311 label: __("Chevron Bold", "post-carousel"),
1312 value: "chevron-bold",
1313 icon: <ChevronBold />,
1314 },
1315 {
1316 label: __("Double Chevron", "post-carousel"),
1317 value: "double-chevron",
1318 icon: <DoubleChevron />,
1319 },
1320 {
1321 label: __("Arrow Solid", "post-carousel"),
1322 value: "arrow-solid",
1323 icon: <ArrowSolid />,
1324 },
1325 {
1326 label: __("Arrow Outline", "post-carousel"),
1327 value: "arrow-outline",
1328 icon: <ArrowOutline />,
1329 },
1330 {
1331 label: __("Arrow Minimal", "post-carousel"),
1332 value: "arrow-minimal",
1333 icon: <ArrowMinimal />,
1334 },
1335 {
1336 label: __("Chevron Border Line", "post-carousel"),
1337 value: "chevron-border-line",
1338 icon: <ChevronBorderLine />,
1339 },
1340 {
1341 label: __("Double Chevron Outline", "post-carousel"),
1342 value: "double-chevron-outline",
1343 icon: <DoubleChevronOutline />,
1344 },
1345 {
1346 label: __("Triangle Outline", "post-carousel"),
1347 value: "triangle-outline",
1348 icon: <TriangleOutline />,
1349 },
1350 ]}
1351 />
1352
1353 <SPRangeControl
1354 label={__("Size", "post-carousel")}
1355 attributes={carouselArrowSize}
1356 attributesKey={"carouselArrowSize"}
1357 setAttributes={setAttributes}
1358 units={["px", "%", "Em"]}
1359 defaultValue={{ unit: "px", value: 16 }}
1360 />
1361 <SPRangeControl
1362 label={__("Box Width", "post-carousel")}
1363 attributes={newsTickerCarouselArrowWidth}
1364 attributesKey={"newsTickerCarouselArrowWidth"}
1365 setAttributes={setAttributes}
1366 units={["px", "%", "Em"]}
1367 defaultValue={{ unit: "px", value: 25 }}
1368 />
1369 <SPRangeControl
1370 label={__("Box Height", "post-carousel")}
1371 attributes={carouselArrowHeight}
1372 attributesKey={"carouselArrowHeight"}
1373 setAttributes={setAttributes}
1374 units={["px", "%", "Em"]}
1375 defaultValue={{ unit: "px", value: 25 }}
1376 />
1377 <SPRangeControl
1378 label={__("Space Between Arrows", "post-carousel")}
1379 attributes={newsCarouselArrowSpaceBetween}
1380 attributesKey={"newsCarouselArrowSpaceBetween"}
1381 setAttributes={setAttributes}
1382 units={["px", "%", "Em"]}
1383 max={40}
1384 defaultValue={{ unit: "px", value: 0 }}
1385 />
1386 <Toggle
1387 label={__("Divider", "post-carousel")}
1388 attributes={tickerDivider}
1389 attributesKey={"tickerDivider"}
1390 setAttributes={setAttributes}
1391 />
1392 <Toggle
1393 label={__("Pause Icon", "post-carousel")}
1394 attributes={tickerPause}
1395 attributesKey={"tickerPause"}
1396 setAttributes={setAttributes}
1397 />
1398 </>
1399 )}
1400 </>
1401 );
1402 };
1403
1404 export const NewsTickerNavigationStyleTab = ({ attributes, setAttributes }) => {
1405 const {
1406 carouselArrowBorderWidth,
1407 newsTickerCarouselArrowBorderRadius,
1408 newsTickerArrowBgColor,
1409 newsTickerCarouselArrowColor,
1410 newsTickerCarouselArrowBorder,
1411 newsTickerCarouselDividerColor,
1412 tickerDivider,
1413 tickerNavigation,
1414 } = attributes;
1415 const [colorState, setColorState] = useState("normal");
1416 if (!tickerNavigation) {
1417 return <p>Please Enable Navigation Toggle from General tab under Navigation tab.</p>;
1418 }
1419
1420 return (
1421 <>
1422 <SPToggleGroupControl
1423 attributes={colorState}
1424 items={[
1425 { label: "Normal", value: "normal" },
1426 { label: "Hover", value: "hover" },
1427 ]}
1428 onClick={(val) => setColorState(val)}
1429 />
1430 {"normal" === colorState ? (
1431 <>
1432 <SpColorPicker
1433 label={__("Color", "post-carousel")}
1434 value={newsTickerCarouselArrowColor.color}
1435 onChange={(newColor) =>
1436 setAttributes({
1437 newsTickerCarouselArrowColor: {
1438 ...newsTickerCarouselArrowColor,
1439 color: newColor,
1440 },
1441 })
1442 }
1443 defaultColor={"#023047"}
1444 />
1445 {tickerDivider && (
1446 <SpColorPicker
1447 label={__("Divider Color", "post-carousel")}
1448 value={newsTickerCarouselDividerColor}
1449 onChange={(newColor) =>
1450 setAttributes({
1451 newsTickerCarouselDividerColor: newColor,
1452 })
1453 }
1454 />
1455 )}
1456 <SpColorPicker
1457 label={__("Background Color", "post-carousel")}
1458 value={newsTickerArrowBgColor.color}
1459 onChange={(newBGColor) =>
1460 setAttributes({
1461 newsTickerArrowBgColor: {
1462 ...newBGColor,
1463 color: newBGColor,
1464 },
1465 })
1466 }
1467 defaultColor={"#FFFFFF"}
1468 />
1469 </>
1470 ) : (
1471 <>
1472 <SpColorPicker
1473 label={__("Hover Color", "post-carousel")}
1474 value={newsTickerCarouselArrowColor.hoverColor}
1475 onChange={(newColor) =>
1476 setAttributes({
1477 newsTickerCarouselArrowColor: {
1478 ...newsTickerCarouselArrowColor,
1479 hoverColor: newColor,
1480 },
1481 })
1482 }
1483 defaultColor={"#1A1B1C"}
1484 />
1485 <SpColorPicker
1486 label={__("Hover Background Color", "post-carousel")}
1487 value={newsTickerArrowBgColor.hoverColor}
1488 onChange={(newBGColor) =>
1489 setAttributes({
1490 newsTickerArrowBgColor: {
1491 ...newsTickerArrowBgColor,
1492 hoverColor: newBGColor,
1493 },
1494 })
1495 }
1496 defaultColor={"#ffffff"}
1497 />
1498 </>
1499 )}
1500 <Border
1501 attributes={{
1502 border: newsTickerCarouselArrowBorder,
1503 borderWidth: carouselArrowBorderWidth,
1504 }}
1505 attributesKey={{
1506 border: "newsTickerCarouselArrowBorder",
1507 borderWidth: "carouselArrowBorderWidth",
1508 }}
1509 setAttributes={setAttributes}
1510 defaultColor={{ color: "#1A1B1C", hover: "#1A1B1C" }}
1511 />
1512 <Spacing
1513 label={__("Border Radius", "post-carousel")}
1514 attributes={newsTickerCarouselArrowBorderRadius}
1515 attributesKey={"newsTickerCarouselArrowBorderRadius"}
1516 setAttributes={setAttributes}
1517 units={["px", "%", "em"]}
1518 defaultValue={{
1519 unit: "%",
1520 value: {
1521 top: 5,
1522 right: 5,
1523 bottom: 5,
1524 left: 5,
1525 },
1526 }}
1527 indicator={"radius"}
1528 />
1529 </>
1530 );
1531 };
1532