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/save.js
import { RichText } from "@wordpress/block-editor";
import {
    BlockProps
} from "@essential-blocks/controls";

const Save = ({ attributes }) => {
    const {
        classHook,
        blockId,
        lottieSource,
        lottieURl,
        lottieJSON,
        speed,
        loop,
        playOn,
        loopCount,
        lottieTitle,
        enableTitle,
        lottieMediaTitle,
        lottieMediaCaption,
        captionType,
        reverse,
        delay,
        startSegment,
        endSegment,
        scrollBottomPoint,
        scrollTopPoint,
        version,
    } = attributes;

    if (!lottieURl) {
        return null;
    }

    // Settings object for the AnimationController
    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} ${version}`}
                    data-id={blockId}
                    data-settings={JSON.stringify(settings)}
                >
                    <div className="eb-lottie-animation"></div>

                    {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 Save;