HEX
Server: Apache
System: Linux www 5.10.0-10-amd64 #1 SMP Debian 5.10.84-1 (2021-12-08) x86_64
User: root (0)
PHP: 8.2.1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals
Upload Files
File: /mnt/drbd/www/edenhouse/wp-content/plugins/essential-blocks/blocks/progress-bar/src/attributes.js
import { __ } from "@wordpress/i18n";

import * as typoPrefixs from "./constants/typographyConstants";
import {
    PROGRESSBAR_HEIGHT,
    PROGRESSBAR_WIDTH,
    PROGRESSBAR_SIZE,
    STROKE_WIDTH,
    BOX_HEIGHT,
    BOX_WIDTH,
    WRAPPER_MARGIN,
    TITLE_SPACE,
} from "./constants";

// import {
// 	generateTypographyAttributes,
// 	generateResponsiveRangeAttributes,
// 	generateDimensionsAttributes,
// } from "../../../util/helpers";

const {
    generateTypographyAttributes,
    generateResponsiveRangeAttributes,
    generateDimensionsAttributes,
} = window.EBControls;

const attributes = {
    resOption: {
        type: "string",
        default: "Desktop",
    },
    // blockId attribute for making unique className and other uniqueness ⬇
    blockId: {
        type: "string",
    },
    blockRoot: {
        type: "string",
        default: "essential_block",
    },
    // blockMeta is for keeping all the styles ⬇
    blockMeta: {
        type: "object",
    },
    // new attributes
    layout: {
        type: "string",
        default: "line",
    },
    wrapperAlign: {
        type: "string",
        default: "center",
    },
    title: {
        type: "string",
        default: __("Progress Bar", "essential-blocks"),
    },
    titleTag: {
        type: "string",
        default: "div",
    },
    progress: {
        type: "number",
        default: 50,
    },
    displayProgress: {
        type: "boolean",
        default: true,
    },
    animationDuration: {
        type: "number",
        default: 1500,
    },
    titleColor: {
        type: "string",
        default: "var(--eb-global-heading-color)",
    },
    counterColor: {
        type: "string",
        default: "var(--eb-global-heading-color)",
    },
    progressColor: {
        type: "string",
        default: "var(--eb-global-primary-color)",
    },
    isProgressGradient: {
        type: "boolean",
        default: false,
    },
    progressGradient: {
        type: "string",
    },
    showInline: {
        type: "boolean",
        default: false,
    },
    backgroundColor: {
        type: "string",
    },
    showStripe: {
        type: "boolean",
        default: false,
    },
    stripeAnimation: {
        type: "string",
        default: "none",
    },
    strokeColor: {
        type: "string",
        default: "var(--eb-global-background-color)",
    },
    prefix: {
        type: "string",
        default: __("Prefix", "essential-blocks"),
    },
    suffix: {
        type: "string",
        default: __("Postfix", "essential-blocks"),
    },
    prefixColor: {
        type: "string",
        default: "var(--eb-global-text-color)",
    },
    // typography attributes
    ...generateTypographyAttributes(Object.values(typoPrefixs)),
    // range controller
    ...generateResponsiveRangeAttributes(PROGRESSBAR_WIDTH),
    ...generateResponsiveRangeAttributes(PROGRESSBAR_HEIGHT, {
        defaultRange: 12,
        noUnits: true,
    }),
    ...generateResponsiveRangeAttributes(PROGRESSBAR_SIZE, {
        defaultRange: 200,
        noUnits: true,
    }),
    ...generateResponsiveRangeAttributes(STROKE_WIDTH, {
        defaultRange: 12,
        noUnits: true,
    }),
    ...generateResponsiveRangeAttributes(BOX_HEIGHT, {
        defaultRange: 200,
        noUnits: true,
    }),
    ...generateResponsiveRangeAttributes(BOX_WIDTH, {
        defaultRange: 140,
        noUnits: true,
    }),
    ...generateDimensionsAttributes(WRAPPER_MARGIN, {
        top: 0,
        right: 0,
        bottom: 25,
        left: 0,
        isLinked: false,
    }),
    ...generateDimensionsAttributes(TITLE_SPACE, {
        isLinked: false,
    }),
    // end new attributes
};

export default attributes;