| @@ -1,0 +1,110 @@ | ||
| 1 | +<?php | |
| 2 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 3 | + exit; | |
| 4 | +} | |
| 5 | +use ABlocks\Controls\Icon; | |
| 6 | +use ABlocks\Controls\Alignment; | |
| 7 | +use ABlocks\Controls\Border; | |
| 8 | +use ABlocks\Controls\Typography; | |
| 9 | +use ABlocks\Controls\TextShadow; | |
| 10 | +use ABlocks\Controls\TextStroke; | |
| 11 | +use ABlocks\Controls\Dimensions; | |
| 12 | +use ABlocks\Controls\Range; | |
| 13 | +use ABlocks\Components\ButtonGroup; | |
| 14 | +$attributes = [ | |
| 15 | + 'block_id' => [ | |
| 16 | + 'type' => 'string', | |
| 17 | + 'default' => '', | |
| 18 | + ], | |
| 19 | + 'blockVersion' => array( | |
| 20 | + 'type' => 'number', | |
| 21 | + 'default' => '', | |
| 22 | + ), | |
| 23 | + 'appearance' => [ | |
| 24 | + 'type' => 'string', | |
| 25 | + 'default' => 'icon', | |
| 26 | + | |
| 27 | + ], | |
| 28 | + 'buttonText' => [ | |
| 29 | + 'type' => 'string', | |
| 30 | + 'default' => 'Top', | |
| 31 | + ], | |
| 32 | + 'buttonTextColor' => [ | |
| 33 | + 'type' => 'string', | |
| 34 | + 'default' => '', | |
| 35 | + ], | |
| 36 | + 'buttonTextColorH' => [ | |
| 37 | + 'type' => 'string', | |
| 38 | + 'default' => '', | |
| 39 | + ], | |
| 40 | + 'buttonTextColorBg' => [ | |
| 41 | + 'type' => 'string', | |
| 42 | + 'default' => '', | |
| 43 | + ], | |
| 44 | + 'buttonTextColorBgH' => [ | |
| 45 | + 'type' => 'string', | |
| 46 | + 'default' => '', | |
| 47 | + ], | |
| 48 | + 'progressColor' => [ | |
| 49 | + 'type' => 'string', | |
| 50 | + 'default' => 'red', | |
| 51 | + ], | |
| 52 | + 'progressColorBg' => [ | |
| 53 | + 'type' => 'string', | |
| 54 | + 'default' => '#EEEEEE', | |
| 55 | + ], | |
| 56 | +]; | |
| 57 | + | |
| 58 | +$attributes = array_merge( | |
| 59 | + $attributes, | |
| 60 | + Range::get_attribute([ | |
| 61 | + 'attributeName' => 'strokeSize', | |
| 62 | + 'attributeObjectKey' => 'value', | |
| 63 | + 'isResponsive' => false, | |
| 64 | + 'defaultValue' => '3', | |
| 65 | + 'hasUnit' => false, | |
| 66 | + ]), | |
| 67 | + Range::get_attribute([ | |
| 68 | + 'attributeName' => 'positionBottom', | |
| 69 | + 'attributeObjectKey' => 'value', | |
| 70 | + 'isResponsive' => true, | |
| 71 | + 'defaultValue' => 20, | |
| 72 | + 'hasUnit' => false, | |
| 73 | + 'unitDefaultValue' => 'px', | |
| 74 | + ]), | |
| 75 | + Range::get_attribute([ | |
| 76 | + 'attributeName' => 'positionLeft', | |
| 77 | + 'attributeObjectKey' => 'value', | |
| 78 | + 'isResponsive' => true, | |
| 79 | + 'defaultValue' => 20, | |
| 80 | + 'hasUnit' => false, | |
| 81 | + 'unitDefaultValue' => 'px', | |
| 82 | + ]), | |
| 83 | + Range::get_attribute([ | |
| 84 | + 'attributeName' => 'positionRight', | |
| 85 | + 'attributeObjectKey' => 'value', | |
| 86 | + 'isResponsive' => true, | |
| 87 | + 'defaultValue' => 20, | |
| 88 | + 'hasUnit' => false, | |
| 89 | + 'unitDefaultValue' => 'px', | |
| 90 | + ]), | |
| 91 | + Icon::get_attribute( 'icon', [ | |
| 92 | + 'path' => 'M34.9 289.5l-22.2-22.2c-9.4-9.4-9.4-24.6 0-33.9L207 39c9.4-9.4 24.6-9.4 33.9 0l194.3 194.3c9.4 9.4 9.4 24.6 0 33.9L413 289.4c-9.5 9.5-25 9.3-34.3-.4L264 168.6V456c0 13.3-10.7 24-24 24h-32c-13.3 0-24-10.7-24-24V168.6L69.2 289.1c-9.3 9.8-24.8 10-34.3.4z', | |
| 93 | + 'viewBox' => '0 0 448 512', | |
| 94 | + 'className' => 'far fa-arrow-alt-circle-up', | |
| 95 | + 'size' => 40, | |
| 96 | + ]), | |
| 97 | + Alignment::get_attribute( 'alignment', true, [ 'value' => 'left' ] ), | |
| 98 | + Alignment::get_attribute( 'position', true ), | |
| 99 | + TextStroke::get_attribute( 'textStroke', true ), | |
| 100 | + Typography::get_attribute( 'typography', true ), | |
| 101 | + Border::get_attribute( 'border', true ), | |
| 102 | + TextShadow::get_attribute( 'textShadow' ), | |
| 103 | + Dimensions::get_attribute( 'padding', false ), | |
| 104 | + ButtonGroup::get_attribute( 'position', false ), | |
| 105 | + ButtonGroup::get_attribute( 'visibleControl', false, [ | |
| 106 | + 'value' => 'visible', | |
| 107 | + ]), | |
| 108 | +); | |
| 109 | + | |
| 110 | +return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() ); | |