| 1 |
<?php |
| 2 |
|
| 3 |
use ABlocks\Controls\Border; |
| 4 |
use ABlocks\Controls\Dimensions; |
| 5 |
use ABlocks\Controls\Alignment; |
| 6 |
use ABlocks\Controls\GroupButton; |
| 7 |
use ABlocks\Controls\Range; |
| 8 |
use ABlocks\Controls\Typography; |
| 9 |
use ABlocks\Controls\TextShadow; |
| 10 |
use ABlocks\Controls\TextStroke; |
| 11 |
use ABlocks\Controls\Icon; |
| 12 |
if ( ! defined( 'ABSPATH' ) ) { |
| 13 |
exit; |
| 14 |
} |
| 15 |
|
| 16 |
$attributes = [ |
| 17 |
'block_id' => [ |
| 18 |
'type' => 'string', |
| 19 |
'default' => '', |
| 20 |
], |
| 21 |
'blockVersion' => array( |
| 22 |
'type' => 'number', |
| 23 |
'default' => '', |
| 24 |
), |
| 25 |
'device' => [ |
| 26 |
'type' => 'string', |
| 27 |
'default' => '', |
| 28 |
], |
| 29 |
'columnGap' => [ |
| 30 |
'type' => 'object', |
| 31 |
'default' => [ |
| 32 |
'value' => 20, |
| 33 |
'valueTablet' => 20, |
| 34 |
'valueMobile' => 10, |
| 35 |
], |
| 36 |
], |
| 37 |
'allowIcon' => [ |
| 38 |
'type' => 'boolean', |
| 39 |
'default' => true, |
| 40 |
], |
| 41 |
'allowDescription' => [ |
| 42 |
'type' => 'boolean', |
| 43 |
'default' => true, |
| 44 |
], |
| 45 |
'allowDivider' => [ |
| 46 |
'type' => 'boolean', |
| 47 |
'default' => true, |
| 48 |
], |
| 49 |
'itemBackgroundH' => [ |
| 50 |
'type' => 'string', |
| 51 |
'default' => '', |
| 52 |
], |
| 53 |
'itemBackground' => [ |
| 54 |
'type' => 'string', |
| 55 |
'default' => '', |
| 56 |
], |
| 57 |
'transition' => [ |
| 58 |
'type' => 'number', |
| 59 |
'default' => '', |
| 60 |
], |
| 61 |
'titleTag' => [ |
| 62 |
'type' => 'string', |
| 63 |
'default' => 'p', |
| 64 |
], |
| 65 |
'titleColor' => [ |
| 66 |
'type' => 'string', |
| 67 |
'default' => '#13191B', |
| 68 |
], |
| 69 |
'descriptionTag' => [ |
| 70 |
'type' => 'string', |
| 71 |
'default' => 'p', |
| 72 |
], |
| 73 |
'descriptionColor' => [ |
| 74 |
'type' => 'string', |
| 75 |
'default' => '#595959', |
| 76 |
], |
| 77 |
// divider related attributes |
| 78 |
'placeDivider' => [ |
| 79 |
'type' => 'string', |
| 80 |
'default' => 'near title', |
| 81 |
], |
| 82 |
'dividerPatternUrl' => [ |
| 83 |
'type' => 'string', |
| 84 |
'default' => 'dashed', |
| 85 |
], |
| 86 |
'dividerType' => [ |
| 87 |
'type' => 'string', |
| 88 |
'default' => 'dashed', |
| 89 |
], |
| 90 |
'color' => [ |
| 91 |
'type' => 'string', |
| 92 |
'default' => '#000000', |
| 93 |
], |
| 94 |
'placePrice' => [ |
| 95 |
'type' => 'string', |
| 96 |
'default' => 'right', |
| 97 |
], |
| 98 |
'priceTag' => [ |
| 99 |
'type' => 'string', |
| 100 |
'default' => 'p', |
| 101 |
], |
| 102 |
'priceColor' => [ |
| 103 |
'type' => 'string', |
| 104 |
'default' => '#595959', |
| 105 |
], |
| 106 |
]; |
| 107 |
|
| 108 |
$attributes = array_merge( |
| 109 |
$attributes, |
| 110 |
Typography::get_attribute('titleTypography', true, [ |
| 111 |
'weight' => '600', |
| 112 |
]), |
| 113 |
TextShadow::get_attribute( 'titleTextShadow' ), |
| 114 |
TextStroke::get_attribute( 'titleTextStroke', true ), |
| 115 |
Typography::get_attribute( 'descriptionTypography', true ), |
| 116 |
TextShadow::get_attribute( 'descriptionTextShadow' ), |
| 117 |
TextStroke::get_attribute( 'descriptionTextStroke', true ), |
| 118 |
Typography::get_attribute( 'priceTypography', true ), |
| 119 |
TextShadow::get_attribute( 'priceTextShadow' ), |
| 120 |
TextStroke::get_attribute( 'priceTextStroke', true ), |
| 121 |
Icon::get_attribute( 'icon' ), |
| 122 |
Typography::get_attribute( 'elementTextTypography', true ), |
| 123 |
TextStroke::get_attribute( 'elementTextStroke', true ), |
| 124 |
Alignment::get_attribute( 'alignment', true, [ 'value' => 'flex-start' ] ), |
| 125 |
Alignment::get_attribute( 'titleAlignment', true, [ 'value' => 'left' ] ), |
| 126 |
Alignment::get_attribute( 'descriptionAlignment', true, [ 'value' => 'left' ] ), |
| 127 |
Alignment::get_attribute( 'priceAlignment', true, [ 'value' => 'left' ] ), |
| 128 |
GroupButton::get_attribute( 'itemsDirection', true, [ |
| 129 |
'value' => 'row' |
| 130 |
] ), |
| 131 |
Border::get_attribute( 'itemBorder', true ), |
| 132 |
Dimensions::get_attribute( 'itemPadding', true ), |
| 133 |
Range::get_attribute( [ |
| 134 |
'attributeName' => 'columnGap', |
| 135 |
'attributeObjectKey' => 'value', |
| 136 |
'isResponsive' => true, |
| 137 |
'defaultValue' => 20, |
| 138 |
'defaultValueTablet' => 20, |
| 139 |
'defaultValueMobile' => 10, |
| 140 |
'hasUnit' => true, |
| 141 |
'unitDefaultValue' => 'px', |
| 142 |
] ), |
| 143 |
Range::get_attribute( [ |
| 144 |
'attributeName' => 'width', |
| 145 |
'attributeObjectKey' => 'value', |
| 146 |
'isResponsive' => true, |
| 147 |
'defaultValue' => 100, |
| 148 |
'defaultValueMobile' => 100, |
| 149 |
'defaultValueTablet' => 100, |
| 150 |
'hasUnit' => false, |
| 151 |
] ), |
| 152 |
Range::get_attribute( [ |
| 153 |
'attributeName' => 'weight', |
| 154 |
'isResponsive' => false, |
| 155 |
'defaultValue' => 2, |
| 156 |
] ), |
| 157 |
Range::get_attribute( [ |
| 158 |
'attributeName' => 'size', |
| 159 |
'isResponsive' => false, |
| 160 |
'defaultValue' => 20, |
| 161 |
] ), |
| 162 |
Range::get_attribute( [ |
| 163 |
'attributeName' => 'gap', |
| 164 |
'attributeObjectKey' => 'value', |
| 165 |
'isResponsive' => true, |
| 166 |
'defaultValue' => 10, |
| 167 |
'defaultValueMobile' => 3, |
| 168 |
'defaultValueTablet' => 1, |
| 169 |
'hasUnit' => true, |
| 170 |
'unitDefaultValue' => 'px', |
| 171 |
] ), |
| 172 |
); |
| 173 |
|
| 174 |
return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() ); |
| 175 |
|
| 176 |
|