PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.13.0
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.13.0
2.13.0 2.13.1 2.12.0 2.11.1 2.11.0 2.10.0 2.9.0 2.7.4 2.7.5 2.7.6 2.7.7 2.8.0 2.8.1 2.9.1 trunk 1.0 1.0-beta1 1.0-beta2 1.0-beta3 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 All 80 releases
ablocks / includes / blocks / info-box / attributes.php

attributes.php in aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder 2.13.0, at includes/blocks/info-box/attributes.php

430 lines 10.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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\Link;
9 use ABlocks\Helper;
10 use ABlocks\Controls\Icon;
11 use ABlocks\Controls\Border;
12 use ABlocks\Controls\Range;
13 use ABlocks\Components\ButtonGroup;
14
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit;
17 }
18
19
20 $attributes = [
21 'block_id' => [
22 'type' => 'string',
23 'default' => '',
24 ],
25 'blockVersion' => array(
26 'type' => 'number',
27 'default' => '',
28 ),
29 'blockElements' => [
30 'type' => 'array',
31 'default' => [
32 [
33 'id' => 0,
34 'slug' => 'Heading',
35 ],
36 [
37 'id' => 1,
38 'slug' => 'Sub-Heading',
39 ],
40 [
41 'id' => 2,
42 'slug' => 'Description',
43 ],
44 [
45 'id' => 3,
46 'slug' => 'Rating',
47 ],
48 [
49 'id' => 4,
50 'slug' => 'Button',
51 ],
52 ]
53 ],
54 'des' => [
55 'type' => 'string',
56 'source' => 'html',
57 'selector' => '.ablocks-info-box-text',
58 'default' => 'Showcase details with style and precision! Customize captivating visuals and text for an engaging, attention-grabbing display!',
59 ],
60 'allowBadgeHover' => [
61 'type' => 'boolean',
62 'default' => false,
63 ],
64 'allowButtonHover' => [
65 'type' => 'boolean',
66 'default' => false,
67 ],
68 'allowBadge' => [
69 'type' => 'boolean',
70 'default' => false,
71 ],
72 'allowIcon' => [
73 'type' => 'boolean',
74 'default' => true,
75 ],
76 'allowHeading' => [
77 'type' => 'boolean',
78 'default' => true,
79 ],
80 'allowSubHeading' => [
81 'type' => 'boolean',
82 'default' => false,
83 ],
84 'allowDes' => [
85 'type' => 'boolean',
86 'default' => true,
87 ],
88 'allowRating' => [
89 'type' => 'boolean',
90 'default' => false,
91 ],
92 'allowButton' => [
93 'type' => 'boolean',
94 'default' => true,
95 ],
96 // badge starts
97 'badgeText' => [
98 'type' => 'string',
99 'default' => 'Featured',
100 ],
101 'badgeSize' => [
102 'type' => 'string',
103 'default' => 'xs',
104 ],
105 'badgeTextColor' => [
106 'type' => 'string',
107 'default' => '#13191B',
108 ],
109 'badgeTextColorH' => [
110 'type' => 'string',
111 'default' => '',
112 ],
113 'badgeBackground' => [
114 'type' => 'string',
115 'default' => '#DDDDDF',
116 ],
117 'badgeBackgroundH' => [
118 'type' => 'string',
119 'default' => '',
120 ],
121 'badgeTransition' => [
122 'type' => 'number',
123 'default' => '',
124 ],
125 // icon starts
126 'iconPrimaryColorH' => [
127 'type' => 'string',
128 'default' => '',
129 ],
130 'iconBackgroundColorH' => [
131 'type' => 'string',
132 'default' => '',
133 ],
134 'iconTransition' => [
135 'type' => 'number',
136 'default' => '',
137 ],
138 // Heading starts
139 'heading' => array(
140 'type' => 'string',
141 'source' => 'html',
142 'selector' => '.ablocks-info-box-heading',
143 'default' => 'Your Info Box Title',
144 ),
145 'headingTag' => array(
146 'type' => 'string',
147 'default' => 'h2',
148 ),
149 'headingTextColor' => array(
150 'type' => 'string',
151 'default' => '#13191B',
152 ),
153 'headingTextColorHover' => array(
154 'type' => 'string',
155 'default' => '',
156 ),
157 'headingTransition' => [
158 'type' => 'number',
159 'default' => '',
160 ],
161 // Sub Heading starts
162 'subHeading' => array(
163 'type' => 'string',
164 'source' => 'html',
165 'selector' => '.ablocks-info-box-sub-heading',
166 'default' => 'Your Info Box Sub Title',
167 ),
168 'subHeadingTag' => array(
169 'type' => 'string',
170 'default' => 'h3',
171 ),
172 'subHeadingTextColor' => array(
173 'type' => 'string',
174 'default' => '#13191B',
175 ),
176 'subHeadingTextColorHover' => array(
177 'type' => 'string',
178 'default' => '',
179 ),
180 'subHeadingTransition' => [
181 'type' => 'number',
182 'default' => '',
183 ],
184 // paragraph starts
185 'des' => [
186 'type' => 'string',
187 'source' => 'html',
188 'selector' => '.ablocks-info-box-text',
189 'default' => 'Showcase details with style and precision! Customize captivating visuals and text for an engaging, attention-grabbing display!',
190 ],
191 'desDropCaps' => [
192 'type' => 'boolean',
193 'default' => false,
194 ],
195 'desDropCapsTextColor' => [
196 'type' => 'string',
197 'default' => '#0f2aff',
198 ],
199 'desSize' => [
200 'type' => 'string',
201 'default' => 'sm',
202 ],
203 'desGraphSize' => [
204 'type' => 'string',
205 'default' => 'sm',
206 ],
207 'desTextColor' => [
208 'type' => 'string',
209 'default' => '#595959',
210 ],
211 'desTextColorHover' => [
212 'type' => 'string',
213 'default' => '',
214 ],
215 'desTransition' => [
216 'type' => 'number',
217 'default' => '',
218 ],
219 // Star Rating starts
220 'ratingScale' => [
221 'type' => 'number',
222 'default' => 5,
223 ],
224 'ratingColor' => [
225 'type' => 'string',
226 'default' => '#e99516',
227 ],
228 'ratingColorHover' => [
229 'type' => 'string',
230 'default' => '',
231 ],
232 'ratingUnmarkedColor' => [
233 'type' => 'string',
234 'default' => '#696969'
235 ],
236 'ratingTransition' => [
237 'type' => 'number',
238 'default' => '',
239 ],
240 'ratingUnmarkedColorHover' => [
241 'type' => 'string',
242 'default' => ''
243 ],
244 'ratingShowCount' => [
245 'type' => 'boolean',
246 'default' => true,
247 ],
248 'showRatingNumber' => [
249 'type' => 'boolean',
250 'default' => true,
251 ],
252 'showCount' => [
253 'type' => 'boolean',
254 'default' => true,
255 ],
256 'ratingNumberColor' => [
257 'type' => 'string',
258 'default' => '#000000',
259 ],
260 'ratingNumberPosition' => [
261 'type' => 'string',
262 'default' => 'right',
263 ],
264 // button starts
265 'btnText' => [
266 'type' => 'string',
267 'default' => 'Learn More',
268 ],
269 'btnSize' => [
270 'type' => 'string',
271 'default' => 'sm',
272 ],
273 'btnTextColor' => [
274 'type' => 'string',
275 'default' => '#FAFAFA',
276 ],
277 'btnTextColorH' => [
278 'type' => 'string',
279 'default' => '',
280 ],
281 'btnBackground' => [
282 'type' => 'string',
283 'default' => '#13191B',
284 ],
285 'btnBackgroundH' => [
286 'type' => 'string',
287 'default' => '',
288 ],
289 'btnTransition' => [
290 'type' => 'number',
291 'default' => '',
292 ],
293 'btnIconPosition' => [
294 'type' => 'string',
295 'default' => 'right',
296 ],
297 'btnIconSpace' => [
298 'type' => 'number',
299 'default' => 10,
300 ],
301 'btnShowIcon' => [
302 'type' => 'boolean',
303 'default' => true
304 ],
305 'stack' => [
306 'type' => 'string',
307 'default' => '',
308 ],
309 ];
310
311 $attributes = array_merge(
312 $attributes,
313 Alignment::get_attribute( 'alignment', true ),
314 ButtonGroup::get_attribute( 'iconPlacement', true, [
315 'value' => '',
316 ] ),
317 // badge starts
318 Border::get_attribute( 'badgeBorder', true ),
319 Dimensions::get_attribute( 'badgePadding', true ),
320 Typography::get_attribute( 'badgeTypography', true, [
321 'fontFamily' => 'Roboto',
322 'weight' => '400',
323 'fontSize' => '12',
324 ] ),
325 TextShadow::get_attribute( 'badgeTextShadow' ),
326 Alignment::get_attribute( 'badgePosition', true, [ 'value' => 'top-right' ] ),
327 Alignment::get_attribute( 'badgeAlignment', true, [ 'value' => 'center' ] ),
328 // icon starts
329 Icon::get_attribute('icon', [
330 'color' => '#000000',
331 'hasNoSelectorOrSource' => true
332 ] ),
333 Dimensions::get_attribute( 'iconMargin', true ),
334 Link::get_attribute( 'iconLink' ),
335 Alignment::get_attribute( 'iconAlignment', true ),
336 // heading starts
337 Typography::get_attribute( 'headingTypography', true, [
338 'fontFamily' => 'Roboto',
339 'weight' => '600',
340 'fontSize' => '28',
341 ]),
342 TextShadow::get_attribute( 'headingTextShadow' ),
343 TextStroke::get_attribute( 'headingTextStroke', true ),
344 Dimensions::get_attribute( 'headingMargin', true ),
345 // sub heading starts
346 Typography::get_attribute( 'subHeadingTypography', true, [
347 'fontFamily' => 'Roboto',
348 'weight' => '500',
349 'fontSize' => '20',
350 ]),
351 TextShadow::get_attribute( 'subHeadingTextShadow' ),
352 TextStroke::get_attribute( 'subHeadingTextStroke', true ),
353 Dimensions::get_attribute( 'subHeadingMargin', true ),
354 // paragraph starts
355 Typography::get_attribute( 'desTypography', true, [
356 'fontFamily' => 'Roboto',
357 'weight' => '400',
358 'fontSize' => '16',
359 ]),
360 TextShadow::get_attribute( 'desTextShadow' ),
361 TextStroke::get_attribute( 'desTextStroke', true ),
362 Dimensions::get_attribute( 'desMargin', true ),
363 // button starts
364 Icon::get_attribute('btnIcon', [
365 'size' => 20,
366 'color' => '#FAFAFA',
367 'path' => 'M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z',
368 'viewBox' => '0 0 448 512',
369 'className' => 'fas fa-arrow-right',
370 'hasNoSelectorOrSource' => true,
371 ] ),
372 Link::get_attribute( 'btnLink' ),
373 Border::get_attribute( 'btnBorder', true ),
374 Dimensions::get_attribute( 'btnPadding', true ),
375 Dimensions::get_attribute( 'btnMargin', true ),
376 Typography::get_attribute( 'btnTypography', true ),
377 TextShadow::get_attribute( 'btnTextShadow' ),
378 Alignment::get_attribute( 'btnAlignment', true, [ 'value' => 'center' ] ),
379 // star rating starts
380 Typography::get_attribute( 'ratingNumberTypography', true ),
381 Dimensions::get_attribute( 'ratingMargin', true ),
382 Icon::get_attribute( 'starIcon', [
383 'path' => 'M528.1 171.5L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6zM388.6 312.3l23.7 138.4L288 385.4l-124.3 65.3 23.7-138.4-100.6-98 139-20.2 62.2-126 62.2 126 139 20.2-100.6 98z',
384 'viewBox' => '0 0 576 512',
385 'className' => 'far fa-star',
386 'hasNoSelectorOrSource' => true,
387 ] ),
388 Range::get_attribute( [
389 'attributeName' => 'rating',
390 'isResponsive' => false,
391 'defaultValue' => 4,
392 ]),
393 Range::get_attribute( [
394 'attributeName' => 'spacing',
395 'attributeObjectKey' => 'value',
396 'isResponsive' => true,
397 'defaultValue' => 0,
398 'hasUnit' => true,
399 'unitDefaultValue' => 'px',
400 ] ),
401 Range::get_attribute( [
402 'attributeName' => 'ratingNumberGap',
403 'attributeObjectKey' => 'value',
404 'isResponsive' => true,
405 'defaultValue' => 0,
406 'hasUnit' => true,
407 'unitDefaultValue' => 'px',
408 ] ),
409 Range::get_attribute([
410 'attributeName' => 'iconGap',
411 'attributeObjectKey' => 'value',
412 'isResponsive' => true,
413 'defaultValue' => 16,
414 'hasUnit' => true,
415 'unitDefaultValue' => 'px',
416 ]),
417 Range::get_attribute([
418 'attributeName' => 'contentGap',
419 'attributeObjectKey' => 'value',
420 'isResponsive' => true,
421 'defaultValue' => 10,
422 'hasUnit' => true,
423 'unitDefaultValue' => 'px',
424 ]),
425 );
426
427 return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() );
428
429
430