FEATURE server side render on editor

This commit is contained in:
Antoine M 2025-10-14 15:56:46 +02:00
parent c62460a65a
commit 0e38ba88b2
4 changed files with 35 additions and 13 deletions

View File

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

View File

@ -26,17 +26,25 @@ __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_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__ = __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_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/explore-tags/editor.scss"); /* harmony import */ var _wordpress_server_side_render__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/server-side-render */ "@wordpress/server-side-render");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime"); /* 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 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_3__ = __webpack_require__(/*! ./editor.scss */ "./src/explore-tags/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() {
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("p", { function Edit(props) {
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)(), return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Explore Tags hello from the editor!", "explore-tags") ...(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: "dynamiques-blocks/explore-tags",
attributes: props.attributes
})
}); });
} }
@ -180,6 +188,16 @@ module.exports = window["wp"]["i18n"];
/***/ }), /***/ }),
/***/ "@wordpress/server-side-render":
/*!******************************************!*\
!*** external ["wp","serverSideRender"] ***!
\******************************************/
/***/ ((module) => {
module.exports = window["wp"]["serverSideRender"];
/***/ }),
/***/ "react/jsx-runtime": /***/ "react/jsx-runtime":
/*!**********************************!*\ /*!**********************************!*\
!*** external "ReactJSXRuntime" ***! !*** external "ReactJSXRuntime" ***!

File diff suppressed because one or more lines are too long

View File

@ -1,12 +1,16 @@
import { __ } from "@wordpress/i18n"; import { __ } from "@wordpress/i18n";
import { useBlockProps } from "@wordpress/block-editor"; import { useBlockProps } from "@wordpress/block-editor";
import ServerSideRender from "@wordpress/server-side-render";
import "./editor.scss"; import "./editor.scss";
export default function Edit() { export default function Edit(props) {
return ( return (
<p {...useBlockProps()}> <div {...useBlockProps({ className: "alignfull" })}>
{__("Explore Tags hello from the editor!", "explore-tags")} <ServerSideRender
</p> block="dynamiques-blocks/explore-tags"
attributes={props.attributes}
/>
</div>
); );
} }