@wordpress/block-library
Version:
Block library for the WordPress editor.
114 lines (112 loc) • 2.97 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _i18n = require("@wordpress/i18n");
var _icons = require("@wordpress/icons");
/**
* WordPress dependencies
*/
const example = {
innerBlocks: [{
name: 'core/paragraph',
attributes: {
customTextColor: '#cf2e2e',
fontSize: 'large',
content: (0, _i18n.__)('One.')
}
}, {
name: 'core/paragraph',
attributes: {
customTextColor: '#ff6900',
fontSize: 'large',
content: (0, _i18n.__)('Two.')
}
}, {
name: 'core/paragraph',
attributes: {
customTextColor: '#fcb900',
fontSize: 'large',
content: (0, _i18n.__)('Three.')
}
}, {
name: 'core/paragraph',
attributes: {
customTextColor: '#00d084',
fontSize: 'large',
content: (0, _i18n.__)('Four.')
}
}, {
name: 'core/paragraph',
attributes: {
customTextColor: '#0693e3',
fontSize: 'large',
content: (0, _i18n.__)('Five.')
}
}, {
name: 'core/paragraph',
attributes: {
customTextColor: '#9b51e0',
fontSize: 'large',
content: (0, _i18n.__)('Six.')
}
}]
};
const variations = [{
name: 'group',
title: (0, _i18n.__)('Group'),
description: (0, _i18n.__)('Gather blocks in a container.'),
attributes: {
layout: {
type: 'constrained'
}
},
isDefault: true,
scope: ['block', 'inserter', 'transform'],
isActive: blockAttributes => !blockAttributes.layout || !blockAttributes.layout?.type || blockAttributes.layout?.type === 'default' || blockAttributes.layout?.type === 'constrained',
icon: _icons.group
}, {
name: 'group-row',
title: (0, _i18n._x)('Row', 'single horizontal line'),
description: (0, _i18n.__)('Arrange blocks horizontally.'),
attributes: {
layout: {
type: 'flex',
flexWrap: 'nowrap'
}
},
scope: ['block', 'inserter', 'transform'],
isActive: blockAttributes => blockAttributes.layout?.type === 'flex' && (!blockAttributes.layout?.orientation || blockAttributes.layout?.orientation === 'horizontal'),
icon: _icons.row,
example
}, {
name: 'group-stack',
title: (0, _i18n.__)('Stack'),
description: (0, _i18n.__)('Arrange blocks vertically.'),
attributes: {
layout: {
type: 'flex',
orientation: 'vertical'
}
},
scope: ['block', 'inserter', 'transform'],
isActive: blockAttributes => blockAttributes.layout?.type === 'flex' && blockAttributes.layout?.orientation === 'vertical',
icon: _icons.stack,
example
}, {
name: 'group-grid',
title: (0, _i18n.__)('Grid'),
description: (0, _i18n.__)('Arrange blocks in a grid.'),
attributes: {
layout: {
type: 'grid'
}
},
scope: ['block', 'inserter', 'transform'],
isActive: blockAttributes => blockAttributes.layout?.type === 'grid',
icon: _icons.grid,
example
}];
var _default = exports.default = variations;
//# sourceMappingURL=variations.js.map
;