| 1 |
<?php |
| 2 |
|
| 3 |
use ABlocks\Controls\Alignment; |
| 4 |
use ABlocks\Controls\Dimensions; |
| 5 |
use ABlocks\Controls\Typography; |
| 6 |
use ABlocks\Controls\Border; |
| 7 |
use ABlocks\Controls\Range; |
| 8 |
use ABlocks\Components\ButtonGroup; |
| 9 |
if ( ! defined( 'ABSPATH' ) ) { |
| 10 |
exit; |
| 11 |
} |
| 12 |
|
| 13 |
$attributes = [ |
| 14 |
'block_id' => [ |
| 15 |
'type' => 'string', |
| 16 |
'default' => '', |
| 17 |
], |
| 18 |
'blockVersion' => array( |
| 19 |
'type' => 'number', |
| 20 |
'default' => '', |
| 21 |
), |
| 22 |
'markerType' => [ |
| 23 |
'type' => 'string', |
| 24 |
'default' => 'icon', |
| 25 |
], |
| 26 |
'markerColor' => [ |
| 27 |
'type' => 'string', |
| 28 |
'default' => '' |
| 29 |
], |
| 30 |
'emoji' => [ |
| 31 |
'type' => 'string', |
| 32 |
'default' => '✍', |
| 33 |
], |
| 34 |
'iconColor' => [ |
| 35 |
'type' => 'string', |
| 36 |
'default' => '#000000', |
| 37 |
], |
| 38 |
'lists' => [ |
| 39 |
'type' => 'array', |
| 40 |
'default' => [ |
| 41 |
[ |
| 42 |
'id' => 0, |
| 43 |
'text' => '', |
| 44 |
'link' => [ |
| 45 |
'linkDestination' => '', |
| 46 |
'href' => '', |
| 47 |
'lightbox' => '', |
| 48 |
'linkTarget' => '', |
| 49 |
'rel' => '', |
| 50 |
'noFollow' => '', |
| 51 |
'keyValue' => '', |
| 52 |
'linkClass' => '', |
| 53 |
], |
| 54 |
'iconColor' => '', |
| 55 |
'textColor' => '', |
| 56 |
'makerColor' => '', |
| 57 |
'isOpen' => false, |
| 58 |
] |
| 59 |
] |
| 60 |
], |
| 61 |
'listIconsClasses' => [ |
| 62 |
'type' => 'array', |
| 63 |
'default' => [], |
| 64 |
], |
| 65 |
'listIcons' => [ |
| 66 |
'type' => 'array', |
| 67 |
'default' => [] |
| 68 |
], |
| 69 |
'iconType' => [ |
| 70 |
'type' => 'string', |
| 71 |
'default' => 'default', |
| 72 |
], |
| 73 |
'iconShape' => [ |
| 74 |
'type' => 'string', |
| 75 |
'default' => 'circle', |
| 76 |
], |
| 77 |
'iconBackground' => [ |
| 78 |
'type' => 'boolean', |
| 79 |
'default' => false, |
| 80 |
], |
| 81 |
'iconBackgroundColor' => [ |
| 82 |
'type' => 'string', |
| 83 |
'default' => '', |
| 84 |
], |
| 85 |
'textColor' => [ |
| 86 |
'type' => 'string', |
| 87 |
'default' => '#000000', |
| 88 |
], |
| 89 |
'belowItem' => [ |
| 90 |
'type' => 'number', |
| 91 |
'default' => 0, |
| 92 |
], |
| 93 |
'divider' => [ |
| 94 |
'type' => 'boolean', |
| 95 |
'default' => false, |
| 96 |
], |
| 97 |
'dividerPatternUrl' => [ |
| 98 |
'type' => 'string', |
| 99 |
'default' => 'solid', |
| 100 |
], |
| 101 |
'borderColor' => [ |
| 102 |
'type' => 'string', |
| 103 |
'default' => '#000000', |
| 104 |
], |
| 105 |
]; |
| 106 |
|
| 107 |
$attributes = array_merge( |
| 108 |
$attributes, |
| 109 |
Alignment::get_attribute( 'position', true, [ 'value' => 'center' ] ), |
| 110 |
Alignment::get_attribute( 'horizontalAlignment', true, [ 'value' => 'flex-start' ] ), |
| 111 |
Dimensions::get_attribute( 'padding', false ), |
| 112 |
Border::get_attribute( 'border', true ), |
| 113 |
Typography::get_attribute( 'typography', true ), |
| 114 |
ButtonGroup::get_attribute( 'verticalAlignment', false, [ |
| 115 |
'value' => 'flex-start', |
| 116 |
] ), |
| 117 |
ButtonGroup::get_attribute( 'stack', false, [ |
| 118 |
'value' => 'vertical', |
| 119 |
] ), |
| 120 |
Range::get_attribute([ |
| 121 |
'attributeName' => 'iconSize', |
| 122 |
'attributeObjectKey' => 'value', |
| 123 |
'isResponsive' => true, |
| 124 |
'defaultValue' => 20, |
| 125 |
'hasUnit' => true, |
| 126 |
'unitDefaultValue' => 'px', |
| 127 |
]), |
| 128 |
Range::get_attribute([ |
| 129 |
'attributeName' => 'markerSize', |
| 130 |
'attributeObjectKey' => 'value', |
| 131 |
'defaultValue' => 10, |
| 132 |
'defaultValueTablet' => 10, |
| 133 |
'defaultValueMobile' => 10, |
| 134 |
]), |
| 135 |
Range::get_attribute([ |
| 136 |
'attributeName' => 'textIndent', |
| 137 |
'attributeObjectKey' => 'value', |
| 138 |
'isResponsive' => true, |
| 139 |
'defaultValue' => 8, |
| 140 |
'defaultValueTablet' => 8, |
| 141 |
'defaultValueMobile' => 8, |
| 142 |
|
| 143 |
]), |
| 144 |
Range::get_attribute([ |
| 145 |
'attributeName' => 'spaceBetween', |
| 146 |
'attributeObjectKey' => 'value', |
| 147 |
'isResponsive' => true, |
| 148 |
'defaultValue' => 20, |
| 149 |
'defaultValueTablet' => 20, |
| 150 |
'defaultValueMobile' => 20, |
| 151 |
]), |
| 152 |
Range::get_attribute([ |
| 153 |
'attributeName' => 'width', |
| 154 |
'attributeObjectKey' => 'value', |
| 155 |
'isResponsive' => true, |
| 156 |
'defaultValue' => 100, |
| 157 |
'hasUnit' => true, |
| 158 |
'unitDefaultValue' => 'px', |
| 159 |
]), |
| 160 |
Range::get_attribute([ |
| 161 |
'attributeName' => 'weight', |
| 162 |
'attributeObjectKey' => 'value', |
| 163 |
'isResponsive' => true, |
| 164 |
'defaultValue' => 5, |
| 165 |
'hasUnit' => true, |
| 166 |
'unitDefaultValue' => 'px', |
| 167 |
]), |
| 168 |
); |
| 169 |
return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() ); |
| 170 |
|
| 171 |
|