| 1 |
<?php |
| 2 |
|
| 3 |
if ( ! defined( 'ABSPATH' ) ) { |
| 4 |
exit; |
| 5 |
} |
| 6 |
use ABlocks\Controls\Alignment; |
| 7 |
use ABlocks\Classes\CssGenerator; |
| 8 |
use ABlocks\Controls\Typography; |
| 9 |
use ABlocks\Controls\TextShadow; |
| 10 |
use ABlocks\Controls\TextStroke; |
| 11 |
use ABlocks\Controls\Border; |
| 12 |
use ABlocks\Controls\Dimensions; |
| 13 |
use ABlocks\Controls\Range; |
| 14 |
use ABlocks\Controls\Icon; |
| 15 |
use ABlocks\Helper; |
| 16 |
$attributes = [ |
| 17 |
'block_id' => array( |
| 18 |
'type' => 'string', |
| 19 |
'default' => '', |
| 20 |
), |
| 21 |
'blockVersion' => array( |
| 22 |
'type' => 'number', |
| 23 |
'default' => '', |
| 24 |
), |
| 25 |
'allowMultiple' => [ |
| 26 |
'type' => 'boolean', |
| 27 |
'default' => false, |
| 28 |
], |
| 29 |
'enableFaqSchema' => [ |
| 30 |
'type' => 'boolean', |
| 31 |
'default' => false, |
| 32 |
], |
| 33 |
'initialOpen' => [ |
| 34 |
'type' => 'number', |
| 35 |
'default' => 1, |
| 36 |
], |
| 37 |
'iconColor' => [ |
| 38 |
'type' => 'string', |
| 39 |
'default' => '#000000', |
| 40 |
], |
| 41 |
'iconColorH' => [ |
| 42 |
'type' => 'string', |
| 43 |
'default' => '', |
| 44 |
], |
| 45 |
'iconActiveColor' => [ |
| 46 |
'type' => 'string', |
| 47 |
'default' => '', |
| 48 |
], |
| 49 |
'headerTextColor' => [ |
| 50 |
'type' => 'string', |
| 51 |
'default' => '#000000' |
| 52 |
], |
| 53 |
'headerTextColorH' => [ |
| 54 |
'type' => 'string', |
| 55 |
'default' => '', |
| 56 |
], |
| 57 |
'headerTextActiveColor' => [ |
| 58 |
'type' => 'string', |
| 59 |
'default' => '', |
| 60 |
], |
| 61 |
'bodyBackgroundH' => [ |
| 62 |
'type' => 'string', |
| 63 |
'default' => '', |
| 64 |
], |
| 65 |
'bodyBackground' => [ |
| 66 |
'type' => 'string', |
| 67 |
'default' => '#F9F9F9' |
| 68 |
], |
| 69 |
'headingTag' => [ |
| 70 |
'type' => 'string', |
| 71 |
'default' => 'p' |
| 72 |
], |
| 73 |
'iconPosition' => [ |
| 74 |
'type' => 'string', |
| 75 |
'default' => 'right' |
| 76 |
], |
| 77 |
'showIcon' => [ |
| 78 |
'type' => 'boolean', |
| 79 |
'default' => true |
| 80 |
], |
| 81 |
'headerBackgroundActiveColor' => [ |
| 82 |
'type' => 'string', |
| 83 |
'default' => '', |
| 84 |
], |
| 85 |
'headerBackgroundColorH' => [ |
| 86 |
'type' => 'string', |
| 87 |
'default' => '', |
| 88 |
], |
| 89 |
'headerBackgroundColor' => [ |
| 90 |
'type' => 'string', |
| 91 |
'default' => '#F9F9F9' |
| 92 |
], |
| 93 |
]; |
| 94 |
$attributes = array_merge( |
| 95 |
$attributes, |
| 96 |
Alignment::get_attribute( 'alignment', true, [ 'value' => 'center' ] ), |
| 97 |
Typography::get_attribute( 'headerTypography', true ), |
| 98 |
TextShadow::get_attribute( 'headerTextShadow' ), |
| 99 |
TextStroke::get_attribute( 'headerTextStroke', true ), |
| 100 |
Border::get_attribute( 'itemBorder', true ), |
| 101 |
Dimensions::get_attribute( 'headerPadding', true ), |
| 102 |
Dimensions::get_attribute( 'bodyPadding', true ), |
| 103 |
Border::get_attribute( 'headerBorder', true ), |
| 104 |
Icon::get_attribute( 'leftCloseIcon', [ |
| 105 |
'path' => 'M256 504c137 0 248-111 248-248S393 8 256 8 8 119 8 256s111 248 248 248zm0-448c110.5 0 200 89.5 200 200s-89.5 200-200 200S56 366.5 56 256 145.5 56 256 56zm20 328h-40c-6.6 0-12-5.4-12-12V256h-67c-10.7 0-16-12.9-8.5-20.5l99-99c4.7-4.7 12.3-4.7 17 0l99 99c7.6 7.6 2.2 20.5-8.5 20.5h-67v116c0 6.6-5.4 12-12 12z', |
| 106 |
'viewBox' => '0 0 512 512', |
| 107 |
'className' => 'far fa-arrow-alt-circle-up', |
| 108 |
'hasNoSelectorOrSource' => true, |
| 109 |
] ), |
| 110 |
Icon::get_attribute( 'leftActiveIcon', [ |
| 111 |
'path' => 'M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm-32-316v116h-67c-10.7 0-16 12.9-8.5 20.5l99 99c4.7 4.7 12.3 4.7 17 0l99-99c7.6-7.6 2.2-20.5-8.5-20.5h-67V140c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12z', |
| 112 |
'viewBox' => '0 0 512 512', |
| 113 |
'className' => 'far fa-arrow-alt-circle-down', |
| 114 |
'hasNoSelectorOrSource' => true, |
| 115 |
] ), |
| 116 |
Icon::get_attribute( 'rightCloseIcon', [ |
| 117 |
'path' => 'M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z', |
| 118 |
'viewBox' => '0 0 448 512', |
| 119 |
'className' => 'fas fa-plus', |
| 120 |
'hasNoSelectorOrSource' => true, |
| 121 |
] ), |
| 122 |
Icon::get_attribute( 'rightActiveIcon', [ |
| 123 |
'path' => 'M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z', |
| 124 |
'viewBox' => '0 0 448 512', |
| 125 |
'className' => 'fas fa-minus', |
| 126 |
'hasNoSelectorOrSource' => true, |
| 127 |
] ), |
| 128 |
Range::get_attribute( [ |
| 129 |
'attributeName' => 'itemSpace', |
| 130 |
'isResponsive' => false, |
| 131 |
'defaultValue' => 10, |
| 132 |
'attributeObjectKey' => 'value', |
| 133 |
'hasUnit' => false, |
| 134 |
'unitDefaultValue' => 'px', |
| 135 |
] ), |
| 136 |
Range::get_attribute([ |
| 137 |
'attributeName' => 'iconSize', |
| 138 |
'isResponsive' => false, |
| 139 |
'defaultValue' => 30, |
| 140 |
'attributeObjectKey' => 'value', |
| 141 |
]), |
| 142 |
Range::get_attribute([ |
| 143 |
'attributeName' => 'iconSpace', |
| 144 |
'isResponsive' => false, |
| 145 |
'defaultValue' => 10, |
| 146 |
'attributeObjectKey' => 'value', |
| 147 |
]), |
| 148 |
); |
| 149 |
return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() ); |
| 150 |
|
| 151 |
|