| 1 |
<?php |
| 2 |
|
| 3 |
use ABlocks\Controls\Alignment; |
| 4 |
use ABlocks\Controls\Dimensions; |
| 5 |
use ABlocks\Controls\Typography; |
| 6 |
use ABlocks\Controls\TextShadow; |
| 7 |
use ABlocks\Controls\TextStroke; |
| 8 |
use ABlocks\Controls\Border; |
| 9 |
use ABlocks\Controls\GroupButton; |
| 10 |
use ABlocks\Controls\Icon; |
| 11 |
use ABlocks\Controls\Range; |
| 12 |
|
| 13 |
if ( ! defined( 'ABSPATH' ) ) { |
| 14 |
exit; |
| 15 |
} |
| 16 |
|
| 17 |
$attributes = [ |
| 18 |
'block_id' => [ |
| 19 |
'type' => 'string', |
| 20 |
'default' => '', |
| 21 |
], |
| 22 |
'markerType' => [ |
| 23 |
'type' => 'string', |
| 24 |
'default' => 'Icon', |
| 25 |
], |
| 26 |
'shapeType' => [ |
| 27 |
'type' => 'string', |
| 28 |
'default' => 'dotted', |
| 29 |
], |
| 30 |
'shapeColor' => [ |
| 31 |
'type' => 'string', |
| 32 |
'default' => 'black', |
| 33 |
], |
| 34 |
'emoji' => [ |
| 35 |
'type' => 'string', |
| 36 |
'default' => '👍', |
| 37 |
], |
| 38 |
'allowDivider' => [ |
| 39 |
'type' => 'boolean', |
| 40 |
'default' => false, |
| 41 |
], |
| 42 |
// Text |
| 43 |
'advanceListItemTextTag' => [ |
| 44 |
'type' => 'string', |
| 45 |
'default' => 'p', |
| 46 |
], |
| 47 |
'dropCaps' => [ |
| 48 |
'type' => 'boolean', |
| 49 |
'default' => false, |
| 50 |
], |
| 51 |
'dropCapsTextColor' => [ |
| 52 |
'type' => 'string', |
| 53 |
'default' => '#0f2aff', |
| 54 |
], |
| 55 |
'advanceListItemTextSize' => [ |
| 56 |
'type' => 'string', |
| 57 |
'default' => 'md', |
| 58 |
], |
| 59 |
'textColor' => [ |
| 60 |
'type' => 'string', |
| 61 |
'default' => '#000000', |
| 62 |
], |
| 63 |
// divider related attributes |
| 64 |
'dividerPatternUrl' => [ |
| 65 |
'type' => 'string', |
| 66 |
'default' => 'solid', |
| 67 |
], |
| 68 |
'dividerType' => [ |
| 69 |
'type' => 'string', |
| 70 |
'default' => 'css-style', |
| 71 |
], |
| 72 |
'color' => [ |
| 73 |
'type' => 'string', |
| 74 |
'default' => 'black', |
| 75 |
], |
| 76 |
]; |
| 77 |
|
| 78 |
$attributes = array_merge( |
| 79 |
$attributes, |
| 80 |
Alignment::get_attribute( 'alignment', true, [ 'value' => 'start' ] ), |
| 81 |
Icon::get_attribute( 'icon', [ |
| 82 |
'className' => 'fas fa-check', |
| 83 |
'path' => 'M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z', |
| 84 |
'viewBox' => '0 0 512 512', |
| 85 |
'size' => '20', |
| 86 |
'color' => '#000', |
| 87 |
] ), |
| 88 |
Alignment::get_attribute( 'iconAlignment', true, [ 'value' => 'row' ] ), |
| 89 |
GroupButton::get_attribute( 'listsDirection', true, [ |
| 90 |
'value' => 'column', |
| 91 |
] ), |
| 92 |
Typography::get_attribute( 'listTypography', true ), |
| 93 |
TextShadow::get_attribute( 'listTextShadow' ), |
| 94 |
TextStroke::get_attribute( 'listTextStroke', true ), |
| 95 |
Range::get_attribute([ |
| 96 |
'attributeName' => 'columnGap', |
| 97 |
'attributeObjectKey' => 'value', |
| 98 |
'isResponsive' => true, |
| 99 |
'defaultValue' => 6, |
| 100 |
'hasUnit' => true, |
| 101 |
'unitDefaultValue' => 'px', |
| 102 |
]), |
| 103 |
Range::get_attribute([ |
| 104 |
'attributeName' => 'innerGap', |
| 105 |
'attributeObjectKey' => 'value', |
| 106 |
'isResponsive' => true, |
| 107 |
'defaultValue' => 6, |
| 108 |
'hasUnit' => true, |
| 109 |
'unitDefaultValue' => 'px', |
| 110 |
]), |
| 111 |
Range::get_attribute( [ |
| 112 |
'attributeName' => 'width', |
| 113 |
'attributeObjectKey' => 'value', |
| 114 |
'isResponsive' => true, |
| 115 |
'defaultValue' => 100, |
| 116 |
'unitDefaultValue' => '%', |
| 117 |
'hasUnit' => false, |
| 118 |
] ), |
| 119 |
Range::get_attribute( [ |
| 120 |
'attributeName' => 'weight', |
| 121 |
'isResponsive' => false, |
| 122 |
'defaultValue' => 4, |
| 123 |
] ), |
| 124 |
Range::get_attribute( [ |
| 125 |
'attributeName' => 'size', |
| 126 |
'isResponsive' => false, |
| 127 |
'defaultValue' => 20, |
| 128 |
] ), |
| 129 |
Range::get_attribute( [ |
| 130 |
'attributeName' => 'shapeSize', |
| 131 |
'isResponsive' => true, |
| 132 |
'defaultValue' => 14, |
| 133 |
] ), |
| 134 |
); |
| 135 |
return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() ); |
| 136 |
|
| 137 |
|