| 1 |
<?php |
| 2 |
|
| 3 |
use ABlocks\Controls\Alignment; |
| 4 |
use ABlocks\Controls\GroupButton; |
| 5 |
use ABlocks\Controls\Dimensions; |
| 6 |
use ABlocks\Controls\Typography; |
| 7 |
use ABlocks\Controls\TextShadow; |
| 8 |
use ABlocks\Controls\TextStroke; |
| 9 |
use ABlocks\Controls\Border; |
| 10 |
use ABlocks\Controls\Range; |
| 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 |
'changedAttributes' => array( |
| 22 |
'type' => 'array', |
| 23 |
'default' => array(), |
| 24 |
), |
| 25 |
'device' => [ |
| 26 |
'type' => 'string', |
| 27 |
'default' => '', |
| 28 |
], |
| 29 |
'markerType' => [ |
| 30 |
'type' => 'string', |
| 31 |
'default' => 'Icon', |
| 32 |
], |
| 33 |
'shapeType' => [ |
| 34 |
'type' => 'string', |
| 35 |
'default' => 'dotted', |
| 36 |
], |
| 37 |
'shapeColor' => [ |
| 38 |
'type' => 'string', |
| 39 |
'default' => 'black', |
| 40 |
], |
| 41 |
'markerColor' => [ |
| 42 |
'type' => 'string', |
| 43 |
'default' => '', |
| 44 |
], |
| 45 |
'allowDivider' => [ |
| 46 |
'type' => 'boolean', |
| 47 |
'default' => false, |
| 48 |
], |
| 49 |
'isLastChild' => [ |
| 50 |
'type' => 'boolean', |
| 51 |
'default' => false, |
| 52 |
], |
| 53 |
'emoji' => [ |
| 54 |
'type' => 'string', |
| 55 |
'default' => '👍', |
| 56 |
], |
| 57 |
'advanceListItemText' => [ |
| 58 |
'type' => 'string', |
| 59 |
'source' => 'html', |
| 60 |
'selector' => '.ablocks-advance-list-item-text', |
| 61 |
'default' => 'Task Checklist', |
| 62 |
], |
| 63 |
'advanceListItemTextTag' => [ |
| 64 |
'type' => 'string', |
| 65 |
'default' => 'p', |
| 66 |
], |
| 67 |
'dropCaps' => [ |
| 68 |
'type' => 'boolean', |
| 69 |
'default' => false, |
| 70 |
], |
| 71 |
'dropCapsTextColor' => [ |
| 72 |
'type' => 'string', |
| 73 |
'default' => '', |
| 74 |
], |
| 75 |
'advanceListItemTextSize' => [ |
| 76 |
'type' => 'string', |
| 77 |
'default' => 'md', |
| 78 |
], |
| 79 |
'textColor' => [ |
| 80 |
'type' => 'string', |
| 81 |
'default' => '', |
| 82 |
], |
| 83 |
// divider related attributes |
| 84 |
'dividerPatternUrl' => [ |
| 85 |
'type' => 'string', |
| 86 |
'default' => '', |
| 87 |
], |
| 88 |
'dividerType' => [ |
| 89 |
'type' => 'string', |
| 90 |
'default' => '', |
| 91 |
], |
| 92 |
'color' => [ |
| 93 |
'type' => 'string', |
| 94 |
'default' => '', |
| 95 |
], |
| 96 |
]; |
| 97 |
|
| 98 |
$attributes = array_merge( |
| 99 |
$attributes, |
| 100 |
Icon::get_attribute( 'icon', [ |
| 101 |
'className' => 'fas fa-check', |
| 102 |
'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', |
| 103 |
'viewBox' => '0 0 512 512', |
| 104 |
'size' => '20', |
| 105 |
'color' => '#000', |
| 106 |
] ), |
| 107 |
Alignment::get_attribute( 'iconAlignment', true, [ 'value' => 'row' ] ), |
| 108 |
Alignment::get_attribute( 'alignment', true, [ 'value' => '' ] ), |
| 109 |
GroupButton::get_attribute( 'listsDirection', true, [ |
| 110 |
'value' => 'column', |
| 111 |
] ), |
| 112 |
Typography::get_attribute( 'listTypography', true ), |
| 113 |
TextShadow::get_attribute( 'listTextShadow' ), |
| 114 |
TextStroke::get_attribute( 'listTextStroke', true ), |
| 115 |
Range::get_attribute( [ |
| 116 |
'attributeName' => 'markerSize', |
| 117 |
'attributeObjectKey' => 'value', |
| 118 |
'defaultValue' => 10, |
| 119 |
'hasUnit' => false, |
| 120 |
] ), |
| 121 |
Range::get_attribute( [ |
| 122 |
'attributeName' => 'innerGap', |
| 123 |
'attributeObjectKey' => 'value', |
| 124 |
'isResponsive' => true, |
| 125 |
'defaultValue' => 6, |
| 126 |
'hasUnit' => true, |
| 127 |
'unitDefaultValue' => 'px', |
| 128 |
] ), |
| 129 |
Range::get_attribute( [ |
| 130 |
'attributeName' => 'width', |
| 131 |
'attributeObjectKey' => 'value', |
| 132 |
'isResponsive' => true, |
| 133 |
'defaultValue' => null, |
| 134 |
'unitDefaultValue' => '%', |
| 135 |
'hasUnit' => false, |
| 136 |
] ), |
| 137 |
Range::get_attribute( [ |
| 138 |
'attributeName' => 'weight', |
| 139 |
'isResponsive' => false, |
| 140 |
'defaultValue' => null, |
| 141 |
] ), |
| 142 |
Range::get_attribute( [ |
| 143 |
'attributeName' => 'size', |
| 144 |
'isResponsive' => false, |
| 145 |
'defaultValue' => null, |
| 146 |
] ), |
| 147 |
Range::get_attribute( [ |
| 148 |
'attributeName' => 'shapeSize', |
| 149 |
'isResponsive' => true, |
| 150 |
'defaultValue' => 14, |
| 151 |
] ), |
| 152 |
); |
| 153 |
return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() ); |
| 154 |
|
| 155 |
|