Compare commits

..

10 Commits

Author SHA1 Message Date
Antoine M
2cee49d71e FEATURE Add new core block support and improve aspect ratio selection in narrative card
All checks were successful
continuous-integration/drone/push Build is passing
2026-03-25 16:02:42 +01:00
Antoine M
629301a623 REFACTOR Simplify save function to return empty fragment 2026-03-25 16:02:30 +01:00
Antoine M
2f6b1f0134 FEATURE Add support for core/file block in chapter section editor 2026-03-25 16:02:19 +01:00
Antoine M
d3ad12d653 FEATURE refactoriong component to handle background shapes 2026-03-25 16:02:08 +01:00
Antoine M
330f140e04 FEATURE introducing block 2026-03-25 16:01:40 +01:00
Antoine M
dedf5d157a REFACTOR Renaming block 2026-03-25 16:01:17 +01:00
Antoine M
877d75b437 rebuilding 2026-03-25 16:00:57 +01:00
Antoine M
4388ac6f6c FEATURE Handling dbmob post type 2026-03-25 16:00:36 +01:00
Antoine M
2a752254f0 FEATURE Update custom post types to 'Notices' and 'Recherches participatives' with revised labels and support for revisions. 2026-03-25 16:00:16 +01:00
Antoine M
837c445bbc FEATURE Introducing the block 2026-03-25 15:59:11 +01:00
69 changed files with 1346 additions and 308 deletions

View File

@ -73,8 +73,9 @@ function carhop_create_posttype()
// CPT Options
array(
'labels' => array(
'name' => __('DBMOB'),
'singular_name' => __('DBMOB'),
'name' => __('Notices'),
'singular_name' => __('Notice biographique'),
'menu_name' => __('Notices biographiques'),
),
'public' => true,
'has_archive' => true,
@ -83,7 +84,7 @@ function carhop_create_posttype()
'menu_icon' => 'data:image/svg+xml;base64,' . base64_encode('<svg width="96" height="74" viewBox="0 0 96 74" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M86.4 2.2C81.6 0.7 76.3 0 71.3 0C62.9 0 53.8 1.7 47.5 6.5C41.2 1.7 32.2 0 23.8 0C15.4 0 6.3 1.7 0 6.5V69.8C0 70.9 1.1 72 2.2 72C3.3 72 2.8 71.8 3.3 71.8C9.1 69 17.6 67 23.8 67C30 67 41.3 68.7 47.6 73.5C53.4 69.8 64 67 71.4 67C78.8 67 85.9 68.3 91.9 71.5C92.3 71.7 92.5 71.7 93 71.7C94.1 71.7 95.2 70.6 95.2 69.5V6.5C92.6 4.6 89.8 3.3 86.6 2.2H86.4ZM86.4 60.5C81.6 59 76.5 58.3 71.3 58.3C64 58.3 53.4 61.1 47.5 64.8V15.1C53.3 11.4 63.9 8.6 71.3 8.6C78.7 8.6 81.7 9.2 86.4 10.8V60.5Z" fill="#9BA2A9"/></svg>'),
'menu_position' => 4,
'supports' => array('title', 'custom-fields'),
'taxonomies' => array('category'),
)
);
@ -105,7 +106,7 @@ function carhop_create_posttype()
'menu_icon' => 'data:image/svg+xml;base64,' . base64_encode('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M17.513 2.69841H17.4805C17.2208 2.69841 16.9935 2.92064 16.9935 3.1746V14.9524C16.9935 15.4603 16.5714 15.873 16.0519 15.873H10.4026V15.0794C10.4026 14.8254 10.1753 14.6032 9.91558 14.6032H7.31818C7.18831 14.6032 7.05844 14.6667 6.96104 14.7302C6.86364 14.7937 6.83117 14.9524 6.83117 15.0794V15.873H4.91558C4.46104 15.873 4.07143 15.619 3.94156 15.1746C3.94156 14.9841 3.94156 14.7619 4.1039 14.6032C4.3961 14.3175 4.78571 14.1587 5.20779 14.1587H14.8506C15.7273 14.1587 16.4091 13.4603 16.4091 12.6349V2.06349C16.4091 0.920635 15.4675 0 14.2987 0H5.11039C3.94156 0 3 0.920635 3 2.06349V15.3651C3.22727 16.2222 4.00649 16.8571 4.94805 16.8254H6.86364V19.5238C6.86364 19.7143 6.99351 19.873 7.15584 19.9683C7.35065 20.0317 7.54545 19.9683 7.67532 19.873L8.64935 18.9841L9.62338 19.873C9.72078 19.9683 9.85065 20 9.94805 20H10.1429C10.3377 19.9365 10.4351 19.746 10.4351 19.5556V16.8571H16.0844C17.1558 16.8571 18 16.0317 18 14.9841V3.1746C18 2.92064 17.7727 2.69841 17.513 2.69841ZM10.1104 10.5079C10.1104 10.7619 9.88312 10.9841 9.62338 10.9841C9.36364 10.9841 9.13636 10.7619 9.13636 10.5079V5.77778C9.13636 5.52381 9.36364 5.30159 9.62338 5.30159C9.88312 5.30159 10.1104 5.52381 10.1104 5.77778V10.5079ZM9.59091 3.1746H9.62338C9.91558 3.1746 10.1429 3.36508 10.2403 3.61905C10.3377 3.87302 10.2403 4.15873 10.0779 4.34921C9.91558 4.53968 9.59091 4.60317 9.33117 4.47619C9.07143 4.38095 8.90909 4.12698 8.90909 3.84127C8.90909 3.55556 9.23377 3.1746 9.59091 3.1746Z" fill="#9BA2A9"/></svg>'),
'menu_position' => 4,
'taxonomies' => array('type', 'etiquettes'),
'supports' => array('title', 'custom-fields', 'editor', 'thumbnail'),
'supports' => array('title', 'revisions', 'editor', 'thumbnail'),
)
);
register_post_type(
@ -118,7 +119,7 @@ function carhop_create_posttype()
),
'menu_name' => 'Recherches participatives',
'show_in_rest' => true,
'supports' => array('title', 'custom-fields', 'editor', 'thumbnail'),
'supports' => array('title', 'revisions', 'editor', 'thumbnail'),
'public' => true,
'has_archive' => true,
'menu_position' => 4,
@ -169,7 +170,7 @@ function carhop_create_posttype()
'rewrite' => array('slug' => 'expositions'),
'menu_icon' => 'data:image/svg+xml;base64,' . base64_encode('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M17.25 3.92857H16.05L11.25 0.785714V0.714286C11.25 0.321429 10.9125 0 10.5 0C10.0875 0 9.75 0.321429 9.75 0.714286V0.785714L4.95 3.92857H3.75C3.3375 3.92857 3 4.25 3 4.64286V19.2857C3 19.6786 3.3375 20 3.75 20H17.25C17.6625 20 18 19.6786 18 19.2857V4.64286C18 4.25 17.6625 3.92857 17.25 3.92857ZM10.2 1.35714C10.3125 1.39286 10.3875 1.42857 10.5 1.42857C10.6125 1.42857 10.725 1.42857 10.8 1.35714L14.7 3.92857H6.3L10.2 1.35714ZM16.5 15.3571C14.1375 11.75 12.9375 11.1786 11.55 12.9286C11.4 13.1071 11.175 13.3571 10.875 13.6429C10.9875 13.9643 11.1 14.2857 11.25 14.6071C12 16.8929 12.9 17.3929 13.65 17.8214L13.8375 17.9286L14.925 18.5357H13.4625C12.6 18.0357 11.4375 17.5714 10.5375 14.8214C10.35 14.2857 10.2 13.8214 10.0125 13.4286C8.6625 10.2857 7.2 10.3571 6.225 11.1429C5.625 11.6429 5.0625 12.3929 4.5 13.2857V5.35714H16.5V15.3571ZM13.875 8.92857C14.5125 8.92857 15 8.46429 15 7.85714C15 7.25 14.5125 6.78571 13.875 6.78571C13.2375 6.78571 12.75 7.25 12.75 7.85714C12.75 8.46429 13.2375 8.92857 13.875 8.92857Z" fill="#9BA2A9"/></svg>'),
'show_in_rest' => true,
'supports' => array('title', 'custom-fields', 'editor', 'thumbnail'),
'supports' => array('title', 'revisions', 'editor', 'thumbnail'),
'menu_position' => 4,
)
);
@ -187,7 +188,7 @@ function carhop_create_posttype()
'rewrite' => array('slug' => 'outils-pedagogiques'),
'menu_icon' => 'data:image/svg+xml;base64,' . base64_encode('<svg width="20" height="20" viewBox="0 0 20 20" fill="#9BA2A9" xmlns="http://www.w3.org/2000/svg"><path d="M19.7648 5.22804L14.0012 11.0178L17.2518 14.9264V14.9352H17.2606L18.7667 16.7631C19.1642 17.2422 19.1377 17.921 18.7137 18.276L16.9117 19.78C16.7218 19.9441 16.4701 20.0151 16.2007 19.9973C15.9048 19.9707 15.6221 19.8154 15.4189 19.5714L13.9217 17.7613C13.9129 17.7524 13.9041 17.7524 13.8952 17.7436C13.8864 17.7347 13.8864 17.7258 13.8864 17.717L10.8964 14.1322L5.7511 19.3052C5.4287 19.6291 4.91196 19.6291 4.58955 19.3052L1.24181 15.9468C0.919398 15.6229 0.919398 15.1038 1.24181 14.78L6.79783 9.18989L2.84501 4.42059C2.80085 4.36735 2.77435 4.30524 2.75668 4.24756L2.74785 4.23869L1.95729 0.529729C1.92195 0.37445 1.98379 0.20586 2.10303 0.103819C2.18253 0.0417075 2.27528 0.00621582 2.38128 0.00621582C2.48727 0.00621582 2.49611 0.0150884 2.54469 0.0417077L6.01168 1.48803H6.02051C6.08235 1.51465 6.13534 1.55901 6.18393 1.60781L9.89383 6.07543L15.2511 0.702755C15.4057 0.538602 15.6221 0.458744 15.8297 0.458744C16.0373 0.458744 16.2448 0.538602 16.4082 0.702755L19.7516 4.06123C20.074 4.3851 20.074 4.90417 19.7516 5.22804H19.7648ZM16.0902 19.0213C16.1432 19.0834 16.2183 19.1367 16.3597 19.1189L18.1616 17.6149C18.1969 17.5883 18.2058 17.4508 18.0998 17.3265L16.8676 15.827L14.8404 17.5262L16.0902 19.0257V19.0213ZM2.98634 1.16416L3.4545 3.34251L5.03121 2.02041L2.98634 1.16859V1.16416ZM15.865 1.31056L14.0277 3.15617L14.7476 3.8882C14.9199 4.06123 14.9199 4.33186 14.7476 4.50488C14.5842 4.67791 14.306 4.67791 14.1426 4.50488L13.4138 3.77285L12.8088 4.37179L13.5375 5.11269C13.7097 5.27684 13.7097 5.55635 13.5375 5.7205C13.3741 5.89353 13.0958 5.89353 12.9324 5.7205L12.1949 4.98847L11.5986 5.5874L12.3273 6.32831C12.4996 6.49246 12.4996 6.77196 12.3273 6.93612C12.1639 7.10914 11.8857 7.10914 11.7134 6.93612L10.9847 6.20409L10.3796 6.80302L11.1172 7.54393C11.2806 7.70808 11.2806 7.98758 11.1172 8.16061C10.945 8.32476 10.6756 8.32476 10.5033 8.16061L9.76575 7.4197L9.16068 8.01864L9.90708 8.75954C10.0705 8.93257 10.0705 9.2032 9.90708 9.37622C9.73483 9.54038 9.45659 9.54038 9.29318 9.37622L8.55561 8.63532L7.96821 9.21207C7.99471 9.24756 8.01238 9.27418 8.02121 9.30968L8.68811 9.9796C8.86036 10.1526 8.86036 10.4321 8.68811 10.5963C8.5247 10.7693 8.24645 10.7693 8.08304 10.5963L7.33665 9.8465L6.73158 10.4543L7.47798 11.2041C7.65022 11.3682 7.65022 11.6477 7.47798 11.8119C7.31456 11.9849 7.03632 11.9849 6.87291 11.8119L6.12651 11.0621L5.52144 11.6699L6.26784 12.4197C6.44009 12.5839 6.44009 12.8634 6.26784 13.0275C6.09559 13.2005 5.82619 13.2005 5.65394 13.0275L4.90754 12.2777L4.30248 12.8855L5.05771 13.6353C5.22112 13.7995 5.22112 14.079 5.05771 14.252C4.88546 14.4162 4.61605 14.4162 4.44381 14.252L3.69741 13.4933L3.09234 14.0923L3.84757 14.8509C4.01098 15.024 4.01098 15.2946 3.84757 15.4676C3.67533 15.6318 3.39708 15.6318 3.23367 15.4676L2.47844 14.709L1.88221 15.299L5.1372 18.6886L13.0914 10.6983L19.1509 4.68235L15.865 1.315V1.31056ZM17.0266 3.45342C17.3136 3.75067 17.3136 4.22095 17.0266 4.50488C16.7395 4.78882 16.2625 4.80213 15.971 4.50488C15.6795 4.20764 15.6839 3.74623 15.971 3.45342C16.2669 3.15617 16.7351 3.15617 17.0266 3.45342Z" fill="#9BA2A9"/></svg>'),
'show_in_rest' => true,
'supports' => array('title', 'editor', 'thumbnail'),
'supports' => array('title', 'revisions', 'editor', 'thumbnail'),
'menu_position' => 4,
)
);
@ -229,8 +230,3 @@ function carhop_create_posttype()
);
}
add_action('init', 'carhop_create_posttype');

View File

@ -355,10 +355,24 @@ return array(
'type' => 'string',
'default' => 'inherit'
),
'borderColor' => array(
'type' => 'string',
'default' => null
),
'blockVariant' => array(
'type' => 'string',
'default' => 'framed'
),
'shapeType' => array(
'type' => 'string',
'default' => 'straight',
'enum' => array(
'straight',
'shapeA',
'shapeB',
'shapeC'
)
),
'blockWidth' => array(
'type' => 'string',
'default' => 'full',
@ -475,22 +489,19 @@ return array(
)
)
),
'dbmob-grid' => array(
'dbmob-archives' => array(
'$schema' => 'https://schemas.wp.org/trunk/block.json',
'apiVersion' => 3,
'name' => 'carhop-plugin/dbmob-grid',
'name' => 'carhop-blocks/dbmob-archives',
'version' => '0.1.0',
'title' => 'Grid de dictionnaires',
'title' => 'Archives des notices biographiques',
'category' => 'carhop-blocks',
'icon' => 'smiley',
'description' => 'Grid de dictionnaires',
'example' => array(
),
'description' => 'Archives des notices biographiques',
'supports' => array(
'html' => false
),
'textdomain' => 'dbmob-grid',
'textdomain' => 'carhop-blocks',
'editorScript' => 'file:./index.js',
'editorStyle' => 'file:./index.css',
'style' => 'file:./style-index.css',
@ -1048,6 +1059,28 @@ return array(
)
)
),
'see-also' => array(
'$schema' => 'https://schemas.wp.org/trunk/block.json',
'apiVersion' => 3,
'name' => 'carhop-blocks/see-also',
'version' => '0.1.0',
'title' => 'Voir aussi',
'category' => 'carhop-blocks',
'icon' => 'smiley',
'description' => 'Voir aussi',
'example' => array(
),
'supports' => array(
'html' => false
),
'textdomain' => 'carhop-blocks',
'editorScript' => 'file:./index.js',
'editorStyle' => 'file:./index.css',
'style' => 'file:./style-index.css',
'viewScript' => 'file:./view.js',
'render' => 'file:./render.php'
),
'story-timeline' => array(
'$schema' => 'https://schemas.wp.org/trunk/block.json',
'apiVersion' => 3,

View File

@ -1 +1 @@
<?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n', 'wp-primitives'), 'version' => 'e29ac5fb21b7bc27f5c0');
<?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n', 'wp-primitives'), 'version' => '9272ca653d58c468069b');

View File

@ -390,7 +390,7 @@ function Edit({
placeholder: "Chapter Title",
content: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse augue augue, sagittis quis mauris in, consequat vehicula est. Aliquam quis nulla ante. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras bibendum eget lorem eget aliquet. Fusce vel consequat neque. "
}]],
allowedBlocks: ["core/heading", "core/paragraph", "core/list", "core/button", "core/buttons", "carhop-blocks/heading", "carhop-blocks/cta", "carhop-blocks/cta-group"]
allowedBlocks: ["core/heading", "core/paragraph", "core/list", "core/file", "core/button", "core/buttons", "carhop-blocks/heading", "carhop-blocks/cta", "carhop-blocks/cta-group"]
})
})
}), coverUrl && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("img", {

File diff suppressed because one or more lines are too long

View File

@ -38,10 +38,24 @@
"type": "string",
"default": "inherit"
},
"borderColor": {
"type": "string",
"default": null
},
"blockVariant": {
"type": "string",
"default": "framed"
},
"shapeType": {
"type": "string",
"default": "straight",
"enum": [
"straight",
"shapeA",
"shapeB",
"shapeC"
]
},
"blockWidth": {
"type": "string",
"default": "full",

View File

@ -1 +1 @@
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-i18n'), 'version' => '9210a38eaa347a81247e');
<?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-i18n'), 'version' => '1e2c2d08d328ea46924d');

View File

@ -41,7 +41,7 @@ function isColorLight(color) {
\************************************/
/***/ ((module) => {
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/content-box","version":"0.1.0","title":"Boite de contenu","category":"carhop-blocks","icon":"smiley","description":"Boite de contenu pour la mise en forme d\'éléments de contenu","example":{},"supports":{"html":false,"anchor":true,"align":["wide","full"]},"textdomain":"carhop-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","attributes":{"hasBackgroundColor":{"type":"boolean","default":false},"backgroundColor":{"type":"string","default":"#f1fcf9"},"hasLightBackground":{"type":"boolean","default":true},"textColor":{"type":"string","default":"inherit"},"blockVariant":{"type":"string","default":"framed"},"blockWidth":{"type":"string","default":"full","enum":["contained","wide","full"]}}}');
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/content-box","version":"0.1.0","title":"Boite de contenu","category":"carhop-blocks","icon":"smiley","description":"Boite de contenu pour la mise en forme d\'éléments de contenu","example":{},"supports":{"html":false,"anchor":true,"align":["wide","full"]},"textdomain":"carhop-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","attributes":{"hasBackgroundColor":{"type":"boolean","default":false},"backgroundColor":{"type":"string","default":"#f1fcf9"},"hasLightBackground":{"type":"boolean","default":true},"textColor":{"type":"string","default":"inherit"},"borderColor":{"type":"string","default":null},"blockVariant":{"type":"string","default":"framed"},"shapeType":{"type":"string","default":"straight","enum":["straight","shapeA","shapeB","shapeC"]},"blockWidth":{"type":"string","default":"full","enum":["contained","wide","full"]}}}');
/***/ }),
@ -65,9 +65,15 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./editor.scss */ "./src/content-box/editor.scss");
/* harmony import */ var _utilities_utilities__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../_utilities/utilities */ "./_utilities/utilities.js");
/* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utilities */ "./src/content-box/utilities.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _shapeA_jsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./shapeA.jsx */ "./src/content-box/shapeA.jsx");
/* harmony import */ var _shapeB_jsx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./shapeB.jsx */ "./src/content-box/shapeB.jsx");
/* harmony import */ var _shapeC_jsx__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./shapeC.jsx */ "./src/content-box/shapeC.jsx");
/* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utilities */ "./src/content-box/utilities.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__);
@ -89,15 +95,17 @@ function Edit({
textColor,
hasLightBackground,
blockVariant,
blockWidth
blockWidth,
shapeType,
borderColor
} = attributes;
// Détecter le type de post actuel
const postType = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
return select("core/editor").getCurrentPostType();
}, []);
const filteredBgColors = (0,_utilities__WEBPACK_IMPORTED_MODULE_6__.filterBgColors)(colors, postType);
const filteredTextColors = (0,_utilities__WEBPACK_IMPORTED_MODULE_6__.filterTextColors)(colors, postType, backgroundColor);
const filteredBgColors = (0,_utilities__WEBPACK_IMPORTED_MODULE_9__.filterBgColors)(colors, postType);
const filteredTextColors = (0,_utilities__WEBPACK_IMPORTED_MODULE_9__.filterTextColors)(colors, postType, backgroundColor);
function onBackgroundColorChange(value) {
if (value === undefined) {
setAttributes({
@ -152,31 +160,33 @@ function Edit({
});
}
}
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.Fragment, {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, {
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, {
console.log(shapeType);
console.log(blockVariant);
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.Fragment, {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, {
title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Aspect", "carhop-blocks"),
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControl, {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControl, {
label: "Mod\xE8le de bloc",
value: blockVariant,
onChange: onBlockVariantChange,
isBlock: true,
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, {
value: "nude",
label: "Nu"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, {
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, {
value: "framed",
label: "Encadr\xE9"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, {
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, {
value: "backgrounded",
label: "Fond color\xE9"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, {
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, {
value: "framed-backgrounded",
label: "Cadre + fond color\xE9"
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControl, {
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControl, {
label: "Largeur du bloc",
value: blockWidth,
onChange: value => setAttributes({
@ -185,62 +195,115 @@ function Edit({
isBlock: true,
__nextHasNoMarginBottom: true,
__next40pxDefaultSize: true,
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, {
value: "contained",
label: "Contenue"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, {
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, {
value: "wide",
label: "Large"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, {
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, {
value: "full",
label: "Pleine largeur"
})]
}), blockVariant === "backgrounded" || blockVariant === "framed-backgrounded" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Card, {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.CardHeader, {
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("h1", {
children: "Couleur de fond"
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.CardBody, {
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.Fragment, {
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ColorPalette, {
})]
}), (blockVariant === "backgrounded" || blockVariant === "framed-backgrounded") && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, {
className: "deligraph-blocks-components-image__panel-body",
title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Arrière plan", "deligraph-blocks"),
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControl, {
className: "deligraph-blocks__variant",
isBlock: true,
label: "Type de forme",
onChange: value => setAttributes({
shapeType: value
}),
value: shapeType,
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, {
label: "Droite",
value: "straight"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, {
label: "Forme A",
value: "shapeA"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, {
label: "Forme B",
value: "shapeB"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.__experimentalToggleGroupControlOption, {
label: "Forme C",
value: "shapeC"
})]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.SelectControl, {
__next40pxDefaultSize: true,
label: "Type de forme",
onChange: value => setAttributes({
shapeType: value
}),
value: shapeType,
options: [{
disabled: true,
label: "Type de forme",
value: ""
}, {
label: "Droite",
value: "straight"
}, {
label: "Forme A",
value: "shapeA"
}, {
label: "Forme B",
value: "shapeB"
}, {
label: "Forme C",
value: "shapeC"
}]
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ColorPalette, {
colors: filteredBgColors,
value: backgroundColor,
onChange: onBackgroundColorChange
})
})
})]
}), (blockVariant === "backgrounded" || blockVariant === "framed-backgrounded") && postType !== "articles" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Card, {
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.CardHeader, {
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("h1", {
children: "Couleur du texte "
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.CardBody, {
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ColorPalette, {
}), (blockVariant === "backgrounded" || blockVariant === "framed-backgrounded") && postType !== "articles" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, {
className: "deligraph-blocks-components-image__panel-body",
title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Couleur du texte", "deligraph-blocks"),
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ColorPalette, {
colors: filteredTextColors,
value: textColor,
onChange: onTextColorChange
})
})]
})]
})
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("section", {
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("section", {
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
className: `${postType !== "articles" && "alignfull"} content-box content-box--variant-${blockVariant} ${hasLightBackground ? "content-box--bg-light" : "content-box--bg-dark"}
className: `${postType !== "articles" && "alignfull"} content-box content-box--variant-${blockVariant} content-box--${shapeType} ${hasLightBackground ? "content-box--bg-light" : "content-box--bg-dark"}
${blockWidth === "contained" ? "aligncontained" : blockWidth === "wide" ? "alignwide" : "alignfull"}`,
style: {
"--content-box-text-color": textColor !== null && textColor !== void 0 ? textColor : "inherit",
"--content-box-background-color": blockVariant === "backgrounded" || blockVariant === "framed-backgrounded" ? backgroundColor : "transparent"
}
}),
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
children: [blockVariant === "backgrounded" && backgroundColor && shapeType === "shapeA" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_shapeA_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], {
backgroundColor: backgroundColor,
borderColor: "none"
}), blockVariant === "backgrounded" && backgroundColor && shapeType === "shapeB" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_shapeB_jsx__WEBPACK_IMPORTED_MODULE_7__["default"], {
backgroundColor: backgroundColor,
borderColor: "none"
}), blockVariant === "backgrounded" && backgroundColor && shapeType === "shapeC" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_shapeC_jsx__WEBPACK_IMPORTED_MODULE_8__["default"], {
backgroundColor: backgroundColor,
borderColor: "none"
}), blockVariant === "framed" && backgroundColor && shapeType === "shapeA" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_shapeA_jsx__WEBPACK_IMPORTED_MODULE_6__["default"], {
backgroundColor: "none",
borderColor: borderColor
}), blockVariant === "framed" && backgroundColor && shapeType === "shapeB" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_shapeB_jsx__WEBPACK_IMPORTED_MODULE_7__["default"], {
backgroundColor: "none",
borderColor: borderColor
}), blockVariant === "framed" && backgroundColor && shapeType === "shapeC" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_shapeC_jsx__WEBPACK_IMPORTED_MODULE_8__["default"], {
backgroundColor: "none",
borderColor: borderColor
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
className: "content-box__innerblocks",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks, {
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks, {
template: [["core/paragraph", {
placeholder: "Ajouter ici le texte"
}]],
allowedBlocks: ["core/heading", "core/paragraph", "core/group", "core/list", "core/button", "core/image", "core/buttons", "core/columns", "core/file", "core/post-title", "core/embed", "core/quote", "core/pullquote", "core/media-text", "core/table", "carhop-blocks/chapter-section", "carhop-blocks/heading", "carhop-blocks/decorative-shapes", "carhop-blocks/scroll-story-block", "carhop-blocks/cta", "carhop-blocks/cta-group", "carhop-blocks/audio-player", "carhop-blocks/content-box", "carhop-blocks/localisation-map", "carhop-blocks/notice-panel", "carhop-blocks/story-timeline", "carhop-blocks/highlight-timeline", "acf/statistics-datas", "ninja-forms/form", "gravityforms/form", "dynamiques-blocks/sitemap", "mailpoet/subscription-form-block", "shortcode"]
})
})
})]
})]
});
}
@ -314,9 +377,13 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export */ });
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _utilities_utilities__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../_utilities/utilities */ "./_utilities/utilities.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _shapeA_jsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shapeA.jsx */ "./src/content-box/shapeA.jsx");
/* harmony import */ var _shapeB_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shapeB.jsx */ "./src/content-box/shapeB.jsx");
/* harmony import */ var _shapeC_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shapeC.jsx */ "./src/content-box/shapeC.jsx");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
@ -329,20 +396,176 @@ function save({
hasLightBackground,
hasBackgroundColor,
blockVariant,
blockWidth
blockWidth,
shapeType,
borderColor
} = attributes;
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("section", {
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("section", {
..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps.save({
className: `content-box content-box--variant-${blockVariant} ${hasLightBackground ? "content-box--bg-light" : "content-box--bg-dark"}
className: `content-box content-box--variant-${blockVariant} content-box--${shapeType} ${hasLightBackground ? "content-box--bg-light" : "content-box--bg-dark"}
${blockWidth === "contained" ? "aligncontained" : blockWidth === "wide" ? "alignwide" : "alignfull"}`,
style: {
"--content-box-text-color": textColor !== null && textColor !== void 0 ? textColor : "inherit",
"--content-box-background-color": blockVariant === "backgrounded" || blockVariant === "framed-backgrounded" ? backgroundColor : "transparent"
}
}),
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
children: [blockVariant === "backgrounded" && backgroundColor && shapeType === "shapeA" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_shapeA_jsx__WEBPACK_IMPORTED_MODULE_1__["default"], {
backgroundColor: backgroundColor,
borderColor: "none"
}), blockVariant === "backgrounded" && backgroundColor && shapeType === "shapeB" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_shapeB_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], {
backgroundColor: backgroundColor,
borderColor: "none"
}), blockVariant === "backgrounded" && backgroundColor && shapeType === "shapeC" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_shapeC_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], {
backgroundColor: backgroundColor,
borderColor: "none"
}), blockVariant === "framed" && backgroundColor && shapeType === "shapeA" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_shapeA_jsx__WEBPACK_IMPORTED_MODULE_1__["default"], {
backgroundColor: "none",
borderColor: borderColor
}), blockVariant === "framed" && backgroundColor && shapeType === "shapeB" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_shapeB_jsx__WEBPACK_IMPORTED_MODULE_2__["default"], {
backgroundColor: "none",
borderColor: borderColor
}), blockVariant === "framed" && backgroundColor && shapeType === "shapeC" && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_shapeC_jsx__WEBPACK_IMPORTED_MODULE_3__["default"], {
backgroundColor: "none",
borderColor: borderColor
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
className: "content-box__innerblocks",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.InnerBlocks.Content, {})
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.InnerBlocks.Content, {})
})]
});
}
/***/ }),
/***/ "./src/content-box/shapeA.jsx":
/*!************************************!*\
!*** ./src/content-box/shapeA.jsx ***!
\************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ ShapeA)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
function ShapeA({
backgroundOrientation,
backgroundColor,
borderColor
}) {
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg", {
width: "1440",
height: "744",
viewBox: "0 0 1440 744",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
className: `content-box__shape content-box__shape--${backgroundOrientation}`,
preserveAspectRatio: "none",
vectorEffect: "non-scaling-stroke",
overflow: "visible",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path", {
d: "M0 0H1440V686.701L0 744V0Z",
fill: backgroundColor,
stroke: borderColor,
strokeWidth: borderColor ? "2px" : "0",
style: {
strokeLinejoin: "round",
vectorEffect: "non-scaling-stroke"
}
})
});
}
/***/ }),
/***/ "./src/content-box/shapeB.jsx":
/*!************************************!*\
!*** ./src/content-box/shapeB.jsx ***!
\************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ ShapeB)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
function ShapeB({
backgroundOrientation,
backgroundColor,
borderColor
}) {
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg", {
className: `content-box__shape content-box__shape--${backgroundOrientation}`,
width: "1302",
height: "654",
viewBox: "0 0 1302 654",
preserveAspectRatio: "none",
vectorEffect: "non-scaling-stroke",
overflow: "visible",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path", {
d: "M1302 0L0 15.8281V654L1302 642.633L1302 0Z",
fill: backgroundColor,
stroke: borderColor,
strokeWidth: borderColor ? "2px" : "0",
style: {
strokeLinejoin: "round",
vectorEffect: "non-scaling-stroke"
}
})
});
}
/***/ }),
/***/ "./src/content-box/shapeC.jsx":
/*!************************************!*\
!*** ./src/content-box/shapeC.jsx ***!
\************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ ShapeB)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
function ShapeB({
backgroundOrientation,
backgroundColor,
borderColor
}) {
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg", {
width: "1440",
height: "997",
viewBox: "0 0 1440 997",
className: `content-box__shape content-box__shape--${backgroundOrientation}`,
preserveAspectRatio: "none",
vectorEffect: "non-scaling-stroke",
overflow: "visible",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path", {
d: "M1440 29.8887L0 0V997L1440 979.242V29.8887Z",
fill: backgroundColor,
stroke: borderColor,
strokeWidth: borderColor ? "2px" : "0",
style: {
strokeLinejoin: "round",
vectorEffect: "non-scaling-stroke"
}
})
})
});
}
@ -450,6 +673,16 @@ module.exports = window["wp"]["i18n"];
/***/ }),
/***/ "react":
/*!************************!*\
!*** external "React" ***!
\************************/
/***/ ((module) => {
module.exports = window["React"];
/***/ }),
/***/ "react/jsx-runtime":
/*!**********************************!*\
!*** external "ReactJSXRuntime" ***!

File diff suppressed because one or more lines are too long

View File

@ -1,17 +1,16 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "carhop-plugin/dbmob-grid",
"name": "carhop-blocks/dbmob-archives",
"version": "0.1.0",
"title": "Grid de dictionnaires",
"title": "Archives des notices biographiques",
"category": "carhop-blocks",
"icon": "smiley",
"description": "Grid de dictionnaires",
"example": {},
"description": "Archives des notices biographiques",
"supports": {
"html": false
},
"textdomain": "dbmob-grid",
"textdomain": "carhop-blocks",
"editorScript": "file:./index.js",
"editorStyle": "file:./index.css",
"style": "file:./style-index.css",

View File

@ -1,11 +1,4 @@
/*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.103.0/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.6_webpack@5.103.0/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@16.0.6_sass@1.94.1_webpack@5.103.0/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/dbmob-grid/editor.scss ***!
\************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/**
* The following styles get applied inside the editor only.
*
* Replace them with your own styles or remove the file completely.
*/
.wp-block-carhop-plugin-latest-news {
border: 1px dotted #f00;
}
/*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.103.0/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.6_webpack@5.103.0/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@16.0.6_sass@1.94.1_webpack@5.103.0/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/dbmob-archives/editor.scss ***!
\****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/

View File

@ -0,0 +1 @@
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-i18n', 'wp-server-side-render'), 'version' => '1cc89250b3f9d57c457e');

View File

@ -1,13 +1,4 @@
/*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.103.0/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.6_webpack@5.103.0/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@16.0.6_sass@1.94.1_webpack@5.103.0/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/dbmob-grid/editor.scss ***!
\************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/**
* The following styles get applied inside the editor only.
*
* Replace them with your own styles or remove the file completely.
*/
.wp-block-carhop-plugin-latest-news {
border: 1px dotted #f00;
}
/*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.103.0/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.6_webpack@5.103.0/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@16.0.6_sass@1.94.1_webpack@5.103.0/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/dbmob-archives/editor.scss ***!
\****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/*# sourceMappingURL=index.css.map*/

View File

@ -2,20 +2,20 @@
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ "./src/dbmob-grid/block.json":
/*!***********************************!*\
!*** ./src/dbmob-grid/block.json ***!
\***********************************/
/***/ "./src/dbmob-archives/block.json":
/*!***************************************!*\
!*** ./src/dbmob-archives/block.json ***!
\***************************************/
/***/ ((module) => {
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-plugin/dbmob-grid","version":"0.1.0","title":"Grid de dictionnaires","category":"carhop-blocks","icon":"smiley","description":"Grid de dictionnaires","example":{},"supports":{"html":false},"textdomain":"dbmob-grid","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php","viewScript":"file:./view.js"}');
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/dbmob-archives","version":"0.1.0","title":"Archives des notices biographiques","category":"carhop-blocks","icon":"smiley","description":"Archives des notices biographiques","supports":{"html":false},"textdomain":"carhop-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php","viewScript":"file:./view.js"}');
/***/ }),
/***/ "./src/dbmob-grid/edit.js":
/*!********************************!*\
!*** ./src/dbmob-grid/edit.js ***!
\********************************/
/***/ "./src/dbmob-archives/edit.js":
/*!************************************!*\
!*** ./src/dbmob-archives/edit.js ***!
\************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
@ -26,26 +26,31 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./editor.scss */ "./src/dbmob-grid/editor.scss");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./editor.scss */ "./src/dbmob-archives/editor.scss");
/* harmony import */ var _wordpress_server_side_render__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/server-side-render */ "@wordpress/server-side-render");
/* harmony import */ var _wordpress_server_side_render__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_server_side_render__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
function Edit() {
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("p", {
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)(),
children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Grid de dictionnaires hello from the editor!", "dbmob-grid")
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_server_side_render__WEBPACK_IMPORTED_MODULE_3__.ServerSideRender, {
block: "carhop-blocks/dbmob-archives"
})
});
}
/***/ }),
/***/ "./src/dbmob-grid/editor.scss":
/*!************************************!*\
!*** ./src/dbmob-grid/editor.scss ***!
\************************************/
/***/ "./src/dbmob-archives/editor.scss":
/*!****************************************!*\
!*** ./src/dbmob-archives/editor.scss ***!
\****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
@ -54,18 +59,18 @@ __webpack_require__.r(__webpack_exports__);
/***/ }),
/***/ "./src/dbmob-grid/index.js":
/*!*********************************!*\
!*** ./src/dbmob-grid/index.js ***!
\*********************************/
/***/ "./src/dbmob-archives/index.js":
/*!*************************************!*\
!*** ./src/dbmob-archives/index.js ***!
\*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./src/dbmob-grid/style.scss");
/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/dbmob-grid/edit.js");
/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./block.json */ "./src/dbmob-grid/block.json");
/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./src/dbmob-archives/style.scss");
/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/dbmob-archives/edit.js");
/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./block.json */ "./src/dbmob-archives/block.json");
@ -76,10 +81,10 @@ __webpack_require__.r(__webpack_exports__);
/***/ }),
/***/ "./src/dbmob-grid/style.scss":
/*!***********************************!*\
!*** ./src/dbmob-grid/style.scss ***!
\***********************************/
/***/ "./src/dbmob-archives/style.scss":
/*!***************************************!*\
!*** ./src/dbmob-archives/style.scss ***!
\***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
@ -118,6 +123,16 @@ module.exports = window["wp"]["i18n"];
/***/ }),
/***/ "@wordpress/server-side-render":
/*!******************************************!*\
!*** external ["wp","serverSideRender"] ***!
\******************************************/
/***/ ((module) => {
module.exports = window["wp"]["serverSideRender"];
/***/ }),
/***/ "react/jsx-runtime":
/*!**********************************!*\
!*** external "ReactJSXRuntime" ***!
@ -238,8 +253,8 @@ module.exports = window["ReactJSXRuntime"];
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
/******/ var installedChunks = {
/******/ "dbmob-grid/index": 0,
/******/ "dbmob-grid/style-index": 0
/******/ "dbmob-archives/index": 0,
/******/ "dbmob-archives/style-index": 0
/******/ };
/******/
/******/ // no chunk on demand loading
@ -289,7 +304,7 @@ module.exports = window["ReactJSXRuntime"];
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module depends on other loaded chunks and execution need to be delayed
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["dbmob-grid/style-index"], () => (__webpack_require__("./src/dbmob-grid/index.js")))
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["dbmob-archives/style-index"], () => (__webpack_require__("./src/dbmob-archives/index.js")))
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
/******/
/******/ })()

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,50 @@
<?php
$args = array(
'post_type' => 'dbmob',
'posts_per_page' => -1,
);
$query = new WP_Query($args);
$post_count = $query->found_posts;
?>
<section <?php echo get_block_wrapper_attributes(); ?>>
<h2>Les notices rédigées par le CARHOP</h2>
<div class="notice-toolbar">
<h2 class="post-count">
<span class="post-count__count">
<?php echo $post_count; ?>
</span>
<span class="post-count__text">
<?php _e('notices biographiques', 'carhop-blocks'); ?>
</span>
</h2>
<div class="search-bar">
<label for="search-input"><?php _e('Rechercher une notice par nom', 'carhop-blocks'); ?></label>
<input type="text" placeholder="<?php _e('Rechercher par nom', 'carhop-blocks'); ?>">
</div>
</div>
<?php if ($query->have_posts()) : ?>
<div class="dbmob-grid">
<?php while ($query->have_posts()) : $query->the_post(); ?>
<?php $maitron_url = get_field('maitron_url', get_the_ID()); ?>
<?php get_template_part('template-parts/components/cards/post-card', null, array(
'ID' => get_the_ID(),
'current_post_type' => 'dbmob',
'has_external_link' => isset($maitron_url) && !empty($maitron_url),
'external_link' => $maitron_url,
'external_link_text' => 'Voir la notice',
)); ?>
<?php endwhile; ?>
</ul>
<?php endif; ?>
</section>

View File

@ -0,0 +1,4 @@
/*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.103.0/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.6_webpack@5.103.0/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@16.0.6_sass@1.94.1_webpack@5.103.0/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/dbmob-archives/style.scss ***!
\***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/

View File

@ -0,0 +1,4 @@
/*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.103.0/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.6_webpack@5.103.0/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@16.0.6_sass@1.94.1_webpack@5.103.0/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/dbmob-archives/style.scss ***!
\***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/

View File

@ -0,0 +1 @@
<?php return array('dependencies' => array(), 'version' => '402a8fd622dd4bbb3e35');

View File

@ -0,0 +1,7 @@
/******/ (() => { // webpackBootstrap
/*!************************************!*\
!*** ./src/dbmob-archives/view.js ***!
\************************************/
/******/ })()
;

View File

@ -1 +0,0 @@
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-i18n'), 'version' => 'f091f500d63d357ff901');

View File

@ -1 +0,0 @@
{"version":3,"file":"dbmob-grid/index.css","mappings":";;;AAAA;;;;EAAA;AAMA;EACC;AAAD,C","sources":["webpack://carhop-blocks/./src/dbmob-grid/editor.scss"],"sourcesContent":["/**\n * The following styles get applied inside the editor only.\n *\n * Replace them with your own styles or remove the file completely.\n */\n\n.wp-block-carhop-plugin-latest-news {\n\tborder: 1px dotted #f00;\n}\n"],"names":[],"ignoreList":[],"sourceRoot":""}

File diff suppressed because one or more lines are too long

View File

@ -1,21 +0,0 @@
<?php
$args = array(
'post_type' => 'dbmob',
'posts_per_page' => 8,
);
$query = new WP_Query($args);
?>
<section <?php echo get_block_wrapper_attributes(); ?>>
<h2>DBMOB SAAAALUUUT</h2>
<?php if ($query->have_posts()) : ?>
<div class="dbmob-grid">
<?php while ($query->have_posts()) : $query->the_post(); ?>
<div class="dbmob-grid__item">
<?php the_title(); ?>
</div>
<?php endwhile; ?>
</div>
<?php endif; ?>
</section>

View File

@ -1 +0,0 @@
<?php return array('dependencies' => array(), 'version' => 'b87daaa5998fcf5f9505');

View File

@ -1,7 +0,0 @@
/******/ (() => { // webpackBootstrap
/*!********************************!*\
!*** ./src/dbmob-grid/view.js ***!
\********************************/
/******/ })()
;

View File

@ -1 +1 @@
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-i18n', 'wp-server-side-render'), 'version' => 'ea4b90607e6ac8f10cfd');
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-i18n', 'wp-server-side-render'), 'version' => 'ddb91c7bcda12f8ad371');

View File

@ -119,29 +119,10 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__);
/**
* React hook that is used to mark the block wrapper element.
* It provides all the necessary props like the class name.
*
* @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops
*/
/**
* The save function defines the way in which the different attributes should
* be combined into the final markup, which is then serialized by the block
* editor into `post_content`.
*
* @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save
*
* @return {Element} Element to render.
*/
function save() {
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("p", {
..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_0__.useBlockProps.save(),
children: 'Explore Tags hello from the saved content!'
});
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.Fragment, {});
}
/***/ }),

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n', 'wp-primitives'), 'version' => '6ebaef11b3d9c28c17cc');
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n', 'wp-primitives'), 'version' => '297fe99d163d5b9ab184');

View File

@ -272,7 +272,7 @@ function Edit({
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
className: "narrative-card__content",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks, {
allowedBlocks: ["core/paragraph", "core/heading", "core/image", "carhop-blocks/cta", "carhop-blocks/cta-group", "core/list", "core/list-item"],
allowedBlocks: ["core/paragraph", "core/heading", "core/image", "carhop-blocks/cta", "carhop-blocks/cta-group", "core/list", "core/list-item", "core/group", "core/columns", "core/column", "core/button", "core/buttons"],
template: [["core/heading", {
content: "Lorem ipsum"
}], ["core/paragraph", {

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,20 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "carhop-blocks/see-also",
"version": "0.1.0",
"title": "Voir aussi",
"category": "carhop-blocks",
"icon": "smiley",
"description": "Voir aussi",
"example": {},
"supports": {
"html": false
},
"textdomain": "carhop-blocks",
"editorScript": "file:./index.js",
"editorStyle": "file:./index.css",
"style": "file:./style-index.css",
"viewScript": "file:./view.js",
"render": "file:./render.php"
}

View File

@ -0,0 +1,4 @@
/*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.103.0/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.6_webpack@5.103.0/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@16.0.6_sass@1.94.1_webpack@5.103.0/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/see-also/editor.scss ***!
\**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/

View File

@ -0,0 +1 @@
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-i18n', 'wp-server-side-render'), 'version' => '98464d04c019ac842fca');

View File

@ -0,0 +1,4 @@
/*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.103.0/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.6_webpack@5.103.0/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@16.0.6_sass@1.94.1_webpack@5.103.0/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/see-also/editor.scss ***!
\**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/

View File

@ -0,0 +1,353 @@
/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ "./src/see-also/block.json":
/*!*********************************!*\
!*** ./src/see-also/block.json ***!
\*********************************/
/***/ ((module) => {
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/see-also","version":"0.1.0","title":"Voir aussi","category":"carhop-blocks","icon":"smiley","description":"Voir aussi","example":{},"supports":{"html":false},"textdomain":"carhop-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","render":"file:./render.php"}');
/***/ }),
/***/ "./src/see-also/edit.js":
/*!******************************!*\
!*** ./src/see-also/edit.js ***!
\******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ Edit)
/* harmony export */ });
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_server_side_render__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/server-side-render */ "@wordpress/server-side-render");
/* harmony import */ var _wordpress_server_side_render__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_server_side_render__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./editor.scss */ "./src/see-also/editor.scss");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
function Edit(props) {
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
className: "alignfull"
}),
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)((_wordpress_server_side_render__WEBPACK_IMPORTED_MODULE_2___default()), {
block: "carhop-blocks/see-also",
attributes: props.attributes
})
});
}
/***/ }),
/***/ "./src/see-also/editor.scss":
/*!**********************************!*\
!*** ./src/see-also/editor.scss ***!
\**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/see-also/index.js":
/*!*******************************!*\
!*** ./src/see-also/index.js ***!
\*******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./src/see-also/style.scss");
/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/see-also/edit.js");
/* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./save */ "./src/see-also/save.js");
/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./block.json */ "./src/see-also/block.json");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__);
(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_4__.name, {
icon: {
src: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 28 32",
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("path", {
d: "M0,27v-3.87l3.98-3.97V5.61L9.61,0h8.77l5.63,5.61v13.54l3.98,3.97v3.87"
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("path", {
class: "cls-1",
d: "M9,31h10"
})]
}),
foreground: "#136f63"
},
edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"],
save: _save__WEBPACK_IMPORTED_MODULE_3__["default"]
});
/***/ }),
/***/ "./src/see-also/save.js":
/*!******************************!*\
!*** ./src/see-also/save.js ***!
\******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ save)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
function save() {
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {});
}
/***/ }),
/***/ "./src/see-also/style.scss":
/*!*********************************!*\
!*** ./src/see-also/style.scss ***!
\*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "@wordpress/block-editor":
/*!*************************************!*\
!*** external ["wp","blockEditor"] ***!
\*************************************/
/***/ ((module) => {
module.exports = window["wp"]["blockEditor"];
/***/ }),
/***/ "@wordpress/blocks":
/*!********************************!*\
!*** external ["wp","blocks"] ***!
\********************************/
/***/ ((module) => {
module.exports = window["wp"]["blocks"];
/***/ }),
/***/ "@wordpress/i18n":
/*!******************************!*\
!*** external ["wp","i18n"] ***!
\******************************/
/***/ ((module) => {
module.exports = window["wp"]["i18n"];
/***/ }),
/***/ "@wordpress/server-side-render":
/*!******************************************!*\
!*** external ["wp","serverSideRender"] ***!
\******************************************/
/***/ ((module) => {
module.exports = window["wp"]["serverSideRender"];
/***/ }),
/***/ "react/jsx-runtime":
/*!**********************************!*\
!*** external "ReactJSXRuntime" ***!
\**********************************/
/***/ ((module) => {
module.exports = window["ReactJSXRuntime"];
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = __webpack_modules__;
/******/
/************************************************************************/
/******/ /* webpack/runtime/chunk loaded */
/******/ (() => {
/******/ var deferred = [];
/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
/******/ if(chunkIds) {
/******/ priority = priority || 0;
/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
/******/ deferred[i] = [chunkIds, fn, priority];
/******/ return;
/******/ }
/******/ var notFulfilled = Infinity;
/******/ for (var i = 0; i < deferred.length; i++) {
/******/ var [chunkIds, fn, priority] = deferred[i];
/******/ var fulfilled = true;
/******/ for (var j = 0; j < chunkIds.length; j++) {
/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
/******/ chunkIds.splice(j--, 1);
/******/ } else {
/******/ fulfilled = false;
/******/ if(priority < notFulfilled) notFulfilled = priority;
/******/ }
/******/ }
/******/ if(fulfilled) {
/******/ deferred.splice(i--, 1)
/******/ var r = fn();
/******/ if (r !== undefined) result = r;
/******/ }
/******/ }
/******/ return result;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ () => (module);
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/jsonp chunk loading */
/******/ (() => {
/******/ // no baseURI
/******/
/******/ // object to store loaded and loading chunks
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
/******/ var installedChunks = {
/******/ "see-also/index": 0,
/******/ "see-also/style-index": 0
/******/ };
/******/
/******/ // no chunk on demand loading
/******/
/******/ // no prefetching
/******/
/******/ // no preloaded
/******/
/******/ // no HMR
/******/
/******/ // no HMR manifest
/******/
/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
/******/
/******/ // install a JSONP callback for chunk loading
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
/******/ var [chunkIds, moreModules, runtime] = data;
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0;
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
/******/ for(moduleId in moreModules) {
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
/******/ }
/******/ }
/******/ if(runtime) var result = runtime(__webpack_require__);
/******/ }
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
/******/ for(;i < chunkIds.length; i++) {
/******/ chunkId = chunkIds[i];
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ installedChunks[chunkId][0]();
/******/ }
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/ return __webpack_require__.O(result);
/******/ }
/******/
/******/ var chunkLoadingGlobal = globalThis["webpackChunkcarhop_blocks"] = globalThis["webpackChunkcarhop_blocks"] || [];
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
/******/ })();
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module depends on other loaded chunks and execution need to be delayed
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["see-also/style-index"], () => (__webpack_require__("./src/see-also/index.js")))
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
/******/
/******/ })()
;
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,36 @@
<?php
$wrapper_attributes = get_block_wrapper_attributes(['class' => 'see-also alignfull']);
$title = $attributes['title'] ?? null;
$current_post_ID = $attributes['currentPostID'] ?? get_the_ID();
$current_tags = get_the_terms($current_post_ID, 'etiquettes');
$relate_topic_posts = get_posts(array(
'post_type' => array('analyses-etudes', 'expositions', 'outils-pedagogiques'),
'tax_query' => array(
array(
'taxonomy' => 'etiquettes',
'field' => 'term_id',
'terms' => wp_list_pluck($current_tags, 'term_id'),
),
),
'posts_per_page' => 3,
'post__not_in' => array($current_post_ID),
));
?>
<section <?php echo $wrapper_attributes; ?>>
<div class="inner">
<div class="see-also__titling">
<h2 class="see-also__title title-small">Suggestions</h2>
<h3 class="see-also__subtitle subtitle-big">Voir aussi <br /> sur ce sujet</h3>
</div>
<div class="post-list">
<?php foreach ($relate_topic_posts as $post) : ?>
<?php get_template_part('template-parts/components/cards/post-card', null, array('ID' => $post->ID, 'current_post_type' => $post->post_type)); ?>
<?php endforeach; ?>
</div>
</div>
</section>

View File

@ -1,4 +1,4 @@
/*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.103.0/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.6_webpack@5.103.0/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@16.0.6_sass@1.94.1_webpack@5.103.0/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/dbmob-grid/style.scss ***!
\***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.103.0/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.6_webpack@5.103.0/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@16.0.6_sass@1.94.1_webpack@5.103.0/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/see-also/style.scss ***!
\*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/

View File

@ -1,4 +1,4 @@
/*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.103.0/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.6_webpack@5.103.0/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@16.0.6_sass@1.94.1_webpack@5.103.0/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/dbmob-grid/style.scss ***!
\***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.103.0/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.6_webpack@5.103.0/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@16.0.6_sass@1.94.1_webpack@5.103.0/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/see-also/style.scss ***!
\*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/

View File

@ -0,0 +1 @@
<?php return array('dependencies' => array(), 'version' => '08c02740ddefdfb1e8e7');

View File

@ -0,0 +1,7 @@
/******/ (() => { // webpackBootstrap
/*!******************************!*\
!*** ./src/see-also/view.js ***!
\******************************/
/******/ })()
;

View File

@ -334,6 +334,7 @@ export default function Edit({ attributes, setAttributes, ...props }) {
"core/heading",
"core/paragraph",
"core/list",
"core/file",
"core/button",
"core/buttons",
"carhop-blocks/heading",

View File

@ -38,10 +38,24 @@
"type": "string",
"default": "inherit"
},
"borderColor": {
"type": "string",
"default": null
},
"blockVariant": {
"type": "string",
"default": "framed"
},
"shapeType": {
"type": "string",
"default": "straight",
"enum": [
"straight",
"shapeA",
"shapeB",
"shapeC"
]
},
"blockWidth": {
"type": "string",
"default": "full",

View File

@ -24,8 +24,12 @@ import {
Button,
CheckboxControl,
ColorPalette,
SelectControl,
} from "@wordpress/components";
import ShapeA from "./shapeA.jsx";
import ShapeB from "./shapeB.jsx";
import ShapeC from "./shapeC.jsx";
import { filterBgColors, filterTextColors } from "./utilities";
export default function Edit({ attributes, setAttributes, ...props }) {
@ -38,6 +42,8 @@ export default function Edit({ attributes, setAttributes, ...props }) {
hasLightBackground,
blockVariant,
blockWidth,
shapeType,
borderColor,
} = attributes;
// Détecter le type de post actuel
@ -84,6 +90,9 @@ export default function Edit({ attributes, setAttributes, ...props }) {
setAttributes({ hasLightBackground: true });
}
}
console.log(shapeType);
console.log(blockVariant);
return (
<>
<InspectorControls>
@ -119,48 +128,85 @@ export default function Edit({ attributes, setAttributes, ...props }) {
<ToggleGroupControlOption value="wide" label="Large" />
<ToggleGroupControlOption value="full" label="Pleine largeur" />
</ToggleGroupControl>
</PanelBody>
{(blockVariant === "backgrounded" ||
blockVariant === "framed-backgrounded") && (
<PanelBody
className="deligraph-blocks-components-image__panel-body"
title={__("Arrière plan", "deligraph-blocks")}
>
<ToggleGroupControl
className="deligraph-blocks__variant"
isBlock
label="Type de forme"
onChange={(value) => setAttributes({ shapeType: value })}
value={shapeType}
>
<ToggleGroupControlOption label="Droite" value="straight" />
<ToggleGroupControlOption label="Forme A" value="shapeA" />
<ToggleGroupControlOption label="Forme B" value="shapeB" />
<ToggleGroupControlOption label="Forme C" value="shapeC" />
</ToggleGroupControl>
<SelectControl
__next40pxDefaultSize
label="Type de forme"
onChange={(value) => setAttributes({ shapeType: value })}
value={shapeType}
options={[
{
disabled: true,
label: "Type de forme",
value: "",
},
{
label: "Droite",
value: "straight",
},
{
label: "Forme A",
value: "shapeA",
},
{
label: "Forme B",
value: "shapeB",
},
{
label: "Forme C",
value: "shapeC",
},
]}
/>
{blockVariant === "backgrounded" ||
(blockVariant === "framed-backgrounded" && (
<Card>
<CardHeader>
<h1>Couleur de fond</h1>
</CardHeader>
<CardBody>
<>
<ColorPalette
colors={filteredBgColors}
value={backgroundColor}
onChange={onBackgroundColorChange}
/>
</>
</CardBody>
</Card>
))}
</PanelBody>
)}
{(blockVariant === "backgrounded" ||
blockVariant === "framed-backgrounded") &&
postType !== "articles" && (
<Card>
<CardHeader>
<h1>Couleur du texte </h1>
</CardHeader>
<CardBody>
<PanelBody
className="deligraph-blocks-components-image__panel-body"
title={__("Couleur du texte", "deligraph-blocks")}
>
<ColorPalette
colors={filteredTextColors}
value={textColor}
onChange={onTextColorChange}
/>
</CardBody>
</Card>
)}
</PanelBody>
)}
</InspectorControls>
<section
{...useBlockProps({
className: `${
postType !== "articles" && "alignfull"
} content-box content-box--variant-${blockVariant} ${
} content-box content-box--variant-${blockVariant} content-box--${shapeType} ${
hasLightBackground
? "content-box--bg-light"
: "content-box--bg-dark"
@ -176,6 +222,36 @@ export default function Edit({ attributes, setAttributes, ...props }) {
},
})}
>
{blockVariant === "backgrounded" &&
backgroundColor &&
shapeType === "shapeA" && (
<ShapeA backgroundColor={backgroundColor} borderColor={"none"} />
)}
{blockVariant === "backgrounded" &&
backgroundColor &&
shapeType === "shapeB" && (
<ShapeB backgroundColor={backgroundColor} borderColor={"none"} />
)}
{blockVariant === "backgrounded" &&
backgroundColor &&
shapeType === "shapeC" && (
<ShapeC backgroundColor={backgroundColor} borderColor={"none"} />
)}
{blockVariant === "framed" &&
backgroundColor &&
shapeType === "shapeA" && (
<ShapeA backgroundColor={"none"} borderColor={borderColor} />
)}
{blockVariant === "framed" &&
backgroundColor &&
shapeType === "shapeB" && (
<ShapeB backgroundColor={"none"} borderColor={borderColor} />
)}
{blockVariant === "framed" &&
backgroundColor &&
shapeType === "shapeC" && (
<ShapeC backgroundColor={"none"} borderColor={borderColor} />
)}
<div className="content-box__innerblocks">
<InnerBlocks
template={[

View File

@ -1,6 +1,7 @@
import { useBlockProps, InnerBlocks } from "@wordpress/block-editor";
import { isColorLight } from "../../_utilities/utilities";
import ShapeA from "./shapeA.jsx";
import ShapeB from "./shapeB.jsx";
import ShapeC from "./shapeC.jsx";
export default function save({ attributes }) {
const {
backgroundColor,
@ -9,11 +10,14 @@ export default function save({ attributes }) {
hasBackgroundColor,
blockVariant,
blockWidth,
shapeType,
borderColor,
} = attributes;
return (
<section
{...useBlockProps.save({
className: `content-box content-box--variant-${blockVariant} ${
className: `content-box content-box--variant-${blockVariant} content-box--${shapeType} ${
hasLightBackground ? "content-box--bg-light" : "content-box--bg-dark"
}
${blockWidth === "contained" ? "aligncontained" : blockWidth === "wide" ? "alignwide" : "alignfull"}`,
@ -27,6 +31,36 @@ export default function save({ attributes }) {
},
})}
>
{blockVariant === "backgrounded" &&
backgroundColor &&
shapeType === "shapeA" && (
<ShapeA backgroundColor={backgroundColor} borderColor={"none"} />
)}
{blockVariant === "backgrounded" &&
backgroundColor &&
shapeType === "shapeB" && (
<ShapeB backgroundColor={backgroundColor} borderColor={"none"} />
)}
{blockVariant === "backgrounded" &&
backgroundColor &&
shapeType === "shapeC" && (
<ShapeC backgroundColor={backgroundColor} borderColor={"none"} />
)}
{blockVariant === "framed" &&
backgroundColor &&
shapeType === "shapeA" && (
<ShapeA backgroundColor={"none"} borderColor={borderColor} />
)}
{blockVariant === "framed" &&
backgroundColor &&
shapeType === "shapeB" && (
<ShapeB backgroundColor={"none"} borderColor={borderColor} />
)}
{blockVariant === "framed" &&
backgroundColor &&
shapeType === "shapeC" && (
<ShapeC backgroundColor={"none"} borderColor={borderColor} />
)}
<div className="content-box__innerblocks">
<InnerBlocks.Content />
</div>

View File

@ -0,0 +1,32 @@
import React from "react";
export default function ShapeA({
backgroundOrientation,
backgroundColor,
borderColor,
}) {
return (
<svg
width="1440"
height="744"
viewBox="0 0 1440 744"
fill="none"
xmlns="http://www.w3.org/2000/svg"
className={`content-box__shape content-box__shape--${backgroundOrientation}`}
preserveAspectRatio="none"
vectorEffect="non-scaling-stroke"
overflow="visible"
>
<path
d="M0 0H1440V686.701L0 744V0Z"
fill={backgroundColor}
stroke={borderColor}
strokeWidth={borderColor ? "2px" : "0"}
style={{
strokeLinejoin: "round",
vectorEffect: "non-scaling-stroke",
}}
/>
</svg>
);
}

View File

@ -0,0 +1,30 @@
import React from "react";
export default function ShapeB({
backgroundOrientation,
backgroundColor,
borderColor,
}) {
return (
<svg
className={`content-box__shape content-box__shape--${backgroundOrientation}`}
width="1302"
height="654"
viewBox="0 0 1302 654"
preserveAspectRatio="none"
vectorEffect="non-scaling-stroke"
overflow="visible"
>
<path
d="M1302 0L0 15.8281V654L1302 642.633L1302 0Z"
fill={backgroundColor}
stroke={borderColor}
strokeWidth={borderColor ? "2px" : "0"}
style={{
strokeLinejoin: "round",
vectorEffect: "non-scaling-stroke",
}}
/>
</svg>
);
}

View File

@ -0,0 +1,32 @@
import React from "react";
export default function ShapeB({
backgroundOrientation,
backgroundColor,
borderColor,
}) {
return (
<>
<svg
width="1440"
height="997"
viewBox="0 0 1440 997"
className={`content-box__shape content-box__shape--${backgroundOrientation}`}
preserveAspectRatio="none"
vectorEffect="non-scaling-stroke"
overflow="visible"
>
<path
d="M1440 29.8887L0 0V997L1440 979.242V29.8887Z"
fill={backgroundColor}
stroke={borderColor}
strokeWidth={borderColor ? "2px" : "0"}
style={{
strokeLinejoin: "round",
vectorEffect: "non-scaling-stroke",
}}
/>
</svg>
</>
);
}

View File

@ -1,17 +1,16 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "carhop-plugin/dbmob-grid",
"name": "carhop-blocks/dbmob-archives",
"version": "0.1.0",
"title": "Grid de dictionnaires",
"title": "Archives des notices biographiques",
"category": "carhop-blocks",
"icon": "smiley",
"description": "Grid de dictionnaires",
"example": {},
"description": "Archives des notices biographiques",
"supports": {
"html": false
},
"textdomain": "dbmob-grid",
"textdomain": "carhop-blocks",
"editorScript": "file:./index.js",
"editorStyle": "file:./index.css",
"style": "file:./style-index.css",

View File

@ -1,11 +1,11 @@
import { __ } from "@wordpress/i18n";
import { useBlockProps } from "@wordpress/block-editor";
import "./editor.scss";
import { ServerSideRender } from "@wordpress/server-side-render";
export default function Edit() {
return (
<p {...useBlockProps()}>
{__("Grid de dictionnaires hello from the editor!", "dbmob-grid")}
</p>
<div {...useBlockProps()}>
<ServerSideRender block="carhop-blocks/dbmob-archives" />
</div>
);
}

View File

@ -0,0 +1,50 @@
<?php
$args = array(
'post_type' => 'dbmob',
'posts_per_page' => -1,
);
$query = new WP_Query($args);
$post_count = $query->found_posts;
?>
<section <?php echo get_block_wrapper_attributes(); ?>>
<h2>Les notices rédigées par le CARHOP</h2>
<div class="notice-toolbar">
<h2 class="post-count">
<span class="post-count__count">
<?php echo $post_count; ?>
</span>
<span class="post-count__text">
<?php _e('notices biographiques', 'carhop-blocks'); ?>
</span>
</h2>
<div class="search-bar">
<label for="search-input"><?php _e('Rechercher une notice par nom', 'carhop-blocks'); ?></label>
<input type="text" placeholder="<?php _e('Rechercher par nom', 'carhop-blocks'); ?>">
</div>
</div>
<?php if ($query->have_posts()) : ?>
<div class="dbmob-grid">
<?php while ($query->have_posts()) : $query->the_post(); ?>
<?php $maitron_url = get_field('maitron_url', get_the_ID()); ?>
<?php get_template_part('template-parts/components/cards/post-card', null, array(
'ID' => get_the_ID(),
'current_post_type' => 'dbmob',
'has_external_link' => isset($maitron_url) && !empty($maitron_url),
'external_link' => $maitron_url,
'external_link_text' => 'Voir la notice',
)); ?>
<?php endwhile; ?>
</ul>
<?php endif; ?>
</section>

View File

@ -1,9 +0,0 @@
/**
* The following styles get applied inside the editor only.
*
* Replace them with your own styles or remove the file completely.
*/
.wp-block-carhop-plugin-latest-news {
border: 1px dotted #f00;
}

View File

@ -1,21 +0,0 @@
<?php
$args = array(
'post_type' => 'dbmob',
'posts_per_page' => 8,
);
$query = new WP_Query($args);
?>
<section <?php echo get_block_wrapper_attributes(); ?>>
<h2>DBMOB SAAAALUUUT</h2>
<?php if ($query->have_posts()) : ?>
<div class="dbmob-grid">
<?php while ($query->have_posts()) : $query->the_post(); ?>
<div class="dbmob-grid__item">
<?php the_title(); ?>
</div>
<?php endwhile; ?>
</div>
<?php endif; ?>
</section>

View File

@ -1,24 +1,5 @@
/**
* React hook that is used to mark the block wrapper element.
* It provides all the necessary props like the class name.
*
* @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops
*/
import { useBlockProps } from '@wordpress/block-editor';
import { useBlockProps } from "@wordpress/block-editor";
/**
* The save function defines the way in which the different attributes should
* be combined into the final markup, which is then serialized by the block
* editor into `post_content`.
*
* @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save
*
* @return {Element} Element to render.
*/
export default function save() {
return (
<p { ...useBlockProps.save() }>
{ 'Explore Tags hello from the saved content!' }
</p>
);
return <></>;
}

View File

@ -121,7 +121,7 @@ export default function Edit({ attributes, setAttributes }) {
onChange={(value) => setAttributes({ aspectRatio: value })}
help={__(
"Sélectionnez la proportion d'affichage de la carte.",
"carhop-blocks"
"carhop-blocks",
)}
/>
@ -189,6 +189,11 @@ export default function Edit({ attributes, setAttributes }) {
"carhop-blocks/cta-group",
"core/list",
"core/list-item",
"core/group",
"core/columns",
"core/column",
"core/button",
"core/buttons",
]}
template={[
["core/heading", { content: "Lorem ipsum" }],

View File

@ -0,0 +1,20 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "carhop-blocks/see-also",
"version": "0.1.0",
"title": "Voir aussi",
"category": "carhop-blocks",
"icon": "smiley",
"description": "Voir aussi",
"example": {},
"supports": {
"html": false
},
"textdomain": "carhop-blocks",
"editorScript": "file:./index.js",
"editorStyle": "file:./index.css",
"style": "file:./style-index.css",
"viewScript": "file:./view.js",
"render": "file:./render.php"
}

View File

@ -0,0 +1,16 @@
import { __ } from "@wordpress/i18n";
import { useBlockProps } from "@wordpress/block-editor";
import ServerSideRender from "@wordpress/server-side-render";
import "./editor.scss";
export default function Edit(props) {
return (
<div {...useBlockProps({ className: "alignfull" })}>
<ServerSideRender
block="carhop-blocks/see-also"
attributes={props.attributes}
/>
</div>
);
}

View File

@ -0,0 +1,21 @@
import { registerBlockType } from "@wordpress/blocks";
import "./style.scss";
import Edit from "./edit";
import save from "./save";
import metadata from "./block.json";
registerBlockType(metadata.name, {
icon: {
src: (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 32">
<path d="M0,27v-3.87l3.98-3.97V5.61L9.61,0h8.77l5.63,5.61v13.54l3.98,3.97v3.87" />
<path class="cls-1" d="M9,31h10" />
</svg>
),
foreground: "#136f63",
},
edit: Edit,
save,
});

View File

@ -0,0 +1,36 @@
<?php
$wrapper_attributes = get_block_wrapper_attributes(['class' => 'see-also alignfull']);
$title = $attributes['title'] ?? null;
$current_post_ID = $attributes['currentPostID'] ?? get_the_ID();
$current_tags = get_the_terms($current_post_ID, 'etiquettes');
$relate_topic_posts = get_posts(array(
'post_type' => array('analyses-etudes', 'expositions', 'outils-pedagogiques'),
'tax_query' => array(
array(
'taxonomy' => 'etiquettes',
'field' => 'term_id',
'terms' => wp_list_pluck($current_tags, 'term_id'),
),
),
'posts_per_page' => 3,
'post__not_in' => array($current_post_ID),
));
?>
<section <?php echo $wrapper_attributes; ?>>
<div class="inner">
<div class="see-also__titling">
<h2 class="see-also__title title-small">Suggestions</h2>
<h3 class="see-also__subtitle subtitle-big">Voir aussi <br /> sur ce sujet</h3>
</div>
<div class="post-list">
<?php foreach ($relate_topic_posts as $post) : ?>
<?php get_template_part('template-parts/components/cards/post-card', null, array('ID' => $post->ID, 'current_post_type' => $post->post_type)); ?>
<?php endforeach; ?>
</div>
</div>
</section>

View File

@ -0,0 +1,3 @@
export default function save() {
return <></>;
}