remodeling architecture

This commit is contained in:
Antoine M 2023-08-12 10:48:15 +02:00
parent 9a341f50bc
commit 234c175da0
299 changed files with 285926 additions and 31562 deletions

30
blocks/_starterBlock/.gitignore vendored Normal file
View File

@ -0,0 +1,30 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Coverage directory used by tools like istanbul
coverage
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Output of `npm pack`
*.tgz
# Output of `wp-scripts plugin-zip`
*.zip
# dotenv environment variables file
.env

View File

@ -0,0 +1,17 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"name": "create-block/multiblocks",
"version": "0.1.0",
"title": "Multiblocks",
"category": "homegrade-blocks",
"icon": "smiley",
"description": "Example block scaffolded with Create Block tool.",
"supports": {
"html": false
},
"textdomain": "homegrade-blocks",
"editorScript": "file:./index.js",
"editorStyle": "file:./index.css",
"style": "file:./style-index.css"
}

View File

@ -0,0 +1 @@
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-element', 'wp-i18n'), 'version' => '8aa4d22e32150d18f6c7');

View File

@ -1,12 +1,12 @@
/*!*************************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/__blocka/editor.scss ***!
\*************************************************************************************************************************************************************************************************************************************************/
/*!****************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/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-blocka {
.wp-block-create-block-multiblocks {
border: 1px dotted #f00;
}

View File

@ -0,0 +1 @@
{"version":3,"file":"index.css","mappings":";;;AAAA;;;;EAAA;AAMA;EACC;AAAD,C","sources":["webpack://multiblocks/./src/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-multiblocks {\n\tborder: 1px dotted #f00;\n}\n"],"names":[],"sourceRoot":""}

View File

@ -2,10 +2,10 @@
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ "./src/__nested-parent/nested-children/edit.js":
/*!*****************************************************!*\
!*** ./src/__nested-parent/nested-children/edit.js ***!
\*****************************************************/
/***/ "./src/edit.js":
/*!*********************!*\
!*** ./src/edit.js ***!
\*********************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
@ -18,68 +18,77 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./editor.scss */ "./src/__nested-parent/nested-children/editor.scss");
/* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./editor.scss */ "./src/editor.scss");
function Edit({
attributes,
setAttributes
}) {
const {
userName,
userPosition
} = attributes;
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("section", _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useBlockProps, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.RichText, {
className: "user-name",
onChange: value => setAttributes({
userName: value
}),
value: userName,
placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("UserName Here", "text-box"),
tagName: "p",
allowedFormats: []
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, userPosition));
function Edit() {
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useBlockProps)()
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Multiblocks salut from the editor!", "multiblocks"));
}
/***/ }),
/***/ "./src/__nested-parent/nested-children/index.js":
/*!******************************************************!*\
!*** ./src/__nested-parent/nested-children/index.js ***!
\******************************************************/
/***/ "./src/index.js":
/*!**********************!*\
!*** ./src/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/__nested-parent/nested-children/style.scss");
/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./block.json */ "./src/__nested-parent/nested-children/block.json");
/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./edit */ "./src/__nested-parent/nested-children/edit.js");
/* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./save */ "./src/__nested-parent/nested-children/save.js");
/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./src/style.scss");
/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/edit.js");
/* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./save */ "./src/save.js");
/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./block.json */ "./src/block.json");
/**
* Registers a new block provided a unique name and an object defining its behavior.
*
* @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/
*/
/**
* Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files.
* All files containing `style` keyword are bundled together. The code used
* gets applied both to the front of your site and to the editor.
*
* @see https://www.npmjs.com/package/@wordpress/scripts#using-css
*/
/**
* Internal dependencies
*/
(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_2__.name, {
title: _block_json__WEBPACK_IMPORTED_MODULE_2__.title,
icon: "smiley",
category: "wpblock-blocks",
parent: ["wpblocks-multiple/nested-parent"],
supports: _block_json__WEBPACK_IMPORTED_MODULE_2__.supports,
attributes: _block_json__WEBPACK_IMPORTED_MODULE_2__.attributes,
edit: _edit__WEBPACK_IMPORTED_MODULE_3__["default"],
save: _save__WEBPACK_IMPORTED_MODULE_4__["default"]
/**
* Every block starts by registering a new block type definition.
*
* @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/
*/
(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_4__.name, {
/**
* @see ./edit.js
*/
edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"],
/**
* @see ./save.js
*/
save: _save__WEBPACK_IMPORTED_MODULE_3__["default"]
});
/***/ }),
/***/ "./src/__nested-parent/nested-children/save.js":
/*!*****************************************************!*\
!*** ./src/__nested-parent/nested-children/save.js ***!
\*****************************************************/
/***/ "./src/save.js":
/*!*********************!*\
!*** ./src/save.js ***!
\*********************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
@ -91,27 +100,35 @@ __webpack_require__.r(__webpack_exports__);
/* 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__);
/**
* 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
*/
function save({
attributes
}) {
const {
userName,
userPosition
} = attributes;
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.RichText.Content, {
tagName: "h2",
value: userName,
className: "mydummytext"
});
/**
* 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 {WPElement} Element to render.
*/
function save() {
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save()
}, "Multiblocks salut from the saved content!");
}
/***/ }),
/***/ "./src/__nested-parent/nested-children/editor.scss":
/*!*********************************************************!*\
!*** ./src/__nested-parent/nested-children/editor.scss ***!
\*********************************************************/
/***/ "./src/editor.scss":
/*!*************************!*\
!*** ./src/editor.scss ***!
\*************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
@ -120,10 +137,10 @@ __webpack_require__.r(__webpack_exports__);
/***/ }),
/***/ "./src/__nested-parent/nested-children/style.scss":
/*!********************************************************!*\
!*** ./src/__nested-parent/nested-children/style.scss ***!
\********************************************************/
/***/ "./src/style.scss":
/*!************************!*\
!*** ./src/style.scss ***!
\************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
@ -172,13 +189,13 @@ module.exports = window["wp"]["i18n"];
/***/ }),
/***/ "./src/__nested-parent/nested-children/block.json":
/*!********************************************************!*\
!*** ./src/__nested-parent/nested-children/block.json ***!
\********************************************************/
/***/ "./src/block.json":
/*!************************!*\
!*** ./src/block.json ***!
\************************/
/***/ ((module) => {
module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"wpblocks-multiple/nested-children","version":"0.1.0","title":"Nested Childrenes","category":"homegrade-blocks","icon":{"background":"#0414eb","foreground":"#fff","src":"admin-plugins"},"description":"Children Nested. #ChildrenNested","supports":{"html":false,"reusable":false},"textdomain":"nested-parent","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","attributes":{"userName":{"type":"string"},"userPosition":{"type":"string"}}}');
module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"create-block/multiblocks","version":"0.1.0","title":"Multiblocks","category":"homegrade-blocks","icon":"smiley","description":"Example block scaffolded with Create Block tool.","supports":{"html":false},"textdomain":"homegrade-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css"}');
/***/ })
@ -224,7 +241,9 @@ module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json
/******/ }
/******/ var notFulfilled = Infinity;
/******/ for (var i = 0; i < deferred.length; i++) {
/******/ var [chunkIds, fn, priority] = deferred[i];
/******/ var chunkIds = deferred[i][0];
/******/ var fn = deferred[i][1];
/******/ var priority = deferred[i][2];
/******/ 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])))) {
@ -292,8 +311,8 @@ module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
/******/ var installedChunks = {
/******/ "__nested-parent/nested-children/index": 0,
/******/ "__nested-parent/style-index": 0
/******/ "index": 0,
/******/ "./style-index": 0
/******/ };
/******/
/******/ // no chunk on demand loading
@ -310,7 +329,9 @@ module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json
/******/
/******/ // install a JSONP callback for chunk loading
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
/******/ var [chunkIds, moreModules, runtime] = data;
/******/ var chunkIds = data[0];
/******/ var moreModules = data[1];
/******/ var runtime = data[2];
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0;
@ -333,7 +354,7 @@ module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json
/******/ return __webpack_require__.O(result);
/******/ }
/******/
/******/ var chunkLoadingGlobal = globalThis["webpackChunktest_de_block"] = globalThis["webpackChunktest_de_block"] || [];
/******/ var chunkLoadingGlobal = self["webpackChunkmultiblocks"] = self["webpackChunkmultiblocks"] || [];
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
/******/ })();
@ -343,7 +364,7 @@ module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json
/******/ // 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, ["__nested-parent/style-index"], () => (__webpack_require__("./src/__nested-parent/nested-children/index.js")))
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["./style-index"], () => (__webpack_require__("./src/index.js")))
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
/******/
/******/ })()

File diff suppressed because one or more lines are too long

View File

@ -1,13 +1,13 @@
/*!************************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/__blocka/style.scss ***!
\************************************************************************************************************************************************************************************************************************************************/
/*!***************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/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-blocka {
.wp-block-create-block-multiblocks {
background-color: #21759b;
color: #fff;
padding: 2px;

View File

@ -0,0 +1 @@
{"version":3,"file":"./style-index.css","mappings":";;;AAAA;;;;;EAAA;AAOA;EACC;EACA;EACA;AAAD,C","sources":["webpack://multiblocks/./src/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-multiblocks {\n\tbackground-color: #21759b;\n\tcolor: #fff;\n\tpadding: 2px;\n}\n"],"names":[],"sourceRoot":""}

28142
blocks/_starterBlock/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,20 @@
{
"name": "multiblocks",
"version": "0.1.0",
"description": "Example block scaffolded with Create Block tool.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
"main": "build/index.js",
"scripts": {
"build": "wp-scripts build",
"format": "wp-scripts format",
"lint:css": "wp-scripts lint-style",
"lint:js": "wp-scripts lint-js",
"packages-update": "wp-scripts packages-update",
"plugin-zip": "wp-scripts plugin-zip",
"start": "wp-scripts start"
},
"devDependencies": {
"@wordpress/scripts": "^26.9.0"
}
}

View File

@ -0,0 +1,55 @@
=== Multiblocks ===
Contributors: The WordPress Contributors
Tags: block
Tested up to: 6.1
Stable tag: 0.1.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Example block scaffolded with Create Block tool.
== Description ==
This is the long description. No limit, and you can use Markdown (as well as in the following sections).
For backwards compatibility, if this section is missing, the full length of the short description will be used, and
Markdown parsed.
== Installation ==
This section describes how to install the plugin and get it working.
e.g.
1. Upload the plugin files to the `/wp-content/plugins/multiblocks` directory, or install the plugin through the WordPress plugins screen directly.
1. Activate the plugin through the 'Plugins' screen in WordPress
== Frequently Asked Questions ==
= A question that someone might have =
An answer to that question.
= What about foo bar? =
Answer to foo bar dilemma.
== Screenshots ==
1. This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from
the /assets directory or the directory that contains the stable readme.txt (tags or trunk). Screenshots in the /assets
directory take precedence. For example, `/assets/screenshot-1.png` would win over `/tags/4.3/screenshot-1.png`
(or jpg, jpeg, gif).
2. This is the second screen shot
== Changelog ==
= 0.1.0 =
* Release
== Arbitrary section ==
You may provide arbitrary sections, in the same format as the ones above. This may be of use for extremely complicated
plugins where more information needs to be conveyed that doesn't fit into the categories of "description" or
"installation." Arbitrary sections will be shown below the built-in sections outlined above.

View File

@ -0,0 +1,17 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"name": "create-block/multiblocks",
"version": "0.1.0",
"title": "Multiblocks",
"category": "homegrade-blocks",
"icon": "smiley",
"description": "Example block scaffolded with Create Block tool.",
"supports": {
"html": false
},
"textdomain": "homegrade-blocks",
"editorScript": "file:./index.js",
"editorStyle": "file:./index.css",
"style": "file:./style-index.css"
}

View File

@ -0,0 +1,11 @@
import { __ } from "@wordpress/i18n";
import { useBlockProps } from "@wordpress/block-editor";
import "./editor.scss";
export default function Edit() {
return (
<p {...useBlockProps()}>
{__("Multiblocks salut from the editor!", "multiblocks")}
</p>
);
}

View File

@ -4,6 +4,6 @@
* Replace them with your own styles or remove the file completely.
*/
.wp-block-create-block-blocka {
.wp-block-create-block-multiblocks {
border: 1px dotted #f00;
}

View File

@ -0,0 +1,24 @@
/**
* 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";
/**
* 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 {WPElement} Element to render.
*/
export default function save() {
return (
<p {...useBlockProps.save()}>
{"Multiblocks salut from the saved content!"}
</p>
);
}

View File

@ -5,7 +5,7 @@
* Replace them with your own styles or remove the file completely.
*/
.wp-block-create-block-blocka {
.wp-block-create-block-multiblocks {
background-color: #21759b;
color: #fff;
padding: 2px;

View File

@ -0,0 +1,18 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org
# WordPress Coding Standards
# https://make.wordpress.org/core/handbook/coding-standards/
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab
[*.{yml,yaml}]
indent_style = space
indent_size = 2

30
blocks/chapter-header/.gitignore vendored Normal file
View File

@ -0,0 +1,30 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Coverage directory used by tools like istanbul
coverage
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Output of `npm pack`
*.tgz
# Output of `wp-scripts plugin-zip`
*.zip
# dotenv environment variables file
.env

View File

@ -5,11 +5,6 @@
"version": "0.1.0",
"title": "Chapter Header",
"category": "homegrade-blocks",
"icon": {
"background": "#fff",
"foreground": "#DF1E1E",
"src": "feedback"
},
"description": "Un bloc automatique pour afficher le bandeau de titrage de la page conseil courante",
"supports": {
"html": false

View File

@ -0,0 +1 @@
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-rich-text'), 'version' => '9bfe4f80aaca434b813f');

View File

@ -1,12 +1,12 @@
/*!*******************************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/chapter-header/editor.scss ***!
\*******************************************************************************************************************************************************************************************************************************************************/
/*!****************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/editor.scss ***!
\****************************************************************************************************************************************************************************************************************************************/
/**
* The following styles get applied inside the editor only.
*
* Replace them with your own styles or remove the file completely.
*/
.chapter-header-block .page-thematic-cover {
.homegrade-blocks-chapter-header-block .page-thematic-cover {
max-width: 300px;
}

View File

@ -0,0 +1 @@
{"version":3,"file":"index.css","mappings":";;;AAAA;;;;EAAA;AAOE;EACA;AADF,C","sources":["webpack://multiblocks/./src/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.homegrade-blocks-chapter-header-block {\n\t\t.page-thematic-cover {\n\t\tmax-width: 300px;\n\t}\n}\n"],"names":[],"sourceRoot":""}

View File

@ -2,10 +2,10 @@
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ "./src/chapter-header/edit.js":
/*!************************************!*\
!*** ./src/chapter-header/edit.js ***!
\************************************/
/***/ "./src/edit.js":
/*!*********************!*\
!*** ./src/edit.js ***!
\*********************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
@ -22,8 +22,10 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./editor.scss */ "./src/chapter-header/editor.scss");
/* harmony import */ var _utilities_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utilities.js */ "./utilities.js");
/* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./editor.scss */ "./src/editor.scss");
/* harmony import */ var _utilities_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utilities.js */ "../utilities.js");
/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/rich-text */ "@wordpress/rich-text");
/* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_7__);
@ -32,6 +34,7 @@ __webpack_require__.r(__webpack_exports__);
function Edit({
attributes,
setAttributes
@ -50,7 +53,13 @@ function Edit({
}
}, [postMainTaxonomy]);
let currentGeneralThematique = (_ref = postParentTaxonomy !== null && postParentTaxonomy !== void 0 ? postParentTaxonomy : postMainTaxonomy) !== null && _ref !== void 0 ? _ref : null;
let currentGeneralThematiqueSlug = postParentTaxonomy ? (0,_utilities_js__WEBPACK_IMPORTED_MODULE_6__.getThematiqueFamilySlug)(postParentTaxonomy.slug) : postMainTaxonomy ? (0,_utilities_js__WEBPACK_IMPORTED_MODULE_6__.getThematiqueFamilySlug)(postMainTaxonomy.slug) : null;
// let currentGeneralThematiqueSlug = postParentTaxonomy
// ? getThematiqueFamilySlug(postParentTaxonomy.slug)
// : postMainTaxonomy
// ? getThematiqueFamilySlug(postMainTaxonomy.slug)
// : null;
let currentGeneralThematiqueCover = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => {
if (currentGeneralThematique) {
return select("core").getMedia(currentGeneralThematique.acf.taxonomy_pictures.illustration_s);
@ -60,27 +69,30 @@ function Edit({
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, "Chargement des donn\xE9es..."));
}
if (postMainTaxonomy && postTitle && currentGeneralThematique) {
// console.log(currentGeneralThematique);
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("section", {
className: `chapter-header-block bg-${currentGeneralThematiqueSlug}-light`
className: "homegrade-blocks-chapter-header-block"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "chapter-header-block__infos"
className: "homegrade-blocks-chapter-header-block__infos"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
className: `chapter-header-block__page-thematic-title text-${currentGeneralThematiqueSlug}`
className: "homegrade-blocks-chapter-header-block__page-thematic-title"
}, currentGeneralThematique.name), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.RichText, {
onChange: value => {
console.log(value);
(0,_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_7__.getActiveFormat)(value);
editPost({
title: value
});
},
value: postTitle,
placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Text de placeholrder du bloc chapter-header", "homegrade-theme__bloks-texte-fonctionnel"),
placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Text de placeholrder du bloc chapter-header", "homegrade-blocks__texte-fonctionnel"),
tagName: "h2",
allowedFormats: []
}), postParentTaxonomy && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
href: "",
className: "cta cta--primary cta--buton"
}, "T\xE9l\xE9charger la brochure", " ")), currentGeneralThematiqueCover && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
className: "chapter-header-block__page-thematic-cover page-thematic-cover",
className: "homegrade-blocks-chapter-header-block__page-thematic-cover page-thematic-cover",
src: `${currentGeneralThematiqueCover.source_url}`,
alt: ""
}));
@ -89,18 +101,18 @@ function Edit({
/***/ }),
/***/ "./src/chapter-header/index.js":
/*!*************************************!*\
!*** ./src/chapter-header/index.js ***!
\*************************************/
/***/ "./src/index.js":
/*!**********************!*\
!*** ./src/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/chapter-header/style.scss");
/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/chapter-header/edit.js");
/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./block.json */ "./src/chapter-header/block.json");
/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./src/style.scss");
/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/edit.js");
/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./block.json */ "./src/block.json");
@ -111,20 +123,16 @@ __webpack_require__.r(__webpack_exports__);
/***/ }),
/***/ "./utilities.js":
/*!**********************!*\
!*** ./utilities.js ***!
\**********************/
/***/ "../utilities.js":
/*!***********************!*\
!*** ../utilities.js ***!
\***********************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ getThematiqueFamilySlug: () => (/* binding */ getThematiqueFamilySlug),
/* harmony export */ lol: () => (/* binding */ lol)
/* harmony export */ getThematiqueFamilySlug: () => (/* binding */ getThematiqueFamilySlug)
/* harmony export */ });
function lol(params) {
console.log("lol" + params);
}
function getThematiqueFamilySlug(thematique_slug) {
switch (thematique_slug) {
case "energie":
@ -149,10 +157,10 @@ function getThematiqueFamilySlug(thematique_slug) {
/***/ }),
/***/ "./src/chapter-header/editor.scss":
/*!****************************************!*\
!*** ./src/chapter-header/editor.scss ***!
\****************************************/
/***/ "./src/editor.scss":
/*!*************************!*\
!*** ./src/editor.scss ***!
\*************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
@ -161,10 +169,10 @@ __webpack_require__.r(__webpack_exports__);
/***/ }),
/***/ "./src/chapter-header/style.scss":
/*!***************************************!*\
!*** ./src/chapter-header/style.scss ***!
\***************************************/
/***/ "./src/style.scss":
/*!************************!*\
!*** ./src/style.scss ***!
\************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
@ -233,13 +241,23 @@ module.exports = window["wp"]["i18n"];
/***/ }),
/***/ "./src/chapter-header/block.json":
/*!***************************************!*\
!*** ./src/chapter-header/block.json ***!
\***************************************/
/***/ "@wordpress/rich-text":
/*!**********************************!*\
!*** external ["wp","richText"] ***!
\**********************************/
/***/ ((module) => {
module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"homegrade-content-blocks/chapter-header","version":"0.1.0","title":"Chapter Header","category":"homegrade-blocks","icon":{"background":"#fff","foreground":"#DF1E1E","src":"feedback"},"description":"Un bloc automatique pour afficher le bandeau de titrage de la page conseil courante","supports":{"html":false},"textdomain":"wpblock-latest-posts","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php","attributes":{"blockTitle":{"type":"string","source":"html","selector":"h2"}}}');
module.exports = window["wp"]["richText"];
/***/ }),
/***/ "./src/block.json":
/*!************************!*\
!*** ./src/block.json ***!
\************************/
/***/ ((module) => {
module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"homegrade-content-blocks/chapter-header","version":"0.1.0","title":"Chapter Header","category":"homegrade-blocks","description":"Un bloc automatique pour afficher le bandeau de titrage de la page conseil courante","supports":{"html":false},"textdomain":"wpblock-latest-posts","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php","attributes":{"blockTitle":{"type":"string","source":"html","selector":"h2"}}}');
/***/ })
@ -285,7 +303,9 @@ module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json
/******/ }
/******/ var notFulfilled = Infinity;
/******/ for (var i = 0; i < deferred.length; i++) {
/******/ var [chunkIds, fn, priority] = deferred[i];
/******/ var chunkIds = deferred[i][0];
/******/ var fn = deferred[i][1];
/******/ var priority = deferred[i][2];
/******/ 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])))) {
@ -353,8 +373,8 @@ module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
/******/ var installedChunks = {
/******/ "chapter-header/index": 0,
/******/ "chapter-header/style-index": 0
/******/ "index": 0,
/******/ "./style-index": 0
/******/ };
/******/
/******/ // no chunk on demand loading
@ -371,7 +391,9 @@ module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json
/******/
/******/ // install a JSONP callback for chunk loading
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
/******/ var [chunkIds, moreModules, runtime] = data;
/******/ var chunkIds = data[0];
/******/ var moreModules = data[1];
/******/ var runtime = data[2];
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0;
@ -394,7 +416,7 @@ module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json
/******/ return __webpack_require__.O(result);
/******/ }
/******/
/******/ var chunkLoadingGlobal = globalThis["webpackChunktest_de_block"] = globalThis["webpackChunktest_de_block"] || [];
/******/ var chunkLoadingGlobal = self["webpackChunkmultiblocks"] = self["webpackChunkmultiblocks"] || [];
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
/******/ })();
@ -404,7 +426,7 @@ module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json
/******/ // 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, ["chapter-header/style-index"], () => (__webpack_require__("./src/chapter-header/index.js")))
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["./style-index"], () => (__webpack_require__("./src/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,49 @@
<?php
$thematique = get_the_terms(get_the_ID(), 'thematiques')[0] ?? null;
$thematique_generale = $thematique->parent ? get_term($thematique->parent, 'thematiques') : $thematique;
$thematique_generale_id_fr = apply_filters('wpml_object_id', $thematique_generale->term_id, 'thematiques', TRUE, 'fr');
// Récupère la source de l'image par rapport à l'ID FR pour s'assurer de bien synchroniser les images dans les deux langues
$thematique_picture = get_field('taxonomy_pictures', "thematiques_" . $thematique_generale_id_fr)['illustration_s'] ?? null;
$lastUpdate = get_the_modified_date('', get_the_ID());
$args = array(
// 'fields' => 'ids',
'post_type' => 'brochures',
'posts_per_page' => 1,
'tax_query' => array(
array(
'taxonomy' => 'thematiques',
'field' => 'term_id',
'terms' => $thematique->term_id
)
)
);
$relatedBrochuresPosts = get_posts($args);
$relatedBrochure = get_field('brochure_pdf', $relatedBrochuresPosts[0]->ID) ?? null;
?>
<section class="homegrade-blocks-chapter-header-block">
<div class="homegrade-blocks-chapter-header-block__infos">
<?php if ($thematique->parent == 0) : ?>
<p class="homegrade-blocks-chapter-header-block__page-thematic-title <?php echo "text-" . getThematiqueFamilySlug($thematique_generale->slug) ?>"><?php echo __("Les conseillers Homegrade vous guident", "homegrade-theme__bloks-texte-fonctionnel") ?></p>
<?php else : ?>
<p class="homegrade-blocks-chapter-header-block__page-thematic-title <?php echo "text-" . getThematiqueFamilySlug($thematique_generale->slug) ?>"><?php echo $thematique_generale->name ?></p>
<?php endif; ?>
<h1 class="homegrade-blocks-chapter-header-block__page-title"><?php echo get_the_title() ?></h1>
<?php if ($relatedBrochure) : ?>
<a class="cta cta--primary cta--button" href="<?php echo $relatedBrochure['url'] ?>" target="_blank">Télécharger la brochure <?php echo $relatedBrochures[0]->post_title ?></a>
<?php endif; ?>
<?php if ($lastUpdate) : ?>
<time>Dernière mise à jour : <?php echo $lastUpdate ?></time>
<?php endif; ?>
</div>
<img class="homegrade-blocks-chapter-header-block__page-thematic-cover " src="<?php echo $thematique_picture['url'] ?>" alt="">
</section>

View File

@ -1,19 +1,19 @@
/*!******************************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/chapter-header/style.scss ***!
\******************************************************************************************************************************************************************************************************************************************************/
/*!***************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/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.
*/
.chapter-header-block {
.homegrade-blocks-chapter-header-block {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
.chapter-header-block__page-thematic-cover {
.homegrade-blocks-chapter-header-block__page-thematic-cover {
max-width: 400px;
}

View File

@ -0,0 +1 @@
{"version":3,"file":"./style-index.css","mappings":";;;AAAA;;;;;EAAA;AAOA;EACC;EACA;EACA;EACA;AAAD;AAEC;EACC;AAAF,C","sources":["webpack://multiblocks/./src/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.homegrade-blocks-chapter-header-block {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tmargin-bottom: 20px;\n\n\t&__page-thematic-cover {\n\t\tmax-width: 400px;\n\t}\n}\n"],"names":[],"sourceRoot":""}

28142
blocks/chapter-header/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,20 @@
{
"name": "multiblocks",
"version": "0.1.0",
"description": "Example block scaffolded with Create Block tool.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
"main": "build/index.js",
"scripts": {
"build": "wp-scripts build",
"format": "wp-scripts format",
"lint:css": "wp-scripts lint-style",
"lint:js": "wp-scripts lint-js",
"packages-update": "wp-scripts packages-update",
"plugin-zip": "wp-scripts plugin-zip",
"start": "wp-scripts start"
},
"devDependencies": {
"@wordpress/scripts": "^26.9.0"
}
}

View File

@ -0,0 +1,55 @@
=== Multiblocks ===
Contributors: The WordPress Contributors
Tags: block
Tested up to: 6.1
Stable tag: 0.1.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Example block scaffolded with Create Block tool.
== Description ==
This is the long description. No limit, and you can use Markdown (as well as in the following sections).
For backwards compatibility, if this section is missing, the full length of the short description will be used, and
Markdown parsed.
== Installation ==
This section describes how to install the plugin and get it working.
e.g.
1. Upload the plugin files to the `/wp-content/plugins/multiblocks` directory, or install the plugin through the WordPress plugins screen directly.
1. Activate the plugin through the 'Plugins' screen in WordPress
== Frequently Asked Questions ==
= A question that someone might have =
An answer to that question.
= What about foo bar? =
Answer to foo bar dilemma.
== Screenshots ==
1. This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from
the /assets directory or the directory that contains the stable readme.txt (tags or trunk). Screenshots in the /assets
directory take precedence. For example, `/assets/screenshot-1.png` would win over `/tags/4.3/screenshot-1.png`
(or jpg, jpeg, gif).
2. This is the second screen shot
== Changelog ==
= 0.1.0 =
* Release
== Arbitrary section ==
You may provide arbitrary sections, in the same format as the ones above. This may be of use for extremely complicated
plugins where more information needs to be conveyed that doesn't fit into the categories of "description" or
"installation." Arbitrary sections will be shown below the built-in sections outlined above.

View File

@ -5,11 +5,6 @@
"version": "0.1.0",
"title": "Chapter Header",
"category": "homegrade-blocks",
"icon": {
"background": "#fff",
"foreground": "#DF1E1E",
"src": "feedback"
},
"description": "Un bloc automatique pour afficher le bandeau de titrage de la page conseil courante",
"supports": {
"html": false

View File

@ -24,6 +24,7 @@ import { useEffect, useState } from "@wordpress/element";
import "./editor.scss";
import { getThematiqueFamilySlug } from "../../utilities.js";
import { getActiveFormat } from "@wordpress/rich-text";
export default function Edit({ attributes, setAttributes }) {
const { editPost } = useDispatch("core/editor");
@ -59,11 +60,11 @@ export default function Edit({ attributes, setAttributes }) {
);
let currentGeneralThematique = postParentTaxonomy ?? postMainTaxonomy ?? null;
let currentGeneralThematiqueSlug = postParentTaxonomy
? getThematiqueFamilySlug(postParentTaxonomy.slug)
: postMainTaxonomy
? getThematiqueFamilySlug(postMainTaxonomy.slug)
: null;
// let currentGeneralThematiqueSlug = postParentTaxonomy
// ? getThematiqueFamilySlug(postParentTaxonomy.slug)
// : postMainTaxonomy
// ? getThematiqueFamilySlug(postMainTaxonomy.slug)
// : null;
let currentGeneralThematiqueCover = useSelect(
(select) => {
@ -85,26 +86,24 @@ export default function Edit({ attributes, setAttributes }) {
}
if (postMainTaxonomy && postTitle && currentGeneralThematique) {
// console.log(currentGeneralThematique);
return (
<section
className={`chapter-header-block bg-${currentGeneralThematiqueSlug}-light`}
>
<div className="chapter-header-block__infos">
<p
className={`chapter-header-block__page-thematic-title text-${currentGeneralThematiqueSlug}`}
>
<section className="homegrade-blocks-chapter-header-block">
<div className="homegrade-blocks-chapter-header-block__infos">
<p className="homegrade-blocks-chapter-header-block__page-thematic-title">
{currentGeneralThematique.name}
</p>
<RichText
onChange={(value) => {
console.log(value);
getActiveFormat(value);
editPost({ title: value });
}}
value={postTitle}
placeholder={__(
"Text de placeholrder du bloc chapter-header",
"homegrade-theme__bloks-texte-fonctionnel"
"homegrade-blocks__texte-fonctionnel"
)}
tagName="h2"
allowedFormats={[]}
@ -118,7 +117,7 @@ export default function Edit({ attributes, setAttributes }) {
</div>
{currentGeneralThematiqueCover && (
<img
className="chapter-header-block__page-thematic-cover page-thematic-cover"
className="homegrade-blocks-chapter-header-block__page-thematic-cover page-thematic-cover"
src={`${currentGeneralThematiqueCover.source_url}`}
alt=""
/>

View File

@ -4,7 +4,7 @@
* Replace them with your own styles or remove the file completely.
*/
.chapter-header-block {
.homegrade-blocks-chapter-header-block {
.page-thematic-cover {
max-width: 300px;
}

View File

@ -0,0 +1,49 @@
<?php
$thematique = get_the_terms(get_the_ID(), 'thematiques')[0] ?? null;
$thematique_generale = $thematique->parent ? get_term($thematique->parent, 'thematiques') : $thematique;
$thematique_generale_id_fr = apply_filters('wpml_object_id', $thematique_generale->term_id, 'thematiques', TRUE, 'fr');
// Récupère la source de l'image par rapport à l'ID FR pour s'assurer de bien synchroniser les images dans les deux langues
$thematique_picture = get_field('taxonomy_pictures', "thematiques_" . $thematique_generale_id_fr)['illustration_s'] ?? null;
$lastUpdate = get_the_modified_date('', get_the_ID());
$args = array(
// 'fields' => 'ids',
'post_type' => 'brochures',
'posts_per_page' => 1,
'tax_query' => array(
array(
'taxonomy' => 'thematiques',
'field' => 'term_id',
'terms' => $thematique->term_id
)
)
);
$relatedBrochuresPosts = get_posts($args);
$relatedBrochure = get_field('brochure_pdf', $relatedBrochuresPosts[0]->ID) ?? null;
?>
<section class="homegrade-blocks-chapter-header-block">
<div class="homegrade-blocks-chapter-header-block__infos">
<?php if ($thematique->parent == 0) : ?>
<p class="homegrade-blocks-chapter-header-block__page-thematic-title <?php echo "text-" . getThematiqueFamilySlug($thematique_generale->slug) ?>"><?php echo __("Les conseillers Homegrade vous guident", "homegrade-theme__bloks-texte-fonctionnel") ?></p>
<?php else : ?>
<p class="homegrade-blocks-chapter-header-block__page-thematic-title <?php echo "text-" . getThematiqueFamilySlug($thematique_generale->slug) ?>"><?php echo $thematique_generale->name ?></p>
<?php endif; ?>
<h1 class="homegrade-blocks-chapter-header-block__page-title"><?php echo get_the_title() ?></h1>
<?php if ($relatedBrochure) : ?>
<a class="cta cta--primary cta--button" href="<?php echo $relatedBrochure['url'] ?>" target="_blank">Télécharger la brochure <?php echo $relatedBrochures[0]->post_title ?></a>
<?php endif; ?>
<?php if ($lastUpdate) : ?>
<time>Dernière mise à jour : <?php echo $lastUpdate ?></time>
<?php endif; ?>
</div>
<img class="homegrade-blocks-chapter-header-block__page-thematic-cover " src="<?php echo $thematique_picture['url'] ?>" alt="">
</section>

View File

@ -4,11 +4,7 @@ export default function save({ attributes }) {
const { blocktitle, showDescription } = attributes;
return (
<div
{...useBlockProps.save({
className: `wpblock-latest-posts`,
})}
>
<div>
<RichText.Content
tagName="h2"
value={blocktitle}
@ -21,7 +17,7 @@ export default function save({ attributes }) {
className="description"
onChange={(value) => setAttributes({ blockDescriptionText: value })}
value={blockDescriptionText}
placeholder={__("Test", "text-box")}
placeholder={__("Test", "homegrade-blocks__texte-fonctionnel")}
tagName="p"
allowedFormats={[]}
/>

View File

@ -5,12 +5,12 @@
* Replace them with your own styles or remove the file completely.
*/
.chapter-header-block {
.homegrade-blocks-chapter-header-block {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
&__page-thematic-cover {
max-width: 400px;
}

View File

@ -0,0 +1,18 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org
# WordPress Coding Standards
# https://make.wordpress.org/core/handbook/coding-standards/
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab
[*.{yml,yaml}]
indent_style = space
indent_size = 2

30
blocks/content-heading/.gitignore vendored Normal file
View File

@ -0,0 +1,30 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Coverage directory used by tools like istanbul
coverage
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Output of `npm pack`
*.tgz
# Output of `wp-scripts plugin-zip`
*.zip
# dotenv environment variables file
.env

View File

@ -1 +1 @@
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'e705b01d84e7792bd413');
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '1494d771e2ea47a17583');

View File

@ -1,6 +1,6 @@
/*!********************************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/content-heading/editor.scss ***!
\********************************************************************************************************************************************************************************************************************************************************/
/*!****************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/editor.scss ***!
\****************************************************************************************************************************************************************************************************************************************/
/**
* The following styles get applied inside the editor only.
*

View File

@ -0,0 +1 @@
{"version":3,"file":"index.css","mappings":";;;AAAA;;;;EAAA,C","sources":["webpack://multiblocks/./src/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// .block-editor-image-size-control {\n// \tdisplay: none;\n// }\n"],"names":[],"sourceRoot":""}

View File

@ -2,10 +2,10 @@
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ "./src/content-heading/edit.js":
/*!*************************************!*\
!*** ./src/content-heading/edit.js ***!
\*************************************/
/***/ "./src/edit.js":
/*!*********************!*\
!*** ./src/edit.js ***!
\*********************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
@ -20,7 +20,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./editor.scss */ "./src/content-heading/editor.scss");
/* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./editor.scss */ "./src/editor.scss");
@ -55,10 +55,10 @@ function Edit({
/***/ }),
/***/ "./src/content-heading/index.js":
/*!**************************************!*\
!*** ./src/content-heading/index.js ***!
\**************************************/
/***/ "./src/index.js":
/*!**********************!*\
!*** ./src/index.js ***!
\**********************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
@ -66,10 +66,10 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style.scss */ "./src/content-heading/style.scss");
/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./edit */ "./src/content-heading/edit.js");
/* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./save */ "./src/content-heading/save.js");
/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./block.json */ "./src/content-heading/block.json");
/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style.scss */ "./src/style.scss");
/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./edit */ "./src/edit.js");
/* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./save */ "./src/save.js");
/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./block.json */ "./src/block.json");
@ -96,10 +96,10 @@ __webpack_require__.r(__webpack_exports__);
/***/ }),
/***/ "./src/content-heading/save.js":
/*!*************************************!*\
!*** ./src/content-heading/save.js ***!
\*************************************/
/***/ "./src/save.js":
/*!*********************!*\
!*** ./src/save.js ***!
\*********************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
@ -127,10 +127,10 @@ function save({
/***/ }),
/***/ "./src/content-heading/editor.scss":
/*!*****************************************!*\
!*** ./src/content-heading/editor.scss ***!
\*****************************************/
/***/ "./src/editor.scss":
/*!*************************!*\
!*** ./src/editor.scss ***!
\*************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
@ -139,10 +139,10 @@ __webpack_require__.r(__webpack_exports__);
/***/ }),
/***/ "./src/content-heading/style.scss":
/*!****************************************!*\
!*** ./src/content-heading/style.scss ***!
\****************************************/
/***/ "./src/style.scss":
/*!************************!*\
!*** ./src/style.scss ***!
\************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
@ -201,10 +201,10 @@ module.exports = window["wp"]["i18n"];
/***/ }),
/***/ "./src/content-heading/block.json":
/*!****************************************!*\
!*** ./src/content-heading/block.json ***!
\****************************************/
/***/ "./src/block.json":
/*!************************!*\
!*** ./src/block.json ***!
\************************/
/***/ ((module) => {
module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"homegrade-content-blocks/content-heading","version":"0.1.0","title":"Titre","category":"homegrade-blocks","icon":"smiley","description":"Bloc de titrage","supports":{"html":false},"textdomain":"homegrade-theme__bloks-texte-fonctionnel","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","attributes":{"title":{"type":"string","source":"html","selector":"h3"}}}');
@ -253,7 +253,9 @@ module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json
/******/ }
/******/ var notFulfilled = Infinity;
/******/ for (var i = 0; i < deferred.length; i++) {
/******/ var [chunkIds, fn, priority] = deferred[i];
/******/ var chunkIds = deferred[i][0];
/******/ var fn = deferred[i][1];
/******/ var priority = deferred[i][2];
/******/ 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])))) {
@ -321,8 +323,8 @@ module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
/******/ var installedChunks = {
/******/ "content-heading/index": 0,
/******/ "content-heading/style-index": 0
/******/ "index": 0,
/******/ "./style-index": 0
/******/ };
/******/
/******/ // no chunk on demand loading
@ -339,7 +341,9 @@ module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json
/******/
/******/ // install a JSONP callback for chunk loading
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
/******/ var [chunkIds, moreModules, runtime] = data;
/******/ var chunkIds = data[0];
/******/ var moreModules = data[1];
/******/ var runtime = data[2];
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0;
@ -362,7 +366,7 @@ module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json
/******/ return __webpack_require__.O(result);
/******/ }
/******/
/******/ var chunkLoadingGlobal = globalThis["webpackChunktest_de_block"] = globalThis["webpackChunktest_de_block"] || [];
/******/ var chunkLoadingGlobal = self["webpackChunkmultiblocks"] = self["webpackChunkmultiblocks"] || [];
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
/******/ })();
@ -372,7 +376,7 @@ module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json
/******/ // 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, ["content-heading/style-index"], () => (__webpack_require__("./src/content-heading/index.js")))
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["./style-index"], () => (__webpack_require__("./src/index.js")))
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
/******/
/******/ })()

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
/*!*******************************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/content-heading/style.scss ***!
\*******************************************************************************************************************************************************************************************************************************************************/
/*!***************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/style.scss ***!
\***************************************************************************************************************************************************************************************************************************************/
/**
* The following styles get applied both on the front of your site
* and in the editor.

View File

@ -0,0 +1 @@
{"version":3,"file":"./style-index.css","mappings":";;;AAAA;;;;;EAAA;AAOA;EACC;EACA;EACA;EACA;AAAD;AAEC;EACC;EACA;EACA;EACA;EACA;AAAF;AAEC;EACC;AAAF;AAGC;;EAEC;EACA;AADF;AAIC;EACC;EACA;AAFF;AAGE;;EAEC;AADH;AAIC;EACC;EACA;AAFF;AAIC;EACC;AAFF;AAIE;;EAEC;AAFH;AAMC;;EAEC;EACA;AAJF;AAMC;EACC;KAAA;EACA;AAJF,C","sources":["webpack://multiblocks/./src/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.wpblock-citation-block {\n\tposition: relative;\n\tpadding: 80px 20px;\n\tmargin-top: 50px !important;\n\tmargin-bottom: 50px !important;\n\n\t.wpblock-citation-citation {\n\t\tfont-weight: 600;\n\t\tfont-size: 50px;\n\t\tline-height: 1.2;\n\t\ttext-transform: unset;\n\t\tpadding-bottom: 50px;\n\t}\n\t.wpblock-citation-author {\n\t\tpadding-top: 20px;\n\t}\n\n\t.wpblock-citation-citation,\n\t.wpblock-citation-author {\n\t\tmax-width: 1040px;\n\t\tmargin: 0;\n\t}\n\n\t&.text-align-right {\n\t\tpadding-right: 50px;\n\t\ttext-align: right;\n\t\t.wpblock-citation-citation,\n\t\t.wpblock-citation-author {\n\t\t\tmargin-left: auto;\n\t\t}\n\t}\n\t&.text-align-left {\n\t\tpadding-left: 50px;\n\t\ttext-align: left;\n\t}\n\t&.text-align-center {\n\t\ttext-align: center;\n\n\t\t.wpblock-citation-citation,\n\t\t.wpblock-citation-author {\n\t\t\tmargin: 0 auto;\n\t\t}\n\t}\n\n\tfigure,\n\timg {\n\t\twidth: 100%;\n\t\theight: 250px;\n\t}\n\timg {\n\t\tobject-fit: cover;\n\t\tfilter: brightness(0.3) grayscale(100%) sepia(100%) hue-rotate(200deg)\n\t\t\topacity(0.5);\n\t}\n}\n"],"names":[],"sourceRoot":""}

28142
blocks/content-heading/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,20 @@
{
"name": "multiblocks",
"version": "0.1.0",
"description": "Example block scaffolded with Create Block tool.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
"main": "build/index.js",
"scripts": {
"build": "wp-scripts build",
"format": "wp-scripts format",
"lint:css": "wp-scripts lint-style",
"lint:js": "wp-scripts lint-js",
"packages-update": "wp-scripts packages-update",
"plugin-zip": "wp-scripts plugin-zip",
"start": "wp-scripts start"
},
"devDependencies": {
"@wordpress/scripts": "^26.9.0"
}
}

View File

@ -0,0 +1,55 @@
=== Multiblocks ===
Contributors: The WordPress Contributors
Tags: block
Tested up to: 6.1
Stable tag: 0.1.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Example block scaffolded with Create Block tool.
== Description ==
This is the long description. No limit, and you can use Markdown (as well as in the following sections).
For backwards compatibility, if this section is missing, the full length of the short description will be used, and
Markdown parsed.
== Installation ==
This section describes how to install the plugin and get it working.
e.g.
1. Upload the plugin files to the `/wp-content/plugins/multiblocks` directory, or install the plugin through the WordPress plugins screen directly.
1. Activate the plugin through the 'Plugins' screen in WordPress
== Frequently Asked Questions ==
= A question that someone might have =
An answer to that question.
= What about foo bar? =
Answer to foo bar dilemma.
== Screenshots ==
1. This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from
the /assets directory or the directory that contains the stable readme.txt (tags or trunk). Screenshots in the /assets
directory take precedence. For example, `/assets/screenshot-1.png` would win over `/tags/4.3/screenshot-1.png`
(or jpg, jpeg, gif).
2. This is the second screen shot
== Changelog ==
= 0.1.0 =
* Release
== Arbitrary section ==
You may provide arbitrary sections, in the same format as the ones above. This may be of use for extremely complicated
plugins where more information needs to be conveyed that doesn't fit into the categories of "description" or
"installation." Arbitrary sections will be shown below the built-in sections outlined above.

View File

@ -40,7 +40,7 @@ export default function Edit({ attributes, setAttributes }) {
value={title}
placeholder={__(
"Insérez votre titre ici",
"homegrade-theme__bloks-texte-fonctionnel"
"homegrade-blocks__texte-fonctionnel"
)}
tagName="h3"
/>

View File

@ -0,0 +1,18 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org
# WordPress Coding Standards
# https://make.wordpress.org/core/handbook/coding-standards/
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab
[*.{yml,yaml}]
indent_style = space
indent_size = 2

30
blocks/highlight/.gitignore vendored Normal file
View File

@ -0,0 +1,30 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Coverage directory used by tools like istanbul
coverage
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Output of `npm pack`
*.tgz
# Output of `wp-scripts plugin-zip`
*.zip
# dotenv environment variables file
.env

View File

@ -1,23 +1,26 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"name": "wpblocks-multiple/blocka",
"name": "homegrade-content-blocks/highlight",
"version": "0.1.0",
"title": "Multiple Block A",
"category": "wpblock-blocks",
"description": "Nouvel exemple de block Multiple",
"title": "Mise en avant",
"category": "homegrade-blocks",
"description": "Bloc pour mettre en avant des informations importantes",
"supports": {
"html": false
},
"textdomain": "blocka",
"textdomain": "homegrade-blocks__texte-fonctionnel",
"editorScript": "file:./index.js",
"editorStyle": "file:./index.css",
"style": "file:./style-index.css",
"attributes": {
"montexte": {
"title": {
"type": "string",
"source": "html",
"selector": "h2"
"selector": "h3"
},
"iconName": {
"type": "string"
}
}
}

View File

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

View File

@ -0,0 +1 @@
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '036d7d2b95e0113f6913');

View File

@ -1,13 +1,24 @@
/*!************************************************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/__nested-parent/nested-children/editor.scss ***!
\************************************************************************************************************************************************************************************************************************************************************************/
/*!****************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/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-blocka {
border: 1px dotted #f00;
.homegrade-blocks-highlight ul li {
display: flex;
padding: 10px 0;
}
.homegrade-blocks-highlight ul li:before {
transform: translateY(6px);
flex-shrink: 0;
border-radius: 50%;
content: "";
width: 10px;
height: 10px;
display: inline-block;
margin-right: 10px;
}
/*# sourceMappingURL=index.css.map*/

View File

@ -0,0 +1 @@
{"version":3,"file":"index.css","mappings":";;;AAAA;;;;EAAA;AAQE;EAEC;EACA;AAHH;AAKE;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAHH,C","sources":["webpack://multiblocks/./src/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.homegrade-blocks-highlight {\n\tul {\n\t\tli {\n\t\t\t// list-style: none !important;\n\t\t\tdisplay: flex;\n\t\t\tpadding: 10px 0;\n\t\t}\n\t\tli:before {\n\t\t\ttransform: translateY(6px);\n\t\t\tflex-shrink: 0;\n\t\t\tborder-radius: 50%;\n\t\t\tcontent: \"\";\n\t\t\twidth: 10px;\n\t\t\theight: 10px;\n\t\t\tdisplay: inline-block;\n\t\t\tmargin-right: 10px;\n\t\t}\n\t}\n}\n"],"names":[],"sourceRoot":""}

View File

@ -0,0 +1,740 @@
/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ "./src/img/icon_block_chain.svg":
/*!**************************************!*\
!*** ./src/img/icon_block_chain.svg ***!
\**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ ReactComponent: () => (/* binding */ SvgIconBlockChain),
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* 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__);
var _g;
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
var SvgIconBlockChain = function SvgIconBlockChain(props) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
xmlns: "http://www.w3.org/2000/svg",
width: 16.012,
height: 15.999
}, props), _g || (_g = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
"data-name": "Icon feather-link",
fill: "none",
stroke: "#fff",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: 2
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
"data-name": "Trac\\xE9 18559",
d: "M6.605 8.7a3.5 3.5 0 0 0 5.28.378l2.1-2.1a3.5 3.5 0 1 0-4.95-4.952l-1.2 1.2"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
"data-name": "Trac\\xE9 18560",
d: "M9.407 7.303a3.5 3.5 0 0 0-5.28-.378l-2.1 2.1a3.5 3.5 0 1 0 4.95 4.948l1.2-1.2"
}))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNi4wMTIiIGhlaWdodD0iMTUuOTk5IiB2aWV3Qm94PSIwIDAgMTYuMDEyIDE1Ljk5OSI+CiAgPGcgaWQ9Ikljb25fZmVhdGhlci1saW5rIiBkYXRhLW5hbWU9Ikljb24gZmVhdGhlci1saW5rIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMS45OTMgLTIuMDA3KSI+CiAgICA8cGF0aCBpZD0iVHJhY8OpXzE4NTU5IiBkYXRhLW5hbWU9IlRyYWPDqSAxODU1OSIgZD0iTTE1LDEwLjcwN2EzLjUsMy41LDAsMCwwLDUuMjguMzc4bDIuMS0yLjFBMy41LDMuNSwwLDEsMCwxNy40Myw0LjAzM2wtMS4yLDEuMiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTYuNDAyIDApIiBmaWxsPSJub25lIiBzdHJva2U9IiNmZmYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIi8+CiAgICA8cGF0aCBpZD0iVHJhY8OpXzE4NTYwIiBkYXRhLW5hbWU9IlRyYWPDqSAxODU2MCIgZD0iTTExLjQsMTQuOWEzLjUsMy41LDAsMCwwLTUuMjgtLjM3OGwtMi4xLDIuMUEzLjUsMy41LDAsMSwwLDguOTcsMjEuNTdsMS4yLTEuMiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAtNS41OSkiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2Utd2lkdGg9IjIiLz4KICA8L2c+Cjwvc3ZnPgo=");
/***/ }),
/***/ "./src/img/icon_bulb.svg":
/*!*******************************!*\
!*** ./src/img/icon_bulb.svg ***!
\*******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ ReactComponent: () => (/* binding */ SvgIconBulb),
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* 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__);
var _g;
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
var SvgIconBulb = function SvgIconBulb(props) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
xmlns: "http://www.w3.org/2000/svg",
width: 13.098,
height: 18.409
}, props), _g || (_g = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
"data-name": "Groupe 3209",
fill: "none",
strokeLinecap: "round"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
"data-name": "Union 18",
strokeLinejoin: "round"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
d: "M4.447 14.845a1 1 0 0 1-1-1v-1.787A6.392 6.392 0 0 1 0 6.411 6.481 6.481 0 0 1 6.549 0 6.481 6.481 0 0 1 13.1 6.411a6.393 6.393 0 0 1-3.447 5.647v1.787a1 1 0 0 1-1 1Z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
d: "M7.65 12.845v-.787a2 2 0 0 1 1.068-1.769c1.468-.774 2.38-2.26 2.38-3.878C11.098 3.979 9.058 2 6.549 2 4.041 2 2 3.979 2 6.41c0 1.619.912 3.105 2.38 3.879a2 2 0 0 1 1.067 1.769v.787h2.204m1 2H4.447a1 1 0 0 1-1-1v-1.787C1.395 10.976 0 8.853 0 6.411 0 2.87 2.932 0 6.55 0c3.615 0 6.548 2.87 6.548 6.41 0 2.443-1.395 4.566-3.447 5.648v1.788a1 1 0 0 1-1 1Z",
fill: "#fff"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
"data-name": "Ligne 3197",
stroke: "#fff",
strokeWidth: 2,
d: "M4.096 17.409h4.779"
}))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMy4wOTgiIGhlaWdodD0iMTguNDA5IiB2aWV3Qm94PSIwIDAgMTMuMDk4IDE4LjQwOSI+CiAgPGcgaWQ9Ikdyb3VwZV8zMjA5IiBkYXRhLW5hbWU9Ikdyb3VwZSAzMjA5IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTkzIC00ODEwKSI+CiAgICA8ZyBpZD0iVW5pb25fMTgiIGRhdGEtbmFtZT0iVW5pb24gMTgiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE5MyA0ODEwKSIgZmlsbD0ibm9uZSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj4KICAgICAgPHBhdGggZD0iTTQuNDQ3LDE0Ljg0NWExLDEsMCwwLDEtMS0xVjEyLjA1OEE2LjM5Miw2LjM5MiwwLDAsMSwwLDYuNDExLDYuNDgxLDYuNDgxLDAsMCwxLDYuNTQ5LDAsNi40ODEsNi40ODEsMCwwLDEsMTMuMSw2LjQxMWE2LjM5Myw2LjM5MywwLDAsMS0zLjQ0Nyw1LjY0N3YxLjc4N2ExLDEsMCwwLDEtMSwxWiIgc3Ryb2tlPSJub25lIi8+CiAgICAgIDxwYXRoIGQ9Ik0gNy42NTA3MDAwOTIzMTU2NzQgMTIuODQ1NDk5OTkyMzcwNjEgTCA3LjY1MDcwMDA5MjMxNTY3NCAxMi4wNTgxMTk3NzM4NjQ3NSBDIDcuNjUwNzAwMDkyMzE1Njc0IDExLjMxNjIyMDI4MzUwODMgOC4wNjEzODAzODYzNTI1MzkgMTAuNjM1Mjc5NjU1NDU2NTQgOC43MTc1Nzk4NDE2MTM3NyAxMC4yODkxMzk3NDc2MTk2MyBDIDEwLjE4NTY4OTkyNjE0NzQ2IDkuNTE0NzE5OTYzMDczNzMgMTEuMDk3NzAwMTE5MDE4NTUgOC4wMjg1OTAyMDIzMzE1NDMgMTEuMDk3NzAwMTE5MDE4NTUgNi40MTA2OTk4NDQzNjAzNTIgQyAxMS4wOTc3MDAxMTkwMTg1NSAzLjk3ODYzMDA2NTkxNzk2OSA5LjA1NzI5OTYxMzk1MjYzNyAyIDYuNTQ5MzAwMTkzNzg2NjIxIDIgQyA0LjA0MDgxMDEwODE4NDgxNCAyIDIgMy45Nzg2MzAwNjU5MTc5NjkgMiA2LjQxMDY5OTg0NDM2MDM1MiBDIDIgOC4wMjg2MTAyMjk0OTIxODggMi45MTE5NzAxMzg1NDk4MDUgOS41MTQ2NTk4ODE1OTE3OTcgNC4zODAwMjAxNDE2MDE1NjIgMTAuMjg4OTQwNDI5Njg3NSBDIDUuMDM2MjgwMTU1MTgxODg1IDEwLjYzNTA2MDMxMDM2Mzc3IDUuNDQ3MDAwMDI2NzAyODgxIDExLjMxNjAyOTU0ODY0NTAyIDUuNDQ3MDAwMDI2NzAyODgxIDEyLjA1Nzk3MDA0Njk5NzA3IEwgNS40NDcwMDAwMjY3MDI4ODEgMTIuODQ1NDk5OTkyMzcwNjEgTCA3LjY1MDcwMDA5MjMxNTY3NCAxMi44NDU0OTk5OTIzNzA2MSBNIDguNjUwNzk5NzUxMjgxNzM4IDE0Ljg0NTQ5OTk5MjM3MDYxIEwgNC40NDY4OTk4OTA4OTk2NTggMTQuODQ1NDk5OTkyMzcwNjEgQyAzLjg5NDI5OTk4Mzk3ODI3MSAxNC44NDU0OTk5OTIzNzA2MSAzLjQ0NzAwMDAyNjcwMjg4MSAxNC4zOTcyOTk3NjY1NDA1MyAzLjQ0NzAwMDAyNjcwMjg4MSAxMy44NDU2MDAxMjgxNzM4MyBMIDMuNDQ3MDAwMDI2NzAyODgxIDEyLjA1Nzk3MDA0Njk5NzA3IEMgMS4zOTQ3MDAwNTAzNTQwMDQgMTAuOTc1NTQ5Njk3ODc1OTggNS45NTA5Mjc1NzI5Mzk2OWUtMDggOC44NTI2NDAxNTE5Nzc1MzkgNS45NTA5Mjc1NzI5Mzk2OWUtMDggNi40MTA2OTk4NDQzNjAzNTIgQyA1Ljk1MDkyNzU3MjkzOTY5ZS0wOCAyLjg3MDEwMDAyMTM2MjMwNSAyLjkzMjE5OTk1NDk4NjU3MiAtMy44MTQ2OTc4OTA5MDI2MDdlLTA5IDYuNTQ5MzAwMTkzNzg2NjIxIC0zLjgxNDY5Nzg5MDkwMjYwN2UtMDkgQyAxMC4xNjU0OTk2ODcxOTQ4MiAtMy44MTQ2OTc4OTA5MDI2MDdlLTA5IDEzLjA5NzcwMDExOTAxODU1IDIuODcwMTAwMDIxMzYyMzA1IDEzLjA5NzcwMDExOTAxODU1IDYuNDEwNjk5ODQ0MzYwMzUyIEMgMTMuMDk3NzAwMTE5MDE4NTUgOC44NTI2NDAxNTE5Nzc1MzkgMTEuNzAyNzEwMTUxNjcyMzYgMTAuOTc1NzAwMzc4NDE3OTcgOS42NTA2OTk2MTU0Nzg1MTYgMTIuMDU4MTE5NzczODY0NzUgTCA5LjY1MDY5OTYxNTQ3ODUxNiAxMy44NDU2MDAxMjgxNzM4MyBDIDkuNjUwNjk5NjE1NDc4NTE2IDE0LjM5NzI5OTc2NjU0MDUzIDkuMjAzMzk5NjU4MjAzMTI1IDE0Ljg0NTQ5OTk5MjM3MDYxIDguNjUwNzk5NzUxMjgxNzM4IDE0Ljg0NTQ5OTk5MjM3MDYxIFoiIHN0cm9rZT0ibm9uZSIgZmlsbD0iI2ZmZiIvPgogICAgPC9nPgogICAgPGxpbmUgaWQ9IkxpZ25lXzMxOTciIGRhdGEtbmFtZT0iTGlnbmUgMzE5NyIgeDI9IjQuNzc5IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxOTcuMDk2IDQ4MjcuNDA5KSIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmZmIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS13aWR0aD0iMiIvPgogIDwvZz4KPC9zdmc+Cg==");
/***/ }),
/***/ "./src/img/icon_feather_key.svg":
/*!**************************************!*\
!*** ./src/img/icon_feather_key.svg ***!
\**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ ReactComponent: () => (/* binding */ SvgIconFeatherKey),
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* 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__);
var _path;
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
var SvgIconFeatherKey = function SvgIconFeatherKey(props) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
xmlns: "http://www.w3.org/2000/svg",
width: 17.803,
height: 17.426
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
"data-name": "Icon feather-key",
d: "m16.012 1.414-1.58 1.58M8.419 9.007a4.346 4.346 0 1 1-6.146 0 4.346 4.346 0 0 1 6.146 0Zm0 0 3.248-3.248m0 0 2.37 2.37 2.762-2.764-2.37-2.37M11.667 5.76l2.765-2.766",
fill: "none",
stroke: "#fff",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: 2
})));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNy44MDMiIGhlaWdodD0iMTcuNDI2IiB2aWV3Qm94PSIwIDAgMTcuODAzIDE3LjQyNiI+CiAgPHBhdGggaWQ9Ikljb25fZmVhdGhlci1rZXkiIGRhdGEtbmFtZT0iSWNvbiBmZWF0aGVyLWtleSIgZD0iTTE4LjAxMywzbC0xLjU4LDEuNThNMTAuNDIsMTAuNTkzYTQuMzQ2LDQuMzQ2LDAsMSwxLTYuMTQ2LDAsNC4zNDYsNC4zNDYsMCwwLDEsNi4xNDYsMFptMCwwLDMuMjQ4LTMuMjQ4bTAsMCwyLjM3LDIuMzdMMTguOCw2Ljk1MWwtMi4zNy0yLjM3TTEzLjY2OCw3LjM0NiwxNi40MzMsNC41OCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTIuMDAxIC0xLjU4NikiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2Utd2lkdGg9IjIiLz4KPC9zdmc+Cg==");
/***/ }),
/***/ "./src/img/icon_house.svg":
/*!********************************!*\
!*** ./src/img/icon_house.svg ***!
\********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ ReactComponent: () => (/* binding */ SvgIconHouse),
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* 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__);
var _path;
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
var SvgIconHouse = function SvgIconHouse(props) {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
xmlns: "http://www.w3.org/2000/svg",
width: 12.388,
height: 14.186
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
"data-name": "Trac\\xE9 18534",
d: "M6.194 1 1 5.782v7.4h10.388v-7.4Z",
fill: "none",
stroke: "#fff",
strokeLinecap: "round",
strokeLinejoin: "round",
strokeWidth: 2
})));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMi4zODgiIGhlaWdodD0iMTQuMTg2IiB2aWV3Qm94PSIwIDAgMTIuMzg4IDE0LjE4NiI+CiAgPHBhdGggaWQ9IlRyYWPDqV8xODUzNCIgZGF0YS1uYW1lPSJUcmFjw6kgMTg1MzQiIGQ9Ik05NjAuMjE0LDkyOS40NDJsLTUuMTk0LDQuNzgydjcuNGgxMC4zODh2LTcuNFoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC05NTQuMDIgLTkyOC40NDIpIiBmaWxsPSJub25lIiBzdHJva2U9IiNmZmYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIi8+Cjwvc3ZnPgo=");
/***/ }),
/***/ "./src/edit.js":
/*!*********************!*\
!*** ./src/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_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./editor.scss */ "./src/editor.scss");
/* harmony import */ var _img_icon_feather_key_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./img/icon_feather_key.svg */ "./src/img/icon_feather_key.svg");
/* harmony import */ var _img_icon_block_chain_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./img/icon_block_chain.svg */ "./src/img/icon_block_chain.svg");
/* harmony import */ var _img_icon_house_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./img/icon_house.svg */ "./src/img/icon_house.svg");
/* harmony import */ var _img_icon_bulb_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./img/icon_bulb.svg */ "./src/img/icon_bulb.svg");
/* harmony import */ var _img_icon_feather_key_png__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./img/icon_feather_key.png */ "./src/img/icon_feather_key.png");
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__);
function Edit({
attributes,
setAttributes
}) {
const {
title,
iconName
} = attributes;
const handleIconChange = newIconName => {
setAttributes({
iconName: newIconName
});
};
function getIconPicture() {
switch (iconName) {
case "key":
return _img_icon_feather_key_svg__WEBPACK_IMPORTED_MODULE_3__["default"];
case "chain":
return _img_icon_block_chain_svg__WEBPACK_IMPORTED_MODULE_4__["default"];
case "house":
return _img_icon_house_svg__WEBPACK_IMPORTED_MODULE_5__["default"];
case "bulb":
return _img_icon_bulb_svg__WEBPACK_IMPORTED_MODULE_6__["default"];
}
}
function getDashiconSymbol() {
switch (iconName) {
case "key":
return "admin-network";
case "chain":
return "admin-links";
case "house":
return "admin-home";
case "bulb":
return "lightbulb";
}
}
let iconPicture = getIconPicture();
let iconDashiconSymbol = getDashiconSymbol();
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("section", {
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_8__.useBlockProps)({
className: `homegrade-blocks-highlight`
})
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_8__.BlockControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__.ToolbarDropdownMenu, {
label: "Icone",
icon: iconDashiconSymbol,
isActive: true,
controls: [{
title: "Clé",
icon: "admin-network",
isActive: false,
onClick: () => {
handleIconChange("key");
}
}, {
title: "Lien",
icon: "admin-links",
isActive: true,
onClick: () => {
handleIconChange("chain");
}
}, {
title: "Homegrade",
icon: "admin-home",
isActive: true,
onClick: () => {
handleIconChange("house");
}
}, {
title: "Inspiration",
icon: "lightbulb",
isActive: true,
onClick: () => {
handleIconChange("bulb");
}
}]
})), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "homegrade-blocks-highlight__titling"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "icon"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
src: iconPicture,
alt: ""
})), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_8__.RichText, {
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_8__.useBlockProps)(),
className: "homegrade-blocks-highlight__block-title",
onChange: value => setAttributes({
title: value
}),
value: title,
placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Votre Texte Monsieur", "homegrade-blocks__texte-fonctionnel"),
tagName: "h3",
allowedFormats: []
})), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_8__.InnerBlocks, {
allowedBlocks: ["core/list", "core/paragraph", "core/heading", "wpblocks-multiple/nested-children"],
template: [["core/paragraph"], ["core/list"]]
})));
}
/***/ }),
/***/ "./src/index.js":
/*!**********************!*\
!*** ./src/index.js ***!
\**********************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./style.scss */ "./src/style.scss");
/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./edit */ "./src/edit.js");
/* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./save */ "./src/save.js");
/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./block.json */ "./src/block.json");
(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_6__.name, {
icon: {
src: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
id: "Calque_2",
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 80 77.4"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("g", {
id: "Layer_1"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
d: "m80,66.17v-16.1c0-2.3-2.5-3.8-4.5-2.6l-14,8.1c-.9.5-1.5,1.5-1.5,2.6v16.2c0,2.3,2.5,3.8,4.5,2.6l14-8.1c.9-.6,1.5-1.6,1.5-2.7Z"
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
d: "m55.7,13.78l-14.2,8.2c-.9.5-2.1.5-3,0l-14.2-8.2c-2-1.2-2-4,0-5.2L38.5.38c.9-.5,2.1-.5,3,0l14.2,8.2c2,1.1,2,4,0,5.2Z"
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
d: "m58.7,19.68l-.7.4c-2,1.2-2,4,0,5.2l7.1,4.1c.9.5,1.5,1.5,1.5,2.6v7.6c0,2.3,2.5,3.8,4.5,2.6l.7-.4c.9-.5,1.5-1.5,1.5-2.6v-11c0-1.1-.6-2.1-1.5-2.6l-10.1-5.8c-.9-.6-2.1-.6-3-.1Z"
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
d: "m0,66.17v-16.1c0-2.3,2.5-3.8,4.5-2.6l14,8.1c.9.5,1.5,1.5,1.5,2.6v16.2c0,2.3-2.5,3.8-4.5,2.6l-14-8.1c-.9-.6-1.5-1.6-1.5-2.7Z"
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
d: "m21.3,19.68l.7.4c2,1.2,2,4,0,5.2l-7.1,4.1c-.9.5-1.5,1.5-1.5,2.6v7.6c0,2.3-2.5,3.8-4.5,2.6l-.7-.4c-.9-.5-1.5-1.5-1.5-2.6v-11.1c0-1.1.6-2.1,1.5-2.6l10.1-5.8c.9-.5,2.1-.5,3,0Z"
}))),
foreground: "#DF1E1E"
},
edit: _edit__WEBPACK_IMPORTED_MODULE_4__["default"],
save: _save__WEBPACK_IMPORTED_MODULE_5__["default"]
});
/***/ }),
/***/ "./src/save.js":
/*!*********************!*\
!*** ./src/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 _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__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_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _img_icon_feather_key_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./img/icon_feather_key.svg */ "./src/img/icon_feather_key.svg");
/* harmony import */ var _img_icon_block_chain_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./img/icon_block_chain.svg */ "./src/img/icon_block_chain.svg");
/* harmony import */ var _img_icon_house_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./img/icon_house.svg */ "./src/img/icon_house.svg");
/* harmony import */ var _img_icon_bulb_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./img/icon_bulb.svg */ "./src/img/icon_bulb.svg");
// pour les querry
function save({
attributes,
setAttributes
}) {
const {
title,
iconName
} = attributes;
function getIconPicture() {
switch (iconName) {
case "key":
return _img_icon_feather_key_svg__WEBPACK_IMPORTED_MODULE_4__["default"];
case "chain":
return _img_icon_block_chain_svg__WEBPACK_IMPORTED_MODULE_5__["default"];
case "house":
return _img_icon_house_svg__WEBPACK_IMPORTED_MODULE_6__["default"];
case "bulb":
return _img_icon_bulb_svg__WEBPACK_IMPORTED_MODULE_7__["default"];
}
}
let iconPicture = getIconPicture();
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("section", {
..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save({
className: `homegrade-blocks-highlight test-de-classe`
})
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "homegrade-blocks-highlight__titling"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "icon"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
clas: true,
src: iconPicture,
alt: ""
})), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.RichText.Content, {
tagName: "h3",
value: title,
className: "homegrade-blocks-highlight__block-title"
})), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks.Content, null));
}
/***/ }),
/***/ "./src/editor.scss":
/*!*************************!*\
!*** ./src/editor.scss ***!
\*************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/style.scss":
/*!************************!*\
!*** ./src/style.scss ***!
\************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "./src/img/icon_feather_key.png":
/*!**************************************!*\
!*** ./src/img/icon_feather_key.png ***!
\**************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
module.exports = __webpack_require__.p + "images/icon_feather_key.26c1f367.png";
/***/ }),
/***/ "react":
/*!************************!*\
!*** external "React" ***!
\************************/
/***/ ((module) => {
module.exports = window["React"];
/***/ }),
/***/ "@wordpress/block-editor":
/*!*************************************!*\
!*** external ["wp","blockEditor"] ***!
\*************************************/
/***/ ((module) => {
module.exports = window["wp"]["blockEditor"];
/***/ }),
/***/ "@wordpress/blocks":
/*!********************************!*\
!*** external ["wp","blocks"] ***!
\********************************/
/***/ ((module) => {
module.exports = window["wp"]["blocks"];
/***/ }),
/***/ "@wordpress/components":
/*!************************************!*\
!*** external ["wp","components"] ***!
\************************************/
/***/ ((module) => {
module.exports = window["wp"]["components"];
/***/ }),
/***/ "@wordpress/data":
/*!******************************!*\
!*** external ["wp","data"] ***!
\******************************/
/***/ ((module) => {
module.exports = window["wp"]["data"];
/***/ }),
/***/ "@wordpress/element":
/*!*********************************!*\
!*** external ["wp","element"] ***!
\*********************************/
/***/ ((module) => {
module.exports = window["wp"]["element"];
/***/ }),
/***/ "@wordpress/i18n":
/*!******************************!*\
!*** external ["wp","i18n"] ***!
\******************************/
/***/ ((module) => {
module.exports = window["wp"]["i18n"];
/***/ }),
/***/ "./src/block.json":
/*!************************!*\
!*** ./src/block.json ***!
\************************/
/***/ ((module) => {
module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"homegrade-content-blocks/highlight","version":"0.1.0","title":"Mise en avant","category":"homegrade-blocks","description":"Bloc pour mettre en avant des informations importantes","supports":{"html":false},"textdomain":"homegrade-blocks__texte-fonctionnel","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","attributes":{"title":{"type":"string","source":"html","selector":"h3"},"iconName":{"type":"string"}}}');
/***/ })
/******/ });
/************************************************************************/
/******/ // 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 = deferred[i][0];
/******/ var fn = deferred[i][1];
/******/ var priority = deferred[i][2];
/******/ 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/global */
/******/ (() => {
/******/ __webpack_require__.g = (function() {
/******/ if (typeof globalThis === 'object') return globalThis;
/******/ try {
/******/ return this || new Function('return this')();
/******/ } catch (e) {
/******/ if (typeof window === 'object') return window;
/******/ }
/******/ })();
/******/ })();
/******/
/******/ /* 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/publicPath */
/******/ (() => {
/******/ var scriptUrl;
/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
/******/ var document = __webpack_require__.g.document;
/******/ if (!scriptUrl && document) {
/******/ if (document.currentScript)
/******/ scriptUrl = document.currentScript.src;
/******/ if (!scriptUrl) {
/******/ var scripts = document.getElementsByTagName("script");
/******/ if(scripts.length) {
/******/ var i = scripts.length - 1;
/******/ while (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src;
/******/ }
/******/ }
/******/ }
/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
/******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
/******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
/******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
/******/ __webpack_require__.p = scriptUrl;
/******/ })();
/******/
/******/ /* 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 = {
/******/ "index": 0,
/******/ "./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 = data[0];
/******/ var moreModules = data[1];
/******/ var runtime = data[2];
/******/ // 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 = self["webpackChunkmultiblocks"] = self["webpackChunkmultiblocks"] || [];
/******/ 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, ["./style-index"], () => (__webpack_require__("./src/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,42 @@
/*!***************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/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.
*/
.homegrade-blocks-highlight__titling {
display: flex;
align-items: center;
}
.homegrade-blocks-highlight__titling .icon {
background-color: black;
border-radius: 50%;
aspect-ratio: 1/1;
width: 40px;
padding: 10px;
height: -moz-fit-content;
height: fit-content;
}
.homegrade-blocks-highlight__titling .icon img {
width: 30px;
height: auto;
}
.homegrade-blocks-highlight__titling h3 {
padding-left: 10px;
}
.homegrade-blocks-highlight ul li {
list-style-type: disc;
list-style-position: inside;
margin-left: 1.5em;
}
.homegrade-blocks-highlight p + ul {
padding-top: 16px;
}
.homegrade-blocks-highlight ul + p {
padding-top: 16px;
}
/*# sourceMappingURL=style-index.css.map*/

View File

@ -0,0 +1 @@
{"version":3,"file":"./style-index.css","mappings":";;;AAAA;;;;;EAAA;AAQC;EACC;EACA;AADF;AAEE;EACC;EACA;EACA;EACA;EACA;EACA;EAAA;AAAH;AAEG;EACC;EACA;AAAJ;AAGE;EACC;AADH;AAKC;EACC;EACA;EAEA;AAJF;AAOC;EACC;AALF;AAOC;EACC;AALF,C","sources":["webpack://multiblocks/./src/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.homegrade-blocks-highlight {\n\t&__titling {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\t.icon {\n\t\t\tbackground-color: black;\n\t\t\tborder-radius: 50%;\n\t\t\taspect-ratio: 1/1;\n\t\t\twidth: 40px;\n\t\t\tpadding: 10px;\n\t\t\theight: fit-content;\n\n\t\t\timg {\n\t\t\t\twidth: 30px;\n\t\t\t\theight: auto;\n\t\t\t}\n\t\t}\n\t\th3 {\n\t\t\tpadding-left: 10px;\n\t\t}\n\t}\n\n\tul li {\n\t\tlist-style-type: disc;\n\t\tlist-style-position: inside;\n\t\t// display: flex;\n\t\tmargin-left: 1.5em;\n\t}\n\n\tp + ul {\n\t\tpadding-top: 16px;\n\t}\n\tul + p {\n\t\tpadding-top: 16px;\n\t}\n}\n"],"names":[],"sourceRoot":""}

28142
blocks/highlight/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,20 @@
{
"name": "multiblocks",
"version": "0.1.0",
"description": "Example block scaffolded with Create Block tool.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
"main": "build/index.js",
"scripts": {
"build": "wp-scripts build",
"format": "wp-scripts format",
"lint:css": "wp-scripts lint-style",
"lint:js": "wp-scripts lint-js",
"packages-update": "wp-scripts packages-update",
"plugin-zip": "wp-scripts plugin-zip",
"start": "wp-scripts start"
},
"devDependencies": {
"@wordpress/scripts": "^26.9.0"
}
}

View File

@ -0,0 +1,55 @@
=== Multiblocks ===
Contributors: The WordPress Contributors
Tags: block
Tested up to: 6.1
Stable tag: 0.1.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Example block scaffolded with Create Block tool.
== Description ==
This is the long description. No limit, and you can use Markdown (as well as in the following sections).
For backwards compatibility, if this section is missing, the full length of the short description will be used, and
Markdown parsed.
== Installation ==
This section describes how to install the plugin and get it working.
e.g.
1. Upload the plugin files to the `/wp-content/plugins/multiblocks` directory, or install the plugin through the WordPress plugins screen directly.
1. Activate the plugin through the 'Plugins' screen in WordPress
== Frequently Asked Questions ==
= A question that someone might have =
An answer to that question.
= What about foo bar? =
Answer to foo bar dilemma.
== Screenshots ==
1. This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from
the /assets directory or the directory that contains the stable readme.txt (tags or trunk). Screenshots in the /assets
directory take precedence. For example, `/assets/screenshot-1.png` would win over `/tags/4.3/screenshot-1.png`
(or jpg, jpeg, gif).
2. This is the second screen shot
== Changelog ==
= 0.1.0 =
* Release
== Arbitrary section ==
You may provide arbitrary sections, in the same format as the ones above. This may be of use for extremely complicated
plugins where more information needs to be conveyed that doesn't fit into the categories of "description" or
"installation." Arbitrary sections will be shown below the built-in sections outlined above.

View File

@ -0,0 +1,26 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"name": "homegrade-content-blocks/highlight",
"version": "0.1.0",
"title": "Mise en avant",
"category": "homegrade-blocks",
"description": "Bloc pour mettre en avant des informations importantes",
"supports": {
"html": false
},
"textdomain": "homegrade-blocks__texte-fonctionnel",
"editorScript": "file:./index.js",
"editorStyle": "file:./index.css",
"style": "file:./style-index.css",
"attributes": {
"title": {
"type": "string",
"source": "html",
"selector": "h3"
},
"iconName": {
"type": "string"
}
}
}

View File

@ -0,0 +1,138 @@
import { __ } from "@wordpress/i18n";
import "./editor.scss";
import keyIcon from "./img/icon_feather_key.svg";
import chainIcon from "./img/icon_block_chain.svg";
import houseIcon from "./img/icon_house.svg";
import bulbIcon from "./img/icon_bulb.svg";
import { ReactComponent as SvgIcon } from "./img/icon_feather_key.png";
import {
RichText,
useBlockProps,
BlockControls,
ToolbarGroup,
InnerBlocks,
} from "@wordpress/block-editor";
import { ToolbarDropdownMenu } from "@wordpress/components";
export default function Edit({ attributes, setAttributes }) {
const { title, iconName } = attributes;
const handleIconChange = (newIconName) => {
setAttributes({ iconName: newIconName });
};
function getIconPicture() {
switch (iconName) {
case "key":
return keyIcon;
case "chain":
return chainIcon;
case "house":
return houseIcon;
case "bulb":
return bulbIcon;
}
}
function getDashiconSymbol() {
switch (iconName) {
case "key":
return "admin-network";
case "chain":
return "admin-links";
case "house":
return "admin-home";
case "bulb":
return "lightbulb";
}
}
let iconPicture = getIconPicture();
let iconDashiconSymbol = getDashiconSymbol();
return (
<>
<section
{...useBlockProps({
className: `homegrade-blocks-highlight`,
})}
>
<BlockControls>
<ToolbarDropdownMenu
label="Icone"
icon={iconDashiconSymbol}
isActive={true}
controls={[
{
title: "Clé",
icon: "admin-network",
isActive: false,
onClick: () => {
handleIconChange("key");
},
},
{
title: "Lien",
icon: "admin-links",
isActive: true,
onClick: () => {
handleIconChange("chain");
},
},
{
title: "Homegrade",
icon: "admin-home",
isActive: true,
onClick: () => {
handleIconChange("house");
},
},
{
title: "Inspiration",
icon: "lightbulb",
isActive: true,
onClick: () => {
handleIconChange("bulb");
},
},
]}
/>
</BlockControls>
<div className="homegrade-blocks-highlight__titling">
<div className="icon">
<img src={iconPicture} alt="" />
</div>
<RichText
{...useBlockProps()}
className="homegrade-blocks-highlight__block-title"
onChange={(value) => setAttributes({ title: value })}
value={title}
placeholder={__(
"Votre Texte Monsieur",
"homegrade-blocks__texte-fonctionnel"
)}
tagName="h3"
allowedFormats={[]}
/>
</div>
<InnerBlocks
allowedBlocks={[
"core/list",
"core/paragraph",
"core/heading",
"wpblocks-multiple/nested-children",
]}
template={[["core/paragraph"], ["core/list"]]}
/>
</section>
</>
);
}

View File

@ -0,0 +1,25 @@
/**
* The following styles get applied inside the editor only.
*
* Replace them with your own styles or remove the file completely.
*/
.homegrade-blocks-highlight {
ul {
li {
// list-style: none !important;
display: flex;
padding: 10px 0;
}
li:before {
transform: translateY(6px);
flex-shrink: 0;
border-radius: 50%;
content: "";
width: 10px;
height: 10px;
display: inline-block;
margin-right: 10px;
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

View File

@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16.012" height="15.999" viewBox="0 0 16.012 15.999">
<g id="Icon_feather-link" data-name="Icon feather-link" transform="translate(-1.993 -2.007)">
<path id="Tracé_18559" data-name="Tracé 18559" d="M15,10.707a3.5,3.5,0,0,0,5.28.378l2.1-2.1A3.5,3.5,0,1,0,17.43,4.033l-1.2,1.2" transform="translate(-6.402 0)" fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
<path id="Tracé_18560" data-name="Tracé 18560" d="M11.4,14.9a3.5,3.5,0,0,0-5.28-.378l-2.1,2.1A3.5,3.5,0,1,0,8.97,21.57l1.2-1.2" transform="translate(0 -5.59)" fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 725 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

View File

@ -0,0 +1,9 @@
<svg xmlns="http://www.w3.org/2000/svg" width="13.098" height="18.409" viewBox="0 0 13.098 18.409">
<g id="Groupe_3209" data-name="Groupe 3209" transform="translate(-193 -4810)">
<g id="Union_18" data-name="Union 18" transform="translate(193 4810)" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path d="M4.447,14.845a1,1,0,0,1-1-1V12.058A6.392,6.392,0,0,1,0,6.411,6.481,6.481,0,0,1,6.549,0,6.481,6.481,0,0,1,13.1,6.411a6.393,6.393,0,0,1-3.447,5.647v1.787a1,1,0,0,1-1,1Z" stroke="none"/>
<path d="M 7.650700092315674 12.84549999237061 L 7.650700092315674 12.05811977386475 C 7.650700092315674 11.3162202835083 8.061380386352539 10.63527965545654 8.71757984161377 10.28913974761963 C 10.18568992614746 9.51471996307373 11.09770011901855 8.028590202331543 11.09770011901855 6.410699844360352 C 11.09770011901855 3.978630065917969 9.057299613952637 2 6.549300193786621 2 C 4.040810108184814 2 2 3.978630065917969 2 6.410699844360352 C 2 8.028610229492188 2.911970138549805 9.514659881591797 4.380020141601562 10.2889404296875 C 5.036280155181885 10.63506031036377 5.447000026702881 11.31602954864502 5.447000026702881 12.05797004699707 L 5.447000026702881 12.84549999237061 L 7.650700092315674 12.84549999237061 M 8.650799751281738 14.84549999237061 L 4.446899890899658 14.84549999237061 C 3.894299983978271 14.84549999237061 3.447000026702881 14.39729976654053 3.447000026702881 13.84560012817383 L 3.447000026702881 12.05797004699707 C 1.394700050354004 10.97554969787598 5.95092757293969e-08 8.852640151977539 5.95092757293969e-08 6.410699844360352 C 5.95092757293969e-08 2.870100021362305 2.932199954986572 -3.814697890902607e-09 6.549300193786621 -3.814697890902607e-09 C 10.16549968719482 -3.814697890902607e-09 13.09770011901855 2.870100021362305 13.09770011901855 6.410699844360352 C 13.09770011901855 8.852640151977539 11.70271015167236 10.97570037841797 9.650699615478516 12.05811977386475 L 9.650699615478516 13.84560012817383 C 9.650699615478516 14.39729976654053 9.203399658203125 14.84549999237061 8.650799751281738 14.84549999237061 Z" stroke="none" fill="#fff"/>
</g>
<line id="Ligne_3197" data-name="Ligne 3197" x2="4.779" transform="translate(197.096 4827.409)" fill="none" stroke="#fff" stroke-linecap="round" stroke-width="2"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

View File

Before

Width:  |  Height:  |  Size: 463 B

After

Width:  |  Height:  |  Size: 463 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

View File

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="12.388" height="14.186" viewBox="0 0 12.388 14.186">
<path id="Tracé_18534" data-name="Tracé 18534" d="M960.214,929.442l-5.194,4.782v7.4h10.388v-7.4Z" transform="translate(-954.02 -928.442)" fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
</svg>

After

Width:  |  Height:  |  Size: 341 B

View File

@ -2,8 +2,6 @@ import { registerBlockType } from "@wordpress/blocks";
import { __ } from "@wordpress/i18n";
import "./style.scss";
import "./nested-children";
import Edit from "./edit";
import save from "./save";
import metadata from "./block.json";
@ -25,7 +23,7 @@ registerBlockType(metadata.name, {
</g>
</svg>
),
foreground: "#0414eb",
foreground: "#DF1E1E",
},
edit: Edit,
save,

View File

@ -9,8 +9,8 @@ foreach ($block->inner_blocks as $inner_block) {
$inner_blocks_html .= $inner_block->render();
}
?>
<section class="wp-block-homegrade-content-blocks-points-cles">
<div class="wp-block-homegrade-content-blocks-points-cles__titling">
<section class="homegrade-blocks-highlight">
<div class="homegrade-blocks-highlight__titling">
<div class="icon">
<img src="<?php echo plugin_dir_url(dirname(__DIR__)) ?>src/points-cles/img/icon_feather_key.png" alt="" />
</div>

View File

@ -0,0 +1,48 @@
import { useBlockProps, RichText, InnerBlocks } from "@wordpress/block-editor";
import { __ } from "@wordpress/i18n";
import { useSelect, useDispatch } from "@wordpress/data"; // pour les querry
import keyIcon from "./img/icon_feather_key.svg";
import chainIcon from "./img/icon_block_chain.svg";
import houseIcon from "./img/icon_house.svg";
import bulbIcon from "./img/icon_bulb.svg";
export default function save({ attributes, setAttributes }) {
const { title, iconName } = attributes;
function getIconPicture() {
switch (iconName) {
case "key":
return keyIcon;
case "chain":
return chainIcon;
case "house":
return houseIcon;
case "bulb":
return bulbIcon;
}
}
let iconPicture = getIconPicture();
return (
<section
{...useBlockProps.save({
className: `homegrade-blocks-highlight test-de-classe`,
})}
>
<div className="homegrade-blocks-highlight__titling">
<div className="icon">
<img clas src={iconPicture} alt="" />
</div>
<RichText.Content
tagName="h3"
value={title}
className="homegrade-blocks-highlight__block-title"
/>
</div>
<InnerBlocks.Content />
</section>
);
}

View File

@ -0,0 +1,43 @@
/**
* 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.
*/
.homegrade-blocks-highlight {
&__titling {
display: flex;
align-items: center;
.icon {
background-color: black;
border-radius: 50%;
aspect-ratio: 1/1;
width: 40px;
padding: 10px;
height: fit-content;
img {
width: 30px;
height: auto;
}
}
h3 {
padding-left: 10px;
}
}
ul li {
list-style-type: disc;
list-style-position: inside;
// display: flex;
margin-left: 1.5em;
}
p + ul {
padding-top: 16px;
}
ul + p {
padding-top: 16px;
}
}

View File

@ -0,0 +1,18 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org
# WordPress Coding Standards
# https://make.wordpress.org/core/handbook/coding-standards/
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab
[*.{yml,yaml}]
indent_style = space
indent_size = 2

30
blocks/picture-banner/.gitignore vendored Normal file
View File

@ -0,0 +1,30 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Coverage directory used by tools like istanbul
coverage
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Output of `npm pack`
*.tgz
# Output of `wp-scripts plugin-zip`
*.zip
# dotenv environment variables file
.env

View File

@ -1,13 +1,13 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"name": "create-block/wpblock-cover",
"name": "homegrade-content-blocks/picture-banner",
"version": "0.1.0",
"title": "Wpblock Cover",
"title": "Image",
"category": "homegrade-blocks",
"icon": {
"background": "#fff",
"foreground": "#0414eb",
"foreground": "#DF1E1E",
"src": "cover-image"
},
"description": "Example block scaffolded with Create Block tool.",
@ -18,16 +18,6 @@
"coverId": {
"type": "number"
},
"title": {
"type": "string",
"source": "html",
"selector": "h2"
},
"subtitle": {
"type": "string",
"source": "html",
"selector": "h3"
},
"coverAlt": {
"type": "string",
"source": "attribute",
@ -40,6 +30,10 @@
"source": "attribute",
"selector": "img",
"attribute": "src"
},
"heightFixed": {
"type": "boolean",
"default": true
}
},
"textdomain": "homegrade-theme__bloks-texte-fonctionnel",

View File

@ -1 +1 @@
<?php return array('dependencies' => array('wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'b5c155da42714eb35d8d');
<?php return array('dependencies' => array('wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '11f04c1215238253c6cb');

View File

@ -1,6 +1,6 @@
/*!******************************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/wpblock-cover/editor.scss ***!
\******************************************************************************************************************************************************************************************************************************************************/
/*!****************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/editor.scss ***!
\****************************************************************************************************************************************************************************************************************************************/
/**
* The following styles get applied inside the editor only.
*

View File

@ -0,0 +1 @@
{"version":3,"file":"index.css","mappings":";;;AAAA;;;;EAAA;AAMA;EACC;AAAD;AAEE;EACC;EACA;EACA;EACA;EACA;EACA;AAAH;AAEE;EACC;AAAH,C","sources":["webpack://multiblocks/./src/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.wpblock-cover-container {\n\tposition: relative;\n\t&.is-loading {\n\t\t.components-spinner {\n\t\t\tposition: absolute;\n\t\t\tleft: 50%;\n\t\t\tright: 50%;\n\t\t\tbottom: 0;\n\t\t\ttop: 0;\n\t\t\tmargin: auto;\n\t\t}\n\t\timg {\n\t\t\topacity: 10%;\n\t\t}\n\t}\n}\n"],"names":[],"sourceRoot":""}

View File

@ -2,10 +2,10 @@
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ "./src/wpblock-cover/edit.js":
/*!***********************************!*\
!*** ./src/wpblock-cover/edit.js ***!
\***********************************/
/***/ "./src/edit.js":
/*!*********************!*\
!*** ./src/edit.js ***!
\*********************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
@ -18,11 +18,11 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./editor.scss */ "./src/wpblock-cover/editor.scss");
/* harmony import */ var _wordpress_blob__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/blob */ "@wordpress/blob");
/* harmony import */ var _wordpress_blob__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blob__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./editor.scss */ "./src/editor.scss");
/* harmony import */ var _wordpress_blob__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/blob */ "@wordpress/blob");
/* harmony import */ var _wordpress_blob__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blob__WEBPACK_IMPORTED_MODULE_5__);
@ -42,8 +42,7 @@ function Edit({
coverUrl,
coverId,
coverAlt,
title,
subtitle
heightFixed
} = attributes;
const [blobUrl, setBlobUrl] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)();
const onUploadError = message => {
@ -76,7 +75,7 @@ function Edit({
};
(0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
if (!coverId && (0,_wordpress_blob__WEBPACK_IMPORTED_MODULE_4__.isBlobURL)(coverUrl)) {
if (!coverId && (0,_wordpress_blob__WEBPACK_IMPORTED_MODULE_5__.isBlobURL)(coverUrl)) {
setAttributes({
coverUrl: undefined,
coverAlt: ""
@ -85,16 +84,49 @@ function Edit({
}, []);
(0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
// Fonction de clean du BLOB URL qui se lance à chaque changement de coverUrl
if ((0,_wordpress_blob__WEBPACK_IMPORTED_MODULE_4__.isBlobURL)(coverUrl)) {
if ((0,_wordpress_blob__WEBPACK_IMPORTED_MODULE_5__.isBlobURL)(coverUrl)) {
// Si la cover est une blob, c'est que ça upload donc on met cette url dans le state
setBlobUrl(coverUrl);
} else {
// Si la cover en'est plus une blob, c'est que l'upload est terminé, on revoke la blob et on clean le state
(0,_wordpress_blob__WEBPACK_IMPORTED_MODULE_4__.revokeBlobURL)(blobUrl); // On utilise la valeur stocké dans le state pour revoke l'url
(0,_wordpress_blob__WEBPACK_IMPORTED_MODULE_5__.revokeBlobURL)(blobUrl); // On utilise la valeur stocké dans le state pour revoke l'url
setBlobUrl();
}
}, [coverUrl]);
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, coverUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.BlockControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.MediaReplaceFlow, {
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.BlockControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.ToolbarGroup, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.ToolbarDropdownMenu, {
icon: heightFixed ? "fullscreen-exit-alt" : "editor-expand",
label: "Hauteur de bloc",
controls: [{
title: "Hauteur Fixe",
icon: "fullscreen-exit-alt",
isActive: false,
onClick: () => {
setAttributes({
heightFixed: true
});
console.log(heightFixed);
// alert(postType);
}
}, {
title: "Hauteur Auto",
icon: "editor-expand",
isActive: true,
onClick: () => {
setAttributes({
heightFixed: false
});
console.log(heightFixed);
// alert(postType);
}
}]
}))), coverUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.BlockControls, {
controls: [{
title: "button1",
icon: "admin-generic",
isActive: true,
onClick: () => alert("button1")
}]
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.BlockControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.MediaReplaceFlow, {
group: "inline",
name: "Remplacer l'image",
disableMediaButtons: coverUrl,
@ -109,31 +141,16 @@ function Edit({
,
mediaId: coverId,
mediaURL: coverUrl
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.ToolbarButton, {
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.ToolbarButton, {
onClick: removeCoverImg
}, "X Supprimer l'image")), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("section", (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useBlockProps)(), coverUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: `wpblock-cover-container ${(0,_wordpress_blob__WEBPACK_IMPORTED_MODULE_4__.isBlobURL)(coverUrl) ? "is-loading" : ""}`
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "titling"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.RichText, {
tagName: "h2",
placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Titre du block"),
value: title,
onChange: title => setAttributes({
title
})
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.RichText, {
tagName: "h3",
placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Sous-titre du block"),
value: subtitle,
onChange: subtitle => setAttributes({
subtitle
}),
allowedFormats: []
})), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
}, "X Supprimer l'image"))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("section", {
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useBlockProps)()
}, coverUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: `picture-container ${(0,_wordpress_blob__WEBPACK_IMPORTED_MODULE_5__.isBlobURL)(coverUrl) ? "is-loading" : ""} ${heightFixed ? "fixed-height" : ""} `
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
src: coverUrl,
alt: coverAlt
}), (0,_wordpress_blob__WEBPACK_IMPORTED_MODULE_4__.isBlobURL)(coverUrl) && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.Spinner, null)), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.MediaPlaceholder, {
}), (0,_wordpress_blob__WEBPACK_IMPORTED_MODULE_5__.isBlobURL)(coverUrl) && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.Spinner, null)), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.MediaPlaceholder, {
disableMediaButtons: coverUrl,
icon: "admin-appearance",
onSelect: updateImage,
@ -146,23 +163,23 @@ function Edit({
})));
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_wordpress_components__WEBPACK_IMPORTED_MODULE_5__.withNotices)(Edit));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.withNotices)(Edit));
/***/ }),
/***/ "./src/wpblock-cover/index.js":
/*!************************************!*\
!*** ./src/wpblock-cover/index.js ***!
\************************************/
/***/ "./src/index.js":
/*!**********************!*\
!*** ./src/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/wpblock-cover/style.scss");
/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/wpblock-cover/edit.js");
/* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./save */ "./src/wpblock-cover/save.js");
/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./block.json */ "./src/wpblock-cover/block.json");
/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./src/style.scss");
/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/edit.js");
/* harmony import */ var _save__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./save */ "./src/save.js");
/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./block.json */ "./src/block.json");
/**
* Registers a new block provided a unique name and an object defining its behavior.
*
@ -204,10 +221,10 @@ __webpack_require__.r(__webpack_exports__);
/***/ }),
/***/ "./src/wpblock-cover/save.js":
/*!***********************************!*\
!*** ./src/wpblock-cover/save.js ***!
\***********************************/
/***/ "./src/save.js":
/*!*********************!*\
!*** ./src/save.js ***!
\*********************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
@ -227,34 +244,27 @@ function save({
coverUrl,
coverId,
coverAlt,
title,
subtitle
heightFixed
} = attributes;
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("section", _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save(), coverUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "wpblock-cover-container"
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("section", {
..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save({
className: `homegrade-content-blocks-picture-banner`
})
}, coverUrl && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: `picture-container ${heightFixed ? "fixed-height" : ""}`
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
src: coverUrl,
alt: coverAlt,
className: `wp-image-${coverId}`
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
className: "titling"
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.RichText.Content, {
tagName: "h2",
value: title,
className: "wpblock-cover-title"
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.RichText.Content, {
tagName: "h3",
value: subtitle,
className: "wpblock-cover-subtitle"
}))));
})));
}
/***/ }),
/***/ "./src/wpblock-cover/editor.scss":
/*!***************************************!*\
!*** ./src/wpblock-cover/editor.scss ***!
\***************************************/
/***/ "./src/editor.scss":
/*!*************************!*\
!*** ./src/editor.scss ***!
\*************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
@ -263,10 +273,10 @@ __webpack_require__.r(__webpack_exports__);
/***/ }),
/***/ "./src/wpblock-cover/style.scss":
/*!**************************************!*\
!*** ./src/wpblock-cover/style.scss ***!
\**************************************/
/***/ "./src/style.scss":
/*!************************!*\
!*** ./src/style.scss ***!
\************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
@ -335,13 +345,13 @@ module.exports = window["wp"]["i18n"];
/***/ }),
/***/ "./src/wpblock-cover/block.json":
/*!**************************************!*\
!*** ./src/wpblock-cover/block.json ***!
\**************************************/
/***/ "./src/block.json":
/*!************************!*\
!*** ./src/block.json ***!
\************************/
/***/ ((module) => {
module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"create-block/wpblock-cover","version":"0.1.0","title":"Wpblock Cover","category":"homegrade-blocks","icon":{"background":"#fff","foreground":"#0414eb","src":"cover-image"},"description":"Example block scaffolded with Create Block tool.","supports":{"html":false},"attributes":{"coverId":{"type":"number"},"title":{"type":"string","source":"html","selector":"h2"},"subtitle":{"type":"string","source":"html","selector":"h3"},"coverAlt":{"type":"string","source":"attribute","selector":"img","attribute":"alt","default":""},"coverUrl":{"type":"string","source":"attribute","selector":"img","attribute":"src"}},"textdomain":"homegrade-theme__bloks-texte-fonctionnel","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css"}');
module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"homegrade-content-blocks/picture-banner","version":"0.1.0","title":"Image","category":"homegrade-blocks","icon":{"background":"#fff","foreground":"#DF1E1E","src":"cover-image"},"description":"Example block scaffolded with Create Block tool.","supports":{"html":false},"attributes":{"coverId":{"type":"number"},"coverAlt":{"type":"string","source":"attribute","selector":"img","attribute":"alt","default":""},"coverUrl":{"type":"string","source":"attribute","selector":"img","attribute":"src"},"heightFixed":{"type":"boolean","default":true}},"textdomain":"homegrade-theme__bloks-texte-fonctionnel","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css"}');
/***/ })
@ -387,7 +397,9 @@ module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json
/******/ }
/******/ var notFulfilled = Infinity;
/******/ for (var i = 0; i < deferred.length; i++) {
/******/ var [chunkIds, fn, priority] = deferred[i];
/******/ var chunkIds = deferred[i][0];
/******/ var fn = deferred[i][1];
/******/ var priority = deferred[i][2];
/******/ 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])))) {
@ -455,8 +467,8 @@ module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
/******/ var installedChunks = {
/******/ "wpblock-cover/index": 0,
/******/ "wpblock-cover/style-index": 0
/******/ "index": 0,
/******/ "./style-index": 0
/******/ };
/******/
/******/ // no chunk on demand loading
@ -473,7 +485,9 @@ module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json
/******/
/******/ // install a JSONP callback for chunk loading
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
/******/ var [chunkIds, moreModules, runtime] = data;
/******/ var chunkIds = data[0];
/******/ var moreModules = data[1];
/******/ var runtime = data[2];
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0;
@ -496,7 +510,7 @@ module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json
/******/ return __webpack_require__.O(result);
/******/ }
/******/
/******/ var chunkLoadingGlobal = globalThis["webpackChunktest_de_block"] = globalThis["webpackChunktest_de_block"] || [];
/******/ var chunkLoadingGlobal = self["webpackChunkmultiblocks"] = self["webpackChunkmultiblocks"] || [];
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
/******/ })();
@ -506,7 +520,7 @@ module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json
/******/ // 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, ["wpblock-cover/style-index"], () => (__webpack_require__("./src/wpblock-cover/index.js")))
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["./style-index"], () => (__webpack_require__("./src/index.js")))
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
/******/
/******/ })()

File diff suppressed because one or more lines are too long

View File

@ -1,31 +1,23 @@
/*!*****************************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/wpblock-cover/style.scss ***!
\*****************************************************************************************************************************************************************************************************************************************************/
/*!***************************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/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-wpblock-cover {
position: relative;
.wp-block-homegrade-content-blocks-picture-banner .picture-container {
overflow: hidden;
border-radius: 22px;
}
.wp-block-create-block-wpblock-cover img {
.wp-block-homegrade-content-blocks-picture-banner .picture-container.fixed-height img {
width: 100%;
max-height: 250px;
height: 200px;
-o-object-fit: cover;
object-fit: cover;
-o-object-position: center;
object-position: center;
}
.wp-block-create-block-wpblock-cover .titling {
position: absolute;
text-align: center;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: white;
z-index: 10;
}
/*# sourceMappingURL=style-index.css.map*/

View File

@ -0,0 +1 @@
{"version":3,"file":"./style-index.css","mappings":";;;AAAA;;;;;EAAA;AAQC;EACC;EACA;AADF;AAGG;EACC;EACA;EACA;KAAA;EACA;KAAA;AADJ,C","sources":["webpack://multiblocks/./src/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-homegrade-content-blocks-picture-banner {\n\t.picture-container {\n\t\toverflow: hidden;\n\t\tborder-radius: 22px;\n\t\t&.fixed-height {\n\t\t\timg {\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 200px;\n\t\t\t\tobject-fit: cover;\n\t\t\t\tobject-position: center;\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":[],"sourceRoot":""}

28142
blocks/picture-banner/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More