MERGE FINAL V2
This commit is contained in:
parent
c86b64fe69
commit
055ff884e8
|
|
@ -1 +1 @@
|
|||
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => 'de0da04da745c8c7f08b');
|
||||
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => 'd77ee03166f76b8f4c32');
|
||||
|
|
|
|||
|
|
@ -281,7 +281,7 @@ function Edit({
|
|||
}], ["core/paragraph", {
|
||||
placeholder: "Ajouter ici le texte"
|
||||
}]],
|
||||
allowedBlocks: ["core/paragraph", "core/list", "core/button", "core/buttons", "gravityforms/form", "homegrade-content-blocks/section-titling"]
|
||||
allowedBlocks: ["core/paragraph", "core/list", "core/button", "core/buttons", "gravityforms/form", "homegrade-content-blocks/section-titling", "acf/search-artisan-btn"]
|
||||
}), cta && cta.title && cta.url && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("a", {
|
||||
href: cta.url
|
||||
}, cta.title)), pageIllustration && !hasCustomImage && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -2,7 +2,7 @@
|
|||
$pageHeaderTitle = $attributes['pageHeaderTitle'] ?? null;
|
||||
$pageHeaderDescription = $attributes['pageHeaderDescription'] ?? null;
|
||||
$cta = $attributes['cta'] ?? null;
|
||||
$pageIllustration = get_field('page_illustration');
|
||||
$pageIllustration = get_field('page_illustration') ?? null;
|
||||
|
||||
$hasCustomImage = $attributes['hasCustomImage'] ?? null;
|
||||
$customImageUrl = $attributes['imageUrl'] ?? null;
|
||||
|
|
@ -11,12 +11,13 @@ $coverSize = $attributes['coverSize'] ?? null;
|
|||
|
||||
$customTitle = $attributes['blockCustomTitle'] ?? null;
|
||||
$anchor = isset($attributes['anchor']) ? esc_html($attributes['anchor']) : null;
|
||||
|
||||
?>
|
||||
|
||||
<section id="<?php echo $anchor ?? "" ?>" <?php echo get_block_wrapper_attributes(['class' => 'block-content-page-header']) ?>>
|
||||
<div class="block-content-page-header__content">
|
||||
<?php echo $content ?>
|
||||
<?php if ($cta && $cta['title'] && $cta['url']) : ?>
|
||||
<?php if ($cta && isset($cta['title']) && isset($cta['url'])) : ?>
|
||||
<a class="block-content-page-header__cta-link" href="<?php echo $cta['url'] ?>"><?php echo $cta['title'] ?></a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -199,6 +199,7 @@ export default function Edit({ attributes, setAttributes }) {
|
|||
"core/buttons",
|
||||
"gravityforms/form",
|
||||
"homegrade-content-blocks/section-titling",
|
||||
"acf/search-artisan-btn",
|
||||
]}
|
||||
/>
|
||||
{cta && cta.title && cta.url && <a href={cta.url}>{cta.title}</a>}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
$pageHeaderTitle = $attributes['pageHeaderTitle'] ?? null;
|
||||
$pageHeaderDescription = $attributes['pageHeaderDescription'] ?? null;
|
||||
$cta = $attributes['cta'] ?? null;
|
||||
$pageIllustration = get_field('page_illustration');
|
||||
$pageIllustration = get_field('page_illustration') ?? null;
|
||||
|
||||
$hasCustomImage = $attributes['hasCustomImage'] ?? null;
|
||||
$customImageUrl = $attributes['imageUrl'] ?? null;
|
||||
|
|
@ -11,12 +11,13 @@ $coverSize = $attributes['coverSize'] ?? null;
|
|||
|
||||
$customTitle = $attributes['blockCustomTitle'] ?? null;
|
||||
$anchor = isset($attributes['anchor']) ? esc_html($attributes['anchor']) : null;
|
||||
|
||||
?>
|
||||
|
||||
<section id="<?php echo $anchor ?? "" ?>" <?php echo get_block_wrapper_attributes(['class' => 'block-content-page-header']) ?>>
|
||||
<div class="block-content-page-header__content">
|
||||
<?php echo $content ?>
|
||||
<?php if ($cta && $cta['title'] && $cta['url']) : ?>
|
||||
<?php if ($cta && isset($cta['title']) && isset($cta['url'])) : ?>
|
||||
<a class="block-content-page-header__cta-link" href="<?php echo $cta['url'] ?>"><?php echo $cta['title'] ?></a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
|
|
|||
18
blocks/cta-slim/.editorconfig
Normal file
18
blocks/cta-slim/.editorconfig
Normal 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/cta-slim/.gitignore
vendored
Normal file
30
blocks/cta-slim/.gitignore
vendored
Normal 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
|
||||
33
blocks/cta-slim/build/block.json
Normal file
33
blocks/cta-slim/build/block.json
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"$schema": "https://schemas.wp.org/trunk/block.json",
|
||||
"apiVersion": 2,
|
||||
"name": "homegrade-content-blocks/cta-slim",
|
||||
"version": "0.1.0",
|
||||
"title": "Call to action Léger",
|
||||
"category": "homegrade-blocks",
|
||||
"icon": "smiley",
|
||||
"description": "Example block scaffolded with Create Block tool.",
|
||||
"supports": {
|
||||
"html": false
|
||||
},
|
||||
"parent": [
|
||||
"homegrade-content-blocks/content-page-header"
|
||||
],
|
||||
"textdomain": "homegrade-blocks",
|
||||
"editorScript": "file:./index.js",
|
||||
"editorStyle": "file:./index.css",
|
||||
"style": "file:./style-index.css",
|
||||
"attributes": {
|
||||
"ctaTextLabel": {
|
||||
"type": "string",
|
||||
"default": "Tapez le texte de votre Lien ici"
|
||||
},
|
||||
"ctaLink": {
|
||||
"type": "object",
|
||||
"default": {
|
||||
"url": "#",
|
||||
"target": "_self"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1
blocks/cta-slim/build/index.asset.php
Normal file
1
blocks/cta-slim/build/index.asset.php
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n'), 'version' => '827689e6492798b3344d');
|
||||
4
blocks/cta-slim/build/index.css
Normal file
4
blocks/cta-slim/build/index.css
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
/*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||
!*** css ./node_modules/.pnpm/css-loader@6.10.0_webpack@5.90.3/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.4.35_webpack@5.90.3/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@12.6.0_sass@1.71.1_webpack@5.90.3/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/editor.scss ***!
|
||||
\***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||
|
||||
399
blocks/cta-slim/build/index.js
Normal file
399
blocks/cta-slim/build/index.js
Normal file
|
|
@ -0,0 +1,399 @@
|
|||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ var __webpack_modules__ = ({
|
||||
|
||||
/***/ "./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 react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* harmony import */ var _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 _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
|
||||
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__);
|
||||
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components");
|
||||
/* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function Edit({
|
||||
attributes,
|
||||
setAttributes
|
||||
}) {
|
||||
const {
|
||||
ctaTextLabel,
|
||||
ctaLink
|
||||
} = attributes;
|
||||
function onChangeCtaTextLabel(ctaTextLabel) {
|
||||
setAttributes({
|
||||
ctaTextLabel
|
||||
});
|
||||
}
|
||||
function onChangeCtaLink(ctaLink) {
|
||||
console.log(ctaLink);
|
||||
setAttributes({
|
||||
ctaLink
|
||||
});
|
||||
}
|
||||
return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.InspectorControls, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.PanelBody, {
|
||||
className: "homegrade-blocks-content-page-header__panel-cta",
|
||||
title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Call to action", "homegrade-blocks")
|
||||
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.TextControl, {
|
||||
label: "Titre du cta",
|
||||
value: ctaTextLabel,
|
||||
onChange: onChangeCtaTextLabel
|
||||
}), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.__experimentalLinkControl, {
|
||||
label: "Lien du cta",
|
||||
title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Call to action", "homegrade-blocks"),
|
||||
value: ctaLink,
|
||||
onChange: onChangeCtaLink
|
||||
})))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.RichText, {
|
||||
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.useBlockProps)({
|
||||
className: `homegrade-blocks-cta-slim`
|
||||
}),
|
||||
tagName: "p",
|
||||
placeholder: "Tapez le texte de votre lien ici",
|
||||
value: ctaTextLabel,
|
||||
onChange: onChangeCtaTextLabel
|
||||
}));
|
||||
}
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./src/index.js":
|
||||
/*!**********************!*\
|
||||
!*** ./src/index.js ***!
|
||||
\**********************/
|
||||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* harmony import */ var _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/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");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_5__.name, {
|
||||
edit: _edit__WEBPACK_IMPORTED_MODULE_3__["default"],
|
||||
save: _save__WEBPACK_IMPORTED_MODULE_4__["default"],
|
||||
icon: {
|
||||
src: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
|
||||
width: "92",
|
||||
height: "102",
|
||||
viewBox: "0 0 92 102"
|
||||
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
|
||||
d: "M87.133 8.57625C83.2696 3.51386 77.4079 0.582997 70.7468 0.0501131C64.3522 -0.34955 57.8244 1.64877 52.4956 5.77861L28.3826 24.5628C23.0537 28.6926 19.4568 34.4211 18.391 40.8157C17.192 47.3436 18.6575 53.7382 22.6541 58.6673C26.5175 63.7297 32.3792 66.6606 39.0403 67.0602C39.5731 67.0602 40.106 67.0602 40.7721 67.0602C46.6339 67.0602 52.4956 65.0619 57.2915 61.1985C59.2898 59.5999 59.6895 56.669 58.0909 54.6707C56.4922 52.6724 53.5613 52.2727 51.563 53.8714C48.0993 56.669 43.8362 58.0012 39.7064 57.7348C35.7097 57.4683 32.3792 55.7365 30.1145 52.8056C27.8497 49.8747 27.0504 46.1446 27.7165 42.2812C28.5158 38.1513 30.7806 34.4211 34.2443 31.7567L58.3573 12.9725C61.821 10.1749 66.0841 8.8427 70.214 9.10914C74.2106 9.37558 77.5411 11.1075 79.8059 14.0383C82.0706 16.9692 82.87 20.6994 82.2039 24.5628C81.4045 28.6926 79.1398 32.4228 75.676 35.0872C73.6777 36.6859 73.278 39.6167 74.8767 41.615C76.4753 43.6134 79.4062 44.013 81.4045 42.4144C86.7334 38.2845 90.3303 32.556 91.3961 26.1614C92.5951 19.6336 91.1297 13.239 87.133 8.30981V8.57625ZM52.762 34.954C46.3674 34.5543 39.8396 36.5527 34.5107 40.6825C32.5124 42.2812 32.1128 45.212 33.7114 47.2103C35.3101 49.2086 38.2409 49.6083 40.2393 48.0097C43.703 45.212 47.9661 43.8798 52.0959 44.1462C56.0925 44.4127 59.4231 46.1446 61.6878 49.0754C63.9526 52.0063 64.7519 55.7365 64.0858 59.5999C63.2865 63.7297 61.0217 67.4599 57.558 70.1243L33.445 88.9085C29.9812 91.7061 25.7182 93.0383 21.5883 92.7719C17.5917 92.5054 14.2612 90.7736 11.9964 87.8427C9.73166 84.9119 8.93233 81.1817 9.59843 77.3183C10.3978 73.1884 12.6625 69.4582 16.1263 66.7938C18.1246 65.1952 18.5242 62.2643 16.9256 60.266C15.3269 58.2677 12.3961 57.868 10.3978 59.4667C5.06892 63.5965 1.47196 69.325 0.406189 75.7196C-0.792799 82.2474 0.672631 88.642 4.66926 93.5712C8.53267 98.6336 14.3944 101.564 21.0554 101.964C21.5883 101.964 22.1212 101.964 22.7873 101.964C28.649 101.964 34.5108 99.9658 39.3067 96.1024L63.4197 77.3183C68.7485 73.1884 72.3455 67.4599 73.4113 61.0653C74.6103 54.5375 73.1448 48.1429 69.1482 43.2137C65.1516 38.2845 59.4231 35.2204 52.762 34.8208V34.954Z"
|
||||
})),
|
||||
foreground: "#DF1E1E"
|
||||
}
|
||||
});
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./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 react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* harmony import */ var _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__);
|
||||
|
||||
|
||||
|
||||
function save({
|
||||
attributes
|
||||
}) {
|
||||
var _ctaLink$url;
|
||||
const {
|
||||
ctaTextLabel,
|
||||
ctaLink
|
||||
} = attributes;
|
||||
const link = (_ctaLink$url = ctaLink.url) !== null && _ctaLink$url !== void 0 ? _ctaLink$url : "#";
|
||||
return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.RichText.Content, {
|
||||
..._wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps.save({
|
||||
className: `homegrade-blocks-cta-slim`
|
||||
}),
|
||||
tagName: "a",
|
||||
value: ctaTextLabel,
|
||||
href: link
|
||||
});
|
||||
}
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./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
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "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/i18n":
|
||||
/*!******************************!*\
|
||||
!*** external ["wp","i18n"] ***!
|
||||
\******************************/
|
||||
/***/ ((module) => {
|
||||
|
||||
module.exports = window["wp"]["i18n"];
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./src/block.json":
|
||||
/*!************************!*\
|
||||
!*** ./src/block.json ***!
|
||||
\************************/
|
||||
/***/ ((module) => {
|
||||
|
||||
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"homegrade-content-blocks/cta-slim","version":"0.1.0","title":"Call to action Léger","category":"homegrade-blocks","icon":"smiley","description":"Example block scaffolded with Create Block tool.","supports":{"html":false},"parent":["homegrade-content-blocks/content-page-header"],"textdomain":"homegrade-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","attributes":{"ctaTextLabel":{"type":"string","default":"Tapez le texte de votre Lien ici"},"ctaLink":{"type":"object","default":{"url":"#","target":"_self"}}}}');
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/************************************************************************/
|
||||
/******/ // The module cache
|
||||
/******/ var __webpack_module_cache__ = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/ // Check if module is in cache
|
||||
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||||
/******/ if (cachedModule !== undefined) {
|
||||
/******/ return cachedModule.exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||
/******/ // no module.id needed
|
||||
/******/ // no module.loaded needed
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = __webpack_modules__;
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/chunk loaded */
|
||||
/******/ (() => {
|
||||
/******/ var deferred = [];
|
||||
/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
|
||||
/******/ if(chunkIds) {
|
||||
/******/ priority = priority || 0;
|
||||
/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
|
||||
/******/ deferred[i] = [chunkIds, fn, priority];
|
||||
/******/ return;
|
||||
/******/ }
|
||||
/******/ var notFulfilled = Infinity;
|
||||
/******/ for (var i = 0; i < deferred.length; i++) {
|
||||
/******/ var [chunkIds, fn, priority] = deferred[i];
|
||||
/******/ var fulfilled = true;
|
||||
/******/ for (var j = 0; j < chunkIds.length; j++) {
|
||||
/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
|
||||
/******/ chunkIds.splice(j--, 1);
|
||||
/******/ } else {
|
||||
/******/ fulfilled = false;
|
||||
/******/ if(priority < notFulfilled) notFulfilled = priority;
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ if(fulfilled) {
|
||||
/******/ deferred.splice(i--, 1)
|
||||
/******/ var r = fn();
|
||||
/******/ if (r !== undefined) result = r;
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ return result;
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/compat get default export */
|
||||
/******/ (() => {
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = (module) => {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ () => (module['default']) :
|
||||
/******/ () => (module);
|
||||
/******/ __webpack_require__.d(getter, { a: getter });
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ (() => {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = (exports) => {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/jsonp chunk loading */
|
||||
/******/ (() => {
|
||||
/******/ // no baseURI
|
||||
/******/
|
||||
/******/ // object to store loaded and loading chunks
|
||||
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
||||
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
|
||||
/******/ var installedChunks = {
|
||||
/******/ "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, moreModules, runtime] = data;
|
||||
/******/ // add "moreModules" to the modules object,
|
||||
/******/ // then flag all "chunkIds" as loaded and fire callback
|
||||
/******/ var moduleId, chunkId, i = 0;
|
||||
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
|
||||
/******/ for(moduleId in moreModules) {
|
||||
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
|
||||
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ if(runtime) var result = runtime(__webpack_require__);
|
||||
/******/ }
|
||||
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
|
||||
/******/ for(;i < chunkIds.length; i++) {
|
||||
/******/ chunkId = chunkIds[i];
|
||||
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
|
||||
/******/ installedChunks[chunkId][0]();
|
||||
/******/ }
|
||||
/******/ installedChunks[chunkId] = 0;
|
||||
/******/ }
|
||||
/******/ return __webpack_require__.O(result);
|
||||
/******/ }
|
||||
/******/
|
||||
/******/ var chunkLoadingGlobal = globalThis["webpackChunkmultiblocks"] = globalThis["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
|
||||
1
blocks/cta-slim/build/index.js.map
Normal file
1
blocks/cta-slim/build/index.js.map
Normal file
File diff suppressed because one or more lines are too long
16
blocks/cta-slim/build/style-index.css
Normal file
16
blocks/cta-slim/build/style-index.css
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||
!*** css ./node_modules/.pnpm/css-loader@6.10.0_webpack@5.90.3/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.4.35_webpack@5.90.3/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@12.6.0_sass@1.71.1_webpack@5.90.3/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-multiblocks {
|
||||
background-color: #21759b;
|
||||
color: #fff;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
/*# sourceMappingURL=style-index.css.map*/
|
||||
1
blocks/cta-slim/build/style-index.css.map
Normal file
1
blocks/cta-slim/build/style-index.css.map
Normal 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":""}
|
||||
20
blocks/cta-slim/package.json
Normal file
20
blocks/cta-slim/package.json
Normal 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"
|
||||
}
|
||||
}
|
||||
10956
blocks/cta-slim/pnpm-lock.yaml
Normal file
10956
blocks/cta-slim/pnpm-lock.yaml
Normal file
File diff suppressed because it is too large
Load Diff
33
blocks/cta-slim/src/block.json
Normal file
33
blocks/cta-slim/src/block.json
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"$schema": "https://schemas.wp.org/trunk/block.json",
|
||||
"apiVersion": 2,
|
||||
"name": "homegrade-content-blocks/cta-slim",
|
||||
"version": "0.1.0",
|
||||
"title": "Call to action Léger",
|
||||
"category": "homegrade-blocks",
|
||||
"icon": "smiley",
|
||||
"description": "Example block scaffolded with Create Block tool.",
|
||||
"supports": {
|
||||
"html": false
|
||||
},
|
||||
"parent": [
|
||||
"homegrade-content-blocks/content-page-header"
|
||||
],
|
||||
"textdomain": "homegrade-blocks",
|
||||
"editorScript": "file:./index.js",
|
||||
"editorStyle": "file:./index.css",
|
||||
"style": "file:./style-index.css",
|
||||
"attributes": {
|
||||
"ctaTextLabel": {
|
||||
"type": "string",
|
||||
"default": "Tapez le texte de votre Lien ici"
|
||||
},
|
||||
"ctaLink": {
|
||||
"type": "object",
|
||||
"default": {
|
||||
"url": "#",
|
||||
"target": "_self"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
57
blocks/cta-slim/src/edit.js
Normal file
57
blocks/cta-slim/src/edit.js
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
import { __ } from "@wordpress/i18n";
|
||||
import "./editor.scss";
|
||||
|
||||
import {
|
||||
useBlockProps,
|
||||
RichText,
|
||||
InspectorControls,
|
||||
BlockControls,
|
||||
__experimentalLinkControl as LinkControl,
|
||||
} from "@wordpress/block-editor";
|
||||
|
||||
import { PanelBody, TextControl, ToggleControl } from "@wordpress/components";
|
||||
export default function Edit({ attributes, setAttributes }) {
|
||||
const { ctaTextLabel, ctaLink } = attributes;
|
||||
|
||||
function onChangeCtaTextLabel(ctaTextLabel) {
|
||||
setAttributes({ ctaTextLabel });
|
||||
}
|
||||
function onChangeCtaLink(ctaLink) {
|
||||
console.log(ctaLink);
|
||||
setAttributes({ ctaLink });
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<InspectorControls>
|
||||
<PanelBody
|
||||
className="homegrade-blocks-content-page-header__panel-cta"
|
||||
title={__("Call to action", "homegrade-blocks")}
|
||||
>
|
||||
<>
|
||||
<TextControl
|
||||
label="Titre du cta"
|
||||
value={ctaTextLabel}
|
||||
onChange={onChangeCtaTextLabel}
|
||||
/>
|
||||
<LinkControl
|
||||
label="Lien du cta"
|
||||
title={__("Call to action", "homegrade-blocks")}
|
||||
value={ctaLink}
|
||||
onChange={onChangeCtaLink}
|
||||
/>
|
||||
</>
|
||||
</PanelBody>
|
||||
</InspectorControls>
|
||||
<RichText
|
||||
{...useBlockProps({
|
||||
className: `homegrade-blocks-cta-slim`,
|
||||
})}
|
||||
tagName="p"
|
||||
placeholder="Tapez le texte de votre lien ici"
|
||||
value={ctaTextLabel}
|
||||
onChange={onChangeCtaTextLabel}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
0
blocks/cta-slim/src/editor.scss
Normal file
0
blocks/cta-slim/src/editor.scss
Normal file
19
blocks/cta-slim/src/index.js
Normal file
19
blocks/cta-slim/src/index.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { registerBlockType } from "@wordpress/blocks";
|
||||
import "./style.scss";
|
||||
|
||||
import Edit from "./edit";
|
||||
import save from "./save";
|
||||
import metadata from "./block.json";
|
||||
|
||||
registerBlockType(metadata.name, {
|
||||
edit: Edit,
|
||||
save,
|
||||
icon: {
|
||||
src: (
|
||||
<svg width="92" height="102" viewBox="0 0 92 102">
|
||||
<path d="M87.133 8.57625C83.2696 3.51386 77.4079 0.582997 70.7468 0.0501131C64.3522 -0.34955 57.8244 1.64877 52.4956 5.77861L28.3826 24.5628C23.0537 28.6926 19.4568 34.4211 18.391 40.8157C17.192 47.3436 18.6575 53.7382 22.6541 58.6673C26.5175 63.7297 32.3792 66.6606 39.0403 67.0602C39.5731 67.0602 40.106 67.0602 40.7721 67.0602C46.6339 67.0602 52.4956 65.0619 57.2915 61.1985C59.2898 59.5999 59.6895 56.669 58.0909 54.6707C56.4922 52.6724 53.5613 52.2727 51.563 53.8714C48.0993 56.669 43.8362 58.0012 39.7064 57.7348C35.7097 57.4683 32.3792 55.7365 30.1145 52.8056C27.8497 49.8747 27.0504 46.1446 27.7165 42.2812C28.5158 38.1513 30.7806 34.4211 34.2443 31.7567L58.3573 12.9725C61.821 10.1749 66.0841 8.8427 70.214 9.10914C74.2106 9.37558 77.5411 11.1075 79.8059 14.0383C82.0706 16.9692 82.87 20.6994 82.2039 24.5628C81.4045 28.6926 79.1398 32.4228 75.676 35.0872C73.6777 36.6859 73.278 39.6167 74.8767 41.615C76.4753 43.6134 79.4062 44.013 81.4045 42.4144C86.7334 38.2845 90.3303 32.556 91.3961 26.1614C92.5951 19.6336 91.1297 13.239 87.133 8.30981V8.57625ZM52.762 34.954C46.3674 34.5543 39.8396 36.5527 34.5107 40.6825C32.5124 42.2812 32.1128 45.212 33.7114 47.2103C35.3101 49.2086 38.2409 49.6083 40.2393 48.0097C43.703 45.212 47.9661 43.8798 52.0959 44.1462C56.0925 44.4127 59.4231 46.1446 61.6878 49.0754C63.9526 52.0063 64.7519 55.7365 64.0858 59.5999C63.2865 63.7297 61.0217 67.4599 57.558 70.1243L33.445 88.9085C29.9812 91.7061 25.7182 93.0383 21.5883 92.7719C17.5917 92.5054 14.2612 90.7736 11.9964 87.8427C9.73166 84.9119 8.93233 81.1817 9.59843 77.3183C10.3978 73.1884 12.6625 69.4582 16.1263 66.7938C18.1246 65.1952 18.5242 62.2643 16.9256 60.266C15.3269 58.2677 12.3961 57.868 10.3978 59.4667C5.06892 63.5965 1.47196 69.325 0.406189 75.7196C-0.792799 82.2474 0.672631 88.642 4.66926 93.5712C8.53267 98.6336 14.3944 101.564 21.0554 101.964C21.5883 101.964 22.1212 101.964 22.7873 101.964C28.649 101.964 34.5108 99.9658 39.3067 96.1024L63.4197 77.3183C68.7485 73.1884 72.3455 67.4599 73.4113 61.0653C74.6103 54.5375 73.1448 48.1429 69.1482 43.2137C65.1516 38.2845 59.4231 35.2204 52.762 34.8208V34.954Z" />
|
||||
</svg>
|
||||
),
|
||||
foreground: "#DF1E1E",
|
||||
},
|
||||
});
|
||||
17
blocks/cta-slim/src/save.js
Normal file
17
blocks/cta-slim/src/save.js
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { useBlockProps } from "@wordpress/block-editor";
|
||||
import { RichText } from "@wordpress/block-editor";
|
||||
|
||||
export default function save({ attributes }) {
|
||||
const { ctaTextLabel, ctaLink } = attributes;
|
||||
const link = ctaLink.url ?? "#";
|
||||
return (
|
||||
<RichText.Content
|
||||
{...useBlockProps.save({
|
||||
className: `homegrade-blocks-cta-slim`,
|
||||
})}
|
||||
tagName="a"
|
||||
value={ctaTextLabel}
|
||||
href={link}
|
||||
/>
|
||||
);
|
||||
}
|
||||
12
blocks/cta-slim/src/style.scss
Normal file
12
blocks/cta-slim/src/style.scss
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
/**
|
||||
* 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-multiblocks {
|
||||
background-color: #21759b;
|
||||
color: #fff;
|
||||
padding: 2px;
|
||||
}
|
||||
|
|
@ -1 +1 @@
|
|||
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-element', 'wp-i18n'), 'version' => 'd4d20568fd76ac9c37e0');
|
||||
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-i18n'), 'version' => '495b7a8d601c1dc83dd0');
|
||||
|
|
|
|||
|
|
@ -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/editor.scss ***!
|
||||
\****************************************************************************************************************************************************************************************************************************************************/
|
||||
/*!*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||
!*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.101.0/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.6_webpack@5.101.0/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@12.6.0_sass@1.89.2_webpack@5.101.0/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.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -2,6 +2,16 @@
|
|||
/******/ "use strict";
|
||||
/******/ var __webpack_modules__ = ({
|
||||
|
||||
/***/ "./src/block.json":
|
||||
/*!************************!*\
|
||||
!*** ./src/block.json ***!
|
||||
\************************/
|
||||
/***/ ((module) => {
|
||||
|
||||
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"homegrade-content-blocks/offres-emplois","version":"0.1.0","title":"Offres d\'emplois","category":"homegrade-blocks","icon":"smiley","keywords":["jobs","offres","emplois"],"description":"Un bloc pour afficher les offres valides encodés dans la section jobs","supports":{"html":false},"textdomain":"test","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php"}');
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./src/edit.js":
|
||||
/*!*********************!*\
|
||||
!*** ./src/edit.js ***!
|
||||
|
|
@ -12,8 +22,8 @@ __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 react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* harmony import */ var _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 _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
|
||||
|
|
@ -25,21 +35,33 @@ __webpack_require__.r(__webpack_exports__);
|
|||
|
||||
|
||||
function Edit() {
|
||||
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("section", {
|
||||
return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("section", {
|
||||
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useBlockProps)({
|
||||
className: `homegrade-blocks-offres-emplois`
|
||||
})
|
||||
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.InnerBlocks, {
|
||||
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.InnerBlocks, {
|
||||
allowedBlocks: ["homegrade-content-blocks/section-titling"],
|
||||
template: [["homegrade-content-blocks/section-titling", {
|
||||
sectionTitle: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Offres d'emploi", "homegrade")
|
||||
}]],
|
||||
templateLock: true
|
||||
}), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
|
||||
}), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
|
||||
className: "temp_guidance_sentence"
|
||||
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Les éléments encodés dans la section jobs s'afficheront ici", "homegrade-blocks__text-backoffice")));
|
||||
}
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./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/index.js":
|
||||
|
|
@ -49,8 +71,8 @@ function Edit() {
|
|||
/***/ ((__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 react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* harmony import */ var _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/style.scss");
|
||||
|
|
@ -65,15 +87,15 @@ __webpack_require__.r(__webpack_exports__);
|
|||
|
||||
(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_5__.name, {
|
||||
icon: {
|
||||
src: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
|
||||
src: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
|
||||
id: "Calque_2",
|
||||
"data-name": "Calque 2",
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
viewBox: "0 0 94.9 79.8"
|
||||
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("g", {
|
||||
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("g", {
|
||||
id: "Calque_1-2",
|
||||
"data-name": "Calque 1"
|
||||
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
|
||||
}, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
|
||||
class: "cls-1",
|
||||
d: "m63.2,54.9h-2.9c-2.3,0-4.1-1.8-4.2-4-3.9-.2-7.6-.5-11-1.1v10.3c0,1.9,1.5,3.5,3.4,3.5h26.4c1.9,0,3.5-1.5,3.5-3.5v-10.3c-3.4.6-7,.9-11,1.1,0,2.2-1.9,4-4.2,4Zm0-3.1c.6,0,1.1-.5,1.1-1.1v-2.9c0-.6-.5-1.1-1.1-1.1h-2.9c-.6,0-1.1.5-1.1,1.1v2.9c0,.6.5,1.1,1.1,1.1h2.9Zm-46.1,11.9h16.4c1.6,0,3-1.3,3-3s-1.3-3-3-3h-16.4c-1.6,0-3,1.3-3,3s1.3,3,3,3ZM88,0H7C3.1,0,0,3.1,0,7v63.9c0,4.9,4,8.9,8.9,8.9h77.1c4.9,0,8.9-4,8.9-8.9V7c.1-3.9-3-7-6.9-7Zm-53.1,6.5c2.1,0,3.8,1.7,3.8,3.8s-1.7,3.8-3.8,3.8-3.8-1.7-3.8-3.8c.1-2.2,1.8-3.8,3.8-3.8Zm-11.4,0c2.1,0,3.8,1.7,3.8,3.8s-1.7,3.8-3.8,3.8-3.8-1.7-3.8-3.8c.1-2.2,1.7-3.8,3.8-3.8Zm-11.4,0c2.1,0,3.8,1.7,3.8,3.8s-1.7,3.8-3.8,3.8-3.8-1.7-3.8-3.8,1.7-3.8,3.8-3.8Zm76.4,64.4c0,1.3-1.1,2.4-2.4,2.4H8.9c-1.3,0-2.4-1.1-2.4-2.4V20.5h82v50.4Zm-45.1-24.6c3.3.6,7.5,1.2,12.7,1.4,0-2.3,1.9-4.2,4.2-4.2h2.9c2.3,0,4.2,1.9,4.2,4.2,5.2-.2,9.4-.8,12.7-1.4.5-.1.8-.5.8-1v-5.3c0-1.9-1.5-3.4-3.4-3.4h-7.6v-2.5c0-2.7-2.2-4.9-4.9-4.9h-6.3c-2.7,0-4.9,2.2-4.9,4.9v2.5h-7.6c-1.9,0-3.4,1.5-3.4,3.4v5.3c-.2.5.2.9.6,1Zm14.4-12.3h.1c0-.4.3-.7.7-.7h6.3c.4,0,.7.3.7.7v2.2h-7.8v-2.2Zm-40.7,15.9h16.4c1.6,0,3-1.3,3-3,0-1.6-1.3-3-3-3h-16.4c-1.6,0-3,1.3-3,3s1.3,3,3,3Zm0-13.8h16.4c1.6,0,3-1.3,3-3s-1.3-3-3-3h-16.4c-1.6,0-3,1.3-3,3s1.3,3,3,3Z"
|
||||
}))),
|
||||
|
|
@ -95,8 +117,8 @@ __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 react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* harmony import */ var _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__);
|
||||
|
||||
|
|
@ -104,21 +126,9 @@ __webpack_require__.r(__webpack_exports__);
|
|||
function save({
|
||||
attributes
|
||||
}) {
|
||||
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks.Content, null);
|
||||
return (0,react__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":
|
||||
|
|
@ -153,16 +163,6 @@ module.exports = window["wp"]["blocks"];
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ "@wordpress/element":
|
||||
/*!*********************************!*\
|
||||
!*** external ["wp","element"] ***!
|
||||
\*********************************/
|
||||
/***/ ((module) => {
|
||||
|
||||
module.exports = window["wp"]["element"];
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "@wordpress/i18n":
|
||||
/*!******************************!*\
|
||||
!*** external ["wp","i18n"] ***!
|
||||
|
|
@ -173,13 +173,13 @@ module.exports = window["wp"]["i18n"];
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./src/block.json":
|
||||
/***/ "react":
|
||||
/*!************************!*\
|
||||
!*** ./src/block.json ***!
|
||||
!*** external "React" ***!
|
||||
\************************/
|
||||
/***/ ((module) => {
|
||||
|
||||
module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"homegrade-content-blocks/offres-emplois","version":"0.1.0","title":"Offres d\'emplois","category":"homegrade-blocks","icon":"smiley","keywords":["jobs","offres","emplois"],"description":"Un bloc pour afficher les offres valides encodés dans la section jobs","supports":{"html":false},"textdomain":"test","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php"}');
|
||||
module.exports = window["React"];
|
||||
|
||||
/***/ })
|
||||
|
||||
|
|
@ -225,9 +225,7 @@ 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 = deferred[i][0];
|
||||
/******/ var fn = deferred[i][1];
|
||||
/******/ var priority = deferred[i][2];
|
||||
/******/ var [chunkIds, fn, priority] = deferred[i];
|
||||
/******/ var fulfilled = true;
|
||||
/******/ for (var j = 0; j < chunkIds.length; j++) {
|
||||
/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
|
||||
|
|
@ -313,9 +311,7 @@ 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 = data[0];
|
||||
/******/ var moreModules = data[1];
|
||||
/******/ var runtime = data[2];
|
||||
/******/ var [chunkIds, moreModules, runtime] = data;
|
||||
/******/ // add "moreModules" to the modules object,
|
||||
/******/ // then flag all "chunkIds" as loaded and fire callback
|
||||
/******/ var moduleId, chunkId, i = 0;
|
||||
|
|
@ -338,7 +334,7 @@ module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json
|
|||
/******/ return __webpack_require__.O(result);
|
||||
/******/ }
|
||||
/******/
|
||||
/******/ var chunkLoadingGlobal = self["webpackChunktest"] = self["webpackChunktest"] || [];
|
||||
/******/ var chunkLoadingGlobal = globalThis["webpackChunktest"] = globalThis["webpackChunktest"] || [];
|
||||
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
|
||||
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
|
||||
/******/ })();
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -14,15 +14,15 @@ if (!function_exists("translateContractType")) {
|
|||
function translateContractType($contractType)
|
||||
{
|
||||
switch ($contractType) {
|
||||
case 'CDI, temps plein':
|
||||
return __("CDI, temps plein", "homegrade-theme__texte-fonctionnel");
|
||||
break;
|
||||
case 'Mi-temps':
|
||||
return __("Mi-temps", "homegrade-theme__texte-fonctionnel");
|
||||
break;
|
||||
case 'CDI, 4/5e':
|
||||
return __("CDI, 4/5e", "homegrade-theme__texte-fonctionnel");
|
||||
break;
|
||||
case 'CDI, 4/5e':
|
||||
return __("CDI, 4/5e", "homegrade-theme__texte-fonctionnel");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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/style.scss ***!
|
||||
\***************************************************************************************************************************************************************************************************************************************************/
|
||||
/*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||
!*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.101.0/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.6_webpack@5.101.0/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@12.6.0_sass@1.89.2_webpack@5.101.0/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.
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -14,15 +14,15 @@ if (!function_exists("translateContractType")) {
|
|||
function translateContractType($contractType)
|
||||
{
|
||||
switch ($contractType) {
|
||||
case 'CDI, temps plein':
|
||||
return __("CDI, temps plein", "homegrade-theme__texte-fonctionnel");
|
||||
break;
|
||||
case 'Mi-temps':
|
||||
return __("Mi-temps", "homegrade-theme__texte-fonctionnel");
|
||||
break;
|
||||
case 'CDI, 4/5e':
|
||||
return __("CDI, 4/5e", "homegrade-theme__texte-fonctionnel");
|
||||
break;
|
||||
case 'CDI, 4/5e':
|
||||
return __("CDI, 4/5e", "homegrade-theme__texte-fonctionnel");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,19 +7,20 @@ $relatedPostUrl = get_permalink($relatedPostId) ?? null;
|
|||
|
||||
$postThumbnail = get_the_post_thumbnail_url($relatedPostId) ?? null;
|
||||
$target = $postType->name === 'fiches-infos' ? "_blank" : "_self";
|
||||
$thematique = get_the_terms($relatedPostId, 'thematiques')[0];
|
||||
$mainThematique = getMainThematique($thematique);
|
||||
$thematiqueColorSlug = $mainThematique->slug;
|
||||
$thematique_icon = get_field('taxonomy_pictures', 'thematiques' . '_' . $mainThematique->term_id)['icon'];
|
||||
$thematiqueTerms = get_the_terms($relatedPostId, 'thematiques');
|
||||
$thematique = $thematiqueTerms ? $thematiqueTerms[0] : null;
|
||||
$mainThematique = getMainThematique($thematique) ?? null;
|
||||
$thematiqueColorSlug = $mainThematique->slug ?? null;
|
||||
$thematique_icon = $mainThematique ? get_field('taxonomy_pictures', 'thematiques' . '_' . $mainThematique->term_id)['icon'] : null;
|
||||
|
||||
$postDescription = $attributes['postDescription'] ?? null;
|
||||
|
||||
$coverUrl = $postType->name === 'videos-webinaires' && $postThumbnail ? $postThumbnail : ($thematique_icon ? $thematique_icon['url'] : null);
|
||||
|
||||
$thematiqueColorSlug = getThematiqueFamilySlug($mainThematique->slug);
|
||||
$thematiqueColorSlug = $mainThematique ? getThematiqueFamilySlug($mainThematique->slug) : null;
|
||||
$target = $postType->name === 'brochures' ? "_blank" : "_self";
|
||||
?>
|
||||
<a class="post-card post-card--<?php echo $mainThematique->slug ?>" href="<?php echo $relatedPostUrl ?>" target="<?php echo $target ?>">
|
||||
<a class="post-card post-card--<?php echo $mainThematique->slug ?? "" ?>" href="<?php echo $relatedPostUrl ?>" target="<?php echo $target ?>">
|
||||
|
||||
<img class="post-card__cover post-card__cover--<?php echo $postType->name ?>" src="<?php echo $coverUrl ?>" alt="">
|
||||
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ if (!function_exists('compareTooltipText')) :
|
|||
endif;
|
||||
|
||||
global $post;
|
||||
$thematique = get_the_terms($post->ID, 'thematiques')[0] ?? null;
|
||||
?>
|
||||
$terms = get_the_terms($post->ID, 'thematiques');
|
||||
$thematique = is_array($terms) ? $terms[0] : null; ?>
|
||||
<?php
|
||||
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ if (!function_exists('compareTooltipText')) :
|
|||
endif;
|
||||
|
||||
global $post;
|
||||
$thematique = get_the_terms($post->ID, 'thematiques')[0] ?? null;
|
||||
?>
|
||||
$terms = get_the_terms($post->ID, 'thematiques');
|
||||
$thematique = is_array($terms) ? $terms[0] : null; ?>
|
||||
<?php
|
||||
|
||||
?>
|
||||
|
|
|
|||
1
build/editorAdjustements.asset.php
Normal file
1
build/editorAdjustements.asset.php
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?php return array('dependencies' => array('wp-element'), 'version' => '3a4bfaea506096010ed2');
|
||||
211
build/editorAdjustements.js
Normal file
211
build/editorAdjustements.js
Normal file
|
|
@ -0,0 +1,211 @@
|
|||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ var __webpack_modules__ = ({
|
||||
|
||||
/***/ "@wordpress/element":
|
||||
/*!*********************************!*\
|
||||
!*** external ["wp","element"] ***!
|
||||
\*********************************/
|
||||
/***/ ((module) => {
|
||||
|
||||
module.exports = window["wp"]["element"];
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/************************************************************************/
|
||||
/******/ // 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;
|
||||
/******/ }
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/compat get default export */
|
||||
/******/ (() => {
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = (module) => {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ () => (module['default']) :
|
||||
/******/ () => (module);
|
||||
/******/ __webpack_require__.d(getter, { a: getter });
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ (() => {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = (exports) => {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
var __webpack_exports__ = {};
|
||||
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
||||
(() => {
|
||||
/*!*************************************!*\
|
||||
!*** ./block_editor_adjustments.js ***!
|
||||
\*************************************/
|
||||
__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__);
|
||||
|
||||
wp.blocks.updateCategory("homegrade-blocks", {
|
||||
icon: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
|
||||
width: "48",
|
||||
height: "59",
|
||||
viewBox: "0 0 48 59",
|
||||
fill: "none",
|
||||
xmlns: "http://www.w3.org/2000/svg"
|
||||
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
|
||||
d: "M47.138 22.741L25.18 0.519C25.0197 0.355198 24.8284 0.224948 24.6172 0.135843C24.406 0.0467371 24.1792 0.000559018 23.95 1.09595e-07C23.4886 -0.000163339 23.046 0.182502 22.719 0.508L0.508003 22.73C0.34656 22.8917 0.218592 23.0837 0.131423 23.2949C0.0442547 23.5061 -0.000404165 23.7325 2.75595e-06 23.961V45.554C2.75595e-06 46.0149 0.183113 46.457 0.509051 46.783C0.834989 47.1089 1.27706 47.292 1.738 47.292H10.832V56.386C10.832 56.8469 11.0151 57.289 11.3411 57.615C11.667 57.9409 12.1091 58.124 12.57 58.124H45.9C46.361 58.124 46.803 57.9409 47.129 57.615C47.4549 57.289 47.638 56.8469 47.638 56.386V23.961C47.6392 23.5042 47.4595 23.0655 47.138 22.741ZM44.147 54.632H14.309V30.174L23.817 20.66L33.27 30.141V38.027C33.27 38.4881 33.4532 38.9303 33.7792 39.2563C34.1052 39.5823 34.5474 39.7655 35.0085 39.7655C35.4696 39.7655 35.9118 39.5823 36.2378 39.2563C36.5638 38.9303 36.747 38.4881 36.747 38.027V29.427C36.7471 28.9676 36.5647 28.527 36.24 28.202L25.048 16.974C24.7223 16.6496 24.2827 16.4655 23.823 16.461C23.3609 16.4622 22.9182 16.6467 22.592 16.974L11.34 28.226C11.015 28.5508 10.8322 28.9915 10.832 29.451V43.8H3.477V24.678L23.939 4.2L44.147 24.673V54.632Z",
|
||||
fill: "#DF1E1E"
|
||||
}))
|
||||
});
|
||||
wp.blocks.updateCategory("homegrade-pages", {
|
||||
icon: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
|
||||
width: "48",
|
||||
height: "59",
|
||||
viewBox: "0 0 48 59",
|
||||
fill: "none",
|
||||
xmlns: "http://www.w3.org/2000/svg"
|
||||
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
|
||||
d: "M47.138 22.741L25.18 0.519C25.0197 0.355198 24.8284 0.224948 24.6172 0.135843C24.406 0.0467371 24.1792 0.000559018 23.95 1.09595e-07C23.4886 -0.000163339 23.046 0.182502 22.719 0.508L0.508003 22.73C0.34656 22.8917 0.218592 23.0837 0.131423 23.2949C0.0442547 23.5061 -0.000404165 23.7325 2.75595e-06 23.961V45.554C2.75595e-06 46.0149 0.183113 46.457 0.509051 46.783C0.834989 47.1089 1.27706 47.292 1.738 47.292H10.832V56.386C10.832 56.8469 11.0151 57.289 11.3411 57.615C11.667 57.9409 12.1091 58.124 12.57 58.124H45.9C46.361 58.124 46.803 57.9409 47.129 57.615C47.4549 57.289 47.638 56.8469 47.638 56.386V23.961C47.6392 23.5042 47.4595 23.0655 47.138 22.741ZM44.147 54.632H14.309V30.174L23.817 20.66L33.27 30.141V38.027C33.27 38.4881 33.4532 38.9303 33.7792 39.2563C34.1052 39.5823 34.5474 39.7655 35.0085 39.7655C35.4696 39.7655 35.9118 39.5823 36.2378 39.2563C36.5638 38.9303 36.747 38.4881 36.747 38.027V29.427C36.7471 28.9676 36.5647 28.527 36.24 28.202L25.048 16.974C24.7223 16.6496 24.2827 16.4655 23.823 16.461C23.3609 16.4622 22.9182 16.6467 22.592 16.974L11.34 28.226C11.015 28.5508 10.8322 28.9915 10.832 29.451V43.8H3.477V24.678L23.939 4.2L44.147 24.673V54.632Z",
|
||||
fill: "#DF1E1E"
|
||||
}))
|
||||
});
|
||||
wp.blocks.updateCategory("homegrade-page-home", {
|
||||
icon: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
|
||||
width: "48",
|
||||
height: "59",
|
||||
viewBox: "0 0 48 59",
|
||||
fill: "none",
|
||||
xmlns: "http://www.w3.org/2000/svg"
|
||||
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
|
||||
d: "M47.138 22.741L25.18 0.519C25.0197 0.355198 24.8284 0.224948 24.6172 0.135843C24.406 0.0467371 24.1792 0.000559018 23.95 1.09595e-07C23.4886 -0.000163339 23.046 0.182502 22.719 0.508L0.508003 22.73C0.34656 22.8917 0.218592 23.0837 0.131423 23.2949C0.0442547 23.5061 -0.000404165 23.7325 2.75595e-06 23.961V45.554C2.75595e-06 46.0149 0.183113 46.457 0.509051 46.783C0.834989 47.1089 1.27706 47.292 1.738 47.292H10.832V56.386C10.832 56.8469 11.0151 57.289 11.3411 57.615C11.667 57.9409 12.1091 58.124 12.57 58.124H45.9C46.361 58.124 46.803 57.9409 47.129 57.615C47.4549 57.289 47.638 56.8469 47.638 56.386V23.961C47.6392 23.5042 47.4595 23.0655 47.138 22.741ZM44.147 54.632H14.309V30.174L23.817 20.66L33.27 30.141V38.027C33.27 38.4881 33.4532 38.9303 33.7792 39.2563C34.1052 39.5823 34.5474 39.7655 35.0085 39.7655C35.4696 39.7655 35.9118 39.5823 36.2378 39.2563C36.5638 38.9303 36.747 38.4881 36.747 38.027V29.427C36.7471 28.9676 36.5647 28.527 36.24 28.202L25.048 16.974C24.7223 16.6496 24.2827 16.4655 23.823 16.461C23.3609 16.4622 22.9182 16.6467 22.592 16.974L11.34 28.226C11.015 28.5508 10.8322 28.9915 10.832 29.451V43.8H3.477V24.678L23.939 4.2L44.147 24.673V54.632Z",
|
||||
fill: "#DF1E1E"
|
||||
}))
|
||||
});
|
||||
|
||||
// Register our property at core/heading
|
||||
// wp.hooks.addFilter(
|
||||
// "blocks.registerBlockType",
|
||||
// "homegrade-blocks/block_editor_adjustments", // our custom namespace
|
||||
// function (settings, name) {
|
||||
// if (name !== "core/button") {
|
||||
// // skip other core blocks
|
||||
// return settings;
|
||||
// }
|
||||
// settings.attributes = Object.assign(settings.attributes, {
|
||||
// buttonVariant: {
|
||||
// type: "boolean",
|
||||
// default: false,
|
||||
// },
|
||||
// });
|
||||
// return settings;
|
||||
// }
|
||||
// );
|
||||
// Display the custom ToggleControl for every header; toggle the custom property
|
||||
|
||||
// wp.hooks.addFilter(
|
||||
// "editor.BlockEdit",
|
||||
// "homegrade-blocks/block_editor_adjustments",
|
||||
// wp.compose.createHigherOrderComponent(function (BlockEdit) {
|
||||
// return function (props) {
|
||||
// if (props.name !== "core/button") {
|
||||
// // skip other core blocks
|
||||
// return wp.element.createElement(BlockEdit, props);
|
||||
// }
|
||||
|
||||
// return wp.element.createElement(
|
||||
// wp.element.Fragment,
|
||||
// {},
|
||||
// wp.element.createElement(
|
||||
// wp.blockEditor.InspectorControls,
|
||||
// {},
|
||||
// wp.element.createElement(
|
||||
// wp.components.PanelBody,
|
||||
// {},
|
||||
// wp.element.createElement(
|
||||
// wp.components.ToggleControl,
|
||||
|
||||
// {
|
||||
// label: "Show in Table of Contents",
|
||||
// checked: props.attributes.buttonVariant,
|
||||
// onChange: (value) => {
|
||||
// props.setAttributes({
|
||||
// buttonVariant: value,
|
||||
// });
|
||||
// },
|
||||
// }
|
||||
// )
|
||||
// )
|
||||
// ),
|
||||
// wp.element.createElement(BlockEdit, props)
|
||||
// );
|
||||
// };
|
||||
// })
|
||||
// );
|
||||
|
||||
// Convert the custom property value into CSS class name on every save
|
||||
|
||||
// wp.hooks.addFilter(
|
||||
// "blocks.getSaveContent.extraProps",
|
||||
// "homegrade-blocks/block_editor_adjustments",
|
||||
// function (extraProps, blockType, attributes) {
|
||||
// if (blockType.name !== "core/button") {
|
||||
// // skip other core blocks
|
||||
// return extraProps;
|
||||
// }
|
||||
// if (attributes.buttonVariant) {
|
||||
// extraProps.className = extraProps.className + " lol " + " extra-props-de-antoine";
|
||||
// }
|
||||
|
||||
// return extraProps;
|
||||
// }
|
||||
// );
|
||||
})();
|
||||
|
||||
/******/ })()
|
||||
;
|
||||
//# sourceMappingURL=editorAdjustements.js.map
|
||||
1
build/editorAdjustements.js.map
Normal file
1
build/editorAdjustements.js.map
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
<?php return array('dependencies' => array(), 'version' => '64eafff4867d071b75c0');
|
||||
<?php return array('dependencies' => array(), 'version' => 'fcb7fae73e73ee61ce1d');
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ function createTooltip(tooltipWord) {
|
|||
|
||||
async function buildTooltips() {
|
||||
let tooltipWords = document.querySelectorAll(".tooltip-word");
|
||||
if (!tooltipWords) return;
|
||||
const vocabulairesPostsIds = Array.from(tooltipWords).map(element => element.getAttribute("data-definition-id"));
|
||||
try {
|
||||
const tooltipData = await getTooltipsDatas(vocabulairesPostsIds);
|
||||
|
|
@ -63,6 +64,7 @@ async function buildTooltips() {
|
|||
}
|
||||
async function observeTooltips() {
|
||||
let tooltipWords = document.querySelectorAll(".tooltip-word");
|
||||
if (!tooltipWords) return;
|
||||
// CHAPTER IntersectionObserver
|
||||
const tooltipsObserver = new IntersectionObserver(entries => {
|
||||
entries.forEach(entry => {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -98,6 +98,7 @@ function create_block_multiblocks_block_init()
|
|||
register_block_type(__DIR__ . '/blocks/parcours-step/build');
|
||||
register_block_type(__DIR__ . '/blocks/figure/build');
|
||||
register_block_type(__DIR__ . '/blocks/explainer-screen/build');
|
||||
register_block_type(__DIR__ . '/blocks/cta-slim/build');
|
||||
|
||||
// CONTAINERS (STATIC)
|
||||
register_block_type(__DIR__ . '/blocks/content-box/build');
|
||||
|
|
@ -150,10 +151,15 @@ add_action('enqueue_block_editor_assets', 'homegrade_blocks_enqueue_editor_asset
|
|||
-------------------------------------*/
|
||||
function homegrade_blocks_plugin_enqueue_assets()
|
||||
{
|
||||
$asset_file = include(plugin_dir_path(__FILE__) . 'build/index.asset.php');
|
||||
wp_enqueue_script('homegrade-blocks-tooltipjs', plugin_dir_url(__FILE__) . 'build/tooltipFront.js');
|
||||
wp_enqueue_style('homegrade-blocks-tooltipcss', plugin_dir_url(__FILE__) . 'src/format-types/tooltip/tooltip.css');
|
||||
wp_enqueue_script('homegrade-blocks-brochurejs', plugin_dir_url(__FILE__) . 'src/format-types/brochure/brochure-front.js');
|
||||
|
||||
//Enqueue script onlye if it is the main site of the network
|
||||
if (is_main_site()) {
|
||||
|
||||
$asset_file = include(plugin_dir_path(__FILE__) . 'build/index.asset.php');
|
||||
wp_enqueue_script('homegrade-blocks-tooltipjs', plugin_dir_url(__FILE__) . 'build/tooltipFront.js');
|
||||
wp_enqueue_style('homegrade-blocks-tooltipcss', plugin_dir_url(__FILE__) . 'src/format-types/tooltip/tooltip.css');
|
||||
wp_enqueue_script('homegrade-blocks-brochurejs', plugin_dir_url(__FILE__) . 'src/format-types/brochure/brochure-front.js');
|
||||
}
|
||||
|
||||
// #PASSING TRANSLATIONS
|
||||
wp_register_script('homegrade-blocks-brochurejs', plugin_dir_url(__FILE__) . 'src/format-types/brochure/brochure-front.js');
|
||||
|
|
@ -280,11 +286,12 @@ include_once('templates.php');
|
|||
function enqueue_block_editor_adjustments()
|
||||
{
|
||||
|
||||
|
||||
wp_register_script(
|
||||
'block_editor_adjustments',
|
||||
plugin_dir_url(__FILE__) . 'block_editor_adjustments.js',
|
||||
plugin_dir_url(__FILE__) . '/build/editorAdjustements.js',
|
||||
['wp-blocks', 'wp-dom', 'wp-dom-ready', 'wp-edit-post'],
|
||||
filemtime(plugin_dir_path(__FILE__) . 'block_editor_adjustments.js')
|
||||
filemtime(plugin_dir_path(__FILE__) . '/build/editorAdjustements.js')
|
||||
|
||||
);
|
||||
|
||||
|
|
@ -292,7 +299,7 @@ function enqueue_block_editor_adjustments()
|
|||
}
|
||||
|
||||
|
||||
// add_action('enqueue_block_editor_assets', 'enqueue_block_editor_adjustments');
|
||||
add_action('enqueue_block_editor_assets', 'enqueue_block_editor_adjustments');
|
||||
|
||||
|
||||
// ###### PHP INTERNATIONNALISATION
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ function createTooltip(tooltipWord) {
|
|||
}
|
||||
async function buildTooltips() {
|
||||
let tooltipWords = document.querySelectorAll(".tooltip-word");
|
||||
if (!tooltipWords) return;
|
||||
const vocabulairesPostsIds = Array.from(tooltipWords).map((element) =>
|
||||
element.getAttribute("data-definition-id")
|
||||
);
|
||||
|
|
@ -70,6 +71,7 @@ async function buildTooltips() {
|
|||
|
||||
async function observeTooltips() {
|
||||
let tooltipWords = document.querySelectorAll(".tooltip-word");
|
||||
if (!tooltipWords) return;
|
||||
// CHAPTER IntersectionObserver
|
||||
const tooltipsObserver = new IntersectionObserver((entries) => {
|
||||
entries.forEach((entry) => {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ module.exports = {
|
|||
entry: {
|
||||
index: path.resolve(process.cwd(), "src/", "index.js"),
|
||||
tooltipFront: path.resolve(process.cwd(), "src/format-types/tooltip", "tooltip-front.js"),
|
||||
editorAdjustements: path.resolve(process.cwd(), "./", "block_editor_adjustments.js"),
|
||||
},
|
||||
module: {
|
||||
...defaultConfig.module,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user