SILENT KILLERPanel

Current Path: > home > codekrsu > > ameliagraphics.com > wp-content > plugins > essential-blocks > src > > blocks > text > src


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: /home/codekrsu//ameliagraphics.com/wp-content/plugins/essential-blocks/src//blocks/text/src

NameTypeSizeLast ModifiedActions
constants Directory - -
attributes.js File 2552 bytes August 27 2024 16:37:06.
edit.js File 3367 bytes August 27 2024 16:37:06.
example.js File 467 bytes August 27 2024 16:37:06.
icon.svg File 2589 bytes August 27 2024 16:37:06.
index.js File 644 bytes August 27 2024 16:37:06.
inspector.js File 8696 bytes September 03 2024 16:13:22.
save.js File 927 bytes August 27 2024 16:37:06.
style.js File 7732 bytes August 27 2024 16:37:06.
style.scss File 22 bytes August 27 2024 16:37:06.

Reading File: /home/codekrsu//ameliagraphics.com/wp-content/plugins/essential-blocks/src//blocks/text/src/edit.js

/**
 * WordPress dependencies
 */
import { __ } from "@wordpress/i18n";
import { useState, useEffect, memo } from "@wordpress/element";
import {
    BlockControls,
    AlignmentToolbar
} from "@wordpress/block-editor";

/**
 * Internal depencencies
 */

import Inspector from "./inspector";

/**
 * External depencencies
 */
import {
    DynamicInputValueHandler,
    BlockProps,
    withBlockContext
} from "@essential-blocks/controls";

import Style from "./style";
import defaultAttributes from './attributes'

function Edit(props) {
    const {
        attributes,
        setAttributes,
        isSelected,
    } = props;
    const {
        blockId,
        align,
        tagName,
        text,
        classHook,
        source
    } = attributes;


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

    const TagName = tagName

    return (
        <>
            {isSelected && (
                <>
                    <BlockControls>
                        <AlignmentToolbar
                            value={align}
                            onChange={(align) => setAttributes({ align })}
                            controls={["left", "center", "right"]}
                        />
                    </BlockControls>
                    <Inspector
                        attributes={attributes}
                        setAttributes={setAttributes}
                    />
                </>
            )}

            <BlockProps.Edit {...enhancedProps}>
                <div
                    className={`eb-parent-wrapper eb-parent-${blockId} ${classHook}`}
                >
                    <div
                        className={`eb-text-wrapper ${blockId}`}
                        data-id={blockId}
                    >
                        {source === 'custom' && (
                            <DynamicInputValueHandler
                                value={text}
                                tagName={tagName}
                                className="eb-text"
                                isSelected={true}
                                allowedFormats={[
                                    "core/bold",
                                    "core/italic",
                                    "core/link",
                                    "core/strikethrough",
                                    "core/underline",
                                    "core/text-color",
                                ]}
                                onChange={(text) =>
                                    setAttributes({ text })
                                }
                                placeholder={__('Type your text here')}
                                readOnly={true}
                            />
                        )}
                        {source && source !== 'custom' && (
                            <TagName className="eb-text">Please note that placeholder data is currently displayed in the editor. The actual data from "<strong>{source}</strong>" will be displayed on the front end.</TagName>
                        )}
                    </div>
                </div>
            </BlockProps.Edit>
        </>
    );
}
export default memo(withBlockContext(defaultAttributes)(Edit))

SILENT KILLER Tool