| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
use ABlocks\Controls\Range; |
| 6 |
use ABlocks\Controls\BackgroundOverlay; |
| 7 |
use ABlocks\Components\ButtonGroup; |
| 8 |
use ABlocks\Controls\Link; |
| 9 |
|
| 10 |
$attributes = [ |
| 11 |
'block_id' => array( |
| 12 |
'type' => 'string', |
| 13 |
'default' => '' |
| 14 |
), |
| 15 |
'blockVersion' => array( |
| 16 |
'type' => 'number', |
| 17 |
'default' => '', |
| 18 |
), |
| 19 |
'className' => [ |
| 20 |
'type' => 'string', |
| 21 |
'default' => '', |
| 22 |
], |
| 23 |
'isRootContainer' => [ |
| 24 |
'type' => 'boolean', |
| 25 |
'default' => false, |
| 26 |
], |
| 27 |
'variationSelected' => [ |
| 28 |
'type' => 'boolean', |
| 29 |
'default' => false, |
| 30 |
], |
| 31 |
|
| 32 |
'direction' => [ |
| 33 |
'type' => 'string', |
| 34 |
'default' => 'column', |
| 35 |
], |
| 36 |
'directionTablet' => [ |
| 37 |
'type' => 'string', |
| 38 |
'default' => '', |
| 39 |
], |
| 40 |
'directionMobile' => [ |
| 41 |
'type' => 'string', |
| 42 |
'default' => '', |
| 43 |
], |
| 44 |
'justify' => [ |
| 45 |
'type' => 'string', |
| 46 |
'default' => '', |
| 47 |
], |
| 48 |
'justifyTablet' => [ |
| 49 |
'type' => 'string', |
| 50 |
'default' => '', |
| 51 |
], |
| 52 |
'justifyMobile' => [ |
| 53 |
'type' => 'string', |
| 54 |
'default' => '', |
| 55 |
], |
| 56 |
'align' => [ |
| 57 |
'type' => 'string', |
| 58 |
'default' => '', |
| 59 |
], |
| 60 |
'alignTablet' => [ |
| 61 |
'type' => 'string', |
| 62 |
'default' => '', |
| 63 |
], |
| 64 |
'alignMobile' => [ |
| 65 |
'type' => 'string', |
| 66 |
'default' => '', |
| 67 |
], |
| 68 |
'wrap' => [ |
| 69 |
'type' => 'string', |
| 70 |
'default' => '', |
| 71 |
], |
| 72 |
'wrapTablet' => [ |
| 73 |
'type' => 'string', |
| 74 |
'default' => '', |
| 75 |
], |
| 76 |
'wrapMobile' => [ |
| 77 |
'type' => 'string', |
| 78 |
'default' => '', |
| 79 |
], |
| 80 |
'layout' => [ |
| 81 |
'type' => 'string', |
| 82 |
'default' => '', |
| 83 |
], |
| 84 |
'htmlTag' => [ |
| 85 |
'type' => 'string', |
| 86 |
'default' => '', |
| 87 |
], |
| 88 |
|
| 89 |
// shape divider |
| 90 |
'shapeTop' => [ |
| 91 |
'type' => 'string', |
| 92 |
'default' => '', |
| 93 |
], |
| 94 |
'shapeBottom' => [ |
| 95 |
'type' => 'string', |
| 96 |
'default' => '', |
| 97 |
], |
| 98 |
'shapeTopColor' => [ |
| 99 |
'type' => 'string', |
| 100 |
'default' => '#61CE70', |
| 101 |
], |
| 102 |
'shapeBottomColor' => [ |
| 103 |
'type' => 'string', |
| 104 |
'default' => '#61CE70', |
| 105 |
], |
| 106 |
'bottomShapeBringToFront' => [ |
| 107 |
'type' => 'boolean', |
| 108 |
'default' => false, |
| 109 |
], |
| 110 |
'topShapeBringToFront' => [ |
| 111 |
'type' => 'boolean', |
| 112 |
'default' => false, |
| 113 |
], |
| 114 |
'topShapeFlip' => [ |
| 115 |
'type' => 'boolean', |
| 116 |
'default' => false, |
| 117 |
], |
| 118 |
'bottomShapeFlip' => [ |
| 119 |
'type' => 'boolean', |
| 120 |
'default' => false, |
| 121 |
], |
| 122 |
|
| 123 |
]; |
| 124 |
|
| 125 |
$columnGap = Range::get_attribute([ |
| 126 |
'attributeName' => 'gap', |
| 127 |
'attributeObjectKey' => 'columnGap', |
| 128 |
'isResponsive' => true, |
| 129 |
'defaultValue' => 0, |
| 130 |
'hasUnit' => true, |
| 131 |
'unitDefaultValue' => 'px', |
| 132 |
]); |
| 133 |
$rowGap = Range::get_attribute([ |
| 134 |
'attributeName' => 'gap', |
| 135 |
'attributeObjectKey' => 'rowGap', |
| 136 |
'isResponsive' => true, |
| 137 |
'defaultValue' => 0, |
| 138 |
'hasUnit' => true, |
| 139 |
'unitDefaultValue' => 'px', |
| 140 |
]); |
| 141 |
|
| 142 |
$attributes = array_merge( |
| 143 |
$attributes, |
| 144 |
[ |
| 145 |
'gap' => [ |
| 146 |
'type' => 'object', |
| 147 |
'default' => array_merge( $columnGap['gap']['default'], $rowGap['gap']['default'] ), |
| 148 |
] |
| 149 |
], |
| 150 |
ButtonGroup::get_attribute( 'containerWidthType', false, [ |
| 151 |
'value' => 'boxed', |
| 152 |
] ), |
| 153 |
ButtonGroup::get_attribute( 'overflow', false, [ |
| 154 |
'value' => 'visible', |
| 155 |
] ), |
| 156 |
ButtonGroup::get_attribute( 'dir', true, [ |
| 157 |
'value' => 'column', |
| 158 |
] ), |
| 159 |
ButtonGroup::get_attribute( 'justification', true, [ |
| 160 |
'value' => '', |
| 161 |
] ), |
| 162 |
ButtonGroup::get_attribute( 'alignment', true, [ |
| 163 |
'value' => '', |
| 164 |
] ), |
| 165 |
ButtonGroup::get_attribute( 'wrapping', true, [ |
| 166 |
'value' => '', |
| 167 |
] ), |
| 168 |
Range::get_attribute( [ |
| 169 |
'attributeName' => 'minimumHeight', |
| 170 |
'attributeObjectKey' => 'value', |
| 171 |
'isResponsive' => true, |
| 172 |
'defaultValue' => null, |
| 173 |
'hasUnit' => true, |
| 174 |
'unitDefaultValue' => 'px', |
| 175 |
] ), |
| 176 |
Range::get_attribute([ |
| 177 |
'attributeName' => 'containerWidth', |
| 178 |
'attributeObjectKey' => 'value', |
| 179 |
'isResponsive' => true, |
| 180 |
'defaultValue' => 100, |
| 181 |
'hasUnit' => true, |
| 182 |
'unitDefaultValue' => '%', |
| 183 |
]), |
| 184 |
Range::get_attribute([ |
| 185 |
'attributeName' => 'gridColumn', |
| 186 |
'attributeObjectKey' => 'value', |
| 187 |
'isResponsive' => true, |
| 188 |
'defaultValue' => 0, |
| 189 |
'defaultValueTablet' => 2, |
| 190 |
'defaultValueMobile' => 1, |
| 191 |
'hasUnit' => false, |
| 192 |
'unitDefaultValue' => '', |
| 193 |
]), |
| 194 |
Range::get_attribute([ |
| 195 |
'attributeName' => 'gridRow', |
| 196 |
'attributeObjectKey' => 'value', |
| 197 |
'isResponsive' => true, |
| 198 |
'defaultValue' => '', |
| 199 |
'hasUnit' => false, |
| 200 |
'unitDefaultValue' => '', |
| 201 |
]), |
| 202 |
Range::get_attribute([ |
| 203 |
'attributeName' => 'containerContentWidth', |
| 204 |
'attributeObjectKey' => 'value', |
| 205 |
'isResponsive' => true, |
| 206 |
'defaultValue' => '', |
| 207 |
'hasUnit' => true, |
| 208 |
'unitDefaultValue' => 'px', |
| 209 |
]), |
| 210 |
Range::get_attribute([ |
| 211 |
'attributeName' => 'shapeBottomHeight', |
| 212 |
'attributeObjectKey' => 'value', |
| 213 |
'isResponsive' => true, |
| 214 |
'defaultValue' => '100', |
| 215 |
'hasUnit' => true, |
| 216 |
'unitDefaultValue' => 'px', |
| 217 |
]), |
| 218 |
Range::get_attribute([ |
| 219 |
'attributeName' => 'shapeBottomWidth', |
| 220 |
'attributeObjectKey' => 'value', |
| 221 |
'isResponsive' => true, |
| 222 |
'defaultValue' => '100', |
| 223 |
'hasUnit' => true, |
| 224 |
'unitDefaultValue' => '%', |
| 225 |
]), |
| 226 |
Range::get_attribute([ |
| 227 |
'attributeName' => 'shapeTopHeight', |
| 228 |
'attributeObjectKey' => 'value', |
| 229 |
'isResponsive' => true, |
| 230 |
'defaultValue' => '100', |
| 231 |
'hasUnit' => true, |
| 232 |
'unitDefaultValue' => 'px', |
| 233 |
]), |
| 234 |
Range::get_attribute([ |
| 235 |
'attributeName' => 'shapeTopWidth', |
| 236 |
'attributeObjectKey' => 'value', |
| 237 |
'isResponsive' => true, |
| 238 |
'defaultValue' => '100', |
| 239 |
'hasUnit' => true, |
| 240 |
'unitDefaultValue' => '%', |
| 241 |
]), |
| 242 |
BackgroundOverlay::get_attribute( '_backgroundOverlay', true ), |
| 243 |
Link::get_attribute( 'link' ), |
| 244 |
); |
| 245 |
|
| 246 |
return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() ); |
| 247 |
|