REBUILDING
This commit is contained in:
parent
a492814103
commit
4bf7040ce4
|
|
@ -921,6 +921,28 @@ return array(
|
||||||
'style' => 'file:./style-index.css',
|
'style' => 'file:./style-index.css',
|
||||||
'viewScript' => 'file:./view.js'
|
'viewScript' => 'file:./view.js'
|
||||||
),
|
),
|
||||||
|
'press-ressources' => array(
|
||||||
|
'$schema' => 'https://schemas.wp.org/trunk/block.json',
|
||||||
|
'apiVersion' => 3,
|
||||||
|
'name' => 'carhop-blocks/press-ressources',
|
||||||
|
'version' => '0.1.0',
|
||||||
|
'title' => 'Ressources pour la presse',
|
||||||
|
'category' => 'carhop-blocks',
|
||||||
|
'icon' => 'smiley',
|
||||||
|
'description' => 'Ressources pour la presse',
|
||||||
|
'example' => array(
|
||||||
|
|
||||||
|
),
|
||||||
|
'supports' => array(
|
||||||
|
'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'
|
||||||
|
),
|
||||||
'scroll-story-block' => array(
|
'scroll-story-block' => array(
|
||||||
'$schema' => 'https://schemas.wp.org/trunk/block.json',
|
'$schema' => 'https://schemas.wp.org/trunk/block.json',
|
||||||
'apiVersion' => 3,
|
'apiVersion' => 3,
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-i18n'), 'version' => '7248346e1270cebc7ce0');
|
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-i18n'), 'version' => '25bbbe07634f2070b956');
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ function Edit() {
|
||||||
template: [["core/paragraph", {
|
template: [["core/paragraph", {
|
||||||
placeholder: "Ajouter ici le texte"
|
placeholder: "Ajouter ici le texte"
|
||||||
}]],
|
}]],
|
||||||
allowedBlocks: ["core/paragraph", "core/list", "core/button", "core/buttons", "core/heading", "carhop-blocks/cta", "carhop-blocks/heading"]
|
allowedBlocks: ["core/paragraph", "core/list", "core/button", "core/buttons", "core/heading", "carhop-blocks/cta", "carhop-blocks/heading", "carhop-blocks/press-contact-persons"]
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
20
plugins/carhop-blocks/build/press-ressources/block.json
Normal file
20
plugins/carhop-blocks/build/press-ressources/block.json
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://schemas.wp.org/trunk/block.json",
|
||||||
|
"apiVersion": 3,
|
||||||
|
"name": "carhop-blocks/press-ressources",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"title": "Ressources pour la presse",
|
||||||
|
"category": "carhop-blocks",
|
||||||
|
"icon": "smiley",
|
||||||
|
"description": "Ressources pour la presse",
|
||||||
|
"example": {},
|
||||||
|
"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"
|
||||||
|
}
|
||||||
11
plugins/carhop-blocks/build/press-ressources/index-rtl.css
Normal file
11
plugins/carhop-blocks/build/press-ressources/index-rtl.css
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
/*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** 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/press-ressources/editor.scss ***!
|
||||||
|
\******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||||
|
/**
|
||||||
|
* The following styles get applied inside the editor only.
|
||||||
|
*
|
||||||
|
* Replace them with your own styles or remove the file completely.
|
||||||
|
*/
|
||||||
|
.wp-block-create-block-chapo {
|
||||||
|
border: 1px dotted #f00;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-i18n', 'wp-server-side-render'), 'version' => 'cbf665ebc2b4e5ba373c');
|
||||||
13
plugins/carhop-blocks/build/press-ressources/index.css
Normal file
13
plugins/carhop-blocks/build/press-ressources/index.css
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
/*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** 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/press-ressources/editor.scss ***!
|
||||||
|
\******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||||
|
/**
|
||||||
|
* The following styles get applied inside the editor only.
|
||||||
|
*
|
||||||
|
* Replace them with your own styles or remove the file completely.
|
||||||
|
*/
|
||||||
|
.wp-block-create-block-chapo {
|
||||||
|
border: 1px dotted #f00;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*# sourceMappingURL=index.css.map*/
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"press-ressources/index.css","mappings":";;;AAAA;;;;EAAA;AAMA;EACC;AAAD,C","sources":["webpack://carhop-blocks/./src/press-ressources/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-create-block-chapo {\n\tborder: 1px dotted #f00;\n}\n"],"names":[],"ignoreList":[],"sourceRoot":""}
|
||||||
327
plugins/carhop-blocks/build/press-ressources/index.js
Normal file
327
plugins/carhop-blocks/build/press-ressources/index.js
Normal file
|
|
@ -0,0 +1,327 @@
|
||||||
|
/******/ (() => { // webpackBootstrap
|
||||||
|
/******/ "use strict";
|
||||||
|
/******/ var __webpack_modules__ = ({
|
||||||
|
|
||||||
|
/***/ "./src/press-ressources/block.json":
|
||||||
|
/*!*****************************************!*\
|
||||||
|
!*** ./src/press-ressources/block.json ***!
|
||||||
|
\*****************************************/
|
||||||
|
/***/ ((module) => {
|
||||||
|
|
||||||
|
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/press-ressources","version":"0.1.0","title":"Ressources pour la presse","category":"carhop-blocks","icon":"smiley","description":"Ressources pour la presse","example":{},"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/press-ressources/edit.js":
|
||||||
|
/*!**************************************!*\
|
||||||
|
!*** ./src/press-ressources/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 _editor_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./editor.scss */ "./src/press-ressources/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_4__.jsx)("div", {
|
||||||
|
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
|
||||||
|
className: "alignwide"
|
||||||
|
}),
|
||||||
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)((_wordpress_server_side_render__WEBPACK_IMPORTED_MODULE_3___default()), {
|
||||||
|
block: "carhop-blocks/press-ressources"
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./src/press-ressources/editor.scss":
|
||||||
|
/*!******************************************!*\
|
||||||
|
!*** ./src/press-ressources/editor.scss ***!
|
||||||
|
\******************************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./src/press-ressources/index.js":
|
||||||
|
/*!***************************************!*\
|
||||||
|
!*** ./src/press-ressources/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/press-ressources/style.scss");
|
||||||
|
/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/press-ressources/edit.js");
|
||||||
|
/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./block.json */ "./src/press-ressources/block.json");
|
||||||
|
/* 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__);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_3__.name, {
|
||||||
|
icon: {
|
||||||
|
src: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("svg", {
|
||||||
|
width: "32",
|
||||||
|
height: "32",
|
||||||
|
viewBox: "0 0 32 32",
|
||||||
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("path", {
|
||||||
|
d: "M16 24L8 16L16 8L24 16L16 24Z"
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"]
|
||||||
|
});
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./src/press-ressources/style.scss":
|
||||||
|
/*!*****************************************!*\
|
||||||
|
!*** ./src/press-ressources/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 = {
|
||||||
|
/******/ "press-ressources/index": 0,
|
||||||
|
/******/ "press-ressources/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, ["press-ressources/style-index"], () => (__webpack_require__("./src/press-ressources/index.js")))
|
||||||
|
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
|
||||||
|
/******/
|
||||||
|
/******/ })()
|
||||||
|
;
|
||||||
|
//# sourceMappingURL=index.js.map
|
||||||
File diff suppressed because one or more lines are too long
147
plugins/carhop-blocks/build/press-ressources/render.php
Normal file
147
plugins/carhop-blocks/build/press-ressources/render.php
Normal file
|
|
@ -0,0 +1,147 @@
|
||||||
|
<?php
|
||||||
|
$wrapper_attributes = get_block_wrapper_attributes(['class' => 'press-ressources alignwide']);
|
||||||
|
|
||||||
|
$contact_persons = get_field('contact_persons', 'option');
|
||||||
|
$ressources_graphiques = get_field('ressources_graphiques', 'option');
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<section <?php echo $wrapper_attributes; ?>>
|
||||||
|
<div class="contact-persons">
|
||||||
|
<div class="contact-persons__content">
|
||||||
|
|
||||||
|
<ul class="contact-persons__list">
|
||||||
|
<?php foreach ($contact_persons as $person) : ?>
|
||||||
|
<?php get_template_part('template-parts/cards/author-card', '', array('member_id' => $person->ID)); ?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="press-toolbar" class="press-toolbar">
|
||||||
|
<div role="tablist" aria-labelledby="tablist-1" class="tablist">
|
||||||
|
<button id="tab-1" type="button" role="tab" aria-selected="true" aria-controls="tabpanel-1" data-tab="communiques">
|
||||||
|
<img class="icon" src="<?php echo get_template_directory_uri(); ?>/resources/img/icons/carhop-plan.svg" alt="">
|
||||||
|
<span>Communiqués de presse</span>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
|
||||||
|
<button id="tab-2" type="button" role="tab" aria-selected="false" aria-controls="tabpanel-2" tabindex="-1" data-tab="ressources-graphiques">
|
||||||
|
<img class="icon" src="<?php echo get_template_directory_uri(); ?>/resources/img/icons/carhop-plume.svg" alt="">
|
||||||
|
<span>Ressources graphiques</span>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button id="tab-3" type="button" role="tab" aria-selected="false" aria-controls="tabpanel-3" tabindex="-1" data-tab="presse-reviews">
|
||||||
|
<img class="icon" src="<?php echo get_template_directory_uri(); ?>/resources/img/icons/carhop-note-biographique.svg" alt="">
|
||||||
|
<span>Ce que la presse dit de nous</span>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="ressources-tabs-grid ressources-grid-content-wrapper" data-active-tab="communiques">
|
||||||
|
<div class="communiques-de-presse">
|
||||||
|
<?php
|
||||||
|
$communiques_de_presse = get_posts(array(
|
||||||
|
'post_type' => 'communique-presse',
|
||||||
|
'posts_per_page' => 10,
|
||||||
|
));
|
||||||
|
?>
|
||||||
|
<h2 class="communiques-de-presse__title">Nos Communiqués de presse</h2>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="communiques-de-presse__list">
|
||||||
|
|
||||||
|
<?php foreach ($communiques_de_presse as $communique) : ?>
|
||||||
|
<div class="communique-card">
|
||||||
|
<h3><?php echo get_the_title($communique->ID); ?></h3>
|
||||||
|
<p><?php echo get_the_date('d F Y', $communique->ID); ?></p>
|
||||||
|
<a href="<?php echo get_permalink($communique->ID); ?>" class="button">Voir le communiqué</a>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="ressources-graphiques">
|
||||||
|
<h2 class="ressources-graphiques__title">Ressources</h2>
|
||||||
|
|
||||||
|
<ul class="contact-datas">
|
||||||
|
<li class="contact-datas__item">
|
||||||
|
<h3>contact direct</h3>
|
||||||
|
<a href="mailto:info@carhop.be">info@carhop.be</a>
|
||||||
|
<a href="tel:+3267485861">+32 67 48 58 61</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="contact-datas__item">
|
||||||
|
<h3>Adresse postale</h3>
|
||||||
|
<p>Avenue de la Houssière, 80
|
||||||
|
<br>7090 Braine-le-Comte
|
||||||
|
</p>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="contact-datas__item socials">
|
||||||
|
<h3>Réseaux sociaux</h3>
|
||||||
|
<?php echo carhop_display_social_links(); ?>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<h2 class="ressources-graphiques__title is-style-stroked-after">Ressources graphiques</h2>
|
||||||
|
|
||||||
|
<?php if (isset($ressources_graphiques) && !empty($ressources_graphiques)) : ?>
|
||||||
|
<ul class="download-list">
|
||||||
|
<div class="list-heading" aria-hidden="true">
|
||||||
|
<span>Type de fichier</span>
|
||||||
|
<span>Format</span>
|
||||||
|
<span>Poids</span>
|
||||||
|
</div>
|
||||||
|
<?php foreach ($ressources_graphiques as $ressource) : ?>
|
||||||
|
|
||||||
|
<?php if (!isset($ressource['file']) || empty($ressource['file'])) continue; ?>
|
||||||
|
<li class="download-list__item">
|
||||||
|
<a href="<?php echo esc_url($ressource['file']['url']); ?>" download>
|
||||||
|
<span class="file-name"><?php echo $ressource['file']['title']; ?></span>
|
||||||
|
<span class="file-format"><?php echo $ressource['file']['subtype']; ?></span>
|
||||||
|
<span class="file-size"><?php echo size_format($ressource['file']['filesize']); ?></span>
|
||||||
|
<span class="download-link">Télécharger</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<li class="download-list__item">
|
||||||
|
<a href="/assets/carhop-logo-couleurs.jpg" download>
|
||||||
|
<span class="file-name">Logo CARHOP (couleurs) en JPG</span>
|
||||||
|
<span class="file-format">JPG</span>
|
||||||
|
<span class="file-size">124 ko</span>
|
||||||
|
<span class="download-link">Télécharger</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="sr-only">
|
||||||
|
Liste des fichiers disponibles au téléchargement, avec leur format et leur poids.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="presse-reviews">
|
||||||
|
<h2 class="presse-reviews__title"><?php echo get_the_title(1135); ?> </h2>
|
||||||
|
<?php
|
||||||
|
// Récupérer la page et simuler son contexte pour charger les scripts des blocs
|
||||||
|
$page_1135 = get_post(1135);
|
||||||
|
if ($page_1135) {
|
||||||
|
global $post;
|
||||||
|
$original_post = $post;
|
||||||
|
$post = $page_1135;
|
||||||
|
setup_postdata($post);
|
||||||
|
|
||||||
|
// Utiliser do_blocks() pour parser et rendre les blocs correctement
|
||||||
|
// Cela déclenche le chargement des scripts view.js des blocs
|
||||||
|
echo do_blocks($page_1135->post_content);
|
||||||
|
|
||||||
|
wp_reset_postdata();
|
||||||
|
$post = $original_post;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
/*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** 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/press-ressources/style.scss ***!
|
||||||
|
\*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||||
|
/**
|
||||||
|
* The following styles get applied both on the front of your site
|
||||||
|
* and in the editor.
|
||||||
|
*
|
||||||
|
* Replace them with your own styles or remove the file completely.
|
||||||
|
*/
|
||||||
|
.wp-block-create-block-chapo {
|
||||||
|
background-color: #21759b;
|
||||||
|
color: #fff;
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
16
plugins/carhop-blocks/build/press-ressources/style-index.css
Normal file
16
plugins/carhop-blocks/build/press-ressources/style-index.css
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
/*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** 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/press-ressources/style.scss ***!
|
||||||
|
\*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||||
|
/**
|
||||||
|
* The following styles get applied both on the front of your site
|
||||||
|
* and in the editor.
|
||||||
|
*
|
||||||
|
* Replace them with your own styles or remove the file completely.
|
||||||
|
*/
|
||||||
|
.wp-block-create-block-chapo {
|
||||||
|
background-color: #21759b;
|
||||||
|
color: #fff;
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*# sourceMappingURL=style-index.css.map*/
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"press-ressources/style-index.css","mappings":";;;AAAA;;;;;EAAA;AAOA;EACC;EACA;EACA;AAAD,C","sources":["webpack://carhop-blocks/./src/press-ressources/style.scss"],"sourcesContent":["/**\n * The following styles get applied both on the front of your site\n * and in the editor.\n *\n * Replace them with your own styles or remove the file completely.\n */\n\n.wp-block-create-block-chapo {\n\tbackground-color: #21759b;\n\tcolor: #fff;\n\tpadding: 2px;\n}\n"],"names":[],"ignoreList":[],"sourceRoot":""}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
<?php return array('dependencies' => array(), 'version' => '519a0e2709812a903d67');
|
||||||
28
plugins/carhop-blocks/build/press-ressources/view.js
Normal file
28
plugins/carhop-blocks/build/press-ressources/view.js
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
/******/ (() => { // webpackBootstrap
|
||||||
|
/*!**************************************!*\
|
||||||
|
!*** ./src/press-ressources/view.js ***!
|
||||||
|
\**************************************/
|
||||||
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
|
const toolbar = document.querySelector("#press-toolbar");
|
||||||
|
if (!toolbar) return;
|
||||||
|
const toolbarButtons = toolbar.querySelectorAll("button");
|
||||||
|
const ressourcesGridContentWrapper = document.querySelector(".ressources-grid-content-wrapper");
|
||||||
|
function setActiveTab(currentButton) {
|
||||||
|
toolbarButtons.forEach(button => {
|
||||||
|
button.setAttribute("aria-selected", "false");
|
||||||
|
});
|
||||||
|
currentButton.setAttribute("aria-selected", "true");
|
||||||
|
ressourcesGridContentWrapper.setAttribute("data-active-tab", currentButton.getAttribute("data-tab"));
|
||||||
|
}
|
||||||
|
function initToolbar() {
|
||||||
|
toolbarButtons.forEach(button => {
|
||||||
|
button.addEventListener("click", function () {
|
||||||
|
setActiveTab(button);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
initToolbar();
|
||||||
|
});
|
||||||
|
/******/ })()
|
||||||
|
;
|
||||||
|
//# sourceMappingURL=view.js.map
|
||||||
1
plugins/carhop-blocks/build/press-ressources/view.js.map
Normal file
1
plugins/carhop-blocks/build/press-ressources/view.js.map
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"press-ressources/view.js","mappings":";;;;AAAAA,QAAQ,CAACC,gBAAgB,CAAC,kBAAkB,EAAE,YAAY;EACzD,MAAMC,OAAO,GAAGF,QAAQ,CAACG,aAAa,CAAC,gBAAgB,CAAC;EACxD,IAAI,CAACD,OAAO,EAAE;EACd,MAAME,cAAc,GAAGF,OAAO,CAACG,gBAAgB,CAAC,QAAQ,CAAC;EACzD,MAAMC,4BAA4B,GAAGN,QAAQ,CAACG,aAAa,CAC1D,kCACD,CAAC;EAED,SAASI,YAAYA,CAACC,aAAa,EAAE;IACpCJ,cAAc,CAACK,OAAO,CAAEC,MAAM,IAAK;MAClCA,MAAM,CAACC,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC;IAC9C,CAAC,CAAC;IAEFH,aAAa,CAACG,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC;IACnDL,4BAA4B,CAACK,YAAY,CACxC,iBAAiB,EACjBH,aAAa,CAACI,YAAY,CAAC,UAAU,CACtC,CAAC;EACF;EAEA,SAASC,WAAWA,CAAA,EAAG;IACtBT,cAAc,CAACK,OAAO,CAAEC,MAAM,IAAK;MAClCA,MAAM,CAACT,gBAAgB,CAAC,OAAO,EAAE,YAAY;QAC5CM,YAAY,CAACG,MAAM,CAAC;MACrB,CAAC,CAAC;IACH,CAAC,CAAC;EACH;EACAG,WAAW,CAAC,CAAC;AACd,CAAC,CAAC,C","sources":["webpack://carhop-blocks/./src/press-ressources/view.js"],"sourcesContent":["document.addEventListener(\"DOMContentLoaded\", function () {\r\n\tconst toolbar = document.querySelector(\"#press-toolbar\");\r\n\tif (!toolbar) return;\r\n\tconst toolbarButtons = toolbar.querySelectorAll(\"button\");\r\n\tconst ressourcesGridContentWrapper = document.querySelector(\r\n\t\t\".ressources-grid-content-wrapper\"\r\n\t);\r\n\r\n\tfunction setActiveTab(currentButton) {\r\n\t\ttoolbarButtons.forEach((button) => {\r\n\t\t\tbutton.setAttribute(\"aria-selected\", \"false\");\r\n\t\t});\r\n\r\n\t\tcurrentButton.setAttribute(\"aria-selected\", \"true\");\r\n\t\tressourcesGridContentWrapper.setAttribute(\r\n\t\t\t\"data-active-tab\",\r\n\t\t\tcurrentButton.getAttribute(\"data-tab\")\r\n\t\t);\r\n\t}\r\n\r\n\tfunction initToolbar() {\r\n\t\ttoolbarButtons.forEach((button) => {\r\n\t\t\tbutton.addEventListener(\"click\", function () {\r\n\t\t\t\tsetActiveTab(button);\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\tinitToolbar();\r\n});\r\n"],"names":["document","addEventListener","toolbar","querySelector","toolbarButtons","querySelectorAll","ressourcesGridContentWrapper","setActiveTab","currentButton","forEach","button","setAttribute","getAttribute","initToolbar"],"ignoreList":[],"sourceRoot":""}
|
||||||
|
|
@ -1 +1 @@
|
||||||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '1f52d271b768de8e56d3');
|
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '025809f38879d8aa4d9f');
|
||||||
|
|
|
||||||
|
|
@ -39,15 +39,15 @@ __webpack_require__.r(__webpack_exports__);
|
||||||
|
|
||||||
// Enregistrement du style de bloc
|
// Enregistrement du style de bloc
|
||||||
|
|
||||||
(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockStyle)("core/column", {
|
(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockStyle)("core/columns", {
|
||||||
name: "sticky-column",
|
name: "sticky-columns",
|
||||||
label: "Colonne sticky"
|
label: "Colonnes sticky"
|
||||||
});
|
});
|
||||||
|
|
||||||
// Fonction pour vérifier si le style sticky-columns est appliqué
|
// Fonction pour vérifier si le style sticky-columns est appliqué
|
||||||
const hasStickyColumnStyle = attributes => {
|
const hasStickyColumnsStyle = attributes => {
|
||||||
const className = attributes?.className || "";
|
const className = attributes?.className || "";
|
||||||
return className.includes("is-style-sticky-column");
|
return className.includes("is-style-sticky-columns");
|
||||||
};
|
};
|
||||||
|
|
||||||
// -----------------------------
|
// -----------------------------
|
||||||
|
|
@ -55,7 +55,7 @@ const hasStickyColumnStyle = attributes => {
|
||||||
// -----------------------------
|
// -----------------------------
|
||||||
(0,_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__.addFilter)("blocks.getSaveElement", "carhop/sticky-columns-wrapper", (element, blockType, attributes) => {
|
(0,_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__.addFilter)("blocks.getSaveElement", "carhop/sticky-columns-wrapper", (element, blockType, attributes) => {
|
||||||
// Vérifier si c'est le bloc core/columns et si le style sticky-columns est appliqué
|
// Vérifier si c'est le bloc core/columns et si le style sticky-columns est appliqué
|
||||||
if (blockType.name !== "core/column" || !hasStickyColumnStyle(attributes)) {
|
if (blockType.name !== "core/columns" || !hasStickyColumnsStyle(attributes)) {
|
||||||
return element;
|
return element;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -64,37 +64,59 @@ const hasStickyColumnStyle = attributes => {
|
||||||
return element;
|
return element;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Envelopper les enfants dans une div avec la classe "sticky-column-wrapper"
|
// Envelopper chaque colonne individuellement dans une div avec la classe "test"
|
||||||
const wrappedChildren = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createElement)("div", {
|
const children = _wordpress_element__WEBPACK_IMPORTED_MODULE_2__.Children.toArray(element.props.children);
|
||||||
className: "sticky-column-wrapper"
|
const wrappedChildren = children.map((child, index) => {
|
||||||
}, element.props.children);
|
// Si c'est un élément React (une colonne), l'envelopper dans une div
|
||||||
|
if (child && typeof child === "object" && child.type) {
|
||||||
|
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createElement)("div", {
|
||||||
|
key: `sticky-column-wrapper-${index}`,
|
||||||
|
className: "test"
|
||||||
|
}, child);
|
||||||
|
}
|
||||||
|
// Sinon, retourner tel quel
|
||||||
|
return child;
|
||||||
|
});
|
||||||
|
|
||||||
// Retourner l'élément avec les enfants enveloppés
|
// Retourner l'élément avec les enfants enveloppés
|
||||||
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createElement)(element.type, {
|
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.cloneElement)(element, {
|
||||||
...element.props,
|
...element.props,
|
||||||
children: wrappedChildren
|
children: wrappedChildren
|
||||||
}, wrappedChildren);
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// -----------------------------
|
// -----------------------------
|
||||||
// 2. Modifier l'affichage dans l'éditeur pour envelopper les colonnes dans une div avec la classe "test"
|
// 2. Modifier l'affichage dans l'éditeur pour envelopper les colonnes dans une div avec la classe "test"
|
||||||
|
// Note: Le rendu côté serveur est géré par render.php
|
||||||
|
// Pour l'éditeur, on utilise un filtre sur BlockEdit pour modifier le rendu
|
||||||
// -----------------------------
|
// -----------------------------
|
||||||
(0,_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__.addFilter)("editor.BlockEdit", "carhop/sticky-columns-editor-wrapper", (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__.createHigherOrderComponent)(BlockEdit => {
|
(0,_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__.addFilter)("editor.BlockEdit", "carhop/sticky-columns-editor-wrapper", (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__.createHigherOrderComponent)(BlockEdit => {
|
||||||
return props => {
|
return props => {
|
||||||
// Vérifier si c'est le bloc core/column et si le style sticky-column est appliqué
|
// Vérifier si c'est le bloc core/columns et si le style sticky-columns est appliqué
|
||||||
if (props.name !== "core/column" || !hasStickyColumnStyle(props.attributes)) {
|
if (props.name !== "core/columns" || !hasStickyColumnsStyle(props.attributes)) {
|
||||||
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(BlockEdit, {
|
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(BlockEdit, {
|
||||||
...props
|
...props
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
console.log(props);
|
|
||||||
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createElement)("div", {
|
// Récupérer le rendu du bloc
|
||||||
className: "sticky-column-wrapper"
|
const blockEditElement = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(BlockEdit, {
|
||||||
}, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(BlockEdit, {
|
|
||||||
...props
|
...props
|
||||||
}));
|
});
|
||||||
|
|
||||||
|
// Si l'élément a des enfants (les inner blocks), on les enveloppe dans une div avec la classe "test"
|
||||||
|
if (blockEditElement && blockEditElement.props && blockEditElement.props.children) {
|
||||||
|
// Cloner l'élément et envelopper les enfants dans une div avec la classe "test"
|
||||||
|
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.cloneElement)(blockEditElement, {
|
||||||
|
...blockEditElement.props,
|
||||||
|
children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createElement)("div", {
|
||||||
|
className: "test"
|
||||||
|
}, blockEditElement.props.children)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return blockEditElement;
|
||||||
};
|
};
|
||||||
}, "withStickyColumnWrapper"));
|
}, "withStickyColumnsWrapper"));
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user