| 1 |
<?php |
| 2 |
/** |
| 3 |
* Sureforms Config. |
| 4 |
* |
| 5 |
* @package Sureforms |
| 6 |
*/ |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
exit; // Exit if accessed directly. |
| 10 |
} |
| 11 |
|
| 12 |
if ( ! class_exists( 'Spec_Block_Config' ) ) { |
| 13 |
|
| 14 |
/** |
| 15 |
* Class Spec_Block_Config. |
| 16 |
*/ |
| 17 |
class Spec_Block_Config { |
| 18 |
|
| 19 |
/** |
| 20 |
* Block Attributes |
| 21 |
* |
| 22 |
* @var block_attributes |
| 23 |
*/ |
| 24 |
public static $block_attributes = null; |
| 25 |
|
| 26 |
/** |
| 27 |
* Block Assets |
| 28 |
* |
| 29 |
* @since 0.0.1 |
| 30 |
* @var block_attributes |
| 31 |
*/ |
| 32 |
public static $block_assets_css = null; |
| 33 |
|
| 34 |
/** |
| 35 |
* Block Assets |
| 36 |
* |
| 37 |
* @var block_attributes |
| 38 |
*/ |
| 39 |
public static $block_assets = null; |
| 40 |
|
| 41 |
/** |
| 42 |
* Get Widget List. |
| 43 |
* |
| 44 |
* @since 0.0.1 |
| 45 |
* |
| 46 |
* @return array The Widget List. |
| 47 |
*/ |
| 48 |
public static function get_block_attributes() { |
| 49 |
|
| 50 |
$image_attribute = self::generate_border_attribute( 'image' ); |
| 51 |
$overlay_attribute = self::generate_border_attribute( 'overlay' ); |
| 52 |
$icon_border_attribute = self::generate_border_attribute( 'icon' ); |
| 53 |
$high_light_border_attribute = self::generate_border_attribute( 'highLight' ); |
| 54 |
|
| 55 |
$image_base_attr = [ |
| 56 |
'height' => '', |
| 57 |
'width' => '', |
| 58 |
'widthTablet' => '', |
| 59 |
'heightTablet' => '', |
| 60 |
'widthMobile' => '', |
| 61 |
'heightMobile' => '', |
| 62 |
'layout' => 'default', |
| 63 |
// image. |
| 64 |
'imageTopMargin' => '', |
| 65 |
'imageRightMargin' => '', |
| 66 |
'imageLeftMargin' => '', |
| 67 |
'imageBottomMargin' => '', |
| 68 |
'imageTopMarginTablet' => '', |
| 69 |
'imageRightMarginTablet' => '', |
| 70 |
'imageLeftMarginTablet' => '', |
| 71 |
'imageBottomMarginTablet' => '', |
| 72 |
'imageTopMarginMobile' => '', |
| 73 |
'imageRightMarginMobile' => '', |
| 74 |
'imageLeftMarginMobile' => '', |
| 75 |
'imageBottomMarginMobile' => '', |
| 76 |
'imageMarginUnit' => 'px', |
| 77 |
'imageMarginUnitTablet' => 'px', |
| 78 |
'imageMarginUnitMobile' => 'px', |
| 79 |
'align' => '', |
| 80 |
'alignTablet' => '', |
| 81 |
'alignMobile' => '', |
| 82 |
// heading. |
| 83 |
'headingShowOn' => 'always', |
| 84 |
'headingLoadGoogleFonts' => false, |
| 85 |
'headingFontFamily' => 'Default', |
| 86 |
'headingFontWeight' => '', |
| 87 |
'headingFontStyle' => 'normal', |
| 88 |
'headingTransform' => '', |
| 89 |
'headingFontSize' => '', |
| 90 |
'headingColor' => '#fff', |
| 91 |
'headingTransform' => '', |
| 92 |
'headingDecoration' => '', |
| 93 |
'headingFontSizeType' => 'px', |
| 94 |
'headingFontSizeTypeTablet' => 'px', |
| 95 |
'headingFontSizeTypeMobile' => 'px', |
| 96 |
'headingFontSizeMobile' => '', |
| 97 |
'headingFontSizeTablet' => '', |
| 98 |
'headingLineHeight' => 'em', |
| 99 |
'headingLineHeightType' => 'em', |
| 100 |
'headingLineHeightMobile' => '', |
| 101 |
'headingLineHeightTablet' => '', |
| 102 |
'headingTopMargin' => '', |
| 103 |
'headingRightMargin' => '', |
| 104 |
'headingLeftMargin' => '', |
| 105 |
'headingBottomMargin' => '', |
| 106 |
'headingTopMarginTablet' => '', |
| 107 |
'headingRightMarginTablet' => '', |
| 108 |
'headingLeftMarginTablet' => '', |
| 109 |
'headingBottomMarginTablet' => '', |
| 110 |
'headingTopMarginMobile' => '', |
| 111 |
'headingRightMarginMobile' => '', |
| 112 |
'headingLeftMarginMobile' => '', |
| 113 |
'headingBottomMarginMobile' => '', |
| 114 |
'headingMarginUnit' => 'px', |
| 115 |
'headingMarginUnitTablet' => 'px', |
| 116 |
'headingMarginUnitMobile' => 'px', |
| 117 |
// overlay. |
| 118 |
'overlayOpacity' => 0.2, |
| 119 |
'overlayHoverOpacity' => 1, |
| 120 |
'overlayPositionFromEdge' => 15, |
| 121 |
'overlayPositionFromEdgeUnit' => 'px', |
| 122 |
'overlayBackground' => '', |
| 123 |
// caption. |
| 124 |
'captionShowOn' => 'hover', |
| 125 |
'captionAlign' => 'center', |
| 126 |
'captionColor' => '', |
| 127 |
'captionLoadGoogleFonts' => false, |
| 128 |
'captionFontFamily' => '', |
| 129 |
'captionFontStyle' => 'normal', |
| 130 |
'captionTransform' => '', |
| 131 |
'captionDecoration' => '', |
| 132 |
'captionFontSizeType' => 'px', |
| 133 |
'captionFontSizeTypeTablet' => 'px', |
| 134 |
'captionFontSizeTypeMobile' => 'px', |
| 135 |
'captionLineHeightType' => 'em', |
| 136 |
'captionFontSize' => '', |
| 137 |
'captionFontWeight' => '', |
| 138 |
'captionFontSizeTablet' => '', |
| 139 |
'captionFontSizeMobile' => '', |
| 140 |
'captionLineHeight' => '', |
| 141 |
'captionLineHeightTablet' => '', |
| 142 |
'captionLineHeightMobile' => '', |
| 143 |
'captionTopMargin' => '', |
| 144 |
'captionRightMargin' => '', |
| 145 |
'captionLeftMargin' => '', |
| 146 |
'captionBottomMargin' => '', |
| 147 |
'captionTopMarginTablet' => '', |
| 148 |
'captionRightMarginTablet' => '', |
| 149 |
'captionLeftMarginTablet' => '', |
| 150 |
'captionBottomMarginTablet' => '', |
| 151 |
'captionTopMarginMobile' => '', |
| 152 |
'captionRightMarginMobile' => '', |
| 153 |
'captionLeftMarginMobile' => '', |
| 154 |
'captionBottomMarginMobile' => '', |
| 155 |
'captionMarginUnit' => 'px', |
| 156 |
'captionMarginUnitTablet' => 'px', |
| 157 |
'captionMarginUnitMobile' => 'px', |
| 158 |
// separator. |
| 159 |
'separatorShowOn' => 'hover', |
| 160 |
'separatorStyle' => '', |
| 161 |
'separatorColor' => '#fff', |
| 162 |
'separatorWidth' => 30, |
| 163 |
'separatorWidthType' => '%', |
| 164 |
'separatorThickness' => 2, |
| 165 |
'separatorThicknessUnit' => 'px', |
| 166 |
'separatorTopMargin' => '', |
| 167 |
'separatorRightMargin' => '', |
| 168 |
'separatorLeftMargin' => '', |
| 169 |
'separatorBottomMargin' => '', |
| 170 |
'separatorTopMarginTablet' => '', |
| 171 |
'separatorRightMarginTablet' => '', |
| 172 |
'separatorLeftMarginTablet' => '', |
| 173 |
'separatorBottomMarginTablet' => '', |
| 174 |
'separatorTopMarginMobile' => '', |
| 175 |
'separatorRightMarginMobile' => '', |
| 176 |
'separatorLeftMarginMobile' => '', |
| 177 |
'separatorBottomMarginMobile' => '', |
| 178 |
'separatorMarginUnit' => 'px', |
| 179 |
'separatorMarginUnitTablet' => 'px', |
| 180 |
'separatorMarginUnitMobile' => 'px', |
| 181 |
// image shadow. |
| 182 |
'useSeparateBoxShadows' => true, |
| 183 |
'imageBoxShadowColor' => '#00000070', |
| 184 |
'imageBoxShadowHOffset' => 0, |
| 185 |
'imageBoxShadowVOffset' => 0, |
| 186 |
'imageBoxShadowBlur' => '', |
| 187 |
'imageBoxShadowSpread' => '', |
| 188 |
'imageBoxShadowPosition' => 'outset', |
| 189 |
'imageBoxShadowColorHover' => '', |
| 190 |
'imageBoxShadowHOffsetHover' => 0, |
| 191 |
'imageBoxShadowVOffsetHover' => 0, |
| 192 |
'imageBoxShadowBlurHover' => '', |
| 193 |
'imageBoxShadowSpreadHover' => '', |
| 194 |
'imageBoxShadowPositionHover' => 'outset', |
| 195 |
// mask. |
| 196 |
'maskShape' => 'none', |
| 197 |
'maskSize' => 'auto', |
| 198 |
'maskPosition' => 'center center', |
| 199 |
'maskRepeat' => 'no-repeat', |
| 200 |
'objectFit' => '', |
| 201 |
'objectFitTablet' => '', |
| 202 |
'objectFitMobile' => '', |
| 203 |
'headingLetterSpacing' => '', |
| 204 |
'headingLetterSpacingTablet' => '', |
| 205 |
'headingLetterSpacingMobile' => '', |
| 206 |
'headingLetterSpacingType' => 'px', |
| 207 |
'captionLetterSpacing' => '', |
| 208 |
'captionLetterSpacingTablet' => '', |
| 209 |
'captionLetterSpacingMobile' => '', |
| 210 |
'captionLetterSpacingType' => 'px', |
| 211 |
'customHeightSetDesktop' => false, |
| 212 |
'customHeightSetTablet' => false, |
| 213 |
'customHeightSetMobile' => false, |
| 214 |
// For Global Block Styles. |
| 215 |
'globalBlockStyleName' => '', |
| 216 |
'globalBlockStyleId' => '', |
| 217 |
]; |
| 218 |
|
| 219 |
$icon_base_attr = [ |
| 220 |
// Size. |
| 221 |
'icon' => '', |
| 222 |
'iconSize' => 40, |
| 223 |
'iconSizeTablet' => '', |
| 224 |
'iconSizeMobile' => '', |
| 225 |
'iconSizeUnit' => 'px', |
| 226 |
// Alignment. |
| 227 |
'align' => 'center', |
| 228 |
'alignTablet' => '', |
| 229 |
'alignMobile' => '', |
| 230 |
// Rotation. |
| 231 |
'rotation' => 0, |
| 232 |
'rotationUnit' => 'deg', |
| 233 |
// StyleSettings. |
| 234 |
'iconView' => 'none', |
| 235 |
'iconBorderWidth' => 3, |
| 236 |
// Color. |
| 237 |
'iconColor' => '#333', |
| 238 |
'iconBorderColor' => '', |
| 239 |
'iconBackgroundColorType' => 'classic', |
| 240 |
'iconBackgroundColor' => '', |
| 241 |
'iconBackgroundGradientColor' => 'linear-gradient(90deg, rgb(155, 81, 224) 0%, rgb(6, 147, 227) 100%)', |
| 242 |
'iconHoverColor' => '', |
| 243 |
'iconHoverBorderColor' => '', |
| 244 |
'iconHoverBackgroundColorType' => 'classic', |
| 245 |
'iconHoverBackgroundColor' => '', |
| 246 |
'iconHoverBackgroundGradientColor' => 'linear-gradient(90deg, rgb(155, 81, 224) 0%, rgb(6, 147, 227) 100%)', |
| 247 |
// Padding. |
| 248 |
'iconTopPadding' => 5, |
| 249 |
'iconRightPadding' => 5, |
| 250 |
'iconBottomPadding' => 5, |
| 251 |
'iconLeftPadding' => 5, |
| 252 |
'iconTopTabletPadding' => '', |
| 253 |
'iconRightTabletPadding' => '', |
| 254 |
'iconBottomTabletPadding' => '', |
| 255 |
'iconLeftTabletPadding' => '', |
| 256 |
'iconTopMobilePadding' => '', |
| 257 |
'iconRightMobilePadding' => '', |
| 258 |
'iconBottomMobilePadding' => '', |
| 259 |
'iconLeftMobilePadding' => '', |
| 260 |
'iconPaddingUnit' => 'px', |
| 261 |
'iconMobilePaddingUnit' => 'px', |
| 262 |
'iconTabletPaddingUnit' => 'px', |
| 263 |
// Margin. |
| 264 |
'iconTopMargin' => '', |
| 265 |
'iconRightMargin' => '', |
| 266 |
'iconBottomMargin' => '', |
| 267 |
'iconLeftMargin' => '', |
| 268 |
'iconTopTabletMargin' => '', |
| 269 |
'iconRightTabletMargin' => '', |
| 270 |
'iconBottomTabletMargin' => '', |
| 271 |
'iconLeftTabletMargin' => '', |
| 272 |
'iconTopMobileMargin' => '', |
| 273 |
'iconRightMobileMargin' => '', |
| 274 |
'iconBottomMobileMargin' => '', |
| 275 |
'iconLeftMobileMargin' => '', |
| 276 |
'iconMarginUnit' => 'px', |
| 277 |
'iconMobileMarginUnit' => 'px', |
| 278 |
'iconTabletMarginUnit' => 'px', |
| 279 |
// Shadow. |
| 280 |
'iconShadowColor' => '#00000070', |
| 281 |
'iconShadowHOffset' => 0, |
| 282 |
'iconShadowVOffset' => 0, |
| 283 |
'iconShadowBlur' => 0, |
| 284 |
// Box Shadow. |
| 285 |
'useSeparateBoxShadows' => true, |
| 286 |
'iconBoxShadowColor' => '#00000070', |
| 287 |
'iconBoxShadowHOffset' => 0, |
| 288 |
'iconBoxShadowVOffset' => 0, |
| 289 |
'iconBoxShadowBlur' => '', |
| 290 |
'iconBoxShadowSpread' => '', |
| 291 |
'iconBoxShadowPosition' => '', |
| 292 |
'iconBoxShadowColorHover' => '', |
| 293 |
'iconBoxShadowHOffsetHover' => 0, |
| 294 |
'iconBoxShadowVOffsetHover' => 0, |
| 295 |
'iconBoxShadowBlurHover' => '', |
| 296 |
'iconBoxShadowSpreadHover' => '', |
| 297 |
'iconBoxShadowPositionHover' => '', |
| 298 |
// Border. |
| 299 |
'iconBorderStyle' => 'default', |
| 300 |
// For Global Block Styles. |
| 301 |
'globalBlockStyleName' => '', |
| 302 |
'globalBlockStyleId' => '', |
| 303 |
]; |
| 304 |
|
| 305 |
$heading_base_attr = [ |
| 306 |
'classMigrate' => false, |
| 307 |
'blockBackground' => '', |
| 308 |
'blockBackgroundType' => 'classic', |
| 309 |
'blockGradientBackground' => 'linear-gradient(90deg, rgb(6, 147, 227) 0%, rgb(155, 81, 224) 100%)', |
| 310 |
'headingAlign' => '', |
| 311 |
'headingAlignTablet' => '', |
| 312 |
'headingDescPosition' => 'below-heading', |
| 313 |
'separatorPosition' => 'below-heading', |
| 314 |
'headingAlignMobile' => '', |
| 315 |
'headingColor' => '#000', |
| 316 |
'headingColorType' => 'classic', |
| 317 |
'headingGradientColor' => 'linear-gradient(90deg, rgb(155, 81, 224) 0%, rgb(6, 147, 227) 100%)', |
| 318 |
'subHeadingColor' => '#000', |
| 319 |
'separatorHeightType' => 'px', |
| 320 |
'separatorSpaceType' => 'px', |
| 321 |
'separatorColor' => '#0170b9', |
| 322 |
'separatorStyle' => 'none', |
| 323 |
'separatorHeight' => 2, |
| 324 |
'separatorWidth' => 12, |
| 325 |
'separatorWidthTablet' => '', |
| 326 |
'separatorWidthMobile' => '', |
| 327 |
'separatorWidthType' => '%', |
| 328 |
'headFontFamily' => '', |
| 329 |
'headLoadGoogleFonts' => false, |
| 330 |
'headFontWeight' => '', |
| 331 |
'headFontStyle' => '', |
| 332 |
'headFontSize' => '', |
| 333 |
'headFontSizeType' => 'px', |
| 334 |
'headFontSizeTypeTablet' => 'px', |
| 335 |
'headFontSizeTypeMobile' => 'px', |
| 336 |
'headFontSizeTablet' => '', |
| 337 |
'headFontSizeMobile' => '', |
| 338 |
'headSpaceType' => 'px', |
| 339 |
'headLineHeight' => '', |
| 340 |
'headLineHeightType' => 'em', |
| 341 |
'headLineHeightTablet' => '', |
| 342 |
'headLineHeightMobile' => '', |
| 343 |
'headLetterSpacing' => '', |
| 344 |
'headLetterSpacingTablet' => '', |
| 345 |
'headLetterSpacingMobile' => '', |
| 346 |
'headLetterSpacingType' => 'px', |
| 347 |
'headShadowColor' => '', |
| 348 |
'headShadowHOffset' => 0, |
| 349 |
'headShadowVOffset' => 0, |
| 350 |
'headShadowBlur' => 10, |
| 351 |
'subHeadFontFamily' => '', |
| 352 |
'subHeadLoadGoogleFonts' => false, |
| 353 |
'subHeadFontWeight' => '', |
| 354 |
'subHeadFontStyle' => '', |
| 355 |
'subHeadFontSize' => '', |
| 356 |
'subHeadFontSizeType' => 'px', |
| 357 |
'subHeadFontSizeTypeTablet' => 'px', |
| 358 |
'subHeadFontSizeTypeMobile' => 'px', |
| 359 |
'subHeadFontSizeTablet' => '', |
| 360 |
'subHeadFontSizeMobile' => '', |
| 361 |
'subHeadLineHeight' => '', |
| 362 |
'subHeadLineHeightType' => 'em', |
| 363 |
'subHeadLineHeightTablet' => '', |
| 364 |
'subHeadLineHeightMobile' => '', |
| 365 |
'subHeadLetterSpacing' => '', |
| 366 |
'subHeadLetterSpacingTablet' => '', |
| 367 |
'subHeadLetterSpacingMobile' => '', |
| 368 |
'subHeadLetterSpacingType' => 'px', |
| 369 |
'headSpace' => 15, |
| 370 |
'headSpaceTablet' => '', |
| 371 |
'headSpaceMobile' => '', |
| 372 |
'separatorSpace' => 15, |
| 373 |
'separatorSpaceTablet' => '', |
| 374 |
'separatorSpaceMobile' => '', |
| 375 |
'separatorHoverColor' => '', |
| 376 |
'headTransform' => '', |
| 377 |
'headDecoration' => '', |
| 378 |
'subHeadTransform' => '', |
| 379 |
'subHeadDecoration' => '', |
| 380 |
// padding. |
| 381 |
'blockTopPadding' => '', |
| 382 |
'blockRightPadding' => '', |
| 383 |
'blockLeftPadding' => '', |
| 384 |
'blockBottomPadding' => '', |
| 385 |
'blockTopPaddingTablet' => '', |
| 386 |
'blockRightPaddingTablet' => '', |
| 387 |
'blockLeftPaddingTablet' => '', |
| 388 |
'blockBottomPaddingTablet' => '', |
| 389 |
'blockTopPaddingMobile' => '', |
| 390 |
'blockRightPaddingMobile' => '', |
| 391 |
'blockLeftPaddingMobile' => '', |
| 392 |
'blockBottomPaddingMobile' => '', |
| 393 |
'blockPaddingUnit' => 'px', |
| 394 |
'blockPaddingUnitTablet' => 'px', |
| 395 |
'blockPaddingUnitMobile' => 'px', |
| 396 |
'blockPaddingLink' => '', |
| 397 |
// margin. |
| 398 |
'blockTopMargin' => '', |
| 399 |
'blockRightMargin' => '', |
| 400 |
'blockLeftMargin' => '', |
| 401 |
'blockBottomMargin' => '', |
| 402 |
'blockTopMarginTablet' => '', |
| 403 |
'blockRightMarginTablet' => '', |
| 404 |
'blockLeftMarginTablet' => '', |
| 405 |
'blockBottomMarginTablet' => '', |
| 406 |
'blockTopMarginMobile' => '', |
| 407 |
'blockRightMarginMobile' => '', |
| 408 |
'blockLeftMarginMobile' => '', |
| 409 |
'blockBottomMarginMobile' => '', |
| 410 |
'blockMarginUnit' => 'px', |
| 411 |
'blockMarginUnitTablet' => 'px', |
| 412 |
'blockMarginUnitMobile' => 'px', |
| 413 |
'blockMarginLink' => '', |
| 414 |
// link. |
| 415 |
'linkColor' => '', |
| 416 |
'linkHColor' => '', |
| 417 |
// Highlight. |
| 418 |
'highLightColor' => '#fff', |
| 419 |
'highLightBackground' => '#007cba', |
| 420 |
'highLightLoadGoogleFonts' => false, |
| 421 |
'highLightFontFamily' => 'Default', |
| 422 |
'highLightFontWeight' => 'Default', |
| 423 |
'highLightFontStyle' => 'normal', |
| 424 |
'highLightTransform' => '', |
| 425 |
'highLightDecoration' => '', |
| 426 |
'highLightFontSizeType' => 'px', |
| 427 |
'highLightFontSizeTypeTablet' => 'px', |
| 428 |
'highLightFontSizeTypeMobile' => 'px', |
| 429 |
'highLightLineHeightType' => 'em', |
| 430 |
'highLightFontSize' => '', |
| 431 |
'highLightFontSizeTablet' => '', |
| 432 |
'highLightFontSizeMobile' => '', |
| 433 |
'highLightLineHeight' => '', |
| 434 |
'highLightLineHeightTablet' => '', |
| 435 |
'highLightLineHeightMobile' => '', |
| 436 |
'highLightLetterSpacing' => '', |
| 437 |
'highLightLetterSpacingTablet' => '', |
| 438 |
'highLightLetterSpacingMobile' => '', |
| 439 |
'highLightLetterSpacingType' => 'px', |
| 440 |
'highLightTopPadding' => '', |
| 441 |
'highLightRightPadding' => '', |
| 442 |
'highLightLeftPadding' => '', |
| 443 |
'highLightBottomPadding' => '', |
| 444 |
'highLightTopPaddingTablet' => '', |
| 445 |
'highLightRightPaddingTablet' => '', |
| 446 |
'highLightLeftPaddingTablet' => '', |
| 447 |
'highLightBottomPaddingTablet' => '', |
| 448 |
'highLightTopPaddingMobile' => '', |
| 449 |
'highLightRightPaddingMobile' => '', |
| 450 |
'highLightLeftPaddingMobile' => '', |
| 451 |
'highLightBottomPaddingMobile' => '', |
| 452 |
'highLightPaddingUnit' => 'px', |
| 453 |
'highLightPaddingUnitTablet' => 'px', |
| 454 |
'highLightPaddingUnitMobile' => 'px', |
| 455 |
'highLightPaddingLink' => '', |
| 456 |
'subHeadSpace' => 15, |
| 457 |
'subHeadSpaceMobile' => '', |
| 458 |
'subHeadSpaceTablet' => '', |
| 459 |
'subHeadSpaceType' => 'px', |
| 460 |
'headingDescToggle' => false, |
| 461 |
// For Global Block Styles. |
| 462 |
'globalBlockStyleName' => '', |
| 463 |
'globalBlockStyleId' => '', |
| 464 |
]; |
| 465 |
|
| 466 |
if ( null === self::$block_attributes ) { |
| 467 |
self::$block_attributes = [ |
| 468 |
'srfm/separator' => [ |
| 469 |
'slug' => '', |
| 470 |
'title' => __( 'Separator', 'sureforms' ), |
| 471 |
'description' => '', |
| 472 |
'default' => true, |
| 473 |
'attributes' => [ |
| 474 |
'separatorAlign' => 'center', |
| 475 |
'separatorAlignTablet' => 'center', |
| 476 |
'separatorAlignMobile' => 'center', |
| 477 |
'separatorStyle' => 'solid', |
| 478 |
'separatorBorderHeight' => 1, |
| 479 |
'separatorBorderHeightMobile' => 1, |
| 480 |
'separatorBorderHeightTablet' => 1, |
| 481 |
'separatorBorderHeightUnit' => 'px', |
| 482 |
'separatorWidth' => 100, |
| 483 |
'separatorWidthTablet' => 100, |
| 484 |
'separatorWidthMobile' => 100, |
| 485 |
'separatorWidthType' => '%', |
| 486 |
'separatorSize' => 5, |
| 487 |
'separatorSizeTablet' => 5, |
| 488 |
'separatorSizeMobile' => 5, |
| 489 |
'separatorSizeType' => 'px', |
| 490 |
'separatorHeight' => 10, |
| 491 |
'separatorHeightMobile' => 10, |
| 492 |
'separatorHeightTablet' => 10, |
| 493 |
'separatorHeightType' => 'px', |
| 494 |
'separatorColor' => '#000', |
| 495 |
'elementType' => 'none', |
| 496 |
'elementPosition' => 'center', |
| 497 |
'elementSpacing' => 15, |
| 498 |
'elementSpacingTablet' => 15, |
| 499 |
'elementSpacingMobile' => 15, |
| 500 |
'elementSpacingUnit' => 'px', |
| 501 |
'elementTextLoadGoogleFonts' => false, |
| 502 |
'elementTextFontFamily' => 'Default', |
| 503 |
'elementTextFontWeight' => '', |
| 504 |
'elementTextFontSize' => '', |
| 505 |
'elementTextFontSizeType' => 'px', |
| 506 |
'elementTextFontSizeTablet' => '', |
| 507 |
'elementTextFontSizeMobile' => '', |
| 508 |
'elementTextLineHeightType' => 'em', |
| 509 |
'elementTextLineHeight' => 1, |
| 510 |
'elementTextLineHeightTablet' => 1, |
| 511 |
'elementTextLineHeightMobile' => 1, |
| 512 |
'elementTextFontStyle' => 'normal', |
| 513 |
'elementTextLetterSpacing' => '', |
| 514 |
'elementTextLetterSpacingTablet' => '', |
| 515 |
'elementTextLetterSpacingMobile' => '', |
| 516 |
'elementTextLetterSpacingType' => 'px', |
| 517 |
'elementTextDecoration' => '', |
| 518 |
'elementTextTransform' => '', |
| 519 |
'elementColor' => '#000', |
| 520 |
'elementIconWidth' => '', |
| 521 |
'elementIconWidthTablet' => '', |
| 522 |
'elementIconWidthMobile' => '', |
| 523 |
'elementIconWidthType' => 'px', |
| 524 |
|
| 525 |
// Padding. |
| 526 |
'blockTopPadding' => '', |
| 527 |
'blockRightPadding' => '', |
| 528 |
'blockLeftPadding' => '', |
| 529 |
'blockBottomPadding' => '', |
| 530 |
'blockTopPaddingTablet' => '', |
| 531 |
'blockRightPaddingTablet' => '', |
| 532 |
'blockLeftPaddingTablet' => '', |
| 533 |
'blockBottomPaddingTablet' => '', |
| 534 |
'blockTopPaddingMobile' => '', |
| 535 |
'blockRightPaddingMobile' => '', |
| 536 |
'blockLeftPaddingMobile' => '', |
| 537 |
'blockBottomPaddingMobile' => '', |
| 538 |
'blockPaddingUnit' => 'px', |
| 539 |
'blockPaddingUnitTablet' => 'px', |
| 540 |
'blockPaddingUnitMobile' => 'px', |
| 541 |
|
| 542 |
// Margin. |
| 543 |
'blockTopMargin' => '', |
| 544 |
'blockRightMargin' => '', |
| 545 |
'blockLeftMargin' => '', |
| 546 |
'blockBottomMargin' => '', |
| 547 |
'blockTopMarginTablet' => '', |
| 548 |
'blockRightMarginTablet' => '', |
| 549 |
'blockLeftMarginTablet' => '', |
| 550 |
'blockBottomMarginTablet' => '', |
| 551 |
'blockTopMarginMobile' => '', |
| 552 |
'blockRightMarginMobile' => '', |
| 553 |
'blockLeftMarginMobile' => '', |
| 554 |
'blockBottomMarginMobile' => '', |
| 555 |
'blockMarginUnit' => 'px', |
| 556 |
'blockMarginUnitTablet' => 'px', |
| 557 |
'blockMarginUnitMobile' => 'px', |
| 558 |
], |
| 559 |
], |
| 560 |
'srfm/image' => [ |
| 561 |
'slug' => '', |
| 562 |
'title' => __( 'Image', 'sureforms' ), |
| 563 |
'description' => '', |
| 564 |
'default' => true, |
| 565 |
'attributes' => array_merge( |
| 566 |
$image_base_attr, |
| 567 |
$image_attribute, |
| 568 |
$overlay_attribute |
| 569 |
), |
| 570 |
], |
| 571 |
|
| 572 |
'srfm/icon' => [ |
| 573 |
'slug' => '', |
| 574 |
'title' => __( 'Icon', 'sureforms' ), |
| 575 |
'description' => '', |
| 576 |
'default' => true, |
| 577 |
'attributes' => array_merge( |
| 578 |
$icon_border_attribute, |
| 579 |
$icon_base_attr |
| 580 |
), |
| 581 |
], |
| 582 |
|
| 583 |
'srfm/advanced-heading' => [ |
| 584 |
'slug' => '', |
| 585 |
'title' => __( 'Heading', 'sureforms' ), |
| 586 |
'description' => '', |
| 587 |
'default' => true, |
| 588 |
'attributes' => array_merge( |
| 589 |
$high_light_border_attribute, |
| 590 |
$heading_base_attr |
| 591 |
), |
| 592 |
|
| 593 |
], |
| 594 |
|
| 595 |
]; |
| 596 |
} |
| 597 |
return apply_filters( 'srfm_gutenberg_blocks_attributes', self::$block_attributes ); |
| 598 |
} |
| 599 |
|
| 600 |
/** |
| 601 |
* Get Block Assets. |
| 602 |
* |
| 603 |
* @since 0.0.1 |
| 604 |
* |
| 605 |
* @return array The Asset List. |
| 606 |
*/ |
| 607 |
public static function get_block_assets() { |
| 608 |
|
| 609 |
if ( null === self::$block_assets ) { |
| 610 |
self::$block_assets = []; |
| 611 |
} |
| 612 |
|
| 613 |
return self::$block_assets; |
| 614 |
} |
| 615 |
|
| 616 |
|
| 617 |
/** |
| 618 |
* Get Block Assets. |
| 619 |
* |
| 620 |
* @since 0.0.1 |
| 621 |
* |
| 622 |
* @return array The Asset List. |
| 623 |
*/ |
| 624 |
public static function get_block_assets_css() { |
| 625 |
|
| 626 |
if ( null === self::$block_assets_css ) { |
| 627 |
self::$block_assets_css = [ |
| 628 |
'srfm/separator' => [ |
| 629 |
'name' => 'separator', |
| 630 |
], |
| 631 |
'srfm/image' => [ |
| 632 |
'name' => 'image', |
| 633 |
], |
| 634 |
'srfm/icon' => [ |
| 635 |
'name' => 'icon', |
| 636 |
], |
| 637 |
'srfm/advanced-heading' => [ |
| 638 |
'name' => 'advanced-heading', |
| 639 |
], |
| 640 |
|
| 641 |
]; |
| 642 |
} |
| 643 |
return self::$block_assets_css; |
| 644 |
} |
| 645 |
|
| 646 |
/** |
| 647 |
* Border attribute generation Function. |
| 648 |
* |
| 649 |
* @since 0.0.1 |
| 650 |
* @param array $prefix Attribute Prefix. |
| 651 |
* @return array |
| 652 |
*/ |
| 653 |
public static function generate_border_attribute( $prefix ) { |
| 654 |
$defaults = [ |
| 655 |
// Width. |
| 656 |
'borderTopWidth' => '', |
| 657 |
'borderRightWidth' => '', |
| 658 |
'borderBottomWidth' => '', |
| 659 |
'borderLeftWidth' => '', |
| 660 |
'borderTopWidthTablet' => '', |
| 661 |
'borderRightWidthTablet' => '', |
| 662 |
'borderBottomWidthTablet' => '', |
| 663 |
'borderLeftWidthTablet' => '', |
| 664 |
'borderTopWidthMobile' => '', |
| 665 |
'borderRightWidthMobile' => '', |
| 666 |
'borderBottomWidthMobile' => '', |
| 667 |
'borderLeftWidthMobile' => '', |
| 668 |
// Radius. |
| 669 |
'borderTopLeftRadius' => '', |
| 670 |
'borderTopRightRadius' => '', |
| 671 |
'borderBottomRightRadius' => '', |
| 672 |
'borderBottomLeftRadius' => '', |
| 673 |
'borderTopLeftRadiusTablet' => '', |
| 674 |
'borderTopRightRadiusTablet' => '', |
| 675 |
'borderBottomRightRadiusTablet' => '', |
| 676 |
'borderBottomLeftRadiusTablet' => '', |
| 677 |
'borderTopLeftRadiusMobile' => '', |
| 678 |
'borderTopRightRadiusMobile' => '', |
| 679 |
'borderBottomRightRadiusMobile' => '', |
| 680 |
'borderBottomLeftRadiusMobile' => '', |
| 681 |
// unit. |
| 682 |
'borderRadiusUnit' => 'px', |
| 683 |
'borderRadiusUnitTablet' => 'px', |
| 684 |
'borderRadiusUnitMobile' => 'px', |
| 685 |
// common. |
| 686 |
'borderStyle' => '', |
| 687 |
'borderColor' => '', |
| 688 |
'borderHColor' => '', |
| 689 |
|
| 690 |
]; |
| 691 |
|
| 692 |
$border_attr = []; |
| 693 |
|
| 694 |
$device = [ '', 'Tablet', 'Mobile' ]; |
| 695 |
|
| 696 |
foreach ( $device as $slug => $data ) { |
| 697 |
|
| 698 |
$border_attr[ "{$prefix}BorderTopWidth{$data}" ] = ''; |
| 699 |
$border_attr[ "{$prefix}BorderLeftWidth{$data}" ] = ''; |
| 700 |
$border_attr[ "{$prefix}BorderRightWidth{$data}" ] = ''; |
| 701 |
$border_attr[ "{$prefix}BorderBottomWidth{$data}" ] = ''; |
| 702 |
$border_attr[ "{$prefix}BorderTopLeftRadius{$data}" ] = ''; |
| 703 |
$border_attr[ "{$prefix}BorderTopRightRadius{$data}" ] = ''; |
| 704 |
$border_attr[ "{$prefix}BorderBottomLeftRadius{$data}" ] = ''; |
| 705 |
$border_attr[ "{$prefix}BorderBottomRightRadius{$data}" ] = ''; |
| 706 |
$border_attr[ "{$prefix}BorderRadiusUnit{$data}" ] = 'px'; |
| 707 |
} |
| 708 |
|
| 709 |
$border_attr[ "{$prefix}BorderStyle" ] = ''; |
| 710 |
$border_attr[ "{$prefix}BorderColor" ] = ''; |
| 711 |
$border_attr[ "{$prefix}BorderHColor" ] = ''; |
| 712 |
return $border_attr; |
| 713 |
} |
| 714 |
} |
| 715 |
} |
| 716 |
|