Plugin Tabs noticias

This commit is contained in:
root
2026-04-14 13:50:04 -06:00
parent 299099d006
commit 19d08e5694
2334 changed files with 628926 additions and 113 deletions

View File

@@ -0,0 +1,243 @@
import * as areoi from '../_components/Core.js';
import meta from './block.json';
const ALLOWED_BLOCKS = null;
const BLOCKS_TEMPLATE = null;
const NEW_TAB_REL = 'noreferrer noopener';
const blockIcon = <svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><rect fill="none" height="24" width="24"/><path d="M3,5v14h18V5H3z M8.33,17H5V7h3.33V17z M13.67,17h-3.33V7h3.33V17z M19,17h-3.33V7H19V17z"/></svg>;
areoi.blocks.registerBlockType( meta, {
icon: blockIcon,
edit: props => {
const {
attributes,
setAttributes,
className,
isSelected,
onReplace,
mergeBlocks,
clientId,
context
} = props;
const { block_id } = attributes;
if ( !block_id ) {
setAttributes( { block_id: clientId } );
}
const isFlex = context['areoi/isFlex']
const classes = [
'col',
attributes.vertical_align_xs,
attributes.vertical_align_sm,
attributes.vertical_align_md,
attributes.vertical_align_lg,
attributes.vertical_align_xl,
attributes.vertical_align_xxl,
attributes.col_xs,
attributes.col_sm,
attributes.col_md,
attributes.col_lg,
attributes.col_xl,
attributes.col_xxl,
attributes.order_xs,
attributes.order_sm,
attributes.order_md,
attributes.order_lg,
attributes.order_xl,
attributes.order_xxl,
attributes.offset_xs,
attributes.offset_sm,
attributes.offset_md,
attributes.offset_lg,
attributes.offset_xl,
attributes.offset_xxl,
attributes.utilities_bg,
attributes.utilities_text,
attributes.utilities_border,
];
const {
linkTarget,
rel,
text,
url,
url_title
} = attributes;
const onSetLinkRel = areoi.element.useCallback(
( value ) => {
setAttributes( { rel: value } );
},
[ setAttributes ]
);
const onToggleOpenInNewTab = areoi.element.useCallback(
( value ) => {
const newLinkTarget = value ? '_blank' : undefined;
let updatedRel = rel;
if ( newLinkTarget && ! rel ) {
updatedRel = NEW_TAB_REL;
} else if ( ! newLinkTarget && rel === NEW_TAB_REL ) {
updatedRel = undefined;
}
setAttributes( {
linkTarget: newLinkTarget,
rel: updatedRel,
} );
},
[ rel, setAttributes ]
);
const ref = areoi.element.useRef();
const richTextRef = areoi.element.useRef();
let classArr = areoi.helper.GetClassNameCol( areoi.helper.GetClassName( classes ), isFlex );
const blockProps = areoi.editor.useBlockProps( {
ref,
className: classArr,
style: { cssText: areoi.helper.GetStyles( attributes ) }
} );
function onChange( key, value ) {
setAttributes( { [key]: value } );
}
const tabDevice = ( tab ) => {
var append = ( tab.name == 'xs' ? '' : '-' + tab.name );
return (
<div>
{ areoi.DeviceLayout( areoi, attributes, onChange, tab ) }
{ !attributes['hide_' + tab.name] &&
<areoi.components.PanelBody title={ 'Settings (' + tab.title + ')' } initialOpen={ false }>
{
(!areoi_vars.is_grid || isFlex) &&
<>
<areoi.components.PanelRow className="areoi-panel-row">
<areoi.components.SelectControl
label="Vertical Align"
labelPosition="top"
help="Align column from top to bottom. This will be applied to all greater device sizes unless overridden."
value={ attributes['vertical_align_' + tab.name] }
options={ [
{ label: 'Default', value: null },
{ label: 'Start', value: 'align-self' + append + '-start' },
{ label: 'Center', value: 'align-self' + append + '-center' },
{ label: 'End', value: 'align-self' + append + '-end' },
] }
onChange={ ( value ) => onChange( 'vertical_align_' + tab.name, value ) }
/>
</areoi.components.PanelRow>
<areoi.components.PanelRow className="areoi-panel-row">
<areoi.components.SelectControl
label="Order"
labelPosition="top"
help="Use .order- classes for controlling the visual order of your content. These classes are responsive, so you can set the order by breakpoint (e.g., .order-1.order-md-2). Includes support for 1 through 5 across all six grid tiers."
value={ attributes['order_' + tab.name] }
options={ areoi.helper.GetCols( 'order', tab.name ) }
onChange={ ( val ) => onChange( 'order_' + tab.name, val ) }
/>
</areoi.components.PanelRow>
</>
}
<areoi.components.PanelRow className="areoi-panel-row">
<areoi.components.SelectControl
label="Columns"
labelPosition="top"
help="Number of columns to span."
value={ attributes['col_' + tab.name] }
options={ areoi.helper.GetCols( 'col', tab.name ) }
onChange={ ( val ) => onChange( 'col_' + tab.name, val ) }
/>
</areoi.components.PanelRow>
<areoi.components.PanelRow>
<areoi.components.SelectControl
label="Offset"
labelPosition="top"
help="Move columns to the right using .offset-md-* classes. These classes increase the left margin of a column by * columns. For example, .offset-md-4 moves .col-md-4 over four columns."
value={ attributes['offset_' + tab.name] }
options={ areoi.helper.GetCols( 'offset', tab.name ) }
onChange={ ( val ) => onChange( 'offset_' + tab.name, val ) }
/>
</areoi.components.PanelRow>
{
areoi_vars.is_grid && !isFlex &&
<areoi.components.PanelRow>
<areoi.components.TextControl
label="Grid Row"
labelPosition="top"
help="Specify which grid row you would like your column to be added to."
value={ attributes['grid_row_' + tab.name] }
onChange={ ( value ) => onChange( 'grid_row_' + tab.name, value ) }
/>
</areoi.components.PanelRow>
}
</areoi.components.PanelBody>
}
{ areoi.DeviceBackground( areoi, attributes, onChange, tab ) }
</div>
);
};
return (
<>
{ areoi.DisplayPreview( areoi, attributes, onChange, 'column' ) }
{
!attributes.preview &&
<>
<div { ...blockProps } data-anchor={ attributes.anchor ? ' : #' + attributes.anchor : '' }>
<areoi.editor.InspectorControls key="setting">
{ areoi.Utilities( areoi, attributes, onChange ) }
{ areoi.Background( areoi, attributes, onChange ) }
{ areoi.ResponsiveTabPanel( tabDevice, meta, props ) }
</areoi.editor.InspectorControls>
{ areoi.DisplayBackground( areoi, attributes ) }
<areoi.editor.InnerBlocks template={ BLOCKS_TEMPLATE } allowedBlocks={ ALLOWED_BLOCKS } />
</div>
<areoi.URLPicker
areoi={ areoi }
url={ url }
urlTitle={ url_title }
setAttributes={ setAttributes }
isSelected={ isSelected }
opensInNewTab={ linkTarget === '_blank' }
onToggleOpenInNewTab={ onToggleOpenInNewTab }
anchorRef={ ref }
richTextRef={ richTextRef }
/>
</>
}
</>
);
},
save: () => {
return (
<areoi.editor.InnerBlocks.Content/>
);
},
} );

View File

@@ -0,0 +1,556 @@
{
"apiVersion": 2,
"name": "areoi/column",
"title": "Column",
"parent": null,
"category": "areoi-layout",
"description": "Modify columns with a handful of options for alignment, ordering, and offsetting thanks to our flexbox grid system.",
"textdomain": "default",
"keywords": [ "areoi", "bootstrap", "layout" ],
"usesContext": ["areoi/isFlex"],
"example": {
"attributes": {
"preview": true
}
},
"attributes": {
"preview": {
"type": "boolean",
"default": false
},
"anchor": {
"type": "string",
"default": false
},
"block_id": {
"type": "string",
"default": null
},
"background_display": {
"type": "boolean",
"default": false
},
"utilities_bg": {
"type": "string",
"default": null
},
"utilities_text": {
"type": "string",
"default": null
},
"utilities_border": {
"type": "string",
"default": null
},
"background_color": {
"type": "object",
"default": {
"rgb": {
"r": 0,
"g": 0,
"b": 0,
"a": 1
}
}
},
"background_image": {
"type": "object",
"default": null
},
"background_video": {
"type": "object",
"default": null
},
"background_display_overlay": {
"type": "boolean",
"default": false
},
"background_overlay": {
"type": "object",
"default": {
"rgb": {
"r": 0,
"g": 0,
"b": 0,
"a": 1
}
}
},
"background_horizontal_align": {
"type": "string",
"default": "justify-content-start"
},
"url": {
"type": "string",
"default": null
},
"url_title": {
"type": "string",
"default": null
},
"title": {
"type": "string",
"default": null
},
"linkTarget": {
"type": "string",
"default": null
},
"rel": {
"type": "string",
"default": null
},
"vertical_align_xs": {
"type": "string",
"default": null
},
"vertical_align_sm": {
"type": "string",
"default": null
},
"vertical_align_md": {
"type": "string",
"default": null
},
"vertical_align_lg": {
"type": "string",
"default": null
},
"vertical_align_xl": {
"type": "string",
"default": null
},
"vertical_align_xxl": {
"type": "string",
"default": null
},
"grid_row_xs": {
"type": "string",
"default": null
},
"grid_row_sm": {
"type": "string",
"default": null
},
"grid_row_md": {
"type": "string",
"default": null
},
"grid_row_lg": {
"type": "string",
"default": null
},
"grid_row_xl": {
"type": "string",
"default": null
},
"grid_row_xxl": {
"type": "string",
"default": null
},
"height_dimension_xs": {
"type": "string",
"default": null
},
"height_unit_xs": {
"type": "string",
"default": "px"
},
"padding_top_xs": {
"type": "string",
"default": null
},
"padding_right_xs": {
"type": "string",
"default": null
},
"padding_bottom_xs": {
"type": "string",
"default": null
},
"padding_left_xs": {
"type": "string",
"default": null
},
"margin_top_xs": {
"type": "string",
"default": null
},
"margin_right_xs": {
"type": "string",
"default": null
},
"margin_bottom_xs": {
"type": "string",
"default": null
},
"margin_left_xs": {
"type": "string",
"default": null
},
"hide_xs": {
"type": "boolean",
"default": false
},
"background_hide_xs": {
"type": "boolean",
"default": false
},
"background_col_xs": {
"type": "string",
"default": null
},
"height_dimension_sm": {
"type": "string",
"default": null
},
"height_unit_sm": {
"type": "string",
"default": "px"
},
"padding_top_sm": {
"type": "string",
"default": null
},
"padding_right_sm": {
"type": "string",
"default": null
},
"padding_bottom_sm": {
"type": "string",
"default": null
},
"padding_left_sm": {
"type": "string",
"default": null
},
"margin_top_sm": {
"type": "string",
"default": null
},
"margin_right_sm": {
"type": "string",
"default": null
},
"margin_bottom_sm": {
"type": "string",
"default": null
},
"margin_left_sm": {
"type": "string",
"default": null
},
"hide_sm": {
"type": "boolean",
"default": false
},
"background_hide_sm": {
"type": "boolean",
"default": false
},
"background_col_sm": {
"type": "string",
"default": null
},
"height_dimension_md": {
"type": "string",
"default": null
},
"height_unit_md": {
"type": "string",
"default": "px"
},
"padding_top_md": {
"type": "string",
"default": null
},
"padding_right_md": {
"type": "string",
"default": null
},
"padding_bottom_md": {
"type": "string",
"default": null
},
"padding_left_md": {
"type": "string",
"default": null
},
"margin_top_md": {
"type": "string",
"default": null
},
"margin_right_md": {
"type": "string",
"default": null
},
"margin_bottom_md": {
"type": "string",
"default": null
},
"margin_left_md": {
"type": "string",
"default": null
},
"hide_md": {
"type": "boolean",
"default": false
},
"background_hide_md": {
"type": "boolean",
"default": false
},
"background_col_md": {
"type": "string",
"default": null
},
"height_dimension_lg": {
"type": "string",
"default": null
},
"height_unit_lg": {
"type": "string",
"default": "px"
},
"padding_top_lg": {
"type": "string",
"default": null
},
"padding_right_lg": {
"type": "string",
"default": null
},
"padding_bottom_lg": {
"type": "string",
"default": null
},
"padding_left_lg": {
"type": "string",
"default": null
},
"margin_top_lg": {
"type": "string",
"default": null
},
"margin_right_lg": {
"type": "string",
"default": null
},
"margin_bottom_lg": {
"type": "string",
"default": null
},
"margin_left_lg": {
"type": "string",
"default": null
},
"hide_lg": {
"type": "boolean",
"default": false
},
"background_hide_lg": {
"type": "boolean",
"default": false
},
"background_col_lg": {
"type": "string",
"default": null
},
"height_dimension_xl": {
"type": "string",
"default": null
},
"height_unit_xl": {
"type": "string",
"default": "px"
},
"padding_top_xl": {
"type": "string",
"default": null
},
"padding_right_xl": {
"type": "string",
"default": null
},
"padding_bottom_xl": {
"type": "string",
"default": null
},
"padding_left_xl": {
"type": "string",
"default": null
},
"margin_top_xl": {
"type": "string",
"default": null
},
"margin_right_xl": {
"type": "string",
"default": null
},
"margin_bottom_xl": {
"type": "string",
"default": null
},
"margin_left_xl": {
"type": "string",
"default": null
},
"hide_xl": {
"type": "boolean",
"default": false
},
"background_hide_xl": {
"type": "boolean",
"default": false
},
"background_col_xl": {
"type": "string",
"default": null
},
"height_dimension_xxl": {
"type": "string",
"default": null
},
"height_unit_xxl": {
"type": "string",
"default": "px"
},
"padding_top_xxl": {
"type": "string",
"default": null
},
"padding_right_xxl": {
"type": "string",
"default": null
},
"padding_bottom_xxl": {
"type": "string",
"default": null
},
"padding_left_xxl": {
"type": "string",
"default": null
},
"margin_top_xxl": {
"type": "string",
"default": null
},
"margin_right_xxl": {
"type": "string",
"default": null
},
"margin_bottom_xxl": {
"type": "string",
"default": null
},
"margin_left_xxl": {
"type": "string",
"default": null
},
"hide_xxl": {
"type": "boolean",
"default": false
},
"background_hide_xxl": {
"type": "boolean",
"default": false
},
"background_col_xxl": {
"type": "string",
"default": null
},
"col_xs": {
"type": "string",
"default": null
},
"col_sm": {
"type": "string",
"default": null
},
"col_md": {
"type": "string",
"default": null
},
"col_lg": {
"type": "string",
"default": null
},
"col_xl": {
"type": "string",
"default": null
},
"col_xxl": {
"type": "string",
"default": null
},
"offset_xs": {
"type": "string",
"default": null
},
"offset_sm": {
"type": "string",
"default": null
},
"offset_md": {
"type": "string",
"default": null
},
"offset_lg": {
"type": "string",
"default": null
},
"offset_xl": {
"type": "string",
"default": null
},
"offset_xxl": {
"type": "string",
"default": null
},
"order_xs": {
"type": "string",
"default": null
},
"order_sm": {
"type": "string",
"default": null
},
"order_md": {
"type": "string",
"default": null
},
"order_lg": {
"type": "string",
"default": null
},
"order_xl": {
"type": "string",
"default": null
},
"order_xxl": {
"type": "string",
"default": null
}
},
"supports": {
"anchor": true,
"align": false,
"html": false
},
"editorScript": "areoi-blocks",
"editorStyle": "file:./index.css",
"style": "file:../../build/style.css"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -0,0 +1,16 @@
.wp-block-areoi-column {
min-height: 40px;
border: 1px dashed #ccc;
}
.wp-block-areoi-column {
min-height: 40px;
border: 1px dashed #ccc;
}
.col {
position: relative;
}
.col:not([class^='offset']),
.col:not([class*='offset']) {
margin-left: 0;
margin-right: 0;
}