REBUILDING
This commit is contained in:
parent
d1b212ab74
commit
706f394438
|
|
@ -14,7 +14,11 @@ return array(
|
||||||
|
|
||||||
),
|
),
|
||||||
'supports' => array(
|
'supports' => array(
|
||||||
'html' => false
|
'html' => false,
|
||||||
|
'color' => array(
|
||||||
|
'background' => true,
|
||||||
|
'text' => true
|
||||||
|
)
|
||||||
),
|
),
|
||||||
'textdomain' => 'dernieres-dynamiques',
|
'textdomain' => 'dernieres-dynamiques',
|
||||||
'editorScript' => 'file:./index.js',
|
'editorScript' => 'file:./index.js',
|
||||||
|
|
@ -26,6 +30,10 @@ return array(
|
||||||
'displayType' => array(
|
'displayType' => array(
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
'default' => 'grid'
|
'default' => 'grid'
|
||||||
|
),
|
||||||
|
'showTableOfContents' => array(
|
||||||
|
'type' => 'boolean',
|
||||||
|
'default' => true
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,11 @@
|
||||||
"description": "Example block scaffolded with Create Block tool.",
|
"description": "Example block scaffolded with Create Block tool.",
|
||||||
"example": {},
|
"example": {},
|
||||||
"supports": {
|
"supports": {
|
||||||
"html": false
|
"html": false,
|
||||||
|
"color": {
|
||||||
|
"background": true,
|
||||||
|
"text": true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"textdomain": "dernieres-dynamiques",
|
"textdomain": "dernieres-dynamiques",
|
||||||
"editorScript": "file:./index.js",
|
"editorScript": "file:./index.js",
|
||||||
|
|
@ -21,6 +25,10 @@
|
||||||
"displayType": {
|
"displayType": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "grid"
|
"default": "grid"
|
||||||
|
},
|
||||||
|
"showTableOfContents": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1 +1 @@
|
||||||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n', 'wp-server-side-render'), 'version' => 'dd3694142dcbdb8c8bb7');
|
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n', 'wp-server-side-render'), 'version' => '79dc145297e0d0e5c73e');
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
\*********************************************/
|
\*********************************************/
|
||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"dynamiques-blocks/dernieres-dynamiques","version":"0.1.0","title":"Dernieres Dynamiques","category":"dynamiques-blocks","icon":"smiley","description":"Example block scaffolded with Create Block tool.","example":{},"supports":{"html":false},"textdomain":"dernieres-dynamiques","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","render":"file:./render.php","attributes":{"displayType":{"type":"string","default":"grid"}}}');
|
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"dynamiques-blocks/dernieres-dynamiques","version":"0.1.0","title":"Dernieres Dynamiques","category":"dynamiques-blocks","icon":"smiley","description":"Example block scaffolded with Create Block tool.","example":{},"supports":{"html":false,"color":{"background":true,"text":true}},"textdomain":"dernieres-dynamiques","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","render":"file:./render.php","attributes":{"displayType":{"type":"string","default":"grid"},"showTableOfContents":{"type":"boolean","default":true}}}');
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
|
@ -44,18 +44,24 @@ function Edit({
|
||||||
setAttributes
|
setAttributes
|
||||||
}) {
|
}) {
|
||||||
const {
|
const {
|
||||||
displayType
|
displayType,
|
||||||
|
showTableOfContents = true
|
||||||
} = attributes;
|
} = attributes;
|
||||||
function onDisplayTypeChange(value) {
|
function onDisplayTypeChange(value) {
|
||||||
setAttributes({
|
setAttributes({
|
||||||
displayType: value
|
displayType: value
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
function onShowTableOfContentsChange(value) {
|
||||||
|
setAttributes({
|
||||||
|
showTableOfContents: !showTableOfContents
|
||||||
|
});
|
||||||
|
}
|
||||||
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, {
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, {
|
||||||
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, {
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, {
|
||||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, {
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, {
|
||||||
title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Paramètres", "dernieres-dynamiques"),
|
title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Paramètres", "dernieres-dynamiques"),
|
||||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControl, {
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControl, {
|
||||||
className: "homegrade-blocks-highlight__variant",
|
className: "homegrade-blocks-highlight__variant",
|
||||||
isBlock: true,
|
isBlock: true,
|
||||||
label: "Type d'affichage des posts",
|
label: "Type d'affichage des posts",
|
||||||
|
|
@ -68,7 +74,11 @@ function Edit({
|
||||||
label: "Grille",
|
label: "Grille",
|
||||||
value: "grid"
|
value: "grid"
|
||||||
})]
|
})]
|
||||||
})
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.CheckboxControl, {
|
||||||
|
label: "Afficher la table des mati\xE8res",
|
||||||
|
checked: showTableOfContents,
|
||||||
|
onChange: onShowTableOfContentsChange
|
||||||
|
})]
|
||||||
})
|
})
|
||||||
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
|
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
|
||||||
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
|
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,14 @@
|
||||||
<?php
|
<?php
|
||||||
$displayType = $attributes['displayType'] ?? 'grid';
|
$displayType = $attributes['displayType'] ?? 'grid';
|
||||||
$variantLocation = $attributes['variantLocation'] ?? 'carhop';
|
$variantLocation = $attributes['variantLocation'] ?? 'carhop';
|
||||||
|
$showTableOfContents = $attributes['showTableOfContents'] ?? true;
|
||||||
|
$backgroundColor = $attributes['backgroundColor'] ?? null;
|
||||||
|
$backgroundColorHex = get_color_hex_from_slug($backgroundColor) ?? null;
|
||||||
|
write_log($backgroundColorHex);
|
||||||
|
|
||||||
|
$hasLightBackground = is_color_light($backgroundColorHex);
|
||||||
|
$backgroundColorClass = $hasLightBackground ? 'block-dernieres-dynamiques--has-light-bg' : 'block-dernieres-dynamiques--has-dark-bg';
|
||||||
|
|
||||||
|
|
||||||
$current_blog_id = get_current_blog_id();
|
$current_blog_id = get_current_blog_id();
|
||||||
switch_to_blog(2);
|
switch_to_blog(2);
|
||||||
|
|
@ -23,7 +31,7 @@ $issue_related_articles = get_field('articles', $last_issue->ID);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
<section class="block-dernieres-dynamiques content-section block-dernieres-dynamiques--<?php echo $variantLocation; ?> alignfull">
|
<section <?php echo get_block_wrapper_attributes(array('class' => 'block-dernieres-dynamiques content-section block-dernieres-dynamiques--' . $variantLocation . ' alignfull ' . $backgroundColorClass)); ?>>
|
||||||
<div class="block-dernieres-dynamiques__inner">
|
<div class="block-dernieres-dynamiques__inner">
|
||||||
<div class="block-dernieres-dynamiques__header">
|
<div class="block-dernieres-dynamiques__header">
|
||||||
<h2 class="block-title">
|
<h2 class="block-title">
|
||||||
|
|
@ -84,6 +92,8 @@ $issue_related_articles = get_field('articles', $last_issue->ID);
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<?php if ($showTableOfContents) : ?>
|
||||||
|
|
||||||
<div class="related-articles">
|
<div class="related-articles">
|
||||||
<h3 class="related-articles__title">
|
<h3 class="related-articles__title">
|
||||||
Table des matières
|
Table des matières
|
||||||
|
|
@ -157,7 +167,7 @@ $issue_related_articles = get_field('articles', $last_issue->ID);
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user