HEX
Server: LiteSpeed
System: Linux server240.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
User: creaqbdc (8964)
PHP: 8.0.30
Disabled: NONE
Upload Files
File: //proc/self/cwd/wp-content/plugins/essential-blocks/src/blocks/lottie-animation/src/deprecated.js
/**
 * WordPress dependencies
 */
import { RichText } from "@wordpress/block-editor";
import {
    BlockProps
} from "@essential-blocks/controls";
import attributes from "./attributes";

const deprecated = [
    {
        attributes: { ...attributes },
        supports: {
            align: ["wide", "full"],
        },
        save: ({ attributes }) => {
            const {
                classHook,
                blockId,
                lottieSource,
                lottieURl,
                lottieJSON,
                speed,
                loop,
                playOn,
                loopCount,
                lottieTitle,
                enableTitle,
                lottieMediaTitle,
                lottieMediaCaption,
                captionType,
                reverse,
                delay,
                startSegment,
                endSegment,
                scrollBottomPoint,
                scrollTopPoint,
            } = attributes;

            if (!lottieURl) {
                return
            }

            //Settings
            const settings = {
                lottieURl,
                speed,
                loop,
                playOn,
                loopCount,
                reverse,
                delay,
                startSegment,
                endSegment,
                scrollBottomPoint,
                scrollTopPoint,
            }



            return (
                <BlockProps.Save attributes={attributes}>
                    <div className={`eb-parent-wrapper eb-parent-${blockId} ${classHook}`} >
                        <div className={`eb-lottie-animation-wrapper ${blockId}`}
                            data-id={blockId}
                            data-settings={JSON.stringify(settings)}
                        >
                            <canvas className="eb-lottie-animation"></canvas>

                            {enableTitle && (
                                <>
                                    {((captionType === 'file-caption' && lottieMediaCaption !== '') ||
                                        (captionType === 'file-title' && lottieMediaTitle !== '')) && (
                                            <p className="eb-lottie-animation-title">
                                                {captionType === 'file-caption' ? lottieMediaCaption : lottieMediaTitle}
                                            </p>
                                        )}
                                    {captionType === 'custom-caption' && lottieTitle?.length > 0 && (
                                        <RichText.Content
                                            tagName={'p'}
                                            className="eb-lottie-animation-title"
                                            value={lottieTitle}
                                        />
                                    )}
                                </>
                            )}
                        </div>
                    </div>
                </BlockProps.Save>
            );
        },
    },
];

export default deprecated;