View source
<?php
namespace Drupal\gridstack;
use Drupal\blazy\BlazyDefault;
class GridStackDefault extends BlazyDefault {
const LEVEL_ROOT = 0;
const LEVEL_ROOT_ITEM = 1;
const LEVEL_NESTED = 2;
const LEVEL_NESTED_ITEM = 3;
const ROOT = ':root';
const NESTED = ':nested';
const CONTAINER = 'Container';
const REGION = 'Region';
public static function commonSettings() {
return [
'gridnative' => FALSE,
'skin' => '',
];
}
public static function baseSettings() {
return [
'optionset' => 'default',
'vanilla' => FALSE,
] + self::commonSettings() + parent::baseSettings();
}
public static function imageSettings() {
return [
'background' => TRUE,
'category' => '',
'stamp' => '',
'stamp_index' => 0,
] + parent::imageSettings() + self::baseSettings();
}
public static function extendedSettings() {
return self::imageSettings() + parent::extendedSettings();
}
public static function viewFieldOptions() {
return [
'captions',
'layouts',
'images',
'links',
'titles',
'classes',
'overlays',
];
}
public static function fixedSettings() {
return [
'item_id' => 'box',
'nameshort' => 'gs',
'namespace' => 'gridstack',
'ratio' => '',
'blazy' => TRUE,
'lazy' => 'blazy',
];
}
public static function cleanUiSettings() {
return [
'debug' => FALSE,
'dev' => FALSE,
'framework' => '',
'no_classes' => FALSE,
'library' => '',
'optimized' => FALSE,
'html5_ac' => FALSE,
'gridstatic' => FALSE,
];
}
public static function uiSettings() {
return [
'animationless' => FALSE,
'editor_pos' => '',
'excludes' => '',
'fw_classes' => '',
'helpless' => FALSE,
'palettes' => '',
'palettes_pos' => '',
'skinless' => FALSE,
] + self::cleanUiSettings();
}
public static function styleSettings() {
return [
'responsive_image_style' => '',
'alpha' => '',
'opacity' => '',
'animations' => [],
'colors' => [],
'extras' => [],
];
}
public static function rangeElements() {
return [
'opacity',
'alpha',
];
}
public static function bgElements() {
return array_merge(self::rangeElements(), [
'rgba',
'bg',
]);
}
public static function textElements() {
return [
'text',
'a',
'a:hover',
'h2',
'h3',
];
}
public static function colorElements() {
return array_merge([
'rgba',
'bg',
], self::textElements());
}
public static function styleElements() {
return array_merge(self::bgElements(), self::textElements());
}
public static function regionSettings() {
return [
'attributes' => '',
'styles' => [],
'target_id' => '',
'wrapper' => '',
'wrapper_classes' => '',
'row_classes' => '',
'_fullwidth' => FALSE,
];
}
public static function layoutSettings() {
return [
'current_selection' => '',
'regions' => [],
'field_name' => '',
'gid' => '',
'metadata' => '',
'vid' => '',
'vm' => '',
] + self::commonSettings() + self::regionSettings();
}
public static function mainWrapperOptions() {
return [
'article' => 'Article',
'aside' => 'Aside',
'main' => 'Main',
'footer' => 'Footer',
'section' => 'Section',
];
}
public static function regionWrapperOptions() {
return self::mainWrapperOptions() + [
'figure' => 'Figure',
'header' => 'Header',
];
}
public static function htmlSettings() {
return [
'_lb' => FALSE,
'_lbux' => FALSE,
'_panels' => FALSE,
'_ipe' => FALSE,
'column' => 12,
'contentless' => FALSE,
'debug' => FALSE,
'ungridstack' => FALSE,
'id' => '',
'lightbox' => '',
'nested' => FALSE,
'rid' => NULL,
'root' => TRUE,
'_root' => 'grids',
'use_framework' => FALSE,
'use_js' => TRUE,
'use_inner' => TRUE,
'view_name' => '',
] + self::commonSettings() + self::imageSettings() + self::fixedSettings();
}
public static function breakpoints() {
return [
'xs' => 'xsmall',
'sm' => 'small',
'md' => 'medium',
'lg' => 'large',
'xl' => 'xlarge',
];
}
public static function regionId($id) {
return 'gridstack_' . $id;
}
public static function variantWrapperId($id) {
return 'gridstack-variant-wrapper-' . str_replace([
'_',
':',
], '-', $id);
}
public static function gid($id) {
return str_replace([
'-',
':',
], '_', $id);
}
public static function layoutId($id) {
return 'gridstack_' . $id;
}
public static function themeProperties() {
return [
'items',
'optionset',
'aside',
'bottom',
'preface',
'postscript',
'settings',
'content_attributes',
'wrapper_attributes',
];
}
}